@a-company/paradigm 1.5.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 (114) hide show
  1. package/README.md +142 -0
  2. package/dist/accept-orchestration-CWZNCGZX.js +188 -0
  3. package/dist/agents-suggest-35LIQKDH.js +83 -0
  4. package/dist/aggregate-W7Q6VIM2.js +88 -0
  5. package/dist/auto-IU7VN55K.js +470 -0
  6. package/dist/beacon-B47XSTL7.js +251 -0
  7. package/dist/chunk-2M6OSOIG.js +1302 -0
  8. package/dist/chunk-4NCFWYGG.js +110 -0
  9. package/dist/chunk-5C4SGQKH.js +705 -0
  10. package/dist/chunk-5GOA7WYD.js +1095 -0
  11. package/dist/chunk-5JGJACDU.js +37 -0
  12. package/dist/chunk-6QC3YGB6.js +114 -0
  13. package/dist/chunk-753RICFF.js +325 -0
  14. package/dist/chunk-AD2LSCHB.js +1595 -0
  15. package/dist/chunk-CHSHON3O.js +669 -0
  16. package/dist/chunk-ELLR7WP6.js +3175 -0
  17. package/dist/chunk-ILOWBJRC.js +12 -0
  18. package/dist/chunk-IRKUEJVW.js +405 -0
  19. package/dist/chunk-MC7XC7XQ.js +533 -0
  20. package/dist/chunk-MO4EEYFW.js +38 -0
  21. package/dist/chunk-MQWH7PFI.js +13366 -0
  22. package/dist/chunk-N6PJAPDE.js +364 -0
  23. package/dist/chunk-PBHIFAL4.js +259 -0
  24. package/dist/chunk-PMXRGPRQ.js +305 -0
  25. package/dist/chunk-PW2EXJQT.js +689 -0
  26. package/dist/chunk-TAP5N3HH.js +245 -0
  27. package/dist/chunk-THFVK5AE.js +148 -0
  28. package/dist/chunk-UM54F7G5.js +1533 -0
  29. package/dist/chunk-UUZ2DMG5.js +185 -0
  30. package/dist/chunk-WS5KM7OL.js +780 -0
  31. package/dist/chunk-YDNKXH4Z.js +2316 -0
  32. package/dist/chunk-YO6DVTL7.js +99 -0
  33. package/dist/claude-SUYNN72C.js +362 -0
  34. package/dist/claude-cli-OF43XAO3.js +276 -0
  35. package/dist/claude-code-PW6SKD2M.js +126 -0
  36. package/dist/claude-code-teams-JLZ5IXB6.js +199 -0
  37. package/dist/constellation-K3CIQCHI.js +225 -0
  38. package/dist/cost-AEK6R7HK.js +174 -0
  39. package/dist/cost-KYXIQ62X.js +93 -0
  40. package/dist/cursor-cli-IHJMPRCW.js +269 -0
  41. package/dist/cursorrules-KI5QWHIX.js +84 -0
  42. package/dist/diff-AJJ5H6HV.js +125 -0
  43. package/dist/dist-7MPIRMTZ-IOQOREMZ.js +10866 -0
  44. package/dist/dist-NHJQVVUW.js +68 -0
  45. package/dist/dist-ZEMSQV74.js +20 -0
  46. package/dist/doctor-6Y6L6HEB.js +11 -0
  47. package/dist/echo-VYZW3OTT.js +248 -0
  48. package/dist/export-R4FJ5NOH.js +38 -0
  49. package/dist/history-EVO3L6SC.js +277 -0
  50. package/dist/hooks-MBWE4ILT.js +12 -0
  51. package/dist/index.d.ts +2 -0
  52. package/dist/index.js +568 -0
  53. package/dist/lint-HXKTWRNO.js +316 -0
  54. package/dist/manual-Y3QOXWYA.js +204 -0
  55. package/dist/mcp.js +14745 -0
  56. package/dist/orchestrate-4ZH5GUQH.js +323 -0
  57. package/dist/probe-OYCP4JYG.js +151 -0
  58. package/dist/promote-Z52ZJTJU.js +181 -0
  59. package/dist/providers-4PGPZEWP.js +104 -0
  60. package/dist/remember-6VZ74B7E.js +77 -0
  61. package/dist/ripple-SBQOSTZD.js +215 -0
  62. package/dist/sentinel-LCFD56OJ.js +43 -0
  63. package/dist/server-F5ITNK6T.js +9846 -0
  64. package/dist/server-T6WIFYRQ.js +16076 -0
  65. package/dist/setup-DF4F3ICN.js +25 -0
  66. package/dist/setup-JHBPZAG7.js +296 -0
  67. package/dist/shift-HKIAP4ZN.js +226 -0
  68. package/dist/snapshot-GTVPRYZG.js +62 -0
  69. package/dist/spawn-BJRQA2NR.js +196 -0
  70. package/dist/summary-H6J6N6PJ.js +140 -0
  71. package/dist/switch-6EANJ7O6.js +232 -0
  72. package/dist/sync-BEOCW7TZ.js +11 -0
  73. package/dist/team-NWP2KJAB.js +32 -0
  74. package/dist/test-MA5TWJQV.js +934 -0
  75. package/dist/thread-JCJVRUQR.js +258 -0
  76. package/dist/triage-ETVXXFMV.js +1880 -0
  77. package/dist/tutorial-L5Q3ZDHK.js +666 -0
  78. package/dist/university-R2WDQLSI.js +40 -0
  79. package/dist/upgrade-5B3YGGC6.js +550 -0
  80. package/dist/validate-F3YHBCRZ.js +39 -0
  81. package/dist/validate-QEEY6KFS.js +64 -0
  82. package/dist/watch-4LT4O6K7.js +123 -0
  83. package/dist/watch-6IIWPWDN.js +111 -0
  84. package/dist/wisdom-LRM4FFCH.js +319 -0
  85. package/package.json +68 -0
  86. package/templates/paradigm/config.yaml +175 -0
  87. package/templates/paradigm/docs/commands.md +727 -0
  88. package/templates/paradigm/docs/decisions/000-template.md +47 -0
  89. package/templates/paradigm/docs/decisions/README.md +26 -0
  90. package/templates/paradigm/docs/error-patterns.md +215 -0
  91. package/templates/paradigm/docs/patterns.md +358 -0
  92. package/templates/paradigm/docs/queries.md +200 -0
  93. package/templates/paradigm/docs/troubleshooting.md +477 -0
  94. package/templates/paradigm/echoes.yaml +25 -0
  95. package/templates/paradigm/prompts/add-feature.md +152 -0
  96. package/templates/paradigm/prompts/add-gate.md +117 -0
  97. package/templates/paradigm/prompts/debug-auth.md +174 -0
  98. package/templates/paradigm/prompts/implement-ftux.md +722 -0
  99. package/templates/paradigm/prompts/implement-sandbox.md +651 -0
  100. package/templates/paradigm/prompts/read-docs.md +84 -0
  101. package/templates/paradigm/prompts/refactor.md +106 -0
  102. package/templates/paradigm/prompts/run-e2e-tests.md +340 -0
  103. package/templates/paradigm/prompts/trace-flow.md +202 -0
  104. package/templates/paradigm/prompts/validate-portals.md +279 -0
  105. package/templates/paradigm/specs/context-tracking.md +200 -0
  106. package/templates/paradigm/specs/context.md +461 -0
  107. package/templates/paradigm/specs/disciplines.md +413 -0
  108. package/templates/paradigm/specs/history.md +339 -0
  109. package/templates/paradigm/specs/logger.md +303 -0
  110. package/templates/paradigm/specs/navigator.md +236 -0
  111. package/templates/paradigm/specs/purpose.md +265 -0
  112. package/templates/paradigm/specs/scan.md +177 -0
  113. package/templates/paradigm/specs/symbols.md +451 -0
  114. package/templates/paradigm/specs/wisdom.md +294 -0
