Summary
The docs/ tree has no stated structure. Four trees grew there for four different
purposes. Nothing says which tree owns what. Nothing keeps CLAUDE.md and README.md
in agreement with the code. This issue does two things:
- Give
docs/ a documented structure, and move the existing files into it once.
- Add a
housekeeping skill that probes the tree, reports drift, and repairs it.
This is a follow-up to #56. Land the knowledge-lookup work first. The housekeeping
skill reads bun run knowledge --topic documentation for its own rules, so it depends
on that CLI staying stable.
Background
CLAUDE.md has drifted. Nobody has asked for it to stay current, and no gate checks
it. Nine phases have shipped since it was written. The measured drift is listed below.
The same problem applies to README.md, which is still two lines and has a spelling
error.
There is also no as-built documentation. The repository has a normative specification
and a pre-implementation design document. It has no document that describes the code
that exists today. dexpace/python-sdk solved this with a flat docs/ tree. We copy
that shape.
Current state
Measured on branch mvp at d8217af. 139 files under docs/.
| Path |
Content |
Size |
docs/knowledge/ |
39 topic files, plus INDEX.md and SOURCES.md |
509 KB |
docs/product-spec/ |
20 chapters, 3 appendices |
568 KB |
docs/product-spec.md |
table of contents for the directory above |
6 KB |
docs/sdk-design-nodejs/ |
10 chapters |
96 KB |
docs/sdk-design-nodejs.md |
table of contents for the directory above |
3 KB |
docs/superpowers/specs/ |
24 files |
— |
docs/superpowers/plans/ |
39 files |
— |
docs/open-items.md |
the running register, sections A through N |
111 KB |
open-items.md (repository root) |
a second register, Phase 5a only, 9 findings |
9 KB |
README.md (repository root) |
2 lines |
44 B |
Measured drift in CLAUDE.md
CLAUDE.md states |
Actual |
"Two published packages today" — @dexpace/core and @dexpace/codec-json |
9 publishable packages and 2 private ones. Missing: logging-pino, logging-debug, body-file, transport-shared, transport-fetch, transport-undici, rx |
| The API section names 2 committed reports |
9 reports exist. bun run api verifies all 9 |
| The gate list has 7 commands |
CI runs 8. verify:sse-37 is a blocking step at .github/workflows/ci.yml:60 and does not appear in CLAUDE.md |
| "518 KB across 39 topic files" |
509 KB across 39 topic files |
| The documentation hierarchy table has 4 rows |
It omits docs/open-items.md, the largest single file in the tree |
Other defects
packages/core/README.md does not exist. @dexpace/core is the flagship package.
The harvested styleguide requires a README on every publishable package
(bun run knowledge --topic documentation).
- The two
open-items.md files are one register that was split. docs/open-items.md
states the gap itself: "Two phases are shipped but were never registered here: 4c
(stage-based pipeline) and 5a (retry)." The root file holds the missing Phase 5a
content. It landed in cba4721 and was never merged in.
- Section letters in
docs/open-items.md are cited from source comments. Nine
references exist in packages/core/src/, for example docs/open-items.md H12 at
packages/core/src/seams/index.ts:11 and docs/open-items.md K11 at
packages/core/src/index.ts:248. A merge must append a new letter. It must not
renumber the existing ones.
- Heading style in
docs/open-items.md is inconsistent. Sections A through G use
## A.; sections H through N use ## Section H —.
docs/superpowers/specs/2026-07-23-nodejs-sdk-v1-roadmap-design.md is 112 KB and
holds ## Open Findings — Phase 4b Validation Review and
## Open Findings — Phase 4c Validation Review. These belong in open-items.md.
docs/ has no index file.
README.md contains the spelling error "paltform".
Target structure
docs/
README.md <- new. Index of this tree. States what each entry owns.
assets/ <- new. Vendored wordmark SVG files.
knowledge/ <- frozen. Owned by knowledge-harvest.
product-spec/ <- frozen. Normative.
product-spec.md <- frozen. Table of contents for product-spec/.
sdk-design-nodejs/ <- frozen. Pre-implementation design.
sdk-design-nodejs.md <- frozen. Table of contents for sdk-design-nodejs/.
sdk-documentation/ <- new. As-built documentation of the shipped code.
open-items.md <- stays. The running register.
deferred-items.md <- new. Split out of open-items.md.
deviations.md <- stays at this level. See note below.
work/
mvp/
roadmap-design.md
checkpoint-scaffold-through-phase3a.md
scaffold/
phase-1/ … phase-10/
Rules
- Frozen trees.
knowledge/, product-spec/, sdk-design-nodejs/ and their two
sibling table-of-contents files are read-only to the housekeeping skill. The skill
reads them. It never writes to them.
work/ holds process records. Design documents, plans, checklists, decisions,
test evidence, and notes taken while doing the work. One directory for each unit of
delivery.
work/mvp/ holds everything delivered so far. All work to date is the MVP. Later
efforts get sibling directories under work/.
- One directory for each whole phase.
phase-3/ holds 3a and 3b. phase-6/
holds 6a, 6b, 6c, and the segmentation design that covers all three. Sub-phases
do not get their own top-level directory.
- Registers stay at the
docs/ root. open-items.md, deferred-items.md, and the
deviation record are cross-phase. They are not process records and they are not
as-built documentation. dexpace/python-sdk does the same, with deviations.md and
conformance-ledger.md at its docs/ root.
docs/superpowers/ stays as the write target. The Superpowers brainstorming and
writing-plans skills hard-code that path
(writing-plans/SKILL.md:18, brainstorming/SKILL.md:100). Do not fight it. The
housekeeping skill collects from docs/superpowers/ and moves the files into
docs/work/. Collection is part of its normal run.
Phase mapping
The 63 files under docs/superpowers/ map as follows.
| Target |
Source files |
work/mvp/roadmap-design.md |
2026-07-23-nodejs-sdk-v1-roadmap-design.md |
work/mvp/checkpoint-scaffold-through-phase3a.md |
the checkpoint plan |
work/mvp/scaffold/ |
the 3 scaffold-milestone files |
work/mvp/phase-1/ |
phase1 design, plan, checklist |
work/mvp/phase-2/ |
phase2 design, plan, checklist |
work/mvp/phase-3/ |
phase3a and phase3b files |
work/mvp/phase-4/ |
phase4a, phase4b, phase4c, and the shared checklist |
work/mvp/phase-5/ |
phase5a, phase5b, phase5c files |
work/mvp/phase-6/ |
phase6a, phase6b, phase6c, and phase6-segmentation |
work/mvp/phase-7/ |
phase7a, phase7b, and phase7-segmentation |
work/mvp/phase-8/ |
phase8a, phase8b, and phase8-segmentation |
work/mvp/phase-9/ |
phase9 design, plan, checklist |
work/mvp/phase-10/ |
phase10 design and plan |
Keep the YYYY-MM-DD- prefix on each file name. It carries ordering that the
directory name does not.
Work items
1. Migration commit
One commit. git mv only, so history follows each file.
Fix the one link that breaks: test/node-conformance/README.md:3 points at
docs/superpowers/plans/2026-07-25-checkpoint-scaffold-through-phase3a.md:341.
Two references need no change. scripts/changeset.mjs:7 is a comment.
scripts/knowledge.test.mjs:127 is a test fixture string. Leave the .changeset/
files alone. They are frozen history.
Update CLAUDE.md at lines 133, 226, and 232.
2. Register consolidation
- Merge the root
open-items.md into docs/open-items.md as a new lettered section.
Do not renumber sections A through N.
- Move
## Open Findings blocks out of the roadmap design document and into
docs/open-items.md.
- Split the deferred items into
docs/deferred-items.md. The roadmap document has a
## Deferred Items Log section; that is the seed.
- Normalize heading style across the whole register.
3. docs/sdk-documentation/
Model on dexpace/python-sdk/docs/, which is flat and already proven:
architecture.md http.md pipelines.md bodies.md auth.md errors.md
quality-gates.md write-a-transport.md write-a-serde.md
write-a-paging-strategy.md write-a-response-handler.md
State the boundary in writing. This tree does not restate what
packages/*/etc/*.api.md and the TSDoc blocks already carry. Those two are generated
and gate-verified; a third copy would drift. This tree holds what they cannot express:
how the packages compose, which package to install for which job, and worked examples
that cross a package boundary.
4. docs/README.md
An index. One row for each entry in docs/. Each row says what the entry owns, who
writes to it, and whether the housekeeping skill may touch it.
5. Root README.md
Rewrite against dexpace/python-sdk/README.md. Keep the same section order: wordmark,
title, badges, one-paragraph statement, package table, quick start, architecture
diagram, core surface table, highlights, development, conventions, contributing,
security, license.
Fix "paltform".
Vendor the wordmark into docs/assets/, the way python-sdk does. The canonical
source is dexpace/morphic:
https://raw.githubusercontent.com/dexpace/morphic/main/docs/assets/dexpace-wordmark-dark.svg
https://raw.githubusercontent.com/dexpace/morphic/main/docs/assets/dexpace-wordmark-light.svg
A vendored copy survives a rename in morphic and works offline. The .github profile
repository links the raw URL instead; that is correct for a profile page and wrong for
a repository README.
Note one gap. The python-sdk README links to CONTRIBUTING.md,
CODE_OF_CONDUCT.md, SECURITY.md, CHANGELOG.md, and LICENSE.md. This repository
has none of them, and its licence file is LICENSE, without an extension. Either add
the files or drop the sections. Do not ship dead links.
6. packages/core/README.md
Write it. The harvested styleguide states the bar: the top of the README gets a new
engineer from zero to one working call in about 30 seconds, without reading source.
Use packages/transport-fetch/README.md as the model. It is the strongest README in
the workspace.
While there, level the weak ones. packages/logging-debug/README.md is 387 bytes and
packages/logging-pino/README.md is 399 bytes.
7. The housekeeping skill
.claude/skills/housekeeping/. It runs in two stages.
Probe. Read-only. Report only. It checks:
- Files sitting in
docs/superpowers/ that belong under docs/work/.
- Files at the repository root that belong under
docs/.
- Claims in
CLAUDE.md against the repository: package count and names, the script
list in package.json, the blocking steps in .github/workflows/ci.yml, the
committed API reports, and the docs/ tree itself.
- Claims in
README.md against the same sources.
- A README on every publishable package.
- Broken relative links inside
docs/, CLAUDE.md, and the package READMEs.
- Open-item or deferral text that has appeared in a specification document instead of
the register.
Apply. Only after the probe reports. It performs the git mv calls, updates
CLAUDE.md and README.md, and refreshes docs/README.md.
It may write to: docs/README.md, docs/sdk-documentation/, docs/work/,
CLAUDE.md, README.md, and the package READMEs.
It must never write to: docs/knowledge/, docs/product-spec/,
docs/sdk-design-nodejs/, docs/product-spec.md, or docs/sdk-design-nodejs.md.
It takes its documentation rules from the corpus, not from its own opinion:
bun run knowledge --topic documentation # 21 harvested styleguide rules
Out of scope
- Any change to the content of
knowledge/, product-spec/, or sdk-design-nodejs/.
- Adding
CONTRIBUTING.md, CODE_OF_CONDUCT.md, or SECURITY.md. Track these
separately if the README is to link them.
- Wiring the skill into CI. It is a manual tool for now, like
bun run test:scripts.
Acceptance criteria
Open decisions
docs/assets/ adds a sixth entry to docs/. Confirm it, or reference the morphic
raw URL instead and add no directory.
- Naming:
docs/sdk-documentation/ against docs/guide/. python-sdk uses plain
docs/, which is not available here because this repository already uses docs/
for four other trees.
- The
deviations record. docs/sdk-design-nodejs/10-deliberate-deviations-from-the-reference-contract.md
sits inside a frozen tree and is cited from CLAUDE.md:164. Decide whether it moves
to docs/deviations.md, or stays and is linked from docs/README.md.
Depends on #56.
Summary
The
docs/tree has no stated structure. Four trees grew there for four differentpurposes. Nothing says which tree owns what. Nothing keeps
CLAUDE.mdandREADME.mdin agreement with the code. This issue does two things:
docs/a documented structure, and move the existing files into it once.housekeepingskill that probes the tree, reports drift, and repairs it.This is a follow-up to #56. Land the knowledge-lookup work first. The housekeeping
skill reads
bun run knowledge --topic documentationfor its own rules, so it dependson that CLI staying stable.
Background
CLAUDE.mdhas drifted. Nobody has asked for it to stay current, and no gate checksit. Nine phases have shipped since it was written. The measured drift is listed below.
The same problem applies to
README.md, which is still two lines and has a spellingerror.
There is also no as-built documentation. The repository has a normative specification
and a pre-implementation design document. It has no document that describes the code
that exists today.
dexpace/python-sdksolved this with a flatdocs/tree. We copythat shape.
Current state
Measured on branch
mvpatd8217af. 139 files underdocs/.docs/knowledge/INDEX.mdandSOURCES.mddocs/product-spec/docs/product-spec.mddocs/sdk-design-nodejs/docs/sdk-design-nodejs.mddocs/superpowers/specs/docs/superpowers/plans/docs/open-items.mdopen-items.md(repository root)README.md(repository root)Measured drift in
CLAUDE.mdCLAUDE.mdstates@dexpace/coreand@dexpace/codec-jsonlogging-pino,logging-debug,body-file,transport-shared,transport-fetch,transport-undici,rxbun run apiverifies all 9verify:sse-37is a blocking step at.github/workflows/ci.yml:60and does not appear inCLAUDE.mddocs/open-items.md, the largest single file in the treeOther defects
packages/core/README.mddoes not exist.@dexpace/coreis the flagship package.The harvested styleguide requires a README on every publishable package
(
bun run knowledge --topic documentation).open-items.mdfiles are one register that was split.docs/open-items.mdstates the gap itself: "Two phases are shipped but were never registered here: 4c
(stage-based pipeline) and 5a (retry)." The root file holds the missing Phase 5a
content. It landed in
cba4721and was never merged in.docs/open-items.mdare cited from source comments. Ninereferences exist in
packages/core/src/, for exampledocs/open-items.md H12atpackages/core/src/seams/index.ts:11anddocs/open-items.md K11atpackages/core/src/index.ts:248. A merge must append a new letter. It must notrenumber the existing ones.
docs/open-items.mdis inconsistent. Sections A through G use## A.; sections H through N use## Section H —.docs/superpowers/specs/2026-07-23-nodejs-sdk-v1-roadmap-design.mdis 112 KB andholds
## Open Findings — Phase 4b Validation Reviewand## Open Findings — Phase 4c Validation Review. These belong inopen-items.md.docs/has no index file.README.mdcontains the spelling error "paltform".Target structure
Rules
knowledge/,product-spec/,sdk-design-nodejs/and their twosibling table-of-contents files are read-only to the housekeeping skill. The skill
reads them. It never writes to them.
work/holds process records. Design documents, plans, checklists, decisions,test evidence, and notes taken while doing the work. One directory for each unit of
delivery.
work/mvp/holds everything delivered so far. All work to date is the MVP. Laterefforts get sibling directories under
work/.phase-3/holds3aand3b.phase-6/holds
6a,6b,6c, and the segmentation design that covers all three. Sub-phasesdo not get their own top-level directory.
docs/root.open-items.md,deferred-items.md, and thedeviation record are cross-phase. They are not process records and they are not
as-built documentation.
dexpace/python-sdkdoes the same, withdeviations.mdandconformance-ledger.mdat itsdocs/root.docs/superpowers/stays as the write target. The Superpowersbrainstormingandwriting-plansskills hard-code that path(
writing-plans/SKILL.md:18,brainstorming/SKILL.md:100). Do not fight it. Thehousekeeping skill collects from
docs/superpowers/and moves the files intodocs/work/. Collection is part of its normal run.Phase mapping
The 63 files under
docs/superpowers/map as follows.work/mvp/roadmap-design.md2026-07-23-nodejs-sdk-v1-roadmap-design.mdwork/mvp/checkpoint-scaffold-through-phase3a.mdwork/mvp/scaffold/scaffold-milestonefileswork/mvp/phase-1/phase1design, plan, checklistwork/mvp/phase-2/phase2design, plan, checklistwork/mvp/phase-3/phase3aandphase3bfileswork/mvp/phase-4/phase4a,phase4b,phase4c, and the shared checklistwork/mvp/phase-5/phase5a,phase5b,phase5cfileswork/mvp/phase-6/phase6a,phase6b,phase6c, andphase6-segmentationwork/mvp/phase-7/phase7a,phase7b, andphase7-segmentationwork/mvp/phase-8/phase8a,phase8b, andphase8-segmentationwork/mvp/phase-9/phase9design, plan, checklistwork/mvp/phase-10/phase10design and planKeep the
YYYY-MM-DD-prefix on each file name. It carries ordering that thedirectory name does not.
Work items
1. Migration commit
One commit.
git mvonly, so history follows each file.Fix the one link that breaks:
test/node-conformance/README.md:3points atdocs/superpowers/plans/2026-07-25-checkpoint-scaffold-through-phase3a.md:341.Two references need no change.
scripts/changeset.mjs:7is a comment.scripts/knowledge.test.mjs:127is a test fixture string. Leave the.changeset/files alone. They are frozen history.
Update
CLAUDE.mdat lines 133, 226, and 232.2. Register consolidation
open-items.mdintodocs/open-items.mdas a new lettered section.Do not renumber sections A through N.
## Open Findingsblocks out of the roadmap design document and intodocs/open-items.md.docs/deferred-items.md. The roadmap document has a## Deferred Items Logsection; that is the seed.3.
docs/sdk-documentation/Model on
dexpace/python-sdk/docs/, which is flat and already proven:State the boundary in writing. This tree does not restate what
packages/*/etc/*.api.mdand the TSDoc blocks already carry. Those two are generatedand gate-verified; a third copy would drift. This tree holds what they cannot express:
how the packages compose, which package to install for which job, and worked examples
that cross a package boundary.
4.
docs/README.mdAn index. One row for each entry in
docs/. Each row says what the entry owns, whowrites to it, and whether the housekeeping skill may touch it.
5. Root
README.mdRewrite against
dexpace/python-sdk/README.md. Keep the same section order: wordmark,title, badges, one-paragraph statement, package table, quick start, architecture
diagram, core surface table, highlights, development, conventions, contributing,
security, license.
Fix "paltform".
Vendor the wordmark into
docs/assets/, the waypython-sdkdoes. The canonicalsource is
dexpace/morphic:A vendored copy survives a rename in
morphicand works offline. The.githubprofilerepository links the raw URL instead; that is correct for a profile page and wrong for
a repository README.
Note one gap. The
python-sdkREADME links toCONTRIBUTING.md,CODE_OF_CONDUCT.md,SECURITY.md,CHANGELOG.md, andLICENSE.md. This repositoryhas none of them, and its licence file is
LICENSE, without an extension. Either addthe files or drop the sections. Do not ship dead links.
6.
packages/core/README.mdWrite it. The harvested styleguide states the bar: the top of the README gets a new
engineer from zero to one working call in about 30 seconds, without reading source.
Use
packages/transport-fetch/README.mdas the model. It is the strongest README inthe workspace.
While there, level the weak ones.
packages/logging-debug/README.mdis 387 bytes andpackages/logging-pino/README.mdis 399 bytes.7. The housekeeping skill
.claude/skills/housekeeping/. It runs in two stages.Probe. Read-only. Report only. It checks:
docs/superpowers/that belong underdocs/work/.docs/.CLAUDE.mdagainst the repository: package count and names, the scriptlist in
package.json, the blocking steps in.github/workflows/ci.yml, thecommitted API reports, and the
docs/tree itself.README.mdagainst the same sources.docs/,CLAUDE.md, and the package READMEs.the register.
Apply. Only after the probe reports. It performs the
git mvcalls, updatesCLAUDE.mdandREADME.md, and refreshesdocs/README.md.It may write to:
docs/README.md,docs/sdk-documentation/,docs/work/,CLAUDE.md,README.md, and the package READMEs.It must never write to:
docs/knowledge/,docs/product-spec/,docs/sdk-design-nodejs/,docs/product-spec.md, ordocs/sdk-design-nodejs.md.It takes its documentation rules from the corpus, not from its own opinion:
bun run knowledge --topic documentation # 21 harvested styleguide rulesOut of scope
knowledge/,product-spec/, orsdk-design-nodejs/.CONTRIBUTING.md,CODE_OF_CONDUCT.md, orSECURITY.md. Track theseseparately if the README is to link them.
bun run test:scripts.Acceptance criteria
docs/matches the target structure above.git mvonly.docs/README.mdexists and lists every entry indocs/.open-items.mdremains. It sits atdocs/. Section letters A through N areunchanged, and every source-comment citation still resolves.
docs/deferred-items.mdexists.docs/sdk-documentation/exists and states its boundary againstetc/*.api.mdand TSDoc.README.mdfollows thepython-sdkshape, shows the wordmark, and has no deadlinks.
packages/core/README.mdexists.CLAUDE.mdnames all 9 publishable packages, lists all 8 verification gatesincluding
verify:sse-37, and its documentation hierarchy table covers the wholeof
docs/..claude/skills/housekeeping/SKILL.mdexists, probes before it applies, andrefuses to write to the three frozen trees.
.github/workflows/ci.ymlstill passes.Run
node .claude/skills/ci-preflight/run-ci.mjs --clean.Open decisions
docs/assets/adds a sixth entry todocs/. Confirm it, or reference themorphicraw URL instead and add no directory.
docs/sdk-documentation/againstdocs/guide/.python-sdkuses plaindocs/, which is not available here because this repository already usesdocs/for four other trees.
deviationsrecord.docs/sdk-design-nodejs/10-deliberate-deviations-from-the-reference-contract.mdsits inside a frozen tree and is cited from
CLAUDE.md:164. Decide whether it movesto
docs/deviations.md, or stays and is linked fromdocs/README.md.Depends on #56.