AI Engineer: Knowledge Organization & Promotion
Trigger
This skill runs on-demand only (not automatically). Invoke it as a subagent when:
- The user explicitly asks to "organize knowledge", "clean up issues", "promote patterns", or "run ai-engineer"
- A natural stopping point has been reached and there are accumulated issues
in
open/that need review - The user wants to deduplicate or recategorize the issue registry
This skill is designed to run as a subagent with a dedicated context window. It should review ALL issues, not just those from the current session.
Algorithm
Phase 0 — Discovery (NEW)
Before doing anything else, get a complete picture of the registry:
- Read
knowledge/issues/INDEX.md— get all issue IDs, titles, categories, certainties, and occurrence counts - Read every issue file in
open/— full content of each - Read every issue file in
promoted/— to avoid re-promoting - Read every issue file in
discarded/— to detect re-emerging patterns (if a discarded issue appears again, it may need re-evaluation)
Phase 1 — Deduplication (NEW)
Before promoting or recategorizing, eliminate duplicates:
- Group issues by keyword overlap on title + description
- Within each group, identify the oldest issue (by
first_seen) - For each duplicate, add a note to its file:
## Resolution Merged into ISSUE-YYYYMMDD-XXXX (duplicate detected via keyword overlap) - Move duplicate files from
open/todiscarded/ - Update
INDEX.md: remove duplicates from Open, add to Discarded with reason "Merged into ISSUE-YYYYMMDD-XXXX" - Increment occurrences on the canonical issue to reflect all instances
Deduplication uses heuristic keyword matching — it may miss some duplicates
or flag false positives. When uncertain, leave both issues in open/ and
add a note for manual review.
Phase 2 — Recategorization (NEW)
Review issues with category: unknown or potentially miscategorized entries:
- Read each
unknownissue and attempt to classify:- Look for language/framework names →
library-api - Look for shell/terminal commands →
powershell - Look for Angular-specific patterns →
angular - Look for Git operations →
git - Look for project-specific paths/conventions →
project-specific
- Look for language/framework names →
- Update the
categoryfield in the issue frontmatter - Update
INDEX.mdto reflect the new category - If still unclear, leave as
unknownand add a note:## Recategorization Attempt — YYYY-MM-DD Unable to classify. Evidence: [summary]. Reviewed by: ai-engineer.
Also scan non-unknown issues for obvious miscategorization and fix if the correct category is unambiguous.
Phase 3 — Evaluate Promotion Criteria
For each issue with certainty: high (3+ occurrences):
| Category | Promotion Target | Action |
|---|---|---|
library-api |
/memories/<lib>-api.md |
Check if memory file exists; if so, str_replace to add. If not, create. |
powershell |
powershell-patterns/SKILL.md |
replace_string_in_file to add new pitfall/pattern. |
angular |
/memories/ or angular skill |
If Angular-specific API version info → user memory. If scaffold pattern → angular-scaffold skill. |
git |
git-workflow/SKILL.md |
replace_string_in_file to add new pattern. |
skill-creation |
New .github/skills/<name>/SKILL.md |
Load skill-creator skill and follow its procedure to create a new skill from scratch. |
project-specific |
/memories/repo/ |
Create or update repo memory file. |
unknown |
— | Do NOT promote. Leave in open/ with recategorization note. |
After promotion:
- Move issue file from
open/topromoted/ - Update issue frontmatter:
status: promoted, addreviewed_by: "ai-engineer", add resolution date - Update
INDEX.md: remove from Open, add to Promoted table withReviewed By
Phase 4 — Periodic Cleanup
For issues in open/ with:
occurrences: 1ANDfirst_seen > 30 days agocertainty: low
→ Move to discarded/, update status to discarded, set
reviewed_by: "ai-engineer", add reason: "Single occurrence, >30 days without recurrence."
For issues previously discarded that have re-emerged (found new evidence in
Phase 0), move back to open/ and increment occurrences.
Phase 5 — Report
Output a comprehensive summary table:
## AI Engineer Report — YYYY-MM-DD
### Deduplication
| Action | Duplicate ID | Merged Into | Reason |
|--------|-------------|-------------|--------|
| 🔗 Merged | ISSUE-005 | ISSUE-001 | Keyword overlap on title |
### Recategorization
| ID | Title | Old Category | New Category |
|----|-------|-------------|--------------|
| 🔄 Recategorized | ISSUE-006 | unknown | powershell |
### Promotion
| ID | Title | Category | Promoted To | Occurrences |
|----|-------|----------|-------------|-------------|
| 📦 Promoted | ISSUE-003 | powershell | powershell-patterns/SKILL.md | 3 |
### Cleanup
| ID | Title | Action | Reason |
|----|-------|--------|--------|
| 🗑️ Discarded | ISSUE-004 | → discarded/ | >30 days, single occurrence |
### Registry Summary
| Status | Before | After |
|--------|--------|-------|
| 🔴 Open | 12 | 8 |
| 🟢 Promoted | 2 | 3 |
| ⚫ Discarded | 1 | 4 |
Important Rules
Review ALL issues, not just recent ones. Unlike
developerwhich only looks at the current session, the AI Engineer has a global view.ALWAYS get user confirmation before promoting to a skill — use
vscode_askQuestionsto ask: "I found pattern X occurring 3 times. Promote to a skill?" Unless the user previously said "always auto-promote."Prefer updating existing skills over creating new ones — a new pitfall in PowerShell belongs in
powershell-patterns/SKILL.md, not a new skill.When creating a new skill, load
skill-creator— theskill-creatorskill has the full procedure for creating skills per the agentskills.io spec and prompt-forge conventions. Follow it exactly.Set
reviewed_byon every issue you touch — this provides an audit trail. Usereviewed_by: "ai-engineer"for automated reviews.Run
sync-skills.ps1after modifying skills — if you promote to a skill file or create a new skill, sync the changes to all packages.Be conservative with deduplication — two issues that look similar may be describing different aspects of the same problem. When uncertain, leave both in
open/and add cross-reference notes instead of merging.
File Paths Reference
| Resource | Path |
|---|---|
| Issue registry index | knowledge/issues/INDEX.md |
| Issue template | knowledge/issues/TEMPLATE.md |
| Open issues | knowledge/issues/open/ISSUE-XXX.md |
| Promoted issues | knowledge/issues/promoted/ISSUE-XXX.md |
| Discarded issues | knowledge/issues/discarded/ISSUE-XXX.md |
| User memory | /memories/<topic>.md |
| Repo memory | /memories/repo/<topic>.md |
| Skills | .github/skills/<name>/SKILL.md |
| Sync script | sync-skills.ps1 |