truthmark 2.2.3 → 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,193 +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-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:
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:
104
41
 
105
42
  ```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
43
+ /truthmark-document document the implemented session timeout behavior across src/auth/session.ts and tests/auth/session.test.ts
111
44
  ```
112
45
 
113
- ## Quick start
114
-
115
- ### Requirements
116
-
117
- - Node.js `>=20`
118
- - npm
119
- - a Git repository
120
-
121
- ### 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.
122
47
 
123
- Run this inside the repository you want to initialize:
124
-
125
- ```bash
126
- cd /path/to/your-repo
127
- npm install -g truthmark
128
- ```
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`.
129
49
 
130
- ### Create the repository truth contract
50
+ ## 💡 The Problem: The AI Documentation Gap
131
51
 
132
- ```bash
133
- truthmark config
134
- ```
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.**
135
53
 
136
- 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.
137
59
 
138
- ```text
139
- .truthmark/config.yml
140
- ```
60
+ ## 🎯 The Solution: Truthmark
141
61
 
142
- 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.
143
63
 
144
- ### 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.
145
65
 
146
- ```bash
147
- truthmark init
148
- ```
66
+ ### ✨ Why Truthmark is Unique
149
67
 
150
- This installs or refreshes:
68
+ Truthmark isn't just another documentation tool. It is deeply integrated into the AI workflow:
151
69
 
152
- - route files
153
- - truth-doc scaffolding
154
- - managed instruction blocks
155
- - 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.
156
74
 
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.
75
+ ## 🔄 How It Works
158
76
 
159
- ### 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:
160
78
 
161
- ```bash
162
- truthmark check
163
- ```
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*.
164
84
 
165
- Then review the generated files before committing.
85
+ ## 🛠 How you interact with Truthmark
166
86
 
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.
87
+ Truthmark has one repo-local contract with two ways to use it.
168
88
 
169
- ## First real use
89
+ ### Humans install and validate the contract
170
90
 
171
- Most repositories need one cleanup pass after initialization.
91
+ Maintainers and CI use the CLI:
172
92
 
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.
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.
174
96
 
175
- Ask your agent to split the broad route into actual product, service, domain, or ownership areas:
97
+ ### Agents follow the contract while coding
176
98
 
177
- ```text
178
- /truthmark-structure split the broad repository area into auth, billing, and notifications
179
- ```
99
+ Truthmark installs repo-local instructions for supported AI coding hosts such as Codex, Claude Code, GitHub Copilot, OpenCode, Antigravity, and Cursor.
180
100
 
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:
101
+ The normal loop is simple:
182
102
 
183
- ```text
184
- /truthmark-document document the implemented payment retry behavior in src/billing/retry.ts and related tests
185
- ```
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.
186
106
 
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.
107
+ The user-started agent requests are intentionally few:
188
108
 
189
- 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.
190
112
 
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.
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.
192
115
 
193
116
  ## What you get
194
117
 
@@ -197,7 +120,7 @@ When the agent changes functional code, Truth Sync acts as the finish-time guard
197
120
  | Git-native truth | Keeps repository truth in committed Markdown and config. |
198
121
  | Branch-scoped documentation | Truth moves with the branch instead of living in a private session. |
199
122
  | 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. |
123
+ | Installed agent guidance | Tells coding agents when to document, test, sync truth, audit, or stop for review. |
201
124
  | Explicit routing | Maps code areas to canonical truth docs. |
202
125
  | Reviewable handoffs | Produces ordinary Git diffs for both code and truth docs. |
203
126
  | Local-first operation | Requires no hosted service, daemon, database, or MCP server. |
@@ -209,7 +132,7 @@ When the agent changes functional code, Truth Sync acts as the finish-time guard
209
132
 
210
133
  ![Truthmark features](docs/assets/truthmark-features.png)
211
134
 
212
- **Features:** what Truthmark installs and how the workflow surface is split.
135
+ **Features:** what Truthmark installs and how agents use repo-local instructions.
213
136
 
214
137
  ![Truthmark position](docs/assets/truthmark-position.png)
215
138
 
@@ -240,7 +163,7 @@ It is useful when you need:
240
163
  - explicit ownership between docs and code
241
164
  - safer agent write boundaries
242
165
  - reviewable documentation instead of hidden memory
243
- - AI workflows that still work from committed repo files
166
+ - agent guidance that still works from committed repo files
244
167
 
245
168
  ## Where Truthmark fits
246
169
 
@@ -262,561 +185,40 @@ Truthmark’s lane is narrow by design:
262
185
  ```text
263
186
  make repository truth explicit
264
187
  route it to code
265
- install agent workflows around it
188
+ install agent guidance around it
266
189
  keep the result reviewable in Git
267
190
  ```
268
191
 
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.
302
-
303
- ## Supported agent platforms
304
-
305
- The default config includes every supported platform.
306
-
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
192
+ ## Go deeper
621
193
 
622
- Edit:
194
+ The README is the storefront: fast context, quick start, and the core mental model.
623
195
 
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.
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).
691
197
 
692
198
  ## Project status
693
199
 
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:
200
+ The current release provides:
731
201
 
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).
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
749
206
 
750
207
  ## Documentation
751
208
 
752
- The README is the fast path for evaluation and setup.
753
-
754
- Detailed current behavior lives under `docs/`:
755
-
209
+ - [User guide](docs/user-guide.md)
756
210
  - [Docs index](docs/README.md)
757
211
  - [Architecture overview](docs/truthmark/engineering/architecture/overview.md)
758
212
  - [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
213
  - [Repository truth maintenance guide](docs/standards/maintaining-repository-truth.md)
763
214
 
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
215
+ For local development and contribution commands, see [CONTRIBUTING.md](CONTRIBUTING.md).
785
216
 
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
217
+ ## Design boundaries
811
218
 
812
- The center of gravity stays the same:
219
+ Truthmark is intentionally small: local, committed, branch-scoped, and reviewable.
813
220
 
814
- ```text
815
- repository truth
816
- agent-native workflows
817
- Git review
818
- branch-scoped documentation
819
- ```
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.
820
222
 
821
223
  ## License
822
224