@robotaccomplice/architext 1.0.0

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.
Files changed (43) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +497 -0
  3. package/docs/architecture/AGENTS_APPENDIX.md +39 -0
  4. package/docs/architecture/ARCHITECTURE_PLAN.md +520 -0
  5. package/docs/architecture/LLM_ARCHITEXT.md +95 -0
  6. package/docs/architext/AGENTS_APPENDIX.md +39 -0
  7. package/docs/architext/LLM_ARCHITEXT.md +64 -0
  8. package/docs/architext/README.md +120 -0
  9. package/docs/architext/data/data-classification.json +34 -0
  10. package/docs/architext/data/decisions.json +54 -0
  11. package/docs/architext/data/flows.json +114 -0
  12. package/docs/architext/data/glossary.json +24 -0
  13. package/docs/architext/data/manifest.json +23 -0
  14. package/docs/architext/data/nodes.json +194 -0
  15. package/docs/architext/data/risks.json +59 -0
  16. package/docs/architext/data/views.json +91 -0
  17. package/docs/architext/dist/assets/index-BWZ6sEpA.js +51 -0
  18. package/docs/architext/dist/assets/index-iWLms0Pa.css +1 -0
  19. package/docs/architext/dist/compass.svg +9 -0
  20. package/docs/architext/dist/index.html +14 -0
  21. package/docs/architext/index.html +13 -0
  22. package/docs/architext/package-lock.json +1822 -0
  23. package/docs/architext/package.json +28 -0
  24. package/docs/architext/public/compass.svg +9 -0
  25. package/docs/architext/schema/data-classification.schema.json +28 -0
  26. package/docs/architext/schema/decisions.schema.json +33 -0
  27. package/docs/architext/schema/flows.schema.json +72 -0
  28. package/docs/architext/schema/glossary.schema.json +22 -0
  29. package/docs/architext/schema/manifest.schema.json +47 -0
  30. package/docs/architext/schema/nodes.schema.json +69 -0
  31. package/docs/architext/schema/risks.schema.json +34 -0
  32. package/docs/architext/schema/views.schema.json +48 -0
  33. package/docs/architext/src/main.tsx +2133 -0
  34. package/docs/architext/src/styles.css +1475 -0
  35. package/docs/architext/tools/validate-architext.mjs +163 -0
  36. package/docs/architext/tsconfig.json +21 -0
  37. package/docs/architext/vite.config.ts +47 -0
  38. package/docs/assets/screenshots/architext-c4.png +0 -0
  39. package/docs/assets/screenshots/architext-data-risks.png +0 -0
  40. package/docs/assets/screenshots/architext-flows.png +0 -0
  41. package/docs/assets/screenshots/architext-sequence.png +0 -0
  42. package/package.json +81 -0
  43. package/tools/architext-adopt.mjs +874 -0
