truthmark 2.2.2 → 2.2.5

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