Skip to content

feat(assets): seed the four fixed docs/ documents at init - #7

Merged
protonspy merged 1 commit into
mainfrom
feat/seed-docs-anchors
Aug 2, 2026
Merged

protonspy merged 1 commit into
mainfrom
feat/seed-docs-anchors

Conversation

@protonspy

Copy link
Copy Markdown
Owner

scc init created docs/adr/, docs/codewiki/, docs/raw/ and docs/wiki/ and left every one of them empty. A fresh workspace therefore shipped eight validators and not one document saying what they check — the formats existed only in the skills, which the user meets after a finding rather than before.

What this adds

init now seeds the knowledge base's four fixed-name documents:

File What it carries
docs/glossary.md the entry format (- **term** — definition. Avoid: …) and when to coin one
docs/stack.md one line of why per adopted technology; adding a dependency as a two-step act
docs/wiki/index.md the entry point and the [[slug]] reachability rule
docs/wiki/changelog.md newest first, naming the pages each change touched

Those four are the only docs/ documents with a fixed name — a wiki page, an ADR and a codewiki page are named after what they are about — so the rest of the tree is still correctly scaffolded empty.

Each seed puts its guidance in prose, its example in a fence and its marker in an HTML comment, which is exactly what mdscan excludes from Body. TestFreshArtifactsPassTheirOwnValidators stays green in all three harnesses: nothing scc just wrote fires a finding.

A seed is a third category, and it is untracked

Not in the manifest, not in scc update. The moment the file exists it holds project knowledge scc has no improved version of to deliver — the same terms the artifact templates ship on. Untracked also settles the two-harness case without a rule of its own: docs/ is one tree per repo rather than one per harness, so the second init finds the files and leaves them alone, as it does for any existing file. --force still overwrites and still names what it destroyed.

assets.Version is deliberately unchanged: no workspace template moved, and a bump would rewrite every manifest to record a number nobody read.

Side effect worth calling out

The stack validator gets better first contact. A repo with dependencies used to receive one stack.missing; it now receives one stack.undocumented-dependency per unrecorded dependency, pointing at a file that already explains what an entry looks like. Verified in a temp workspace with a go.mod: one finding for github.com/go-chi/chi/v5, gone once the entry is added.

Tests

New assertions cover: seeds land where the validators look and in sorted order; no seed collides with a managed file; seeds are harness-neutral and carry no template action; Dirs() covers every seed's parent; the manifest never names one; an edited glossary.md survives a second init; and scc update's plan does not mention them.

gofmt, go vet and go test ./... are clean locally. -race was not run locally (no cgo toolchain on this machine); CI covers it on all three platforms.

Existing workspaces

scc update ignores seeds by construction, so the path forward there is re-running scc init — idempotent and additive, it writes only what is missing.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GchWF6iL5PjTdXAT8H3mhb

init created docs/adr/, docs/codewiki/, docs/raw/ and docs/wiki/ and left
every one of them empty, so a fresh workspace shipped eight validators and
not one document telling the user what they check. glossary.md, stack.md,
wiki/index.md and wiki/changelog.md are the knowledge base's only
fixed-name documents — a wiki page, an ADR and a codewiki page are named
after what they are about — so those four are seeded and the directories
stay correctly empty.

Each seed carries its validator's format: the guidance in prose, the
example in a fence, the marker in an HTML comment. That is exactly what
mdscan excludes from Body, so nothing scc just wrote fires a finding.

A seed is a third template category, and it is untracked: not in the
manifest, not in scc update. The moment the file exists it holds project
knowledge scc has no improved version of, which is the same terms the
artifact templates ship on. Untracked also settles the two-harness case
without a rule of its own, because docs/ is one tree per repo rather than
one per harness.

Side effect on the stack validator: a repo with dependencies used to get
one stack.missing, and now gets one line per undocumented dependency
pointing at a file that already explains what an entry looks like.

assets.Version is unchanged — no workspace template moved, and a bump
would rewrite every manifest to record a number nobody read.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GchWF6iL5PjTdXAT8H3mhb
@protonspy
protonspy merged commit 1cf7f06 into main Aug 2, 2026
4 checks passed
@protonspy
protonspy deleted the feat/seed-docs-anchors branch August 2, 2026 23:39
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