truthmark 2.2.3 → 2.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,193 +2,126 @@
2
2
 
3
3
  **Your agents write code. Truthmark maintains human-facing, Git-reviewable documentation.**
4
4
 
5
- English | [Deutsch](README.de.md) | [中文](README.zh.md) | [Español](README.es.md) | [Русский](README.ru.md)
5
+ [![npm version](https://img.shields.io/npm/v/truthmark?color=cb3837&label=npm)](https://www.npmjs.com/package/truthmark)
6
+ [![CI](https://github.com/merlinhu1/truthmark/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/merlinhu1/truthmark/actions/workflows/ci.yml)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
8
+ [![Node.js >=24](https://img.shields.io/badge/node-%3E%3D24-339933?logo=node.js&logoColor=white)](package.json)
6
9
 
7
- ![Truthmark banner](docs/assets/truthmark-banner.png)
8
-
9
- AI coding agents can change a repository faster than humans can keep its documentation aligned.
10
-
11
- Truthmark fixes the part that usually breaks after the code is written: the repository truth.
12
-
13
- It installs a Git-native, branch-scoped workflow layer that helps AI coding agents update the right docs, respect ownership boundaries, and leave humans with normal diffs they can review.
14
-
15
- No hosted service.
16
-
17
- No database.
18
-
19
- No hidden memory layer.
20
-
21
- No extra server to operate.
22
-
23
- Just repository truth that moves with the branch.
24
-
25
- ## The problem
10
+ [Website](https://merlinhu1.github.io/truthmark/) | [GitHub](https://github.com/merlinhu1/truthmark) | [User Guide](docs/user-guide.md)
26
11
 
27
- AI coding agents are good at producing code. That creates a new failure mode.
12
+ [🇺🇸 English](README.md) | [🇨🇳 简体中文](docs/readmes/README.zh.md) | [🇯🇵 日本語](docs/readmes/README.ja.md) | [🇰🇷 한국어](docs/readmes/README.ko.md) | [🇩🇪 Deutsch](docs/readmes/README.de.md) | [🇫🇷 Français](docs/readmes/README.fr.md) | [🇪🇸 Español](docs/readmes/README.es.md) | [🇧🇷 Português](docs/readmes/README.pt.md) | [🇷🇺 Русский](docs/readmes/README.ru.md) | [🇸🇦 العربية](docs/readmes/README.ar.md) | [🇮🇹 Italiano](docs/readmes/README.it.md) | [🇵🇱 Polski](docs/readmes/README.pl.md) | [🇹🇷 Türkçe](docs/readmes/README.tr.md) | [🇻🇳 Tiếng Việt](docs/readmes/README.vi.md) | [🇮🇩 Bahasa Indonesia](docs/readmes/README.id.md) | [🇬🇷 Ελληνικά](docs/readmes/README.el.md)
28
13
 
29
- The implementation changes, but the repository story drifts:
30
-
31
- - behavior lives in chat history
32
- - architecture docs fall behind
33
- - product decisions disappear after handoff
34
- - reviewers see code diffs without the related truth diffs
35
- - branches quietly develop different versions of “what is true”
36
- - each agent session has to rediscover repository truth from scratch
37
-
38
- Truthmark turns that fragile repository truth into committed repository infrastructure.
39
-
40
- Instead of relying on every human and every agent to remember the right documentation habit, Truthmark installs the habit into the repository.
41
-
42
- ## The promise
14
+ ![Truthmark banner](docs/assets/truthmark-banner.png)
43
15
 
44
- When an agent changes functional code, the work should not end with only a code diff.
16
+ ## 🚀 Quick Start: running locally in five minutes
45
17
 
46
- The normal Truthmark path is:
18
+ Run this inside the Git repository you want Truthmark to manage:
47
19
 
48
- ```text
49
- agent changes functional code
50
- relevant tests run
51
- Truth Sync checks mapped truth docs
52
- truth docs update when needed
53
- human reviews code diff + truth diff
54
- commit or hand off
20
+ ```bash
21
+ cd /path/to/your-repo
22
+ npm install -g truthmark
23
+ truthmark config
55
24
  ```
56
25
 
57
- That is the core value: **AI work becomes easier to trust because the repository stays legible.**
26
+ Enable the AI host you actually use. Fresh configs are host-neutral, so add a top-level `platforms` list to `.truthmark/config.yml` before initialization:
58
27
 
59
- ## Two surfaces, one truth system
60
-
61
- Truthmark is not just a CLI.
62
-
63
- It has two distinct surfaces, and the distinction matters.
64
-
65
- ### 1. Human-facing CLI
66
-
67
- The CLI is for maintainers, reviewers, and automation.
28
+ ```yaml
29
+ version: 2
30
+ platforms:
31
+ - codex # or: claude-code, github-copilot, opencode, antigravity, cursor
32
+ truthmark:
33
+ workspace: docs/truthmark
34
+ generated:
35
+ portal:
36
+ enabled: false
37
+ ```
68
38
 
69
- Use it to configure a repository, install or refresh workflow files, validate truth artifacts, and generate optional review material.
39
+ Then install the repo-local truth docs, routing, and AI-host instructions:
70
40
 
71
41
  ```bash
72
- truthmark config
73
42
  truthmark init
74
43
  truthmark check
44
+ git diff
75
45
  ```
76
46
 
77
- The CLI prepares and validates the repository environment.
78
-
79
- It is not the AI workflow runtime.
80
-
81
- ### 2. AI-facing workflow surfaces
82
-
83
- The AI-facing surfaces are for coding agents.
84
-
85
- Truthmark installs host-native skills, prompts, commands, managed instruction blocks, and supported subagent surfaces so AI agents can follow repository-specific truth workflows inside their normal coding tools.
86
-
87
- Examples:
88
-
89
- ```text
90
- /truthmark-sync
91
- /truthmark-document
92
- /truthmark-structure
93
- /truthmark-realize
94
- /truthmark-check
95
- ```
96
-
97
- These look like commands because agent hosts expose workflows through slash commands, prompts, skills, or project commands.
98
-
99
- They are not shell commands.
100
-
101
- They are AI-facing workflow entrypoints.
102
-
103
- The split is the product:
47
+ Now try the most common adoption path: document one existing behavior from code and tests. In your AI coding host, ask the installed workflow:
104
48
 
105
49
  ```text
106
- humans own the repository contract
107
- Truthmark installs the contract into the repo
108
- agents operate inside that contract
109
- truth updates appear as Git diffs
110
- humans review the result
50
+ /truthmark-document document the implemented session timeout behavior across src/auth/session.ts and tests/auth/session.test.ts
111
51
  ```
112
52
 
113
- ## Quick start
114
-
115
- ### Requirements
116
-
117
- - Node.js `>=20`
118
- - npm
119
- - a Git repository
120
-
121
- ### Install Truthmark
53
+ After that, users should not normally invoke Truth Sync directly. Keep coding through your AI host; the installed repository instructions tell the agent to run relevant tests and perform the Truth Sync review before handoff when functional code changes. You review the resulting code diff plus truth-doc diff.
122
54
 
123
- Run this inside the repository you want to initialize:
55
+ If you only want CLI validation and do not want host-specific AI workflows yet, leave `platforms` omitted and run `truthmark init && truthmark check`; you can add a platform later and rerun `truthmark init`.
124
56
 
125
- ```bash
126
- cd /path/to/your-repo
127
- npm install -g truthmark
128
- ```
57
+ ## 💡 The Problem: The AI Documentation Gap
129
58
 
130
- ### Create the repository truth contract
59
+ AI coding agents are incredible at writing code fast. But this speed creates a dangerous new failure mode: **the repository's story drifts from reality.**
131
60
 
132
- ```bash
133
- truthmark config
134
- ```
61
+ * Behavior is lost in ephemeral chat histories.
62
+ * Architecture documents quickly fall behind.
63
+ * Product decisions vanish after handoff.
64
+ * Code reviewers are left examining raw code diffs without understanding the "why."
65
+ * Every new AI session is forced to rediscover your repository's truth from scratch.
135
66
 
136
- This creates:
67
+ ## 🎯 The Solution: Truthmark
137
68
 
138
- ```text
139
- .truthmark/config.yml
140
- ```
69
+ **Truthmark** installs a Git-native workflow layer into your repository. It fixes the part of AI development that usually breaks: keeping documentation aligned with code after the first draft.
141
70
 
142
- Review this file before continuing. It defines the committed hierarchy contract for the repository.
71
+ Instead of hoping humans and AI agents remember to update docs, Truthmark makes documentation a systematic, reviewable habit right inside your repo.
143
72
 
144
- ### Install the workflow surfaces
73
+ Truthmark is not a one-shot docs generator. It is an ongoing truth-doc curation loop that keeps human-facing docs small, owned, evidence-backed, and reviewable as agents keep changing code.
145
74
 
146
- ```bash
147
- truthmark init
148
- ```
75
+ ### ✨ Why Truthmark is Unique
149
76
 
150
- This installs or refreshes:
77
+ Truthmark isn't just another documentation tool. It is deeply integrated into the AI workflow:
151
78
 
152
- - route files
153
- - truth-doc scaffolding
154
- - managed instruction blocks
155
- - AI-facing workflow surfaces for configured platforms
79
+ * **🚫 Zero Vendor Lock-in:** No hosted services, no hidden databases, no extra servers to operate.
80
+ * **🌳 100% Git-Native:** Everything lives in your repository. The truth moves with your branch.
81
+ * **🤝 Human-owned, agent-followed contract:** Maintainers own the repo contract; agents follow the installed instructions while coding.
82
+ * **🧭 Ongoing truth curation:** Broad or messy docs are routed toward Structure instead of becoming giant catch-all files.
83
+ * **✅ Trust Through Verification:** AI work becomes easier to trust because behavior-changing work includes a human-reviewable truth-doc decision or diff.
156
84
 
157
- Default truth-doc templates are justified in [Template Standards](docs/standards/template-standards.md), which maps them to recognized software engineering references such as ISO/IEC/IEEE 42010, ISO/IEC/IEEE 29148, ISO/IEC/IEEE 12207, ISO/IEC 25010, C4, arc42, OpenAPI, SemVer, Google SRE, and Diátaxis.
85
+ ## 🔄 How It Works
158
86
 
159
- ### Validate the setup
87
+ When an AI agent modifies your code, the job isn't finished. Truthmark installs a finish-time workflow guard that agents follow before handoff:
160
88
 
161
- ```bash
162
- truthmark check
163
- ```
89
+ 1. 💻 **Code:** Agent modifies functional code.
90
+ 2. 🧪 **Test:** Relevant tests are executed.
91
+ 3. 🔍 **Check:** Truthmark checks mapped documentation as part of the installed finish-time review.
92
+ 4. 📝 **Document:** Docs are updated by the agent when repository truth has changed.
93
+ 5. 👀 **Review:** A human reviews the *code diff* + the *truth diff*.
164
94
 
165
- Then review the generated files before committing.
95
+ ## 🛠 How you interact with Truthmark
166
96
 
167
- The exact files depend on `.truthmark/config.yml`, but the install always has the same shape: routing, truth scaffolding, compact managed instructions, and host-native workflow surfaces for the enabled platforms.
97
+ Truthmark has one repo-local contract with two ways to use it.
168
98
 
169
- ## First real use
99
+ ### Humans install and validate the contract
170
100
 
171
- Most repositories need one cleanup pass after initialization.
101
+ Maintainers and CI use the CLI:
172
102
 
173
- The default scaffold starts with a provisional broad `repository` bootstrap area. Before normal syncing on real code, split that bootstrap route into precise routing.
103
+ * `truthmark config` - create the initial configuration.
104
+ * `truthmark init` - install or refresh routing, truth-doc scaffolds, and AI-host instructions.
105
+ * `truthmark check` - validate the repository truth from the terminal.
174
106
 
175
- Ask your agent to split the broad route into actual product, service, domain, or ownership areas:
107
+ ### Agents follow the contract while coding
176
108
 
177
- ```text
178
- /truthmark-structure split the broad repository area into auth, billing, and notifications
179
- ```
109
+ Truthmark installs repo-local instructions for supported AI coding hosts such as Codex, Claude Code, GitHub Copilot, OpenCode, Antigravity, and Cursor.
180
110
 
181
- If the project already has implemented features but missing or weak truth docs, ask the installed Truth Document workflow to document a focused scope:
111
+ The normal loop is simple:
182
112
 
183
- ```text
184
- /truthmark-document document the implemented payment retry behavior in src/billing/retry.ts and related tests
185
- ```
113
+ 1. Ask your agent for a code change, or ask it to document existing behavior.
114
+ 2. The installed instructions tell the agent when to test, when to update truth docs, and when to stop for human review.
115
+ 3. You review ordinary Git diffs: code plus any truth-doc changes.
186
116
 
187
- Truth Document is the common first workflow for existing projects. It inspects implementation, tests, routes, and existing docs, then creates or repairs truth docs and routing without changing functional code.
117
+ The user-started agent requests are intentionally few:
188
118
 
189
- After that, use your AI coding agent normally.
119
+ * `/truthmark-document` - document existing implemented behavior from code and tests.
120
+ * `/truthmark-realize` - implement code from existing truth docs.
121
+ * `/truthmark-check` - audit repository truth.
190
122
 
191
- When the agent changes functional code, Truth Sync acts as the finish-time guard that checks whether mapped truth docs need to change before handoff.
123
+ Truth Sync is not the usual way to start work; it is the finish-time review after functional code changes.
124
+ Truth Structure is not a day-to-day command; it repairs routing or ownership only when that blocks the work.
192
125
 
193
126
  ## What you get
194
127
 
@@ -197,8 +130,9 @@ When the agent changes functional code, Truth Sync acts as the finish-time guard
197
130
  | Git-native truth | Keeps repository truth in committed Markdown and config. |
198
131
  | Branch-scoped documentation | Truth moves with the branch instead of living in a private session. |
199
132
  | Human CLI | Gives maintainers setup, refresh, validation, and inspection commands. |
200
- | AI-facing workflows | Gives agents host-native workflows for sync, documentation, structure, realization, and audit. |
133
+ | Installed agent guidance | Tells coding agents when to document, test, sync truth, audit, or stop for review. |
201
134
  | Explicit routing | Maps code areas to canonical truth docs. |
135
+ | Durable truth curation | Keeps docs bounded, evidence-backed, and reviewable instead of letting them grow into catch-all files. |
202
136
  | Reviewable handoffs | Produces ordinary Git diffs for both code and truth docs. |
203
137
  | Local-first operation | Requires no hosted service, daemon, database, or MCP server. |
204
138
  | Safer write boundaries | Separates code-first, doc-first, read-only, and doc-only workflows. |
@@ -209,7 +143,7 @@ When the agent changes functional code, Truth Sync acts as the finish-time guard
209
143
 
210
144
  ![Truthmark features](docs/assets/truthmark-features.png)
211
145
 
212
- **Features:** what Truthmark installs and how the workflow surface is split.
146
+ **Features:** what Truthmark installs and how agents use repo-local instructions.
213
147
 
214
148
  ![Truthmark position](docs/assets/truthmark-position.png)
215
149
 
@@ -231,6 +165,8 @@ Not governance as ceremony. Governance as a simple question:
231
165
 
232
166
  Truthmark helps teams answer that with committed files, explicit routing, and reviewable diffs.
233
167
 
168
+ Most AI tools can draft documentation. Truthmark keeps repository truth curated after the draft, after the next code change, and after the doc starts getting too broad.
169
+
234
170
  It is useful when you need:
235
171
 
236
172
  - less documentation drift
@@ -240,7 +176,7 @@ It is useful when you need:
240
176
  - explicit ownership between docs and code
241
177
  - safer agent write boundaries
242
178
  - reviewable documentation instead of hidden memory
243
- - AI workflows that still work from committed repo files
179
+ - agent guidance that still works from committed repo files
244
180
 
245
181
  ## Where Truthmark fits
246
182
 
@@ -262,561 +198,42 @@ Truthmark’s lane is narrow by design:
262
198
  ```text
263
199
  make repository truth explicit
264
200
  route it to code
265
- install agent workflows around it
201
+ install agent guidance around it
266
202
  keep the result reviewable in Git
267
203
  ```
268
204
 
269
- ## How Truthmark runs
270
-
271
- Truthmark runs locally against the active Git worktree.
272
-
273
- The human-facing CLI reads and writes repository files, then exits.
274
-
275
- The AI-facing workflow surfaces are committed files that agent hosts can load later. That means agents can follow the installed workflow from repository state instead of depending on a background Truthmark process.
276
-
277
- The layers fit together like this:
278
-
279
- ```mermaid
280
- flowchart LR
281
- Human["Human / CI"] --> CLI["Truthmark CLI"]
282
- CLI --> Config["Config and route map"]
283
- CLI --> Truth["Canonical truth docs"]
284
- CLI --> Surfaces["Generated host-native workflows"]
285
- Surfaces --> Hosts["Codex / Claude Code / Copilot / OpenCode / Gemini"]
286
- Hosts --> Worktree["Active Git worktree"]
287
- Hosts -->|"helper checks / validate / index"| CLI
288
- Worktree --> Truth
289
- ```
290
-
291
- Agents do not talk to a Truthmark daemon, but they can run the installed Truthmark CLI when a workflow asks for validation, indexing, or helper checks.
292
-
293
- Truthmark owns the generated workflow surfaces it creates, but the important contract is architectural: repo-local config and routing point agents at canonical truth docs, while host-native workflows give each supported agent a way to run the same Truthmark procedures.
294
-
295
- Generated workflow surfaces include Truthmark version markers. After upgrading Truthmark, rerun:
296
-
297
- ```bash
298
- truthmark init
299
- ```
300
-
301
- Then review the generated diffs.
205
+ ## Go deeper
302
206
 
303
- ## Supported agent platforms
207
+ The README is the storefront: fast context, quick start, and the core mental model.
304
208
 
305
- The default config includes every supported platform.
209
+ The [static website](https://merlinhu1.github.io/truthmark/) is the concise public introduction for GitHub Pages.
306
210
 
307
- Remove platforms you do not use from `.truthmark/config.yml`, then rerun:
308
-
309
- ```bash
310
- truthmark init
311
- ```
312
-
313
- | Platform config name | Generated surface | Invocation shape |
314
- | --- | --- | --- |
315
- | `codex` | Skill packages and verifier agents | `/truthmark-*` or `$truthmark-*` |
316
- | `claude-code` | Project skills, verifier agents, and managed instructions | `/truthmark-*` |
317
- | `github-copilot` | Agent skills, prompt commands, custom agents, and managed instructions | `/truthmark-*` in supported Copilot IDEs; `@truth-*` custom agents in Copilot CLI |
318
- | `opencode` | Skill packages and verifier agents | `/skill truthmark-*` |
319
- | `gemini-cli` | Agent skills, slash commands, subagents, and managed instructions | `/truthmark:*` |
320
-
321
- Unknown platform names are config errors.
322
-
323
- Removing a platform stops future refreshes for that platform. It does not delete previously generated files.
324
-
325
- ## AI-facing workflows
326
-
327
- These workflows are installed into supported AI coding hosts.
328
-
329
- They are used by agents or agent hosts during repository work. They are not top-level shell commands.
330
-
331
- | Workflow | Direction | Use it when | Write boundary |
332
- | --- | --- | --- | --- |
333
- | Truth Structure | topology-first | The default route is too broad, ownership spans multiple areas, or route files still point at placeholders. | Creates or repairs routing and starter truth docs. |
334
- | Truth Document | implementation-first | Behavior already exists in code, but canonical truth docs are missing or weak. | Writes truth docs and routing only. Functional code must not change. |
335
- | Truth Sync | code-first | Functional code changed and mapped truth docs may need to be updated before handoff. | Updates truth docs. Functional code must not be rewritten by Truth Sync. |
336
- | Truth Realize | doc-first | Product or architecture truth docs lead and code should be updated to match. | Updates code only. The agent must not edit the truth docs it is realizing. |
337
- | Truth Check | audit-first | A reviewer or agent needs to audit repository truth health. | Audits and reports. |
338
- | Truthmark Portal | presentation-only | A human explicitly asks for a browsable static HTML Portal over repository truth docs. | Writes generated non-canonical static files only under the fixed Portal output directory. |
339
-
340
- ### Important distinction
341
-
342
- Do not confuse these two surfaces:
343
-
344
- | Surface | Used by | Example | Meaning |
345
- | --- | --- | --- | --- |
346
- | Human CLI | humans, scripts, CI-like checks | `truthmark check` | Validate repository truth artifacts from the terminal. |
347
- | AI-facing workflow | coding agents and agent hosts | `/truthmark-check` | Ask an agent to run the installed audit workflow. |
348
-
349
- The names are intentionally related, but the surfaces are different.
350
-
351
- ## Normal AI-assisted code change
352
-
353
- Most users should not need to invoke Truth Sync manually every time.
354
-
355
- Truth Sync is the installed finish-time guard for functional code changes.
356
-
357
- ```text
358
- agent changes functional code
359
- agent runs or asks for relevant tests
360
- installed workflow detects that functional code changed
361
- Truth Sync checks mapped truth docs
362
- agent updates truth docs if needed
363
- human reviews code diff + truth diff
364
- ```
365
-
366
- Direct invocation is still useful for troubleshooting, forcing an early sync, or making the handoff explicit:
367
-
368
- ```text
369
- /truthmark-sync sync the repository truth now before handoff
370
- ```
371
-
372
- ## Existing behavior without docs
373
-
374
- Use Truth Document when the implementation already exists but the repository truth is incomplete. This is the normal path for established repositories adopting Truthmark after the codebase already exists.
375
-
376
- ```text
377
- /truthmark-document document the implemented session timeout behavior across src/auth/session.ts, src/auth/middleware.ts, and tests/auth/session.test.ts
378
- ```
379
-
380
- Give it the feature name, code paths, test paths, or desired truth-doc area. On OpenCode-style hosts, call the same workflow as `/skill truthmark-document ...`; on Gemini CLI, use `/truthmark:document ...`.
381
-
382
- For a large repo that still has one broad placeholder route, run Truth Structure first, then invoke Truth Document for one bounded feature or area at a time.
383
-
384
- Truth Document inspects implementation, tests, route files, and existing docs as evidence.
385
-
386
- It writes truth docs and routing only.
387
-
388
- It must not change functional code.
389
-
390
- ## Doc-first changes
391
-
392
- Use Truth Realize when a product or architecture decision starts in docs and code should be updated to match.
393
-
394
- ```text
395
- /truthmark-realize realize docs/truthmark/product/capabilities/session-timeout.md into code
396
- ```
397
-
398
- Truth Realize is doc-first.
399
-
400
- The truth docs lead. The code follows.
401
-
402
- The agent must not edit the truth docs it is realizing.
403
-
404
- ## Read-only routing preview
405
-
406
- Use Truth Preview before a change when the agent needs to understand likely routing.
407
-
408
- ```text
409
- /truthmark-preview preview the likely truth routing for changes to the billing API (GitHub Copilot)
410
- /truthmark:preview preview the likely truth routing for changes to the billing API (Gemini CLI)
411
- ```
412
-
413
- Truth Preview is read-only.
414
-
415
- It is a selector and planning aid, not write authorization and not a replacement for Truth Check.
416
-
417
- ## Repository truth audit
418
-
419
- Use Truth Check when you want an agent-facing audit workflow.
420
-
421
- ```text
422
- /truthmark-check audit routing and truth coverage before review
423
- ```
424
-
425
- Use the human-facing CLI when you want terminal validation:
426
-
427
- ```bash
428
- truthmark check
429
- ```
430
-
431
- Both are useful. They are not the same surface.
432
-
433
- ## Human-facing CLI commands
434
-
435
- Most maintainers start with three commands.
436
-
437
- | Command | Purpose |
438
- | --- | --- |
439
- | `truthmark config` | Create `.truthmark/config.yml`. Writes only that file unless `--stdout` is used. |
440
- | `truthmark init` | Install or refresh configured workflow surfaces from the reviewed config. |
441
- | `truthmark check` | Validate configuration, authority, routing, decision-bearing docs, frontmatter, internal links, branch scope, generated surfaces, freshness, and coverage diagnostics. |
442
-
443
- Optional repository-intelligence helpers generate derived review material for the active checkout, such as RepoIndex, RouteMap, ImpactSet, and compact WorkflowState/action-context JSON. Generated workflow skill packages may also expose helper manifests and helper policies that call installed `truthmark validate ... --json` CLI validators; those helpers are accelerators, not bundled repo-local scripts or sources of truth. Standalone Copilot prompts and Gemini commands use the same CLI validator contract when the installed runner is available, and otherwise report a visible skipped helper status with manual validation.
444
-
445
- They are not sources of truth.
446
-
447
- | Command | Purpose |
448
- | --- | --- |
449
- | `truthmark index` | Build RepoIndex and RouteMap JSON for the active checkout. |
450
- | `truthmark impact --base <ref>` | Map changed files to routed truth docs, owning routes, nearby tests, and public symbols. |
451
- | `truthmark workflow status --workflow <workflow> [--base <ref>] --json` | Return workflow applicability, write boundaries, target truth docs, checks, helper commands, and compact affected-test guidance. |
452
-
453
- Structured output is available with `--json` where supported.
454
-
455
- ## Truthmark Portal
456
-
457
- Truthmark Portal is an optional presentation workflow for teams that want a human-readable site over their committed truth docs.
458
-
459
- It is deliberately separate from the core truth workflow:
460
-
461
- - Markdown truth docs remain canonical.
462
- - Generated Portal HTML is presentation only.
463
- - Portal is manual-only; it does not run as a completion review, Truth Sync step, `truthmark check` step, or automatic post-change hook.
464
- - Portal writes stay inside the fixed Truthmark-derived output directory.
465
- - Generated pages should use local assets, source provenance, and a visible Markdown-canonical disclaimer.
466
-
467
- Enable it with the namespaced config block:
468
-
469
- ```yaml
470
- truthmark:
471
- generated:
472
- portal:
473
- enabled: true
474
- ```
475
-
476
- Then rerun:
477
-
478
- ```bash
479
- truthmark init
480
- ```
481
-
482
- When enabled, Truthmark installs host-native Portal workflow surfaces for the configured platforms, such as `/truthmark-portal` or `/truthmark:portal` depending on the agent host.
483
-
484
- ## Configuration
485
-
486
- Truthmark is config-first.
487
-
488
- The main config file is:
489
-
490
- ```text
491
- .truthmark/config.yml
492
- ```
493
-
494
- New repositories should run:
495
-
496
- ```bash
497
- truthmark config
498
- ```
499
-
500
- Then review the generated config before running:
501
-
502
- ```bash
503
- truthmark init
504
- ```
505
-
506
- Important config areas include:
507
-
508
- | Config area | Purpose |
509
- | --- | --- |
510
- | `version` | Config contract version. |
511
- | `platforms` | Agent hosts that should receive platform-specific generated surfaces. |
512
- | `truthmark.workspace` | Truthmark-owned workspace for routes, truth docs, templates, and generated presentation output. |
513
- | Fixed routes | Routes live under `routes/areas.md` and `routes/areas/` inside `truthmark.workspace`; the default area is `repository` and delegation depth is `1`. |
514
- | Fixed truth lanes | Product truth lives under `product/` and engineering truth under `engineering/` inside `truthmark.workspace`. |
515
- | Fixed templates | Truth-doc templates live under `templates/` inside `truthmark.workspace`. |
516
- | `truthmark.generated.portal` | Optional manual presentation workflow enablement: `enabled`. |
517
- | `instruction_targets` | Files that receive shared managed instruction blocks, such as `AGENTS.md`. |
518
- | `frontmatter.required` | Metadata fields that produce error diagnostics when missing. |
519
- | `frontmatter.recommended` | Metadata fields that produce review diagnostics when missing. |
520
- | `ignore` | Glob patterns excluded from relevant checks and routing logic. |
521
-
522
- ## Repository truth routing
523
-
524
- Truthmark maps code surfaces to truth docs.
525
-
526
- The main routing files are:
527
-
528
- ```text
529
- docs/truthmark/routes/areas.md
530
- docs/truthmark/routes/areas/**/*.md
531
- ```
532
-
533
- A route tells the agent:
534
-
535
- - which code surface belongs to an area
536
- - which truth docs own that area
537
- - when truth should be updated
538
- - what kind of truth doc is involved
539
-
540
- The default scaffold starts with a provisional broad bootstrap route so a fresh repository is routeable. When real code is touched, split that bootstrap route into real product, service, domain, or ownership areas before normal Truth Sync; do not turn the bootstrap handoff into a catch-all behavior doc.
541
-
542
- Example:
543
-
544
- ```text
545
- /truthmark-structure split the broad repository area into frontend, backend, billing, and deployment
546
- ```
547
-
548
- Good routing gives Truth Sync precise destinations.
549
-
550
- Bad routing makes agents guess.
551
-
552
- ## What Truthmark installs
553
-
554
- Truthmark installs a compact repository-native truth layer.
555
-
556
- It does this in four layers:
557
-
558
- - configuration and routing for ownership boundaries
559
- - canonical truth docs and starter templates
560
- - compact managed instruction blocks for repository-wide agent instructions
561
- - host-native workflow packages, commands, prompts, and verifier agents for the platforms enabled in config
562
-
563
- Truthmark preserves manual content outside managed instruction blocks.
564
-
565
- Generated workflow surfaces are managed by Truthmark and may be refreshed by rerunning:
566
-
567
- ```bash
568
- truthmark init
569
- ```
570
-
571
- ## Subagents and bounded evidence checks
572
-
573
- Where supported by the host, Truthmark can install project-scoped verifier agents and a leased `truth-doc-writer`.
574
-
575
- These help keep large truth tasks bounded:
576
-
577
- - route auditors inspect route ownership
578
- - claim verifiers check whether doc claims are supported by evidence
579
- - doc reviewers inspect truth-doc quality
580
- - leased doc writers handle bounded truth-doc writing shards
581
-
582
- The parent workflow still owns final interpretation, write boundaries, diff validation, and acceptance.
583
-
584
- This is important: subagents help with bounded evidence work. They do not replace the main workflow contract.
585
-
586
- ## Review loop
587
-
588
- Truthmark is designed for ordinary Git review.
589
-
590
- A good AI-assisted handoff should show:
591
-
592
- ```text
593
- code diff
594
- test evidence
595
- truth-doc diff, if needed
596
- routing changes, if needed
597
- agent report
598
- ```
599
-
600
- The reviewer should be able to answer:
601
-
602
- - What code changed?
603
- - Which truth docs own that code?
604
- - Did those docs need updates?
605
- - If not, why not?
606
- - Did the agent stay inside the workflow write boundary?
607
- - Are tests or verification evidence included?
608
-
609
- ## Examples
610
-
611
- ### Initialize a repository
612
-
613
- ```bash
614
- npm install -g truthmark
615
- truthmark config
616
- truthmark init
617
- truthmark check
618
- ```
619
-
620
- ### Remove unused agent platforms
621
-
622
- Edit:
623
-
624
- ```text
625
- .truthmark/config.yml
626
- ```
627
-
628
- Then rerun:
629
-
630
- ```bash
631
- truthmark init
632
- truthmark check
633
- ```
634
-
635
- ### Split broad routing
636
-
637
- ```text
638
- /truthmark-structure split the broad repository area into auth, billing, notifications, and deployment
639
- ```
640
-
641
- ### Document implemented behavior
642
-
643
- ```text
644
- /truthmark-document document the implemented password reset flow under docs/truthmark/engineering/behaviors/authentication
645
- ```
646
-
647
- ### Sync after code changes
648
-
649
- ```text
650
- /truthmark-sync sync the repository truth now before handoff
651
- ```
652
-
653
- ### Realize a doc-first decision
654
-
655
- ```text
656
- /truthmark-realize realize docs/truthmark/product/capabilities/invoice-retry-policy.md into code
657
- ```
658
-
659
- ### Audit truth health from the terminal
660
-
661
- ```bash
662
- truthmark check
663
- ```
664
-
665
- ### Generate branch-impact summary
666
-
667
- ```bash
668
- truthmark impact --base main
669
- ```
670
-
671
- ### Inspect workflow status
672
-
673
- ```bash
674
- truthmark workflow status --workflow truthmark-sync --base main --json
675
- ```
676
-
677
- ### Enable the optional Portal workflow
678
-
679
- ```yaml
680
- truthmark:
681
- generated:
682
- portal:
683
- enabled: true
684
- ```
685
-
686
- ```bash
687
- truthmark init
688
- ```
689
-
690
- Then explicitly ask the agent host to run the installed Portal workflow when you want the static presentation site generated or refreshed.
211
+ For command-by-command usage, surface comparisons, supported platform details, configuration, routing, Portal, and examples, read the [Truthmark User Guide](docs/user-guide.md).
691
212
 
692
213
  ## Project status
693
214
 
694
- Truthmark V1 currently provides:
695
-
696
- - `truthmark config`
697
- - `truthmark init`
698
- - `truthmark check`
699
- - `truthmark index`
700
- - `truthmark impact`
701
- - `truthmark workflow status`
702
- - branch-scope metadata
703
- - managed instruction blocks
704
- - generated Truth Structure workflow surfaces
705
- - generated Truth Document workflow surfaces
706
- - generated Truth Sync workflow surfaces
707
- - generated Truth Preview workflow surfaces
708
- - generated Truth Realize workflow surfaces
709
- - generated Truth Check workflow surfaces
710
- - optional generated Truthmark Portal workflow surfaces
711
- - route, authority, decision-structure, frontmatter, link, freshness, generated-surface, and coverage diagnostics
712
- - derived RepoIndex, RouteMap, ImpactSet, and WorkflowState artifacts
713
- - host-specific surfaces for Codex, Claude Code, GitHub Copilot, OpenCode, and Gemini CLI
714
-
715
- ## Development
716
-
717
- Install dependencies:
718
-
719
- ```bash
720
- npm install
721
- ```
722
-
723
- Run the local development CLI:
724
-
725
- ```bash
726
- npm run dev -- init
727
- npm run dev -- check
728
- ```
729
-
730
- Run the full project check:
215
+ The current release provides:
731
216
 
732
- ```bash
733
- npm run check
734
- ```
735
-
736
- Useful scripts:
737
-
738
- | Script | Purpose |
739
- | --- | --- |
740
- | `npm run dev` | Run the TypeScript CLI entry point with `tsx`. |
741
- | `npm run build` | Build the package. |
742
- | `npm run lint` | Run ESLint. |
743
- | `npm run typecheck` | Run TypeScript checks. |
744
- | `npm run test` | Run tests. |
745
- | `npm run check` | Run lint, typecheck, tests, and build. |
746
- | `npm run release:check` | Run release-oriented validation. |
747
-
748
- When changing Truthmark itself, see [CONTRIBUTING.md](CONTRIBUTING.md).
217
+ - local CLI commands for config, init, check, index, impact, and workflow status
218
+ - generated repo-local agent instructions for Codex, Claude Code, GitHub Copilot, OpenCode, Antigravity, and Cursor
219
+ - route, authority, frontmatter, link, freshness, generated-surface, branch-scope, and coverage diagnostics
220
+ - branch-scoped truth docs and derived repository-intelligence artifacts
749
221
 
750
222
  ## Documentation
751
223
 
752
- The README is the fast path for evaluation and setup.
753
-
754
- Detailed current behavior lives under `docs/`:
755
-
224
+ - [User guide](docs/user-guide.md)
756
225
  - [Docs index](docs/README.md)
757
226
  - [Architecture overview](docs/truthmark/engineering/architecture/overview.md)
758
227
  - [API and CLI contracts](docs/truthmark/engineering/contracts/config-route-and-check-contracts.md)
759
- - [Init and scaffold behavior](docs/truthmark/engineering/behaviors/init-and-scaffold.md)
760
- - [Check diagnostics](docs/truthmark/engineering/behaviors/check-diagnostics.md)
761
- - [Installed workflows](docs/truthmark/engineering/workflows/installed-workflow-runtime.md)
762
228
  - [Repository truth maintenance guide](docs/standards/maintaining-repository-truth.md)
763
229
 
764
- ## Design boundaries
765
-
766
- Truthmark is intentionally small.
767
-
768
- It is not:
769
-
770
- - a hosted service
771
- - an MCP server
772
- - a vector database
773
- - a canonical documentation website generator or hosted docs platform
774
- - a CI or PR enforcement product
775
- - a replacement for tests, code review, or technical leadership
776
- - an autonomous code rewrite engine
777
- - a model-training or fine-tuning framework
778
- - a hidden memory layer
779
-
780
- Those boundaries are part of the product.
781
-
782
- Truthmark keeps the workflow local, committed, branch-scoped, and reviewable.
783
-
784
- ## Safety and review discipline
230
+ For local development and contribution commands, see [CONTRIBUTING.md](CONTRIBUTING.md).
785
231
 
786
- Truthmark helps the repository stay honest. It does not prove the code is correct.
787
-
788
- Teams should still:
789
-
790
- - run relevant tests
791
- - review functional code changes
792
- - review truth-doc changes
793
- - keep secrets out of docs
794
- - keep repository-specific instructions outside managed blocks
795
- - review generated workflow-surface diffs after upgrades
796
- - keep human ownership over product and architecture decisions
797
-
798
- Truthmark makes agent-facing repository truth visible. It does not replace human judgment.
799
-
800
- ## Roadmap direction
801
-
802
- The current future direction emphasizes:
803
-
804
- - stronger `truthmark check` evidence reporting
805
- - clearer adoption examples
806
- - example repositories showing real Truth Sync cycles
807
- - migration guides for teams already using agent instruction files
808
- - conformance tests for generated host surfaces
809
- - route-aware stale-truth hints
810
- - bounded implementation checklists for doc-first work
232
+ ## Design boundaries
811
233
 
812
- The center of gravity stays the same:
234
+ Truthmark is intentionally small: local, committed, branch-scoped, and reviewable.
813
235
 
814
- ```text
815
- repository truth
816
- agent-native workflows
817
- Git review
818
- branch-scoped documentation
819
- ```
236
+ It is not a hosted service, MCP server, vector database, hidden memory layer, CI enforcement product, or autonomous code rewrite engine. It helps repository truth stay visible; it does not replace tests, code review, or human judgment.
820
237
 
821
238
  ## License
822
239