@@ -0,0 +1,461 @@
1
+ # Context & Documentation Index System
2
+
3
+ The Context system provides **hierarchical documentation indexing** for efficient AI navigation. It enables AI agents to find and read only the relevant portions of documentation, reducing token usage and improving accuracy.
4
+
5
+ ---
6
+
7
+ ## Core Principle
8
+
9
+ **AI agents should read indexes first, then targeted sections — never entire documents blindly.**
10
+
11
+ The system provides:
12
+ - Directory-level indexes (`.index.yaml`)
13
+ - Document frontmatter with metadata
14
+ - Section-level line ranges
15
+ - Dependency tracking between files
16
+
17
+ ---
18
+
19
+ ## Index System Structure
20
+
21
+ ```
22
+ docs/
23
+ ├── .index.yaml # Directory index (read this FIRST)
24
+ ├── DESIGN.md # Document with YAML frontmatter
25
+ ├── API.md # Another indexed document
26
+ └── guides/
27
+ ├── .index.yaml # Subdirectory index
28
+ └── getting-started.md
29
+ ```
30
+
31
+ ---
32
+
33
+ ## Index File Schema
34
+
35
+ Each directory with documentation should have a `.index.yaml`:
36
+
37
+ ```yaml
38
+ # .index.yaml
39
+ version: 1.0.0
40
+ description: What this directory contains
41
+ updated: YYYY-MM-DD
42
+
43
+ documents:
44
+ - id: unique-id
45
+ file: filename.md
46
+ title: Human-readable title
47
+ summary: One-line description for quick scanning
48
+ lines: total-line-count
49
+ tags: [keyword, tags, for, search]
50
+ canonical_for: [concepts-this-is-source-of-truth-for]
51
+ sections:
52
+ - anchor: "section-anchor"
53
+ title: Section Title
54
+ lines: [start, end]
55
+ summary: What this section covers
56
+ subsections:
57
+ - anchor: "sub-anchor"
58
+ title: Subsection Title
59
+ lines: [start, end]
60
+ summary: Subsection content
61
+
62
+ dependencies:
63
+ - source: doc-id#section
64
+ affects: [list, of, files, or, globs]
65
+ reason: Why changes here affect those files
66
+
67
+ subdirs:
68
+ - path: subdir/
69
+ summary: What the subdirectory contains
70
+ index: subdir/.index.yaml
71
+ ```
72
+
73
+ ---
74
+
75
+ ## Document Frontmatter Schema
76
+
77
+ Each indexed document should have YAML frontmatter:
78
+
79
+ ```yaml
80
+ ---
81
+ id: unique-id
82
+ title: Document Title
83
+ version: 0.1.0
84
+ updated: YYYY-MM-DD
85
+ tags: [keywords, for, search]
86
+ canonical_for: [concepts, this, owns]
87
+ related:
88
+ - ../path/to/file (description)
89
+ - ../other/file (description)
90
+ changelog:
91
+ - YYYY-MM-DD: What changed
92
+ - YYYY-MM-DD: Previous change
93
+ ---
94
+
95
+ # Document Title
96
+
97
+ Content begins here...
98
+ ```
99
+
100
+ ---
101
+
102
+ ## AI Navigation Protocol
103
+
104
+ When working with documentation:
105
+
106
+ ### 1. Start with Index
107
+
108
+ Always read the `.index.yaml` first:
109
+
110
+ ```
111
+ Read: docs/.index.yaml
112
+ → Understand what documents exist
113
+ → Find relevant document by tags/summary
114
+ → Get section line ranges
115
+ ```
116
+
117
+ ### 2. Use Section Hints
118
+
119
+ Index provides line ranges — read only what's needed:
120
+
121
+ ```
122
+ # Instead of reading entire 1000-line doc:
123
+ Read: docs/DESIGN.md (lines 531-770) # Just data models section
124
+ ```
125
+
126
+ ### 3. Check Dependencies
127
+
128
+ Before changing a document:
129
+
130
+ ```yaml
131
+ dependencies:
132
+ - source: design#data-models
133
+ affects: [../backend/migrations/*]
134
+ reason: Schema changes require migrations
135
+ ```
136
+
137
+ → If editing `#data-models`, also review migration files
138
+
139
+ ### 4. Update Atomically
140
+
141
+ When editing a document:
142
+
143
+ 1. Update the document content
144
+ 2. Update the document's frontmatter (`updated`, `changelog`)
145
+ 3. Update the directory's `.index.yaml` (`lines`, `summary` if changed)
146
+
147
+ ### 5. Propagate Changes
148
+
149
+ If `dependencies.affects` lists other files, review them for consistency.
150
+
151
+ ---
152
+
153
+ ## Index Maintenance Rules
154
+
155
+ | Action | Index Update Required |
156
+ |--------|----------------------|
157
+ | Create new doc | Add entry to parent `.index.yaml` |
158
+ | Delete doc | Remove from `.index.yaml`, check dependencies |
159
+ | Rename doc | Update all references in indexes |
160
+ | Add/remove sections | Update `sections` array with new line ranges |
161
+ | Change doc content | Update `lines` count, `summary` if meaning changed |
162
+
163
+ ---
164
+
165
+ ## Line Number Guidelines
166
+
167
+ - Line numbers are **approximate** (within ~5 lines is acceptable)
168
+ - Update line counts when sections grow/shrink significantly (>10 lines)
169
+ - Section line ranges help AI read only relevant portions
170
+ - Use `wc -l` or similar to get accurate counts
171
+
172
+ ### Keeping Lines Updated
173
+
174
+ After significant edits:
175
+
176
+ ```bash
177
+ # Get line count
178
+ wc -l docs/DESIGN.md
179
+
180
+ # Get section line numbers
181
+ grep -n "^## " docs/DESIGN.md
182
+ ```
183
+
184
+ ---
185
+
186
+ ## Canonical Markers
187
+
188
+ Use `canonical_for` to establish source of truth:
189
+
190
+ ```yaml
191
+ # In .premise
192
+ canonical_for:
193
+ - entity-graph
194
+ - data-relationships
195
+
196
+ # In docs/DESIGN.md frontmatter
197
+ canonical_for:
198
+ - product-spec
199
+ - data-models
200
+ - ux-system
201
+ ```
202
+
203
+ This tells AI:
204
+ - `.premise` is THE source for entity relationships
205
+ - `DESIGN.md` is THE source for product spec, data models, UX
206
+
207
+ When conflicts arise, canonical sources win.
208
+
209
+ ---
210
+
211
+ ## Dependency Tracking
212
+
213
+ Track how documents affect other files:
214
+
215
+ ```yaml
216
+ dependencies:
217
+ - source: design#data-models
218
+ affects:
219
+ - ../backend/supabase/migrations/*
220
+ - ../.premise
221
+ reason: Schema changes require migration updates
222
+
223
+ - source: design#ux-system
224
+ affects:
225
+ - ../ios/AStar/Components/*
226
+ - ../android/app/src/main/kotlin/com/astar/ui/*
227
+ - ../web/src/components/*
228
+ reason: UX patterns should be consistent across platforms
229
+ ```
230
+
231
+ ### Common Patterns
232
+
233
+ | Source | Typically Affects |
234
+ |--------|------------------|
235
+ | `#data-models` | Migrations, `.premise`, API types |
236
+ | `#ux-system` | Platform UI components |
237
+ | `#tech-stack` | Build configs, dependencies |
238
+ | `#api-spec` | Client SDKs, documentation |
239
+
240
+ ---
241
+
242
+ ## Tags for Discovery
243
+
244
+ Use consistent tags for searchability:
245
+
246
+ ```yaml
247
+ tags: [architecture, product, data-models, ux]
248
+ ```
249
+
250
+ ### Recommended Tags
251
+
252
+ | Category | Tags |
253
+ |----------|------|
254
+ | Structure | architecture, monorepo, structure |
255
+ | Features | features, product, requirements |
256
+ | Data | data-models, schema, database, sql |
257
+ | UX | ux, navigation, design, accessibility |
258
+ | Tech | tech-stack, platforms, infrastructure |
259
+ | Process | roadmap, phases, priorities |
260
+
261
+ ---
262
+
263
+ ## Integration with Paradigm
264
+
265
+ ### Syncing with .premise
266
+
267
+ The `.premise` file should reference its sync targets:
268
+
269
+ ```yaml
270
+ # .premise
271
+ metadata:
272
+ canonical_for: [entity-graph, data-relationships]
273
+ syncs_with:
274
+ - docs/DESIGN.md#data-models
275
+ - backend/supabase/migrations/
276
+ ```
277
+
278
+ ### Syncing with .purpose
279
+
280
+ The `.purpose` file should reference its sync targets:
281
+
282
+ ```yaml
283
+ # .purpose
284
+ canonical_for: [features, flows, signals]
285
+ syncs_with:
286
+ - docs/DESIGN.md (feature descriptions)
287
+ - .premise (entity references)
288
+ ```
289
+
290
+ ### Source of Truth Hierarchy
291
+
292
+ | Concept | Source of Truth | Syncs To |
293
+ |---------|----------------|----------|
294
+ | Entity relationships | `.premise` | DESIGN.md#data-models, migrations |
295
+ | Features & flows | `.purpose` | DESIGN.md (relevant sections) |
296
+ | Access control | `portal.yaml` | .purpose gate references |
297
+ | SQL schemas | DESIGN.md#data-models | migrations (implementation) |
298
+ | UX patterns | DESIGN.md#ux-system | platform components |
299
+
300
+ ---
301
+
302
+ ## Root Index
303
+
304
+ Projects should have a root `.index.yaml`:
305
+
306
+ ```yaml
307
+ # .index.yaml (project root)
308
+ version: 1.0.0
309
+ description: Root index for the project
310
+ updated: YYYY-MM-DD
311
+
312
+ documents:
313
+ - id: readme
314
+ file: README.md
315
+ title: Project Overview
316
+ summary: Getting started and links
317
+ tags: [overview, setup]
318
+
319
+ - id: changelog
320
+ file: CHANGELOG.md
321
+ title: Changelog
322
+ summary: Version history
323
+ tags: [releases, history]
324
+
325
+ config_files:
326
+ - id: premise
327
+ file: .premise
328
+ description: Entity graph
329
+ canonical_for: [entity-graph]
330
+
331
+ - id: purpose
332
+ file: .purpose
333
+ description: Features, flows, signals
334
+ canonical_for: [features, flows]
335
+
336
+ - id: portal
337
+ file: portal.yaml
338
+ description: Access control gates
339
+
340
+ subdirs:
341
+ - path: docs/
342
+ summary: Design and architecture documentation
343
+ index: docs/.index.yaml
344
+ - path: .paradigm/team/
345
+ summary: Multi-agent handoff files
346
+ ```
347
+
348
+ ---
349
+
350
+ ## Best Practices
351
+
352
+ ### For AI Agents
353
+
354
+ 1. **Always start with index** — never read full docs blindly
355
+ 2. **Use line ranges** — read only needed sections
356
+ 3. **Check canonical markers** — know which file is authoritative
357
+ 4. **Follow dependencies** — update affected files together
358
+ 5. **Update indexes** — keep line numbers reasonably accurate
359
+
360
+ ### For Humans
361
+
362
+ 1. **Add frontmatter** — all indexed docs need metadata
363
+ 2. **Keep summaries current** — one-liners help AI navigate
364
+ 3. **Use consistent tags** — improves discoverability
365
+ 4. **Document dependencies** — prevents drift between files
366
+ 5. **Run periodic audits** — verify line numbers stay accurate
367
+
368
+ ---
369
+
370
+ ## Keeping .cursorrules Slim
371
+
372
+ The `.cursorrules` file loads on **every chat**. Keep it minimal to preserve context for actual work.
373
+
374
+ ### The Problem
375
+
376
+ | File Size | Est. Tokens | % of 200K Context |
377
+ |-----------|-------------|-------------------|
378
+ | 600 lines / 18KB | ~4,500 | 2.25% |
379
+ | 80 lines / 3KB | ~750 | 0.38% |
380
+
381
+ A bloated `.cursorrules` wastes thousands of tokens before you even type.
382
+
383
+ ### The Solution
384
+
385
+ **Embed essentials, reference details.**
386
+
387
+ #### Keep in `.cursorrules` (~80 lines)
388
+
389
+ - Symbol quick reference table
390
+ - Logger method mapping table
391
+ - Key file locations
392
+ - Critical conventions (5-10 rules)
393
+ - Team handoff summary (3 lines)
394
+ - Table of pointers to full specs
395
+
396
+ #### Move to `.paradigm/specs/` (read on-demand)
397
+
398
+ - Full symbol documentation with examples
399
+ - Logger implementation patterns
400
+ - Changelog/commit format details
401
+ - Documentation navigation protocol
402
+ - Complete Team handoff documentation
403
+ - Source of truth hierarchy
404
+
405
+ ### Measuring Context Cost
406
+
407
+ ```bash
408
+ # Character count
409
+ wc -c .cursorrules
410
+
411
+ # Estimate tokens (chars ÷ 4)
412
+ echo "Tokens: $(( $(wc -c < .cursorrules) / 4 ))"
413
+ ```
414
+
415
+ ### Target: <1,000 tokens
416
+
417
+ | Metric | Bloated | Target |
418
+ |--------|---------|--------|
419
+ | Lines | 500+ | <100 |
420
+ | Characters | 15,000+ | <4,000 |
421
+ | Tokens | 4,000+ | <1,000 |
422
+
423
+ ### Example Slim Structure
424
+
425
+ ```markdown
426
+ # project - Paradigm Context
427
+
428
+ ## Symbols (table)
429
+ ## Logger Mapping (table)
430
+ ## Key Files (table)
431
+ ## Conventions (5 bullets)
432
+ ## Team Handoff (3 lines)
433
+ ## Specs (reference table)
434
+ ```
435
+
436
+ See `.paradigm/docs/troubleshooting.md` for the full template.
437
+
438
+ ---
439
+
440
+ ## Example: Reading a Large Document
441
+
442
+ Instead of:
443
+ ```
444
+ Read: docs/DESIGN.md (full 1000 lines)
445
+ → 4000+ tokens used
446
+ ```
447
+
448
+ Do this:
449
+ ```
450
+ 1. Read: docs/.index.yaml
451
+ → Find: design#data-models at lines 531-770
452
+
453
+ 2. Read: docs/DESIGN.md (lines 531-770)
454
+ → Only 240 lines
455
+ → ~1000 tokens used
456
+
457
+ 3. Find related: dependencies show ./backend/migrations/*
458
+ → Read only if making schema changes
459
+ ```
460
+
461
+ **Result**: 75% fewer tokens, focused context, better results.