superdev-cli 0.1.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 (182) hide show
  1. package/.claude-plugin/marketplace.json +33 -0
  2. package/.claude-plugin/plugin.json +21 -0
  3. package/.codex-plugin/plugin.json +27 -0
  4. package/CODE_OF_CONDUCT.md +109 -0
  5. package/CONTRIBUTING.md +205 -0
  6. package/LICENSE +202 -0
  7. package/NOTICE +11 -0
  8. package/README.md +1051 -0
  9. package/SECURITY.md +135 -0
  10. package/THIRD-PARTY-NOTICES.md +253 -0
  11. package/hooks/hooks.json +61 -0
  12. package/hooks/run.mjs +88 -0
  13. package/package.json +65 -0
  14. package/references/confidentiality.md +48 -0
  15. package/references/evidence-and-risk.md +73 -0
  16. package/references/operating-model.md +105 -0
  17. package/references/platform-capabilities.md +51 -0
  18. package/references/project-record.md +91 -0
  19. package/references/provider-contracts.md +102 -0
  20. package/scripts/doctor/doctor.mjs +539 -0
  21. package/scripts/privacy/scan-history.mjs +163 -0
  22. package/scripts/privacy/scan.mjs +368 -0
  23. package/scripts/validate/README.md +94 -0
  24. package/scripts/validate/common.mjs +149 -0
  25. package/scripts/validate/data-model.mjs +225 -0
  26. package/scripts/validate/dependencies.mjs +69 -0
  27. package/scripts/validate/docs-templates.mjs +99 -0
  28. package/scripts/validate/footprint.mjs +78 -0
  29. package/scripts/validate/imports.mjs +61 -0
  30. package/scripts/validate/manifests.mjs +173 -0
  31. package/scripts/validate/markdown.mjs +123 -0
  32. package/scripts/validate/migrations.mjs +187 -0
  33. package/scripts/validate/no-tests.mjs +136 -0
  34. package/scripts/validate/privacy.mjs +115 -0
  35. package/scripts/validate/record-links.mjs +127 -0
  36. package/scripts/validate/skill-commands.mjs +190 -0
  37. package/scripts/validate/skills.mjs +112 -0
  38. package/scripts/validate/specification.mjs +88 -0
  39. package/scripts/validate/style.mjs +78 -0
  40. package/scripts/validate/validate-all.mjs +175 -0
  41. package/skills/debug/SKILL.md +68 -0
  42. package/skills/decision/SKILL.md +99 -0
  43. package/skills/docs/SKILL.md +86 -0
  44. package/skills/docs/assets/fragments/api/events.md +14 -0
  45. package/skills/docs/assets/fragments/api/graphql.md +14 -0
  46. package/skills/docs/assets/fragments/api/local-only.md +13 -0
  47. package/skills/docs/assets/fragments/api/rest.md +13 -0
  48. package/skills/docs/assets/fragments/api/rpc.md +13 -0
  49. package/skills/docs/assets/fragments/async/event-bus.md +13 -0
  50. package/skills/docs/assets/fragments/async/none.md +11 -0
  51. package/skills/docs/assets/fragments/async/platform-jobs.md +13 -0
  52. package/skills/docs/assets/fragments/async/queue.md +13 -0
  53. package/skills/docs/assets/fragments/async/scheduler.md +13 -0
  54. package/skills/docs/assets/fragments/auth/detected-provider.md +15 -0
  55. package/skills/docs/assets/fragments/auth/neutral-base.md +14 -0
  56. package/skills/docs/assets/fragments/data/document.md +13 -0
  57. package/skills/docs/assets/fragments/data/external-saas.md +13 -0
  58. package/skills/docs/assets/fragments/data/key-value.md +13 -0
  59. package/skills/docs/assets/fragments/data/none.md +12 -0
  60. package/skills/docs/assets/fragments/data/sql-orm.md +13 -0
  61. package/skills/docs/assets/fragments/data/sql-plain.md +13 -0
  62. package/skills/docs/assets/fragments/env/conventional.md +13 -0
  63. package/skills/docs/assets/fragments/env/envx.md +13 -0
  64. package/skills/docs/assets/fragments/env/managed-platform.md +13 -0
  65. package/skills/docs/assets/fragments/env/none.md +11 -0
  66. package/skills/docs/assets/fragments/ui/api-only.md +13 -0
  67. package/skills/docs/assets/fragments/ui/cli.md +14 -0
  68. package/skills/docs/assets/fragments/ui/desktop.md +14 -0
  69. package/skills/docs/assets/fragments/ui/mobile.md +14 -0
  70. package/skills/docs/assets/fragments/ui/web.md +14 -0
  71. package/skills/docs/assets/templates/adr.md +62 -0
  72. package/skills/docs/assets/templates/api.md +30 -0
  73. package/skills/docs/assets/templates/architecture.md +52 -0
  74. package/skills/docs/assets/templates/change-impact-drift-report.md +29 -0
  75. package/skills/docs/assets/templates/compliance.md +29 -0
  76. package/skills/docs/assets/templates/data-schema.md +43 -0
  77. package/skills/docs/assets/templates/feature.md +43 -0
  78. package/skills/docs/assets/templates/foundations.md +55 -0
  79. package/skills/docs/assets/templates/jobs-webhooks.md +36 -0
  80. package/skills/docs/assets/templates/module-inventory.md +19 -0
  81. package/skills/docs/assets/templates/module.md +50 -0
  82. package/skills/docs/assets/templates/nfr.md +22 -0
  83. package/skills/docs/assets/templates/observability.md +28 -0
  84. package/skills/docs/assets/templates/pages-ui-actions.md +47 -0
  85. package/skills/docs/assets/templates/project-summary.md +44 -0
  86. package/skills/docs/assets/templates/roles-permissions.md +26 -0
  87. package/skills/docs/assets/templates/test-plan.md +23 -0
  88. package/skills/docs/assets/templates/workflow-state-machine.md +43 -0
  89. package/skills/docs/references/adr-authoring.md +24 -0
  90. package/skills/docs/references/apis-and-data.md +23 -0
  91. package/skills/docs/references/capability-fragments.md +25 -0
  92. package/skills/docs/references/change-tracking.md +62 -0
  93. package/skills/docs/references/diagrams.md +31 -0
  94. package/skills/docs/references/discovery.md +59 -0
  95. package/skills/docs/references/edge-cases.md +45 -0
  96. package/skills/docs/references/foundations-modules.md +18 -0
  97. package/skills/docs/references/ingestion.md +52 -0
  98. package/skills/docs/references/initialize-adopt.md +25 -0
  99. package/skills/docs/references/module-decomposition.md +38 -0
  100. package/skills/docs/references/profiles.md +60 -0
  101. package/skills/docs/references/quality-attributes.md +27 -0
  102. package/skills/docs/references/reverse-engineer.md +21 -0
  103. package/skills/docs/references/spec-depths.md +31 -0
  104. package/skills/docs/references/summarize.md +18 -0
  105. package/skills/docs/references/surfaces-and-actions.md +24 -0
  106. package/skills/docs/references/validation.md +47 -0
  107. package/skills/docs/references/workflows-and-jobs.md +25 -0
  108. package/skills/docs/scripts/ingest.mjs +984 -0
  109. package/skills/docs/scripts/profile-detect.mjs +299 -0
  110. package/skills/docs/scripts/screen.mjs +96 -0
  111. package/skills/docs/scripts/template-lint.mjs +143 -0
  112. package/skills/docs/scripts/validate-docs.mjs +363 -0
  113. package/skills/doctor/SKILL.md +167 -0
  114. package/skills/feature/SKILL.md +132 -0
  115. package/skills/init/SKILL.md +137 -0
  116. package/skills/project/SKILL.md +261 -0
  117. package/skills/project/references/commands.md +213 -0
  118. package/skills/resume/SKILL.md +79 -0
  119. package/skills/review/SKILL.md +91 -0
  120. package/skills/status/SKILL.md +85 -0
  121. package/skills/task/SKILL.md +183 -0
  122. package/src/cli/product-map.mjs +468 -0
  123. package/src/cli/render.mjs +544 -0
  124. package/src/cli.mjs +2774 -0
  125. package/src/cloud/crypto.mjs +118 -0
  126. package/src/cloud/merge.mjs +186 -0
  127. package/src/cloud/policy.mjs +115 -0
  128. package/src/cloud/sync.mjs +512 -0
  129. package/src/cloud/transport.mjs +116 -0
  130. package/src/db/connect.mjs +189 -0
  131. package/src/db/maintenance.mjs +419 -0
  132. package/src/db/migrate.mjs +188 -0
  133. package/src/db/migrations/001_initial.sql +1024 -0
  134. package/src/db/migrations/002_docs_coverage.sql +126 -0
  135. package/src/db/migrations/003_memory_retrieval_and_integrity.sql +168 -0
  136. package/src/db/migrations/004_task_categories.sql +59 -0
  137. package/src/db/migrations/005_executable_evidence.sql +32 -0
  138. package/src/db/migrations/006_module_and_feature_boundaries.sql +27 -0
  139. package/src/db/migrations/007_drop_redundant_module_users.sql +13 -0
  140. package/src/db/migrations/008_changes_assumptions_test_plans_api_services.sql +166 -0
  141. package/src/db/migrations/009_retired_documents.sql +54 -0
  142. package/src/db/migrations/010_test_plan_evidence.sql +20 -0
  143. package/src/db/migrations/011_criterion_waiver.sql +13 -0
  144. package/src/db/migrations/012_synchronization.sql +56 -0
  145. package/src/db/store.mjs +327 -0
  146. package/src/decisions/record.mjs +167 -0
  147. package/src/docs/proposals.mjs +871 -0
  148. package/src/docs/render.mjs +1424 -0
  149. package/src/docs/templates.mjs +1281 -0
  150. package/src/features/acceptance.mjs +315 -0
  151. package/src/features/specify.mjs +248 -0
  152. package/src/init/discovery.mjs +901 -0
  153. package/src/init/index.mjs +784 -0
  154. package/src/init/questions.mjs +562 -0
  155. package/src/memory/benchmark.mjs +171 -0
  156. package/src/memory/capture.mjs +135 -0
  157. package/src/memory/consolidate.mjs +255 -0
  158. package/src/memory/index.mjs +810 -0
  159. package/src/model/ids.mjs +185 -0
  160. package/src/model/screening.mjs +150 -0
  161. package/src/model/toolkit.mjs +258 -0
  162. package/src/model/vocabulary.mjs +190 -0
  163. package/src/product/assumptions.mjs +120 -0
  164. package/src/product/changes.mjs +180 -0
  165. package/src/product/test-plans.mjs +183 -0
  166. package/src/progress/index.mjs +1364 -0
  167. package/src/runtime/harness.mjs +264 -0
  168. package/src/runtime/hooks.mjs +1021 -0
  169. package/src/runtime/identity.mjs +305 -0
  170. package/src/runtime/resume.mjs +343 -0
  171. package/src/runtime/session.mjs +679 -0
  172. package/src/runtime/version.mjs +315 -0
  173. package/src/service/assets/control-center.html +206 -0
  174. package/src/service/assets/control-center.manifest.json +7 -0
  175. package/src/service/manage.mjs +542 -0
  176. package/src/service/mutations.mjs +860 -0
  177. package/src/service/read-model.mjs +1557 -0
  178. package/src/service/server.mjs +783 -0
  179. package/src/tasks/categories.mjs +154 -0
  180. package/src/tasks/derive.mjs +977 -0
  181. package/src/tasks/lifecycle.mjs +830 -0
  182. package/src/verify/index.mjs +236 -0
