Knowledge Unification Plan
Plan: Knowledge Unification
Context Pointers
- Architecture: ARCHITECTURE.md @ d795b03ee, SHA-256
46b99403eafebcfeb8b9b25abddef3796fdd226ed4d82071284d5106476dc451. - Spec: SPEC.md @ 7b0210cfe, SHA-256
6d2634b24dfac4ad9b1a85dc6bd1607c25f923182371b1a71df0e848894f7138. - Grill: status SHA-256
270e515f…, log SHA-25678114c4b…at commit45fc437bb. - Freshness: a task re-reads the pair when either SHA changes. A conflict returns to
requirements-grill. architecture_applicability: local. Evidence: the change moves tracked files, rewrites guidance and removes scripts. It adds no module, seam or runtime owner (architecture#whole-system).
Situation and Problem
Root docs/ and apps/wiki both claim knowledge authority, and the wiki takes part in CI, install, Vercel PR statuses and lint/type/test scripts. The spec accepts one knowledge home and Wiki gate isolation (OUT-001 to OUT-004).
Solution Shape
Five disjoint edits in wave 1, the root docs/ deletion and its link sweep in wave 2, then release notes, validation and backlog closure in wave 3. Everything lands as one squashed commit on main (spec Constraints).
Resolved Decision Ledger
| Decision | Source |
|---|---|
| All accepted decisions Q1–Q20 | Spec #accepted-technical-decisions |
| Planning-only identities; no backlog sync | User, 2026-10-12: "no delivery or anything. just do it" |
| No grilling round | No open decision; grill closed with confirmation (status #current-round) |
No planning-discovery, parallel-research or plan-reviewer subagent | Evidence gathered during the grill and compile (spec #verification-seams); user asked for direct execution |
| TDD: not applicable | Spec #accepted-testing-decisions: no new tests; verification by commands |
| Existing CLI release-script tests stay; run the classifier test if one exists | Spec #accepted-testing-decisions |
Assumptions and Constraints
- Skill text,
AGENTS.mdtext and rule text followwriting-for-agents(/home/stefan/repos/skills/skills/agnostic/docs/writing-for-agents/SKILL.md). - Shared skills change only in
/home/stefan/repos/skillsonmain(repository rule); synced copies are not hand-edited. CLAUDE.mdstays a symlink beside eachAGENTS.md.- Historical text stays unchanged (spec Non-Goals).
Dependency Graph and Waves
- Wave 1: T1, T2, T3, T4, T5 (disjoint write scopes).
- Wave 2: T6.
- Wave 3: T7, then T8.
Tasks
Common fields for every task: task_identity_mode: planning-only; backlog_item_id, backlog_item_url, relation_mode: none; backlog_sync_skip_reason: user requested direct execution without delivery; tdd_status: not-applicable; red_command, expected_red_failure, green_command: none; reason_not_testable: content, guidance and script-surface removal verified by commands (spec #verification-seams); review_mode: cli; runtime_validation: none; runtime_target, runtime_evidence, runtime_cleanup: none; status: done; log, files edited/created and evidence: IMPLEMENTATION-NOTES.md.
T1: Wiki content
depends_on: none.wave_boundary: wave 1.location:apps/wiki/content/docs/project/,apps/wiki/AGENTS.md.owned_paths:apps/wiki/content/docs/project/**exceptspecs/wiki/knowledge-unification/**;apps/wiki/AGENTS.md;apps/wiki/index.md;apps/wiki/wiki-framework.md;apps/wiki/README.md.read_dependencies:docs/README.md,docs/reference/**,docs/runbooks/**.description: (a) moveproject/reference/tech-debt/**toproject/tech-debt/**with the same sub-paths, updatemeta.jsonfiles andtech-debt/index.mdx, rewrite every live link to the old route (AC-004). (b) Link each currentdocs/README.mdentry fromproject/index.mdxor the owning section index; skip "Historical records" (AC-003). (c) Add a knowledge-maintenance grill log entry that supersedes Q8 and links the IP-439 grill; update the live root-docs/authority statements in the knowledge-maintenanceSPEC.mdandARCHITECTURE.md(AC-009). (d) Rewriteapps/wiki/AGENTS.mdownership and wiki contract socontent/docsis the only knowledge home, projections come only fromspecs/, and validation commands arecheck:contentandcheck:health(AC-006, AC-008). (e) Update live (non-historical) wiki pages that call rootdocs/the authority, such asdecisions/wiki-content-ownership.mdx(AC-008).validation:bun run --cwd apps/wiki check:health;git grep -n "project/reference/tech-debt" -- apps/wiki/contentreturns only historical text.assigned_skills:writing-for-agents.implementation_skill_guidance:writing-for-agents— forapps/wiki/AGENTS.md, keep one source of truth per meaning, positive wording, and leave lookups to the environment.codebase_design_notes: none (content only). Spec: OUT-001, OUT-002; AC-003, AC-004, AC-006, AC-008, AC-009. Architecture: ARC-002, ARC-003, ARC-004, ARC-005.
T2: Wiki runtime and isolation
depends_on: none.wave_boundary: wave 1.location:apps/wiki/.owned_paths:apps/wiki/scripts/**,apps/wiki/src/public-routes.test.tsx,apps/wiki/package.json,apps/wiki/vercel.json,apps/wiki/vitest.config.ts,apps/wiki/oxlint.config.ts,apps/wiki/tools/**,apps/wiki/test-fixtures/**,apps/wiki/tsconfig.tsbuildinfo,bun.lock.description: (a)sync-content.mjs: remove the root-docs/trees,tech-decisions.mdcopy and their link projections; keep thespecs/projection (AC-010). (b)check-health.mjs: report a rootdocs/directory and frontmattersource:paths that do not resolve; exit 0 with findings (AC-011). (c)package.json: keep onlybuild,dev,start,check:content,check:health; removepostinstall; remove dev dependencies used only by deleted files; refreshbun.lockwithbun install(AC-014). (d) Delete the 5 test files,vitest.config.ts,oxlint.config.ts,tools/oxlint/,test-fixtures/(AC-014). (e)vercel.json:ignoreCommandthat skips non-mainbuilds (AC-013).validation:bun run --cwd apps/wiki check:content;bun run --cwd apps/wiki check:healthexits 0;VERCEL_GIT_COMMIT_REF=feature sh -c '<ignoreCommand>'; echo $?is 0 and withmainis 1;bun install --frozen-lockfilepasses.assigned_skills: none.codebase_design_notes: remove code made unused; add no new abstraction. Spec: OUT-003; AC-010, AC-011, AC-013, AC-014. Architecture: ARC-006, ARC-007, ARC-009, ARC-010.
T3: Root CI and repository scripts
depends_on: none.wave_boundary: wave 1.location: repository root.owned_paths:turbo.json,package.json,scripts/behavior-contract/run-ci-verification.mjs,scripts/assert-wiki-generated-source.mjs,apps/cli/scripts/classify-release-impact.mjs.description: (a)turbo.json: remove@punks/wiki#check:contentdocs/**input,@punks/wiki#check-types, the changelog and assert-script inputs, and thecheck:contentdependency of@punks/wiki#build(AC-010, AC-012, AC-014). (b)run-ci-verification.mjs: add--filter=!@punks/wikito theaffected/plantask list (AC-012). (c) Roottest:ci: add--filter=!@punks/wikito the first turbo run; remove the assert script fromlint:repo(AC-012, AC-015). (d) Deletescripts/assert-wiki-generated-source.mjs(AC-015). (e) Remove thedocs/prefix fromreleasePathOwnership(AC-015).validation:TURBO_SCM_BASE=origin/main TURBO_SCM_HEAD=HEAD bun scripts/behavior-contract/run-ci-verification.mjs affected --dry=jsonselects no@punks/wikitask; existing tests for the two scripts, if present, pass.assigned_skills:turborepo(filter and inputs).implementation_skill_guidance:turborepo— combine--affectedwith a negated--filter. Spec: OUT-003; AC-012, AC-015. Architecture: ARC-008, ARC-013.
T4: Guidance, rules and subagents
depends_on: none.wave_boundary: wave 1.location: repository root and nested scopes.owned_paths:AGENTS.md;apps/{api,backoffice,cli,web}/AGENTS.md;apps/cli/src/AGENTS.md;apps/cli/src/data/AGENTS.md;packages/*/AGENTS.md;apps/cli/README.md;.agents/rules/**;.agents/subagents/manifest.mjs;.claude/agents/**,.codex/agents/**,.cursor/agents/**,.opencode/agents/**.description: (a) Replace every "updatedocs/README.md" duty with "update the owning wiki page and its section index"; replace links to rootdocs/pages with wiki paths; rewrite rootAGENTS.mdownership line that givesdocs/authority (AC-006, AC-008). (b) RewriteHI-DOCS-001and its Registry row; repointHI-REPO-003authority and activation (AC-005, AC-008). (c) Remove thedocsagent from the manifest and theapps-wiki"keep canonical operations indocs" boundary; regenerate harness mirrors with the CLI'sbuildHarnessAgentFiles; delete the fourdocsmirrors (AC-007).validation:git grep -n "docs/README.md"over owned paths returns nothing; mirrors equal regenerated output;find . -name CLAUDE.md -not -type lover touched scopes returns nothing.assigned_skills:writing-for-agents,rule-authoring.implementation_skill_guidance:writing-for-agents— one meaning, one place; positive phrasing; prune stale lines.- Spec: OUT-002; AC-005 to AC-008. Architecture: ARC-004.
T5: Shared skills and sync
depends_on: none.wave_boundary: wave 1.location:/home/stefan/repos/skillsmain, then this repository.owned_paths:/home/stefan/repos/skills/skills/**/resolve-debt-phase/**,**/implement-spec/references/lifecycle.md,**/docs-ingest-phase/**;apps/cli/scripts/sync-skills-repo.mjs;.agents/skills/**;apps/cli/skills/**;apps/cli/.devpunks-cache/**.description: Edit the three skills (AC-016): tech debt goes to<wiki-root>/content/docs/project/tech-debt/<domain>/...;docs-ingest-phaseroutes implemented operations to the wiki and treats a rootdocs/as legacy input to merge. Commit on skillsmainas simosabba, push, tagsync/<slug>-<sha12>; move the pin; runbun run sync:skills; verify the receipt commit.validation: receipt inapps/cli/.devpunks-cache/skills-sync.jsonnames the new commit;git grep "docs/reference/tech-debt" -- .agents/skills apps/cli/skillsreturns nothing.assigned_skills:writing-for-agents.implementation_skill_guidance:writing-for-agents— sharpen pointers; positive target behavior; no sediment.- Spec: OUT-004; AC-016. Architecture: ARC-011, FLOW-004.
T6: Delete root docs and sweep live links
depends_on: T1, T2, T3, T4.wave_boundary: wave 2.owned_paths:docs/**; any remaining live file the sweep finds outside other tasks' completed paths.description:git rm -r docs; runbun run --cwd apps/wiki check:contentto prove the projection no longer needs it; sweepgit grepfor live root-docs/paths and repoint the remaining ones (AC-001, AC-002, AC-008).validation:git ls-files docsis empty;check:contentandcheck:healthpass; reference and runbook page list equals the pre-change list.- Spec: OUT-001; AC-001, AC-002, AC-008. Architecture: ARC-001, FLOW-001.
T7: Changelog and validation
depends_on: T5, T6.wave_boundary: wave 3.owned_paths:BASELINE_CHANGELOG.md;apps/wiki/log.md; this plan's status fields;IMPLEMENTATION-NOTES.md.description: Add theUnreleasednote; runbun run release:classify -- --base origin/main --head HEADand requirebaseline; run all task validations again; record evidence (AC-017).- Spec: OUT-004; AC-017.
T8: Rewrite IP-439
depends_on: T7.wave_boundary: wave 3.owned_paths: Linear IP-439.description: Rewrite title and description to the accepted scope, link the spec, remove labelfog; read back (AC-018).- Spec: OUT-004; AC-018. Architecture: ARC-012.
Testing Strategy
No new tests (spec #accepted-testing-decisions). Each task runs its command checks. T7 repeats them on the final tree and runs the release classifier.
Risks and Mitigations
| Risk | Mitigation |
|---|---|
Deleting docs/ before the projection change makes sync-content.mjs prune the copies | T6 depends on T2 |
bun install lock drift after dev-dependency removal | T2 refreshes bun.lock and checks --frozen-lockfile |
| Pre-commit hook fails on unrelated pre-existing lint | Verify on a clean origin/main tree before any bypass (memory: skills sync release flow) |
Turbo rejects --affected with --filter | Dry run in T3 validation |
Unresolved Questions
None.