scc-init
Skill4 starsChanged 2 months agoApache-2.0View on GitHub
Bootstrap this project's knowledge base from the code that already exists: survey the repository, then write the stack, glossary, wiki, codewiki and ADRs, and the project's real build, test, lint and format commands. Use it on a workspace whose docs/ is still the seeded anchors, or to document an existing codebase.
- Reads credentials
In this repository9 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- gauntlet-loopSkill
- scc-adrSkill
- scc-codewikiSkill
- scc-glossarySkill
- scc-plan-runSkill
- scc-prdSkill
- scc-stackSkill
- scc-wikiSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 160
Leave the credentials alone.
- Distinctive: line 223
No graph, no CI file, no history worth reading — none of that stops the run.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
You fill an empty knowledge base from a repository that already exists. $ARGUMENTS
is the scope, if one was given; the table below is what to do when it was not.
The formats are not yours. Each artifact has an owner — the stack, glossary,
wiki, codewiki, and adr skills — and the rule they all enforce is
.claude/rules/knowledge-base.md. Call them; do not restate them. What this skill
owns is what no rule can: the order across artifacts, the survey that precedes all
of them, and the bar for what may be written at all.
The bar — nothing without evidence
Everything here is reconstructed, not remembered. Nobody is telling you why this system is the way it is; you are inferring it from what survived. So write only what you can point at — a file, a dependency manifest, a CI workflow, a commit, a comment, a migration.
Where the code cannot tell you why, say the reasoning is unrecorded and move on. A plausible reason invented here is worse than a gap, because a gap is visible and an invention is believed. The knowledge base's whole value is that it can be trusted without checking, and this run is where that trust is either earned or spent.
Before anything — is there a workspace
scc validate fails outside one. If .claude/scc-manifest.json is absent the repository was
never scaffolded, and which harness it is scaffolded for is the user's call, not
yours — scc init --claude, --codex, or --opencode. Ask, then carry on.
Ask twice, then start
One exchange, before the survey, because both answers change how much you read:
| Ask | Answers |
| How deep — the anchors, or everything? | anchors (stack.md, glossary.md, the project rule, and a wiki a newcomer can enter) · full (also codewiki/ and the ADRs for decisions already taken) |
| The whole repository, or one subtree? | the root · one package, service, or app inside a monorepo |
Anchors is the right default for a first run. State what you took, so a wrong reading costs a sentence rather than a session.
The survey — read the map, not the territory
Cheapest sources first, and stop when another pass stops changing the map:
- What was written for a newcomer — README, CI workflows,
Makefileor the scripts block, the dependency manifests, the top-level directories. - The structure —
scc graph explore "<question>", per.claude/rules/code-search.md. A survey is exactly the shape of question the graph answers, and exactly the one that ruins a context window when answered by reading files. - The history, for what was argued about —
git logover a directory that moved, a revert, a migration, a dependency swapped out. This is the cheapest evidence that a decision was expensive, which is what an ADR needs and what code alone never says.
Report the map back before writing anything — the areas, the concepts you would give pages, the decisions you would record. That is the last moment a correction is cheap.
Then write, in this order
Cheapest and most checkable first, most interpretive last, with scc validate between
stages so no stage inherits the previous one's findings.
docs/stack.md— thestackskill. It has a finish line nothing else here has:stack.undocumented-dependencyreaching zero, because the validator reads the direct dependencies straight out of the manifest. Where nobody can justify one, say what it is used for — the import sites are a fact you can point at — and mark the decision unrecorded. Do not invent a rationale, and do not delete a dependency to silence a finding..claude/rules/project.md— the build, test, lint, and format commands. Run each one before you write it. Take them from CI first, since a workflow file is the one place somebody maintains them, then verify locally. A guessed command that exits0looks exactly like a passing suite, which is the whole reason that rule exists.Then record the same four as the delivery gate —
scc check set <gate> "<command>". The rule above is prose somebody reads; these are run, and their answers decide whether a branch becomes a pull request. There are four gates and they run in this order, stopping at the first failure:Gate What it has to do Typical source buildthe project compiles go build ./...,tsc --noEmit,cargo build,mvn -q compileformatthe formatter has nothing to say — the check, not the rewrite gofmt -l .,prettier --check,black --check,cargo fmt --checklintthe best-practices layer golangci-lint run,eslint .,ruff check,clippy -- -D warningstestthe suite passes, and covers enough see below A language that genuinely has no such step gets
scc check skip <gate>, once. That is a decision and it is recorded like one — the validator then stays quiet about it forever. Leaving a gate unrecorded is not the same thing: that is a decision nobody has made, and it is reported on every run until somebody makes it. Skip deliberately and rarely: most languages have a formatter, and "we have no linter" is usually "nobody has picked one yet", which is a finding worth keeping.The format gate is the check, never the rewrite.
gofmt -w .exits0having silently changed the tree; the gate has to be the one that fails on unformatted code, or it certifies every run.The test gate asks for one thing more — a JSON object anywhere in its output:
{"total": 412, "coverage": 88.4}Nothing in scc knows how your project produces those, which is why writing this is your job on this run. Build it from what the survey already told you:
Stack Where the two numbers come from Go go test -json -coverprofile=…for the count,go tool cover -funcfor the total lineNode / TS jest --coverage --json,vitest run --coverage --reporter=json— both already emit totalsPython pytest --cov --cov-report=json -q, and the summary line for the countRust cargo testfor the count,cargo llvm-cov --summary-onlyfor coverageAnything else whatever CI already runs, plus three lines of shell that print the object Put a pipeline in the repository, not in the manifest. Record a target —
make test-report,npm run test:report,./scripts/test-report.sh— and set that as the command. A pipeline recorded inline is one nobody can run by hand, fix, or review in a diff. A single command that already does the job goes in as it is.Three things to get right, because each has a failure mode that looks like success: a wrapped command's exit status has to survive the wrapper (a script ending in
echoreturns the echo's0and reports a broken build as green); the test report goes to stdout and the runner's own noise to stderr; andtotalis a real count, not a constant — zero tests with high coverage is a finding, and so is a number nobody updates.Then run
scc checkand read what it says. A gate that does not do what it claims is exactly as useless as no gate, and this is the one moment where fixing it costs nothing..devcontainer/Dockerfile— fit the container to this project.scc initseeds it with the agent's own toolchain (Claude Code,scc,codegraph,rtk) and a placeholder for yours; what it cannot know is the language, which you have just surveyed. Fill the marked block with whatscc checkactually runs — the compiler, the package manager, the linter and the formatter you recorded in step 2 — and nothing that only a human would want.This project Add Go golangat the version ingo.mod, plusgolangci-lintif the lint gate uses itNode / TS the Node version in .nvmrcorengines, and the package manager the lockfile impliesPython pythonplusuv/poetry/pip— whichever the lockfile is forRust rustupwith the toolchain inrust-toolchain.tomlThe bar is the gate, not the language. A container that cannot run
scc checkis a container the delivery gate cannot be verified in, which is the whole reason this file exists. So the test is mechanical: build it, open a shell in it, and runscc check. If a gate fails for a missing tool, that tool belongs in the Dockerfile.This matters most on Windows, where it is not a convenience: ai-jail's sandbox has no Windows backend, so the container is the only isolation
scc launchcan give. On Linux and macOS the same file is useful and optional — the kernel sandbox is what runs there.Leave the credentials alone. The seeded
devcontainer.jsonforwards a token and mounts.gitconfigread-only on purpose; do not add a mount for~/.sshor a cloud credential file, which is the one change that would hand a compromised dependency the keys the container exists to keep away from it.docs/glossary.md— theglossaryskill, conservatively. Every synonym listed afterAvoid:becomes a finding wherever it appears underdocs/, so list one only where you actually saw two names used for one thing. Take terms from the domain this project is about, never from its framework.docs/wiki/— thewikiskill. One page per concept a newcomer has to hold to read the code, never one per directory: a wiki that mirrors the file tree is the file tree, and it goes stale faster. Link every page fromindex.mdand log the run inchangelog.md.docs/codewiki/— thecodewikiskill, only where reading the code does not tell you why it is shaped that way. Every section cites the lines it explains, and a citation is a promise to keep the page current, so cite the part that is stable.docs/adr/— theadrskill, last, and the one to be strictest about. A decision qualifies only when both hold: undoing it would be expensive, and there is evidence in the repository that it was taken. Number from0001in the order the history says they happened.Say that the record is reconstructed. An ADR is what was believed at the time, and these were not written at the time — so open
## Contextwith one line naming what it was reconstructed from, and when.status: acceptedwhere the code shows the decision in force; neverproposedfor something already built.docs/notes.md— theTODO,FIXME,HACKand aside comments already in the code, moved into the log one line each with the file they sit on:scc notes add "…" --tag <t> --path <file>. Leave the comment where it is; this run does not touch code, and it goes when that file is next edited. What does not make the move is anything that is really work — that is a task in a plan, not a note.
What this does not do
- It does not write specs. Documenting a system that already works as
specs/means restating the whole product as requirements..claude/rules/specs.mdis explicit that a spec meets existing code as a delta, so the first spec here is written by the next change and not by this run. - It does not rewrite
CLAUDE.md. That file is the user's. - It does not touch code. A defect you notice is worth reporting at the end; it is not this run's to fix, and a documentation branch that also changes behavior is one nobody can review.
Finishing
scc validate --checks exits 0 — the artifacts in shape and every gate actually
doing what it claims — then deliver it as ordinary work: one branch, one pull
request, .claude/rules/delivery.md.
Then report what was left unknown, by name: the dependency nobody could justify, the area whose reasoning is unrecorded, the decision that looked expensive and had no evidence behind it. That list is the most valuable thing this run produces, and it is the part that disappears if you do not write it down.
Re-running
It is additive and resumable, and it takes its position from the repository rather
than from memory. Read what docs/ already holds, never rewrite a page somebody
else wrote, clear scc validate findings first and fill gaps second. A second run
over a documented workspace should report that there is nothing to add — not produce a
second account of the same system.
Degrading
No graph, no CI file, no history worth reading — none of that stops the run. Say which one is missing, fall back to what is there, and lower the claim rather than the honesty: five pages somebody can check beat a whole knowledge base assembled out of inference.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

