Skip to content

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

Merged
dean0x merged 6 commits intomainfrom
feat/99-project-knowledge
Mar 15, 2026
Merged

fix: Wave 2 post-merge cleanup — knowledge persistence & command consistency#145
dean0x merged 6 commits intomainfrom
feat/99-project-knowledge

Conversation

@dean0x
Copy link
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 merged commit 9de5060 into main Mar 15, 2026
10 checks passed
@dean0x dean0x deleted the feat/99-project-knowledge branch March 15, 2026 15:40
dean0x pushed a commit that referenced this pull request Mar 18, 2026
- H2: ambient-router description updated to standard "This skill should
  be used when..." format
- M3: simplifier agent gains Output and Boundaries sections matching
  scrutinizer pattern
- M7: add homepage/repository/license/keywords metadata to 3 plugin.json
  files (ambient, audit-claude, self-review)

Closes remaining HIGH and MEDIUM findings. M1 (acceptable), M4 and M6
(by-design) closed without code changes. H3/H4/H6/M2/M5/M8 were already
fixed in PRs #145-147.

Refs #142
dean0x added a commit that referenced this pull request Mar 18, 2026
## Summary

Fixes all HIGH, MEDIUM, and 2 of 3 LOW findings from #142 (post-Wave 2
consistency audit). Only L1 (skill line counts) remains — skipped by
design.

### Commit 1: H2, M3, M7 code fixes
- **H2**: `ambient-router` SKILL.md description updated to standard
`"This skill should be used when..."` format
- **M3**: `simplifier.md` agent gains `## Output` and `## Boundaries`
sections (matching scrutinizer pattern)
- **M7**: Added `homepage`, `repository`, `license`, `keywords` to 3
plugin.json files (`devflow-ambient`, `devflow-audit-claude`,
`devflow-self-review`)

### Commit 2: L2, L3 documentation and description sync
- **L2**: Updated CLAUDE.md to document intentional `allowed-tools`
exceptions (git skills add `Bash`, interactive skills add
`AskUserQuestion`, persistence skills add `Write`)
- **L3**: Synced plugin descriptions across all 3 sources (`plugin.json`
as canonical → `plugins.ts` + `marketplace.json`). 9 plugins had
divergent descriptions with missing details.

### Also resolved in issue (no code changes needed)
- **M1**: Closed as acceptable — agents under 350-line threshold
- **M4**: Closed as by-design — specify doesn't load skills, consistent
with non-teams variant
- **M6**: Closed as by-design — `agents: []` is correct;
`claude-md-auditor` is plugin-specific, not shared

### Previously fixed (PRs #145-147)
H3, H4, H6, M2, M5, M8

### Remaining (skipped)
- **L1**: 15 skills exceed 150-line target — acceptable, all have
`references/` directories

## Test plan

- [x] `npm run build` — 45 skill copies + 21 agent copies, no errors
- [x] `npm test` — 250 tests pass
- [x] Spot checks: ambient-router description, simplifier sections,
plugin.json metadata, description sync

Closes #142

---------

Co-authored-by: Dean Sharon <deanshrn@gmain.com>
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