@@ -0,0 +1,19 @@
1
+ <!-- Template: module inventory. Every module folder is registered here or is an orphan. -->
2
+ # {{project-name}} - Module Inventory
3
+
4
+ - **Status:** generated projection of the `modules` table; the database is canonical and this file is rebuilt from it
5
+ - **Last verified:** {{revision}} on {{date}}
6
+
7
+ | Module | Purpose | Primary users | Owns | Status | Doc root |
8
+ |---|---|---|---|---|---|
9
+ | {{module}} | {{purpose}} | {{roles}} | {{data-and-surfaces}} | planned / in-progress / implemented / deprecated | {{path}} |
10
+
11
+ ## Status rules
12
+
13
+ - `implemented` is derived, not asserted: it requires the module's features to be complete and their acceptance criteria to carry current verification evidence.
14
+ - Deprecated modules keep their row and doc root; history is never deleted.
15
+ - Editing this file does not change a module's status. Change it in the database, then regenerate; a manual edit here is detected and raised as a proposal.
16
+
17
+ ## Deliberate exclusions
18
+
19
+ Folders under the modules root that are intentionally not modules (fixtures, archives): {{list-or-none}}
@@ -0,0 +1,50 @@
1
+ <!-- Template: module specification. Built by the twenty-step decomposition loop;
2
+ every step filled or "N/A - reason". -->
3
+ # Module: {{module-name}}
4
+
5
+ - **Status:** draft | accepted
6
+ - **Purpose:** {{one-sentence}}
7
+ - **Primary users:** {{roles}}
8
+ - **Owns:** {{entities-surfaces-processes}}
9
+ - **Does not own (consumes):** {{consumed-from-other-modules}}
10
+ - **Last verified:** {{revision}} on {{date}} against {{code-paths}}
11
+
12
+ ## Surfaces
13
+
14
+ (per the pages/UI/actions template - link or inline)
15
+
16
+ ## API surface
17
+
18
+ | Operation | Purpose | Doc |
19
+ |---|---|---|
20
+ | {{operation}} | {{purpose}} | {{link}} |
21
+
22
+ ## Data
23
+
24
+ | Entity | Role in module | Doc |
25
+ |---|---|---|
26
+ | {{entity}} | {{owner/consumer}} | {{link}} |
27
+
28
+ ## Wiring (key actions end-to-end)
29
+
30
+ | Action | Path |
31
+ |---|---|
32
+ | {{action}} | {{surface}} → {{handler}} → {{service}} → {{data}} → {{side-effects}} |
33
+
34
+ ## State machines
35
+
36
+ {{list-with-links-or-deliberate-none}}
37
+
38
+ ## Events
39
+
40
+ | Event | Direction | Payload owner | Consumers |
41
+ |---|---|---|---|
42
+ | {{event}} | emits / consumes | {{owner}} | {{consumers}} |
43
+
44
+ ## Edge cases
45
+
46
+ {{category-walk-outcome-link}} - every category filled or `N/A - reason`
47
+
48
+ ## Remaining loop steps
49
+
50
+ Telemetry: {{or-N/A}} · Accessibility: {{summary}} · i18n: {{or-N/A}} · Flags: {{or-N/A}} · Responsive: {{summary}} · Copy: {{link-or-inline}} · URL state: {{or-N/A}} · Performance: {{evidence-based-or-N/A}} · SEO: {{or-N/A}} · Compliance: {{declared-regimes-or-N/A}} · Test plan: {{link}}
@@ -0,0 +1,22 @@
1
+ <!-- Template: non-functional requirements. Every number has a source: a measurement,
2
+ a platform limit, or an owner decision. Invented budgets are forbidden. -->
3
+ # {{project-name}} - Non-Functional Requirements
4
+
5
+ - **Status:** draft | accepted
6
+ - **Last verified:** {{revision}} on {{date}}
7
+
8
+ | # | Requirement | Target | Source (measurement / platform limit / decision) | Measured how | Current status |
9
+ |---|---|---|---|---|---|
10
+ | {{NFR-id}} | {{statement}} | {{target}} | {{evidence-or-adr}} | {{method}} | met / unmet / unmeasured |
11
+
12
+ ## Rules
13
+
14
+ - A target without a source is a **question for the owner**, not a requirement - list it under Open below.
15
+ - A requirement without a measurement method is a draft.
16
+ - `unmeasured` is an honest status; fabricated compliance is drift.
17
+
18
+ ## Open (awaiting owner targets)
19
+
20
+ | Area | Why it matters here | Proposed measurement |
21
+ |---|---|---|
22
+ | {{area}} | {{why}} | {{how-we-would-measure}} |
@@ -0,0 +1,28 @@
1
+ <!-- Template: observability. Vendor names only from evidence or decision. -->
2
+ # {{module-or-project}} - Observability
3
+
4
+ - **Status:** draft | accepted
5
+ - **Tooling in use:** {{from-evidence-or-none-declared}}
6
+ - **Last verified:** {{revision}} on {{date}}
7
+
8
+ ## Signals that prove it works
9
+
10
+ | Capability | Signal (event/metric/log) | Where emitted |
11
+ |---|---|---|
12
+ | {{capability}} | {{signal}} | {{code-path}} |
13
+
14
+ ## Operator views
15
+
16
+ | View/dashboard | Shows | Exists at |
17
+ |---|---|---|
18
+ | {{view}} | {{content}} | {{location-from-evidence}} |
19
+
20
+ ## Alerts
21
+
22
+ | Condition | Threshold (evidence/decision) | Who is notified |
23
+ |---|---|---|
24
+ | {{condition}} | {{threshold-with-source}} | {{destination}} |
25
+
26
+ ## First-response pointers
27
+
28
+ When {{failure-class}} → look at {{signal/view}} first.
@@ -0,0 +1,47 @@
1
+ <!-- Template: pages, UI surfaces, and complete action/state inventories. -->
2
+ # {{module-name}} - Surfaces and Actions
3
+
4
+ - **Status:** draft | accepted
5
+ - **Last verified:** {{revision}} on {{date}} against {{code-paths}}
6
+
7
+ ## Pages/surfaces
8
+
9
+ | Path/route | Surface | Purpose | Primary role | Key components | Entities shown |
10
+ |---|---|---|---|---|---|
11
+ | {{route}} | {{name}} | {{purpose}} | {{role}} | {{components}} | {{entities}} |
12
+
13
+ ## Action inventory ({{surface-name}})
14
+
15
+ | Field | Value |
16
+ |---|---|
17
+ | Trigger | {{control-and-location}} |
18
+ | Who | {{role}} - enforced at {{enforcement-point}} |
19
+ | Precondition | {{state/visibility-conditions}} |
20
+ | Effect | {{api-operation-or-local-effect}} |
21
+ | Input/validation | {{fields-rules-limits}} |
22
+ | Side effects | {{events-notifications-derived}} |
23
+ | Confirmation | {{required?-copy}} |
24
+ | Loading | {{behavior}} |
25
+ | Disabled | {{conditions-and-affordance}} |
26
+ | Success | {{feedback}} |
27
+ | Empty | {{if-applicable}} |
28
+ | Error | {{behavior-and-copy}} |
29
+ | Offline | {{if-in-scope-else-N/A-deliberate}} |
30
+ | Keyboard | {{reachability/shortcut}} |
31
+ | Accessible name | {{name}} |
32
+ | Focus behavior | {{after-complete/cancel}} |
33
+ | Responsive | {{breakpoint-behavior}} |
34
+ | Telemetry | {{only-if-approved-else-none}} |
35
+ | Acceptance test | {{reference}} |
36
+
37
+ ## Role × action matrix
38
+
39
+ | Action | {{role-1}} | {{role-2}} |
40
+ |---|---|---|
41
+ | {{action}} | ✓ / own / - | ✓ / own / - |
42
+
43
+ Legend: `✓` full · `own` only own records · ` - ` blocked. Matrix must agree with the enforcement points above.
44
+
45
+ ## State completeness
46
+
47
+ Every surface: empty / loading / error / success documented. Every action: disabled conditions documented. Undocumented states found in code are drift (`code-ahead-of-spec`).
@@ -0,0 +1,44 @@
1
+ <!-- Template: cited project summary. Written only on request (see summarize reference);
2
+ every load-bearing claim cites a source path and carries an epistemic label. -->
3
+ # {{project-name}} - Project Summary
4
+
5
+ - **Generated:** {{date}} against {{revision}}
6
+ - **Method:** code-first read; claims labeled Confirmed / Inferred / Unknown; citations per claim
7
+
8
+ ## What it is
9
+
10
+ {{one-paragraph}} ({{citation}})
11
+
12
+ ## Who uses it
13
+
14
+ | Role | Goal | Evidence |
15
+ |---|---|---|
16
+ | {{role}} | {{goal}} | {{path}} |
17
+
18
+ ## What it does
19
+
20
+ | Area/module | Capabilities | Evidence |
21
+ |---|---|---|
22
+ | {{area}} | {{capabilities}} | {{paths}} |
23
+
24
+ ## How it is built
25
+
26
+ {{stack-from-evidence-with-citations}}
27
+
28
+ ## How it runs
29
+
30
+ Entry points: {{paths}} · Environments: {{names-only-never-values}} ({{citations}})
31
+
32
+ ## State of the project
33
+
34
+ Tests: {{summary+citation}} · Docs freshness: {{summary}} · Known drift: {{count-and-link}}
35
+
36
+ ## Docs vs code (drift found while summarizing)
37
+
38
+ | Class | Code side | Doc side |
39
+ |---|---|---|
40
+ | {{drift-class}} | {{path}} | {{path}} |
41
+
42
+ ## Could not be established
43
+
44
+ - {{unknown-item}} - {{what-would-resolve-it}}
@@ -0,0 +1,26 @@
1
+ <!-- Template: roles and permissions - the three nested matrices. -->
2
+ # {{project-name}} - Roles and Permissions
3
+
4
+ - **Status:** draft | accepted
5
+ - **Permission source of truth (code):** {{declared-path}}
6
+ - **Last verified:** {{revision}} on {{date}}
7
+
8
+ ## 1. Role × module visibility
9
+
10
+ | Module | {{role-1}} | {{role-2}} |
11
+ |---|---|---|
12
+ | {{module}} | ✓ / - | ✓ / - |
13
+
14
+ ## 2. Role × action capability (per module - link module inventories)
15
+
16
+ {{links-to-per-module-matrices}}
17
+
18
+ ## 3. Role × field sensitivity
19
+
20
+ | Entity.field | Class | {{role-1}} | {{role-2}} |
21
+ |---|---|---|---|
22
+ | {{entity.field}} | personal/financial/secret | read / write / redacted / - | … |
23
+
24
+ ## Enforcement
25
+
26
+ Every row names its enforcement point: {{middleware/policy/guard-paths}}. Matrix-vs-code disagreement is a P1 parity finding (validation category K).
@@ -0,0 +1,23 @@
1
+ <!-- Template: module test plan. Tooling names come from project evidence. -->
2
+ # {{module-name}} - Test Plan
3
+
4
+ - **Status:** draft | accepted
5
+ - **Test tooling in use:** {{from-evidence}}
6
+ - **Last verified:** {{revision}} on {{date}}
7
+
8
+ ## What must be true
9
+
10
+ {{acceptance-criteria-rollup-from-features}}
11
+
12
+ ## Coverage map
13
+
14
+ | Area | Level (unit/integration/e2e) | Cases | Status |
15
+ |---|---|---|---|
16
+ | Happy paths per feature | {{level}} | {{cases}} | exists / planned / missing |
17
+ | Applicable edge-case categories | {{level}} | {{cases-per-category}} | … |
18
+ | Permission boundaries (per matrix) | {{level}} | {{role×action-cases}} | … |
19
+ | State machines (incl. illegal transitions) | {{level}} | {{transition-cases}} | … |
20
+
21
+ ## Evidence conventions
22
+
23
+ Results live at {{where}}; a claim of "tested" cites a run. Tests claimed but absent is a P1 finding (validation category N).
@@ -0,0 +1,43 @@
1
+ <!-- Template: workflow and/or state machine. Use the sections that apply. -->
2
+ # {{workflow-or-entity-name}}
3
+
4
+ - **Status:** draft | accepted | implemented
5
+ - **Module:** {{owning-module}}
6
+ - **Last verified:** {{revision}} on {{date}} against {{code-paths}}
7
+
8
+ ## Workflow
9
+
10
+ - **Purpose:** {{why}}
11
+ - **Actors:** {{people-systems-jobs}}
12
+ - **Trigger:** {{what-starts-it}}
13
+
14
+ | Step | Owner | Action | On failure |
15
+ |---|---|---|---|
16
+ | {{n}} | {{actor}} | {{action}} | {{retry/compensate/park/abort}} |
17
+
18
+ - **Completion:** {{criteria}}
19
+ - **Observability:** {{how-progress-is-visible}}
20
+
21
+ ```mermaid
22
+ sequenceDiagram
23
+ {{swimlane-if-multi-actor}}
24
+ ```
25
+
26
+ ## State machine
27
+
28
+ | State | Meaning | Permits (UI/API) |
29
+ |---|---|---|
30
+ | {{state}} | {{meaning}} | {{allowed-actions}} |
31
+
32
+ | From | Event | Guard | To | Actor |
33
+ |---|---|---|---|---|
34
+ | {{state}} | {{event}} | {{guard}} | {{state}} | {{who}} |
35
+
36
+ - **Illegal transitions:** explicitly rejected at {{enforcement-point}} (documented-but-unenforced = drift)
37
+ - **Terminal states:** {{list}}
38
+ - **Timeouts/expiry:** {{time-driven-transitions}}
39
+
40
+ ```mermaid
41
+ stateDiagram-v2
42
+ {{states-and-transitions}}
43
+ ```
@@ -0,0 +1,24 @@
1
+ # ADR Authoring (Docs-side)
2
+
3
+ Docs owns the authoring quality of decision records; the decision skill owns conflict behavior and lifecycle enforcement. Template: `assets/templates/adr.md`; fields and statuses follow the shared project record (`${CLAUDE_PLUGIN_ROOT}/references/project-record.md`) §6.
4
+
5
+ ## Authoring rules
6
+
7
+ - **Context before decision:** the problem, constraints, and evidence (with epistemic labels) come first; a reader must be able to disagree intelligently.
8
+ - **Options considered is mandatory** - including the rejected ones with honest reasons; "we didn't consider alternatives" is itself the recorded truth when so.
9
+ - **Observable rationale only:** criteria, tradeoffs, consequences, revisit triggers - never private reasoning.
10
+ - **Consequences include the negative ones.** A decision with only upsides is under-analyzed.
11
+ - **Enforcement points:** name where the decision is enforced (validator rule, review checklist, code location) - unenforced decisions drift.
12
+ - **Revisit triggers:** concrete conditions that reopen the decision (evidence changes, scale thresholds, dependency EOL), not vague "revisit later".
13
+ - **Declined and deferred are first-class:** record them with reasons and revisit conditions - "declined, not forgotten".
14
+
15
+ ## Supersession (authoring side)
16
+
17
+ - New record lists `supersedes:`; the old record gains `superseded-by:` plus a dated banner explaining **why** - especially when superseded outside its own revisit triggers.
18
+ - **Bodies are immutable.** The old record's text is history; only status, banner, and cross-references change.
19
+ - **Partial supersession** names exactly which statements/scope fell and which stand, on both records.
20
+ - Same-decision-different-places drift (log entry vs index row vs record status) is a validation finding; the record file is authoritative, indexes are regenerated.
21
+
22
+ ## Escalation rule
23
+
24
+ Changes crossing a system-design seam (new datastore, tenancy model, external dependency, public contract, security model) require a decision record before implementation - this is step 6 of the change-tracking protocol.
@@ -0,0 +1,23 @@
1
+ # APIs and Data/Schema
2
+
3
+ Universal structure lives in templates; style-specific sections come from fragments activated by evidence or decision - never defaults.
4
+
5
+ ## APIs (`assets/templates/api.md` + `assets/fragments/api/*`)
6
+
7
+ Per operation, regardless of style: name/route/procedure · purpose · caller surfaces/actions · auth requirement + permission · request contract (fields, validation, limits) · response contract (success shape, error shapes with codes and user-facing meaning) · idempotency (key/semantics for anything retried) · rate/size limits (from evidence) · side effects (events, jobs, notifications) · versioning/compatibility expectations · test references.
8
+
9
+ Style fragments add the style's specifics: REST (methods/status codes/resource shape), GraphQL (schema types/resolvers/authorization points), RPC (procedures/middleware), events (topics/payloads/delivery), local-only (in-process contracts).
10
+
11
+ API docs map to real code: each operation names its implementing file(s). Unmapped operations are drift.
12
+
13
+ ## Data/schema (`assets/templates/data-schema.md` + `assets/fragments/data/*`)
14
+
15
+ Per entity: purpose · owning module · fields (name, type, nullability, default, constraints) · relationships · lifecycle (created/updated/deleted by which operations) · sensitivity class (what is personal/secret/regulated under declared regimes) · retention (from decisions, not invented) · indexes/uniqueness from evidence · migration notes.
16
+
17
+ Persistence fragments add style specifics: SQL-with-ORM (model↔table mapping, migration tool in use), SQL-without-ORM (DDL location, migration discipline), document (collection shape, denormalization rules), key-value (key schema, TTL), external SaaS (owned-by-vendor caveats, sync), no-persistence (explicit statement).
18
+
19
+ ## Shared rules
20
+
21
+ - Schema docs cite the schema source files; prose never outranks the schema file (authority ladder).
22
+ - Cross-module data access is documented on both sides (owner and consumer).
23
+ - Breaking-change candidates (field removal/retype, contract change) trigger the API-contract / schema-migration change classes in `change-tracking.md`.
@@ -0,0 +1,25 @@
1
+ # Capability Fragments - Inventory and Activation Rules
2
+
3
+ A fragment supplies the style-specific sections of universal templates. **Activation rule:** a fragment activates only when (a) detected from current code/configuration - with the evidence recorded - or (b) selected in an accepted decision. Never by default, never from genre expectations.
4
+
5
+ ## Layout
6
+
7
+ One directory per capability axis under `assets/fragments/`, one file per style. Each fragment states its activation evidence patterns and the template sections it fills. `none.md` variants make absence an explicit, documentable state.
8
+
9
+ ## Inventory
10
+
11
+ | Axis | Styles |
12
+ |---|---|
13
+ | `assets/fragments/api/` | rest · graphql · rpc · events · local-only |
14
+ | `assets/fragments/data/` | sql-orm · sql-plain · document · key-value · external-saas · none |
15
+ | `assets/fragments/async/` | queue · scheduler · event-bus · platform-jobs · none |
16
+ | `assets/fragments/auth/` | neutral-base · detected-provider |
17
+ | `assets/fragments/ui/` | web · mobile · desktop · cli · api-only |
18
+ | `assets/fragments/env/` | envx · conventional · managed-platform · none |
19
+
20
+ ## Usage
21
+
22
+ 1. Determine the relevant axis from the operation (API doc → `api/`, entity doc → `data/`, …).
23
+ 2. Pick the style whose activation evidence is present, or the style an accepted decision selects; record which and why in the produced artifact.
24
+ 3. If no style's evidence exists and no decision selects one, use the `none.md` variant where the axis has one, or state the absence - never pick a plausible default.
25
+ 4. Fragment content fills the template's designated section; universal template text is never edited to embed style specifics.
@@ -0,0 +1,62 @@
1
+ # Change Tracking, Impact, Sync, Drift, and Indexes
2
+
3
+ Always on. Documentation catches up with accepted changes **before the next unrelated task begins**; the only alternative is a tracked deferral (a visible pending-sync entry), never silence. Completion claims with required sync missing are refused.
4
+
5
+ ## Contents
6
+ 1. The seven-step protocol
7
+ 2. Code-edit triggers
8
+ 3. Change classes → minimum artifacts
9
+ 4. Silent-edit exceptions
10
+ 5. Drift taxonomy and reporting
11
+ 6. Indexes
12
+ 7. Deferred engine boundary
13
+
14
+ ## 1. The seven-step protocol (every accepted mutation)
15
+
16
+ 1. **Identify** what changed (actual diff, not intention).
17
+ 2. **Classify** the change (table below).
18
+ 3. **Confirm** material sibling updates with the user before making them.
19
+ 4. **Rewrite** the affected current-state artifacts (mark drift where intent and code now disagree - never silently pick a side).
20
+ 5. **Record** the change: one coherent change entry (fields per the shared project record, `${CLAUDE_PLUGIN_ROOT}/references/project-record.md` §6).
21
+ 6. **Escalate to a decision record** when the change is architectural (crosses a system-design seam: new datastore, tenancy, external dependency, public contract, security model).
22
+ 7. **Re-verify:** links resolve; parity holds for touched specs; version/freshness markers updated.
23
+
24
+ ## 2. Code-edit triggers
25
+
26
+ The profile's ownership map (index or adapter) maps code paths → owning artifacts. On any code edit - the agent's, the user's, or co-edits - walk the changed paths against the map. "No doc impact" is a valid outcome **only after walking the map**, never a default. Bulk refactors and migrations are walked once as a set, with one coherent change entry.
27
+
28
+ ## 3. Change classes → minimum affected artifacts
29
+
30
+ | Class | Minimum artifacts |
31
+ |---|---|
32
+ | behavior addition | feature spec (accepted, right depth) · action/state inventory if UI · test plan · change entry |
33
+ | behavior change | spec delta · affected inventories · change entry |
34
+ | behavior removal | spec status update (removed, not erased) · inventories · change entry |
35
+ | bug fix | change entry; spec/docs only if intended behavior or operations changed |
36
+ | refactor | change entry; ownership map if paths moved |
37
+ | dependency | decision record (or reminder of the declining decision) · stack slot · change entry |
38
+ | schema/migration | data/schema doc · migration note · affected API docs · change entry |
39
+ | API contract | API doc · consumers notified in docs · versioning note · change entry |
40
+ | UI interaction | action/state inventory · acceptance tests · change entry |
41
+ | security/privacy | roles/permissions matrices · compliance doc if regime-relevant · change entry |
42
+ | operations | observability/runbook content · change entry |
43
+ | documentation-only | change entry (docs are artifacts too) |
44
+ | decision-only | decision record · decision index · change entry |
45
+
46
+ ## 4. Silent-edit exceptions (the only two)
47
+
48
+ Typo fixes and user-facing copy corrections that change no meaning may be applied directly - and still appear in the next checkpoint's change entry. Everything else follows the protocol.
49
+
50
+ ## 5. Drift taxonomy and reporting
51
+
52
+ `code-ahead-of-spec` · `spec-ahead-of-code` · `stale-current-state-prose` · `legitimate-historical-reference` · `missing-ownership` · `broken-cross-reference` · `unverified-assumption` · `implementation-defect` · `unknown`.
53
+
54
+ Drift reports (template `assets/templates/change-impact-drift-report.md`) list each item with class, evidence (both sides), and the resolution owner (code, docs, or decision). Documentation drift is never reported as runtime failure, nor vice versa. Contradictions stay visible until resolved.
55
+
56
+ ## 6. Indexes
57
+
58
+ Generated views (module inventory rollups, decision index, ownership rollups) are rebuildable, regeneration-marked, and never hand-edited. Update the affected index at the checkpoint; full rebuilds are the recovery path.
59
+
60
+ ## 7. Engine commands
61
+
62
+ Durable writes go through the record engine: append the change entry with `node "${CLAUDE_PLUGIN_ROOT}/scripts/talks/events.mjs" append --root <project> --event <file|-> --apply` (immutable, collision-safe, secret/reasoning-content rejected), map changed paths with `node "${CLAUDE_PLUGIN_ROOT}/scripts/talks/ownership.mjs" match`, and regenerate views with `node "${CLAUDE_PLUGIN_ROOT}/scripts/talks/index.mjs" rebuild --apply`. Generated views are never hand-edited - rebuild them.
@@ -0,0 +1,31 @@
1
+ # Diagram Catalogue
2
+
3
+ Diagrams are contracts, not decoration: each has an owner artifact, stays in sync through change tracking, and a stale diagram is drift (validation category O). Use Mermaid unless the project already uses another convention (adapter declares it).
4
+
5
+ ## Project-wide (in architecture/foundations)
6
+
7
+ | Diagram | Shows | When required |
8
+ |---|---|---|
9
+ | System context | Actors, the system, external dependencies | Always (even one box + actors) |
10
+ | Container/deployment | Running pieces and their communication | More than one runtime piece |
11
+ | Module map | Modules and their dependencies | More than one module |
12
+ | Data-ownership map | Which module owns which entities | Shared persistence |
13
+ | Auth flow | Session/token issuance and checks | Any authentication |
14
+ | Critical-path sequence | The one flow the product exists for | Always |
15
+
16
+ ## Per-module / per-artifact
17
+
18
+ | Diagram | Lives with | When |
19
+ |---|---|---|
20
+ | Navigation map | Module doc | Module has multiple surfaces |
21
+ | Feature sequence | Feature spec (standard+) | Cross-component flows |
22
+ | State machine | State-machine spec | Every lifecycle entity |
23
+ | Workflow swimlane | Workflow spec | Multi-actor flows |
24
+ | Job/webhook flow | Jobs spec | Async paths with failure branches |
25
+
26
+ ## Rules
27
+
28
+ - Node names are the project's real names (routes, modules, entities) - never invented vendors or placeholder stacks; external dependencies appear only from evidence.
29
+ - Every diagram carries a one-line caption stating what it claims; a diagram that cannot be captioned is decoration - cut it.
30
+ - Diagrams participate in the change-tracking walk: a change touching a diagrammed path updates or explicitly defers the diagram.
31
+ - Prefer several small accurate diagrams over one mural; a diagram nobody updates is worse than none.
@@ -0,0 +1,59 @@
1
+ # Project Classification, Requirement Discovery, and Question Discipline
2
+
3
+ ## Contents
4
+ 1. Classify the project
5
+ 2. Discover requirements
6
+ 3. Question discipline
7
+ 4. Push-back catalogue
8
+ 5. Proactive suggestions
9
+
10
+ ## 1. Classify the project
11
+
12
+ From evidence, never assumption: delivery shape (web / mobile / desktop / CLI / API-only / library), persistence style, API style, async needs, auth needs, environment handling, deployment shape. Each classification cites its evidence (file, config, dependency) and gets an epistemic label. Classifications feed **fragment activation** (`assets/fragments/`) - a capability fragment activates only from detected evidence or an accepted decision.
13
+
14
+ ## 2. Discover requirements
15
+
16
+ Work section by section - product intent, users and roles, scope boundaries, core flows, data, integrations, quality attributes - and for each: state what the evidence already answers, then ask only what remains material. Requirements land as drafts with provenance; acceptance is explicit.
17
+
18
+ ## 3. Question discipline
19
+
20
+ - One important question at a time; group only trivial factual selections.
21
+ - Recommend first: every question carries a recommendation, why, and when not to take it (the question-packet format in the shared evidence contract).
22
+ - Skip what evidence answers; never ask for facts visible in code, lockfiles, routers, or existing docs.
23
+ - Ask only when the answer materially changes the deliverable; otherwise proceed with a declared assumption.
24
+
25
+ ## 4. Push-back catalogue
26
+
27
+ Push back when an answer cannot drive implementation - require the missing dimension, propose a concrete default, and record the resolution:
28
+
29
+ | Vague answer | Require |
30
+ |---|---|
31
+ | "secure" | threat model scope + data classes |
32
+ | "real-time" | latency + consistency expectation |
33
+ | "admin can manage X" | role boundary + exact capabilities |
34
+ | "multi-tenant" | tenant axis + isolation level |
35
+ | "scalable" | load assumption + growth horizon |
36
+ | "AI-powered" | model responsibility, failure behavior, cost boundary |
37
+ | "audit everything" | which events, retention, who reads them |
38
+ | "works offline" | which operations, conflict resolution |
39
+ | "fast" | budget with a measurement point, from evidence - never invented |
40
+
41
+ Do not push back on every answer; push back when building on the answer as-is would produce rework.
42
+
43
+ ## 5. Proactive suggestions
44
+
45
+ When a capability appears, volunteer its commonly forgotten neighbors - as questions, at capability level, never as vendor choices:
46
+
47
+ | Trigger | Volunteer |
48
+ |---|---|
49
+ | authentication | session revocation, MFA policy, password reset, account lockout |
50
+ | payments/billing | refunds, disputes, dunning, tax handling, webhooks idempotency |
51
+ | file upload | size/type limits, virus scanning policy, storage lifecycle, access control |
52
+ | search | empty results, indexing lag, permission filtering |
53
+ | notifications | preferences, batching, quiet hours, delivery failure |
54
+ | invitations/teams | expiry, re-invite, role at accept, member removal |
55
+ | background jobs | retry policy, dead-letter handling, idempotency, monitoring |
56
+ | i18n | date/number formats, RTL, translatable content ownership |
57
+ | deletion | soft vs hard, cascades, export-before-delete, legal holds |
58
+
59
+ Suggestions are offers; declined ones are recorded as declined-not-forgotten with a revisit condition.
@@ -0,0 +1,45 @@
1
+ # Edge-Case Coverage
2
+
3
+ Walk every applicable category for each feature or module. **No category is left silent:** each is either specified or marked `N/A - <deliberate reason>`. A category marked N/A without a reason is a validation finding.
4
+
5
+ ## Contents
6
+ 1. The categories (behavioral · operational · distribution · data integrity and lifecycle)
7
+ 2. Per-capability starter sets
8
+
9
+ ## The categories
10
+
11
+ ### Behavioral
12
+ 1. **Empty states** - no data yet, filtered-to-empty, first-run.
13
+ 2. **Boundary values** - zero, one, maximum, overflow, truncation, pagination edges.
14
+ 3. **Invalid input** - type, format, range, injection-shaped input at trust boundaries.
15
+ 4. **Permission boundaries** - each role attempting each action, including URL/API access without UI affordance.
16
+ 5. **State-machine violations** - actions attempted in wrong states; double-submits; replayed transitions.
17
+ 6. **Concurrent actions** - two actors editing/deleting the same entity; optimistic-lock behavior.
18
+ 7. **Ordering** - out-of-order arrival of events/webhooks/responses.
19
+ 8. **Duplication** - retried requests, duplicate submissions, idempotency expectations.
20
+
21
+ ### Operational
22
+ 9. **Network failure** - timeouts, partial failure mid-flow, retry behavior, user feedback.
23
+ 10. **Dependency failure** - downstream service down, degraded mode, circuit behavior.
24
+ 11. **Slow paths** - long-running operations, progress feedback, cancellation.
25
+ 12. **Time** - timezones, DST, clock skew, expiry boundaries, date rollover, leap cases.
26
+ 13. **Data migration states** - old-shape data encountered by new code and vice versa.
27
+ 14. **Recovery** - crash mid-operation; what is resumable, what is orphaned, cleanup.
28
+ 15. **Limits and quotas** - rate limits, storage limits, plan limits; behavior at and past the limit.
29
+
30
+ ### Distribution
31
+ 16. **Multi-device/session** - same account concurrently; stale-tab actions; session expiry mid-flow.
32
+ 17. **Offline/degraded** - if in scope: queued actions, conflict resolution, reconnect.
33
+ 18. **Localization** - long strings, RTL, unsupported locale fallback (if in scope).
34
+ 19. **Platform variance** - browser/OS/device classes in scope.
35
+ 20. **Versioning** - old clients against new APIs; deprecation windows.
36
+
37
+ ### Data integrity and lifecycle
38
+ 21. **Deletion semantics** - soft/hard, cascades, references to deleted entities, export-before-delete.
39
+ 22. **Consistency** - derived data staleness, cache invalidation, eventual-consistency visibility.
40
+ 23. **Privacy lifecycle** - data subject requests, retention, anonymization (declared regimes only).
41
+ 24. **Auditability** - who did what when, for actions that require it.
42
+
43
+ ## Per-capability starter sets
44
+
45
+ When a capability is present, its typical hot spots (start here, then walk all categories): **auth** - expiry mid-flow, revoked session, role change mid-session · **payments** - webhook replay/ordering, partial refund, currency rounding · **upload** - oversize, wrong type, interrupted upload, orphaned blobs · **search** - empty, injection-shaped queries, permission filtering, index lag · **realtime** - reconnect gaps, missed events, ordering · **multi-tenant** - cross-tenant reference attempts, tenant deletion · **mobile** - backgrounding mid-flow, push permission denied, app-version skew against the API, deep-link cold start · **i18n** - long-string overflow, RTL layout, locale fallback, pluralization rules · **AI features** - model failure/timeout, unsafe output handling, cost runaway, nondeterminism in tests.
@@ -0,0 +1,18 @@
1
+ # Foundations and Module Inventory
2
+
3
+ ## Foundations (`assets/templates/foundations.md`)
4
+
5
+ The accepted base every other artifact builds on. Sections: **product** (what it is, for whom, the problem, explicit non-goals) · **users and roles** (actors and their goals; role list feeds the permission matrices) · **scope** (in/out for the current horizon, with the out-list as discipline) · **architecture** (per `assets/templates/architecture.md`: system shape, boundaries, key flows, diagram inventory per `diagrams.md`) · **stack** (capability slots - delivery, persistence, API style, async, auth, environment - each filled by the active fragment with its evidence; no vendor appears without evidence or decision) · **design direction** (pointer to the project's design system if one exists; UI depth belongs to the ui skill) · **glossary** (project vocabulary; one meaning per term).
6
+
7
+ Foundations claims carry epistemic labels; greenfield foundations are drafts until accepted; brownfield foundations are built via `reverse-engineer.md` with inferred claims marked.
8
+
9
+ ## Module inventory (`assets/templates/module-inventory.md`)
10
+
11
+ The registry that makes module docs discoverable and orphans detectable:
12
+
13
+ | Module | Purpose | Primary users | Owns (data/surfaces) | Status | Doc root |
14
+
15
+ Rules:
16
+ - Every module folder under the profile's modules root appears here; folders present but unregistered are **orphans** (validation reports them distinctly - they are either registered, archived, or deliberate exclusions listed in the adapter).
17
+ - Status reflects reality: `planned` / `in-progress` / `implemented` / `deprecated`; `implemented` requires parity validation to have passed at least once.
18
+ - Cross-module ownership disputes resolve here (one owner per entity/surface), during the reconciliation pass of `module-decomposition.md`.