Skip to content

fix: Wave 2 post-merge cleanup — knowledge persistence & command consistency#143

Closed
dean0x wants to merge 6 commits intomainfrom
fix/99-project-knowledge
Closed

fix: Wave 2 post-merge cleanup — knowledge persistence & command consistency#143
dean0x wants to merge 6 commits intomainfrom
fix/99-project-knowledge

Conversation

@dean0x
Copy link
Copy Markdown
Owner

@dean0x dean0x commented Mar 15, 2026

Summary

Post-merge cleanup for the Wave 2 project knowledge system (#99). Addresses consistency audit findings from #142 and code review findings from #140.

  • Add knowledge-persistence skill with full extraction procedure, lock protocol, loading instructions, and examples
  • Add knowledge awareness (Load Project Knowledge phase) to /debug, /specify, /self-review commands
  • Add pitfall recording phase to /code-review and /resolve commands
  • Renumber fractional phases (1.5, 2.5) to sequential integers across all 12 command files
  • Fix CLAUDE.md stale skill count (31→32), add skill to architecture reference
  • Remove conditional "(if available)" phrasing from knowledge loading phases
  • Add createMemoryDir failure test for missing directory edge case
  • Resolve 14 code review findings from PR feat: Wave 2 — project knowledge system (decisions + pitfalls) #140

Files Changed (28 files, +814/-227)

New files (2): knowledge-persistence/SKILL.md, knowledge-persistence/references/examples.md
Commands (12): All 6 command pairs updated with knowledge phases + sequential numbering
Agents (3): coder, reviewer, skimmer — knowledge context references
Plugins (4): plugin.json manifest updates for knowledge-persistence skill
Tests (1): +230 lines of memory/migration tests
Docs (4): CLAUDE.md, skills-architecture, file-organization, docs-framework

Test plan

  • npm run build passes (32 skills, 17 plugins)
  • npm test passes (250 tests, 13 test files)
  • Grep confirms zero "(if available)" in knowledge-related contexts
  • Manual: verify /debug loads pitfalls.md before hypothesis generation
  • Manual: verify /specify passes knowledge context to explore agents

Dean Sharon added 6 commits March 14, 2026 18:58
Add structured knowledge extraction and injection so agents learn from
past architectural decisions and known pitfalls across sessions.

- Create `.memory/knowledge/decisions.md` (ADR-NNN) and `pitfalls.md` (PF-NNN)
- Inject TL;DR headers at session start (~30-50 tokens)
- Coder reads decisions before implementation, Reviewer checks pitfalls
- /implement records ADRs, /code-review + /debug + /resolve record pitfalls
- Both base and Teams command variants updated
- createMemoryDir() now creates knowledge/ subdirectory
- 8 new tests (246 total), all passing
Batch 1 — Mechanical fixes:
- Fix duplicate step 5→6 in 4 explorer prompts (implement-teams.md)
- Fix fractional 2.5→3 renumbering in 4 reviewer prompts (code-review-teams.md)
- Fix fractional 1.5→2 renumbering in reviewer.md responsibilities
- Update stale counts: 24→31 skills, 8→17 plugins (file-organization.md)
- Add missing ambient-prompt.sh to hooks listing (file-organization.md)

Batch 2 — DRY extraction via knowledge-persistence skill:
- Create shared/skills/knowledge-persistence/SKILL.md with canonical procedure
  (ADR/PF formats, lock protocol, capacity cap, dedup, TL;DR update)
- Replace 8 inline extraction procedures with skill references in
  implement, code-review, debug, resolve (base + teams variants)
- Register skill in 4 plugin manifests (plugin.json + plugins.ts)

Batch 3 — Hook improvements:
- Collapse head+sed+grep into single sed -n for TL;DR extraction
- Guard section joins to prevent leading newlines when Section 1 skipped

Batch 4 — Quick fixes:
- Add TL;DR-only rationale comment to skimmer.md step 6
- Log createMemoryDir errors in verbose mode instead of silent catch
- Add 3 hook integration tests (TL;DR injection, no leading newlines,
  no knowledge section when files absent)

Issues dismissed: #9 (TL;DR sanitization — trust model), #10 (integrity
verification — instruction-enforced), #17 (mkdir failure test — low value),
#18 (phase ordering cosmetic), #19 (intentional scope exclusion)
…eMemoryDir failure test

- /specify: Add Phase 2.5 to read decisions.md + pitfalls.md before
  exploration. Constraints and Failure Modes explorers now receive
  prior decisions and known pitfalls as context.
- /self-review: Phase 0 reads knowledge files. Simplifier and
  Scrutinizer receive KNOWLEDGE_CONTEXT to check for reintroduced
  pitfall patterns and verify architectural consistency.
- Add createMemoryDir failure test (file blocking mkdir path).

Resolves review issues #17 and #19 from PR #140.
The base specify.md got Phase 2.5 (knowledge read) but the teams
variant was missed. Both now read decisions.md + pitfalls.md before
exploration.
…mmands

Eliminates all Phase X.5 numbering introduced by the knowledge-recording
phases, replacing with sequential integers and shifting subsequent phases.

Files: specify, implement, code-review, debug, resolve (base + teams variants)
…sing

- Remove redundant "When This Skill Activates" section from SKILL.md
- Add references/examples.md with full ADR and pitfall entry examples
- Expand SKILL.md with File Locations, Loading, Extended References sections
- Fix description to follow "This skill should be used when..." convention
- Add knowledge-persistence to skills-architecture.md reference table
- Remove "(if available)" from phase titles in debug, specify, self-review
- Remove "if they exist" qualifier from knowledge loading body text
- Fix CLAUDE.md stale skill count (31 → 32)

Addresses H1, H5, M5, M8 (partial) from issue #142.
@dean0x dean0x closed this Mar 15, 2026
@dean0x dean0x deleted the fix/99-project-knowledge branch March 15, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant