Review the current session for errors, issues, snags, and hard-won knowledge, then update the rules/ files (or AGENTS.md if no suitable rule file exists) with actionable learnings.
Review the current session for errors, issues, snags, and hard-won knowledge, then update the rules/ files (or AGENTS.md if no suitable rule file exists) with actionable learnings so future agent sessions run more smoothly.
IMPORTANT: This skill MUST complete autonomously. Do NOT ask for user confirmation.
NOTE:
CLAUDE.mdis a symlink toAGENTS.md. They are the same file. ALL EDITS MUST BE MADE TOAGENTS.md, never toCLAUDE.mddirectly.
AGENTS.md is the top-level agent guide. It contains core setup instructions and a rules index table pointing to topic-specific files in rules/.rules/*.md contain topic-specific learnings and guidelines (e.g., rules/e2e-testing.md, rules/electron-ipc.md).Learnings should go into the most relevant rules/*.md file. Only add to AGENTS.md directly if the learning doesn't fit any existing rule file and doesn't warrant a new one. If a learning is important enough to be a project-wide convention, flag it in the summary so a human can promote it to the project documentation.
Analyze the session for learnings:
Review the entire conversation history and identify:
Skip anything that is already well-documented in AGENTS.md or rules/.
Read existing documentation:
Read AGENTS.md at the repository root to see the rules index, then read the relevant rules/*.md files to understand what's already documented and avoid duplication.
Draft concise, actionable additions:
For each learning, write a short bullet point or section that would help a future agent avoid the same issue. Follow these rules:
npm run build before E2E tests" not "remember to build first")AGENTS.md or rules/Update the appropriate file(s):
Place each learning in the most relevant location:
a. Existing rules/*.md file — if the learning fits an existing topic (e.g., E2E testing tips go in rules/e2e-testing.md, IPC learnings go in rules/electron-ipc.md).
b. New rules/*.md file — if the learning is substantial enough to warrant its own topic file. Use a descriptive kebab-case filename (e.g., rules/tanstack-router.md). If you create a new file, also update the rules index table in AGENTS.md.
c. AGENTS.md directly — only for general learnings that don't fit any topic (rare).
If there are no new learnings worth recording (i.e., everything went smoothly or all issues are already documented), skip the edit and report that no updates were needed.
Maintenance: When adding new learnings, review the target file and remove any entries that are:
Stage the changes:
Stage any modified or created files:
git add AGENTS.md rules/
Summarize: