Instructions for Agent
How This Skill is Invoked
This skill is mandatory — copilot-instructions.md § Session Lifecycle requires it before every final message. You will also be invoked:
- When explicitly asked: "Run self-evaluation", "What did you learn?", "Improve skills"
- After addressing code review feedback that reveals a recurring pattern
Core Principle: Learn From Every Session
Every session produces insights that can improve future agent effectiveness. Capture these systematically.
Step 1: Review the Session
Examine what happened during this session:
- Code review feedback received — What patterns did reviewers catch?
- Mistakes made and corrected — What errors occurred during implementation?
- Owner/user feedback — What preferences or corrections did the user provide?
- Patterns discovered — What reusable patterns emerged from the work?
Step 2: Categorize Lessons
Classify each lesson into one of these categories:
| Category | Examples | Update Target |
|---|---|---|
| Code quality | Binary file modes, const refs, resource cleanup | code-quality skill |
| Testing | AAA violations, missing directory setup, save checks | testing skill |
| CI/CD | Workflow structure, artifact patterns | workflow skill |
| Documentation | Link fixes, formatting, content standards | documentation skill |
| Build | CMake, dependencies, Flatpak packaging | build skill |
| Versioning | PR title format, commit conventions, releases | versioning skill |
Step 3: Check Against Existing Knowledge
Before proposing updates, verify the lesson is not already documented:
- Check
copilot-instructions.md— Is this pattern already listed? - Check the relevant skill's
SKILL.md— Is this rule already stated? - Check skill
references/— Is there already an example?
Only propose additions for genuinely new or underemphasized patterns.
Step 4: Propose Skill Updates
For each new lesson, propose a specific, minimal update:
Format for Proposed Updates
**Lesson:** [One-line description]
**Source:** [PR #, review comment, or error that revealed this]
**Category:** [From Step 2 table]
**Target File:** [Exact file path to update]
**Proposed Change:** [Specific text to add or modify]
**Priority:** [High = caused bugs/rework, Medium = improved quality, Low = nice to have]
Prioritization Rules
- High priority: Patterns that caused bugs, security issues, or significant rework
- Medium priority: Patterns that improve code quality or developer experience
- Low priority: Style preferences or minor improvements
Only implement High and Medium priority changes. Document Low priority for future reference.
Step 5: Apply Updates (If Appropriate)
If changes are warranted and the session scope allows:
- Update the relevant skill — Add the lesson to the appropriate section
- Increment the skill version — Bump the version in YAML frontmatter
- Keep changes minimal — Add only what's necessary, don't restructure
- Maintain skill boundaries — Don't duplicate content across skills
Step 6: Generate Session Summary
Produce a brief summary of lessons captured:
### Session Self-Evaluation
**Lessons Captured:** [count]
**Skills Updated:** [list of skills modified, or "None"]
**Key Patterns Added:**
- [Pattern 1: brief description]
- [Pattern 2: brief description]
**Deferred (Low Priority):**
- [Pattern that was noted but not implemented]
Anti-Patterns to Avoid
- Don't update skills for one-off situations — Only add patterns that are likely to recur
- Don't duplicate across skills — Each lesson goes in exactly one place
- Don't restructure existing skills — Add to existing sections, don't reorganize
- Don't add lessons that are standard programming practice — Focus on project-specific patterns
- Don't forget to check existing docs first — Avoid adding what's already there
Reference
For detailed examples of lessons learned and how they were incorporated, see references/LESSONS_LEARNED_PATTERNS.md.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.