document
init is for repos with
nothing. document is for repos with something stale. It
delta-merges, preserving the why.
When to use it
- Stack changed: new test framework, package manager, or build tool.
CLAUDE.mdexists but the agent keeps producing code that does not match the repo.- Mature repo adopting Groundwork for the first time.
- After an
auditwith "stale context" findings.
What it produces
- Existing files extended, not overwritten.
- Stale sections moved to a
## Deprecatedblock with date and reason. - Chat summary that names what changed: added, deprecated, kept.
How it works
- Detect what exists. Globs every known context-file location. Notes last-modified date and approximate accuracy.
- Read the repo deeply. Last 50 commits and a sample of recent files. Checks whether existing conventions still match the code.
- Ask three questions. Which detected rules are still correct? Which new patterns should be written in? Anything to mark deprecated?
- Delta-merge. Correct sections kept verbatim. Drifted sections: new content added with a date, old content moved to a deprecated block with the reason.
- Anchored-rule sweep. Walks the Style section. Each rule must name a verb plus a specific technology, command, or pattern. Vague rules ("write robust error handling") get surfaced as anchor / drop / keep choices; the command never silently rewrites them.
- Reconcile across harnesses. If
CLAUDE.mdandAGENTS.mddisagree, surface the diff. Never pick a winner silently. - Verify. Same fail-loudly behaviour as
init.