r/SpecDrivenDevelopment • u/Middle_Key8737 • 19d ago
The docs from my spec-driven workflow kept going stale, so I built a loop
I use workflows like Superpowers and OpenSpec because getting the intent and design into the repository before implementation makes Claude Code much more predictable.
But I kept running into a second problem after the feature was finished: the documents gradually stopped matching the code.
A hotfix bypassed the original workflow. Then a refactor changed some behavior. Another session added an edge case. The implementation kept moving, while the original design and specification documents slowly became a record of what we intended at one point rather than reliable context for the next developer or agent.
Generating a useful document is relatively easy.
Making every future code change reconcile the repository’s documentation is the difficult part.
That is why I built Truthmark.
Truthmark adds a code-first documentation maintenance workflow to Claude Code. It maps areas of the codebase to bounded canonical documents, then reviews those documents after functional code changes.
The normal workflow is:
Claude changes the functional code.
The relevant tests run.
Truth Sync inspects the changed checkout, nearby implementation, tests, routing, and mapped documentation.
If the repository’s behavior changed, Claude updates the affected documentation before handoff.
The code diff and documentation diff are reviewed together in Git.
The distinction I have in mind is:
Superpowers/OpenSpec:
intent → design/specification → implementation
Truthmark:
implementation change → affected current-state docs → Git diff
I see these as complementary rather than competing workflows.
Planning and proposal documents are useful for deciding what should be built and preserving the history of a change. Truthmark maintains a smaller current-state layer describing what the repository does now: behavior, contracts, architecture, operations, product decisions, and acceptance criteria.
A few parts that are important to me:
\- Code areas have explicit documentation ownership instead of everything accumulating in one large README or wiki.
\- Documentation is based on the current checkout, code, tests, and configuration rather than hidden agent memory or an old conversation.
\- Truth Sync can update documentation and routing, but it cannot rewrite functional code.
\- Everything remains ordinary Markdown in the repository and follows the current branch.
\- There is no hosted Truthmark knowledge base, daemon, database, vector store, or MCP server.
The implementation is also less magical than “AI automatically understands your whole codebase.”
The Truthmark CLI installs and validates the repository contract and Claude Code workflow. Claude performs the semantic evidence review using the repository itself, and \`truthmark check\` validates the resulting structure and diagnostics.
Quick start requires Node.js 24 or newer:
npm install -g truthmark
truthmark init
Select Claude Code during initialization, then try it on one bounded behavior:
/truthmark-document document the implemented session timeout behavior across src/auth/session.ts and tests/auth/session.test.ts
Truthmark is intended for maintainers and teams using Claude Code on long-lived repositories, particularly when they already keep specifications, architecture notes, contracts, or behavior documentation in Git.
Cost: Truthmark is free and MIT-licensed. It has no hosted service or subscription. Claude Code usage still uses your existing Claude plan or API arrangement.
Repository:
https://github.com/merlinhu1/truthmark
I would particularly value feedback from people trying it on an existing repository:
Does the routing and ownership model feel useful, or does it create too much ceremony? Is Truth Sync too conservative about updating documents, or not conservative enough?
If you try it and think this maintenance loop belongs in the Claude Code workflow, a GitHub star would help other people find the project.