@@ -0,0 +1,520 @@
1
+ # Architext Architecture Plan
2
+
3
+ ## Context
4
+
5
+ Architext is a reusable global CLI and local architecture viewer backed by
6
+ strict JSON data files in each target repository. The JSON files serve two
7
+ audiences:
8
+
9
+ - humans reading the rendered local site
10
+ - LLMs maintaining an explicit map of the project's architecture, dataflows,
11
+ risks, decisions, and implementation touchpoints
12
+
13
+ The site must be usable without a hosted service. It will be served through a
14
+ tiny local static server so the browser can load JSON files with normal
15
+ `fetch()` behavior.
16
+
17
+ ## Architectural Drivers
18
+
19
+ - **Correctness:** schema violations and unresolved references must stop render.
20
+ - **LLM maintainability:** data shape must be explicit, stable, and easy to
21
+ update mechanically.
22
+ - **Human readability:** engineers should be able to inspect architecture,
23
+ flows, data movement, and risks quickly.
24
+ - **Project locality:** each target project owns its Architext data under
25
+ version control.
26
+ - **Low operational burden:** no hosted backend, database, or remote build
27
+ service.
28
+ - **Local runtime assets:** no framework code, fonts, styles, schemas, or
29
+ visualization libraries are loaded from remote URLs at runtime.
30
+ - **Cross-platform scripts:** setup, validation, build, and dev commands must
31
+ work on Windows, Linux, and macOS without POSIX-only shell behavior.
32
+ - **Function over form:** the UI prioritizes dense navigation, diagram space,
33
+ search, and selected-node detail over decorative presentation.
34
+
35
+ ## Non-Goals
36
+
37
+ - Hosted SaaS documentation.
38
+ - Browser-specific `file://` loading behavior.
39
+ - Runtime CDN imports.
40
+ - In-browser editing of architecture JSON.
41
+ - Project-specific look and feel.
42
+ - Inferring architecture magically without reviewable JSON output.
43
+
44
+ ## Local Serving Model
45
+
46
+ Architext requires a local server. The default user command should be:
47
+
48
+ ```sh
49
+ architext serve [path]
50
+ ```
51
+
52
+ The package-owned viewer loads target data from `/data/manifest.json`, then
53
+ follows the file list in the manifest to load the remaining JSON files.
54
+
55
+ This avoids browser lock-in. A direct `file://` page with sibling JSON files is
56
+ not a sound baseline because browser security rules differ.
57
+
58
+ The viewer may use a frontend framework internally. Dependencies must be
59
+ installed locally and bundled or served from local project files. The running
60
+ site must not pull code, styles, fonts, schemas, or assets from remote URLs.
61
+
62
+ The build output must remain static so a target project can serve a generated
63
+ `docs/architext/dist/` with a tiny local static server when needed.
64
+
65
+ NPM scripts should call Node/Vite entrypoints directly and avoid shell command
66
+ chains, environment-variable syntax, or utilities that are not available on all
67
+ target operating systems.
68
+
69
+ ## Adoption And Upgrade Workflow
70
+
71
+ Architext needs a cross-platform Node CLI because copied templates are
72
+ error-prone and difficult to upgrade consistently. The intended interface is
73
+ the globally installed `architext` command. This is a breaking distribution
74
+ change and starts the `1.0.0` line.
75
+
76
+ The CLI should support lifecycle commands:
77
+
78
+ - **Sync:** install when absent, upgrade when stale, and no-op when current.
79
+ - **Install:** write neutral starter data and metadata into
80
+ `docs/architext`, plus optional repository-level agent instructions.
81
+ - **Migrate/upgrade:** preserve target data, remove copied viewer/schema/tool
82
+ files from old installs, update metadata and agent instructions, and validate
83
+ with package-owned schemas.
84
+ - **Doctor/status:** inspect installation health, version, validation, ignore
85
+ rules, instruction appendix presence, and accidentally tracked generated
86
+ artifacts without writing files.
87
+ - **Serve/validate/build:** run package-owned commands against an optional
88
+ target path. The path defaults to the current directory.
89
+ - **Prompt:** print LLM-ready instructions for initial build-out, architecture
90
+ changes, or validation repair.
91
+ - **Clean:** remove generated local artifacts such as `dist/`, with an explicit
92
+ flag required before deleting dependencies.
93
+ - **Explain:** summarize schema files and data contracts for humans or LLMs.
94
+
95
+ Upgrade and migration must preserve target-owned architecture data by default:
96
+
97
+ - do not overwrite `docs/architext/data/*.json`
98
+ - remove copied implementation files such as `src/`, `schema/`, `tools/`,
99
+ `public/`, `index.html`, `package.json`, `package-lock.json`, `tsconfig.json`,
100
+ and `vite.config.ts`
101
+ - update old Architext sections in `AGENTS.md` and `CLAUDE.md` so agents know
102
+ to edit only project-owned data and use the global CLI
103
+ - allow explicit data overwrite only for starter resets or controlled
104
+ migrations
105
+
106
+ The script should also be able to append the Architext agent mandate to a
107
+ target `AGENTS.md` or `CLAUDE.md` file when explicitly requested. It must avoid
108
+ duplicate appendix insertion by checking for the Architext heading before
109
+ appending.
110
+
111
+ The script should maintain deterministic ignore rules for generated local
112
+ artifacts. `docs/architext/dist/` should be ignored. Target repositories no
113
+ longer commit copied Architext dependencies or viewer implementation files.
114
+
115
+ When a target project has a root `package.json`, the install workflow should
116
+ offer to add convenience scripts such as `architext`, `architext:validate`,
117
+ `architext:build`, `architext:doctor`, and `architext:prompt`. These scripts
118
+ keep daily usage at the repository root and avoid requiring users to remember
119
+ `docs/architext` paths.
120
+
121
+ Each install should also write Architext-owned metadata at
122
+ `docs/architext/.architext.json`. This file records the CLI version,
123
+ install/update time, operation, migrated copied install state, whether
124
+ instruction files and `.gitignore` were managed, and the last successful
125
+ validation. The metadata is not the architecture source of truth; it is
126
+ lifecycle state for automation.
127
+
128
+ The workflow must avoid POSIX-only shell behavior. Use Node filesystem APIs for
129
+ copying, directory creation, path handling, and file updates so the same command
130
+ works on Windows, Linux, and macOS.
131
+
132
+ ## Template Placement
133
+
134
+ In a consuming project, the intended structure is:
135
+
136
+ ```text
137
+ docs/
138
+ architext/
139
+ data/
140
+ manifest.json
141
+ nodes.json
142
+ flows.json
143
+ views.json
144
+ data-classification.json
145
+ decisions.json
146
+ risks.json
147
+ glossary.json
148
+ .architext.json
149
+ ```
150
+
151
+ ## Data Model
152
+
153
+ The data model is split by responsibility instead of stored as one large file.
154
+ `manifest.json` is the entrypoint.
155
+
156
+ ### `manifest.json`
157
+
158
+ Defines:
159
+
160
+ - project identity
161
+ - schema version
162
+ - generated timestamp
163
+ - default view
164
+ - required data files
165
+ - generation notes
166
+ - validation expectations
167
+
168
+ ### `nodes.json`
169
+
170
+ Defines architectural elements:
171
+
172
+ - actors
173
+ - clients
174
+ - applications
175
+ - services
176
+ - modules
177
+ - jobs/workers
178
+ - queues/topics
179
+ - data stores
180
+ - external services
181
+ - deployment/runtime units
182
+ - trust boundaries
183
+
184
+ Each node should support:
185
+
186
+ - stable ID
187
+ - type
188
+ - name
189
+ - summary
190
+ - responsibilities
191
+ - owner
192
+ - source paths
193
+ - runtime/deployment notes
194
+ - APIs, events, topics, or commands
195
+ - dependencies
196
+ - data handled
197
+ - trust/security notes
198
+ - observability hooks
199
+ - related flows
200
+ - related decisions
201
+ - known risks
202
+ - verification references
203
+
204
+ ### `flows.json`
205
+
206
+ Defines ordered flows only. A flow is a scenario or system behavior with a
207
+ numbered sequence of steps.
208
+
209
+ Each flow should support:
210
+
211
+ - stable ID
212
+ - name
213
+ - summary
214
+ - status
215
+ - trigger
216
+ - actors
217
+ - ordered steps
218
+ - guarantees
219
+ - failure behavior
220
+ - data classes moved
221
+ - trust boundary crossings
222
+ - observability
223
+ - source paths
224
+ - verification references
225
+ - known gaps
226
+
227
+ Each step references existing node IDs. Unresolved references are validation
228
+ errors.
229
+
230
+ ### `views.json`
231
+
232
+ Defines renderable views over the same model:
233
+
234
+ - system map
235
+ - flow explorer
236
+ - C4 context
237
+ - C4 container
238
+ - C4 component
239
+ - dataflow
240
+ - deployment/runtime
241
+ - risk and decision overlays
242
+
243
+ Views may provide lane/grouping/layout hints. They must not redefine the
244
+ project-specific visual language.
245
+
246
+ ### `data-classification.json`
247
+
248
+ Defines project data classes and handling constraints:
249
+
250
+ - public metadata
251
+ - customer content
252
+ - PII
253
+ - secrets
254
+ - auth tokens
255
+ - financial data
256
+ - regulated data
257
+ - internal operational data
258
+
259
+ Flows that move data must reference these classifications.
260
+
261
+ ### `decisions.json`
262
+
263
+ Defines architecture decisions or links to ADRs:
264
+
265
+ - accepted decisions
266
+ - rejected alternatives
267
+ - consequences
268
+ - related nodes
269
+ - related flows
270
+
271
+ ### `risks.json`
272
+
273
+ Defines architecture risks:
274
+
275
+ - technical risks
276
+ - operational risks
277
+ - security risks
278
+ - data/privacy risks
279
+ - status
280
+ - mitigations
281
+ - related nodes
282
+ - related flows
283
+
284
+ ## Schema Discipline
285
+
286
+ The schema must be strict:
287
+
288
+ - stable IDs are required
289
+ - references must resolve
290
+ - unknown top-level fields are rejected unless explicitly versioned
291
+ - ordered flow steps are required
292
+ - data classification is required for flow steps that move data
293
+ - node and flow types come from Architext-owned enums
294
+ - project-specific tags are allowed as data, not as UI behavior
295
+ - invalid data prevents rendering
296
+
297
+ ## Viewer Layout
298
+
299
+ The viewer should use a dense three-region layout:
300
+
301
+ - collapsible left navigation
302
+ - central diagram canvas
303
+ - right selected-item detail panel
304
+
305
+ Required interactions:
306
+
307
+ - search
308
+ - filter by view/type/status/risk/data classification
309
+ - select node
310
+ - select flow
311
+ - highlight ordered path
312
+ - pan/zoom/fit diagram
313
+ - maximize diagram
314
+ - independent left-panel collapse and right-panel collapse
315
+ - collapse controls attached to the sidebars they control so either side can
316
+ reclaim diagram space without hunting in a global toolbar
317
+ - persisted collapse state across reloads
318
+ - right-panel deep links to sections
319
+
320
+ Collapse behavior should follow the pattern used in Palm Command Center: a
321
+ small polished control lives on the controlled panel edge, the panel shrinks to
322
+ a narrow rail instead of disappearing entirely, and the expanded/collapsed
323
+ affordance is clear from the icon orientation. Architext needs this on both
324
+ sides because the diagram canvas is the primary work area.
325
+
326
+ The first demo currently falls short here: it only collapses the left panel from
327
+ the top toolbar, has no right-panel collapse, and hides the left panel entirely
328
+ instead of retaining a useful rail.
329
+
330
+ The right panel should be scrollable and sectioned:
331
+
332
+ - Summary
333
+ - Responsibilities
334
+ - Source paths
335
+ - Runtime/deployment
336
+ - APIs/events/topics
337
+ - Dependencies
338
+ - Data handled
339
+ - Security/trust boundary
340
+ - Observability
341
+ - Related flows
342
+ - Related decisions
343
+ - Known risks
344
+ - Verification/tests
345
+
346
+ ## Look And Feel
347
+
348
+ Architext look and feel is product-owned, not project-owned.
349
+
350
+ Projects may provide names, descriptions, tags, and architecture data. Projects
351
+ must not provide custom CSS, arbitrary palettes, or custom rendering grammar.
352
+
353
+ The UI should be quiet, utilitarian, and optimized for engineers. Diagram space
354
+ is more important than branding.
355
+
356
+ Node cards should stay compact. The screenshot target shows dense cards with
357
+ short labels and secondary metadata; large dashboard cards waste diagram space.
358
+ Architext should prefer compact node boxes, lane headers, and scrollable/pannable
359
+ canvas behavior over large fixed cards.
360
+
361
+ Vertical space should be allocated the same way: non-diagram sections should
362
+ auto-size to their content, while the diagram canvas takes the remaining height.
363
+ Headers, filters, legends, and selected-flow step summaries are supporting
364
+ controls, not primary layout regions.
365
+
366
+ Flows must be visible as lines between boxes, not only as a textual list of
367
+ steps. A selected flow should draw directional edges between involved nodes,
368
+ with numbered step markers or labels where legible. The textual ordered step
369
+ list remains useful, but it is not a substitute for visual relationships.
370
+
371
+ Flow routing must optimize readability over geometric cleverness. The original
372
+ visual target uses compact boxes and readable highlighted paths; Architext
373
+ should preserve that. Lines should not take surprising paths, pass behind
374
+ related boxes, or hide numbered markers. Prefer simple direct or gently curved
375
+ paths through clear gutters, with step markers placed on readable line segments.
376
+ If a clean route cannot be drawn in a dense canvas, the renderer should choose a
377
+ simpler layout or require explicit layout hints.
378
+
379
+ Any side of a node box is a valid source or target for an edge. The renderer
380
+ should choose the least contentious attachment surface and path for the actual
381
+ node positions: under, over, or around objects is acceptable when it is clear;
382
+ behind a node or through an ambiguous overlap is not. Same-column relationships
383
+ should usually route through an outside gutter. Backward or cross-lane
384
+ relationships should reserve a clean corridor above or below the involved boxes
385
+ instead of crossing behind active nodes. The canvas should keep enough left and
386
+ top breathing room for these gutters so the columnar layout does not force
387
+ unreadable paths.
388
+
389
+ Two distinct edges should not share the same route unless there is no readable
390
+ alternative. Even when two edges connect the same pair of nodes, the renderer
391
+ should fan them into separate nearby lanes or corridors so each relationship can
392
+ be followed independently and its marker remains legible.
393
+
394
+ Architext should also support sequence diagrams as a separate view type. A
395
+ sequence diagram is not the same as the free-form flow map: it shows the ordered
396
+ messages in one selected flow across lifelines, with message numbers,
397
+ participants, and payload/data classifications.
398
+
399
+ ## C4 And Architecture Views
400
+
401
+ Architext must include first-class C4-inspired views, not merely generic
402
+ groupings:
403
+
404
+ - **Context:** project/system in the center, actors and external systems around
405
+ it, labeled relationships.
406
+ - **Container:** deployable/runtime units, databases, queues, browsers, workers,
407
+ and external systems with communication labels.
408
+ - **Component:** major components inside a selected container, with dependencies
409
+ and source paths.
410
+
411
+ Each view should be generated from the same JSON model. C4 views are projections
412
+ over nodes, flows, and relationships, not separate hand-maintained diagrams.
413
+
414
+ The first demo previously mislabeled lane-grouped views as C4 views. That is
415
+ not acceptable. C4 levels are semantic zoom levels, not alternate column
416
+ groupings:
417
+
418
+ - Context shows the system boundary and its relationships to actors and external
419
+ systems. It should not expose internal containers.
420
+ - Container shows deployable/runtime units inside the system boundary plus
421
+ external context. It should label communication protocols or interaction
422
+ styles.
423
+ - Component shows major components inside one selected container. It should not
424
+ mix unrelated runtime units from the whole system.
425
+
426
+ The schema needs enough relationship metadata to render these levels honestly:
427
+ relationship label, technology/protocol where known, source, target, and whether
428
+ the source/target is inside or outside the system boundary.
429
+
430
+ The UI should expose C4 as drilldown navigation:
431
+
432
+ 1. **Context:** select the system boundary.
433
+ 2. **Container:** drill into that system to see deployable/runtime units.
434
+ 3. **Component:** drill into one selected container to see internal modules.
435
+
436
+ This should not be rendered like a selected ordered flow. Flow diagrams show
437
+ scenario paths. C4 diagrams show structural containment and static
438
+ relationships at a chosen abstraction level.
439
+
440
+ C4 diagrams should show structural connections, not workflows. A C4 Context,
441
+ Container, or Component diagram may show that one element uses, calls, reads
442
+ from, writes to, publishes to, or depends on another element. It should not show
443
+ the numbered step-by-step path for a selected flow. Ordered behavior belongs in
444
+ flow, dynamic, or sequence diagrams.
445
+
446
+ The UI implementation should now move from a generic "view dropdown" toward
447
+ work modes. Flows, sequence, C4, deployment, and data/risk review are different
448
+ jobs for engineers and should expose different left-panel navigation, diagram
449
+ controls, and details states.
450
+
451
+ The first dedicated C4 renderer does not need full Structurizr parity, but it
452
+ must stop behaving like an ordered flow diagram. It should show a system
453
+ boundary, actor/external context, relationship labels, and level switching
454
+ between context, container, and component projections. C4 edges are structural
455
+ relationships and should never use numbered workflow markers.
456
+
457
+ Diagram inspection is a core workflow. The viewer should expose zoom, fit,
458
+ reset, and focus-mode controls; selectable/hoverable edges; keyboard-focusable
459
+ nodes and relationships; and right-panel details that distinguish node, flow,
460
+ step, and relationship selections.
461
+
462
+ ## Alignment Checkpoint
463
+
464
+ Against the original brief:
465
+
466
+ - **Locally hosted:** aligned. The viewer requires a local server and avoids
467
+ `file://` behavior.
468
+ - **JSON-backed:** aligned. JSON files are the data source and LLM architecture
469
+ map.
470
+ - **LLM-targeted markdown:** aligned as a first draft, but it still needs
471
+ installer/adoption workflow details.
472
+ - **Consistent directory structure:** aligned as a first draft.
473
+ - **Architext-specific look and feel:** partially aligned. The plan says this,
474
+ but the implementation still needs a more compact diagram-first layout.
475
+ - **Left navigation:** aligned.
476
+ - **Collapsible navigation:** partially aligned. Needs panel-edge controls,
477
+ right-panel collapse, and persisted state.
478
+ - **Engineer-first UX:** partially aligned. Search/details exist, but visual
479
+ flow lines and C4 views are missing.
480
+ - **Right-hand details panel:** aligned, but it also needs collapse behavior.
481
+ - **Self-hosted example project:** aligned. The bundled example describes
482
+ Architext itself instead of a fictitious product.
483
+ - **AGENTS/CLAUDE mandate:** aligned. Migration must replace old copied-template
484
+ instructions with global-CLI/data-only instructions.
485
+
486
+ ## Self-Hosted Example Project
487
+
488
+ The bundled example should describe Architext itself.
489
+
490
+ It should include:
491
+
492
+ - global CLI
493
+ - package-owned viewer runtime
494
+ - package-owned schemas and validator
495
+ - target repository data files
496
+ - lifecycle metadata
497
+ - copied-install migration
498
+ - agent instruction management
499
+ - static export
500
+ - release/package workflow
501
+
502
+ Example flows:
503
+
504
+ - fresh data-only install
505
+ - copied install migration
506
+ - architecture data maintenance
507
+ - local viewer review
508
+ - static export
509
+ - release packaging
510
+
511
+ This example is broad enough to exercise package-owned runtime boundaries,
512
+ target-owned data, migrations, generated artifacts, agent instructions,
513
+ deployment views, risks, and data classification.
514
+
515
+ ## Open Questions
516
+
517
+ - Should the validator be pure browser JavaScript, Node-based, or both?
518
+ - Should diagram layout be hand-hinted in JSON or computed deterministically?
519
+ - Should future source-code extraction be plugin-based by language/ecosystem?
520
+ - Should schema version migrations be supported from the first release?
@@ -0,0 +1,95 @@
1
+ # LLM Architext Contract
2
+
3
+ This file is written for LLM agents working inside a project that uses
4
+ Architext.
5
+
6
+ ## Purpose
7
+
8
+ Architext JSON files are the machine-readable architecture source of truth for
9
+ the project. They describe components, dataflows, deployment/runtime structure,
10
+ data classification, risks, and architecture decisions.
11
+
12
+ When architecture changes, update Architext data before claiming the task is
13
+ complete.
14
+
15
+ ## Required Behavior
16
+
17
+ - Read existing Architext data before editing it.
18
+ - Reuse existing IDs for existing concepts.
19
+ - Create new nodes before referencing them from flows or views.
20
+ - Keep flows ordered.
21
+ - Update data classification whenever data movement changes.
22
+ - Update risks when adding external dependencies, persistence, async
23
+ processing, sensitive data handling, trust boundary crossings, or operational
24
+ complexity.
25
+ - Prefer source-path-backed claims.
26
+ - Mark uncertainty explicitly instead of inventing details.
27
+ - Run `architext validate [path]` after changing data.
28
+ - Do not claim Architext is current if validation failed or was skipped.
29
+ - Do not edit copied viewer, schema, package, Vite, or local tool files in a
30
+ target repository. Those files are package-owned in Architext 1.0+.
31
+
32
+ ## Persistence Rules
33
+
34
+ Persist these project-owned files in git:
35
+
36
+ - `docs/architext/data/*.json`
37
+ - `docs/architext/.architext.json`
38
+ - repository-level `AGENTS.md` or `CLAUDE.md` Architext instructions, when
39
+ present
40
+
41
+ Do not persist generated or local runtime artifacts:
42
+
43
+ - `docs/architext/dist/`
44
+ - `.DS_Store`
45
+ - editor/OS temp files
46
+ - local server logs
47
+ - screenshots created only for debugging unless intentionally added to project
48
+ documentation
49
+
50
+ If the target project does not already ignore generated artifacts, use
51
+ `architext sync [path]` to update lifecycle metadata, instructions, and ignore
52
+ rules.
53
+
54
+ ## Files
55
+
56
+ Expected project-local location:
57
+
58
+ ```text
59
+ docs/architext/
60
+ data/
61
+ manifest.json
62
+ nodes.json
63
+ flows.json
64
+ views.json
65
+ data-classification.json
66
+ decisions.json
67
+ risks.json
68
+ glossary.json
69
+ schema/
70
+ *.schema.json
71
+ ```
72
+
73
+ ## Update Triggers
74
+
75
+ Update Architext when changing:
76
+
77
+ - module or service responsibilities
78
+ - public APIs
79
+ - internal APIs
80
+ - queues, topics, jobs, or workers
81
+ - data stores
82
+ - external integrations
83
+ - authentication or authorization behavior
84
+ - trust boundaries
85
+ - deployment topology
86
+ - observability paths
87
+ - sensitive data handling
88
+ - core business flows
89
+ - architecture decisions
90
+ - known architecture risks
91
+
92
+ ## Validation Rule
93
+
94
+ Validation is not optional. Broken Architext data is worse than missing
95
+ Architext data because it gives humans and future LLMs false confidence.
@@ -0,0 +1,39 @@
1
+ # Architext Agent Instructions Appendix
2
+
3
+ Add this section to a target project's `AGENTS.md` or `CLAUDE.md` when adopting
4
+ Architext.
5
+
6
+ ```markdown
7
+ ## Architext Architecture Documentation
8
+
9
+ This project uses `docs/architext/data/*.json` as the machine-readable
10
+ architecture source of truth.
11
+
12
+ When changing architecture, data flow, persistence, external integrations, trust
13
+ boundaries, deployment topology, observability paths, or major module
14
+ responsibilities, update the relevant Architext JSON files before completing the
15
+ task.
16
+
17
+ Run the Architext validator after edits:
18
+
19
+ ```sh
20
+ architext validate [path]
21
+ ```
22
+
23
+ Use the local viewer for review:
24
+
25
+ ```sh
26
+ architext serve [path]
27
+ ```
28
+
29
+ The optional path defaults to the current directory. Target repositories should
30
+ not vendor or edit Architext viewer, schema, tool, package, or Vite files.
31
+ Those are owned by the globally installed `architext` package. Edit project
32
+ architecture data under `docs/architext/data/*.json`; use `architext sync
33
+ [path]` to install or migrate lifecycle metadata and instructions.
34
+
35
+ Use `architext doctor [path]` to inspect installation health and `architext
36
+ prompt [path]` to print the current LLM build-out or maintenance instructions.
37
+ Do not claim the architecture documentation is current if validation fails or
38
+ was skipped.
39
+ ```