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,137 @@
1
+ ---
2
+ name: init
3
+ description: Start a Superdev project and run product discovery, or adopt a repository that already exists. Use for "set up superdev here", "I want to build X", "start a project", "initialize", "adopt this codebase", or when the orchestrator finds no project in the database. Detects new versus existing, inspects the repository before asking anything, checks provider readiness without installing, runs brainstorming and discovery, records sources and assumptions, walks the production-readiness checklist so no capability area is silently skipped, presents a high-level plan for acceptance, stores accepted content in the database, generates the Markdown projection, derives the first tasks, and opens the control center.
4
+ ---
5
+
6
+ # Initialize or Adopt
7
+
8
+ Initialization creates the container and the accepted plan. It does not create
9
+ implementation work until a person has accepted the plan.
10
+
11
+ `SD` means the installed `superdev` command, with `--root <project>` on
12
+ every call. Full surface:
13
+ `the plugin's skills/project/references/commands.md`.
14
+
15
+ ## Which path
16
+
17
+ | Input | Command |
18
+ |---|---|
19
+ | An idea in a sentence, a Markdown brief, a folder of notes | `SD init` |
20
+ | Empty or nearly empty repository | `SD init` |
21
+ | Existing code, existing documentation, existing conventions | `SD adopt` |
22
+
23
+ If both apply (a real codebase plus a brief for what comes next), adopt first,
24
+ then run discovery for the new direction on top of what adoption found.
25
+
26
+ ## Order of operations
27
+
28
+ 1. **Inspect before asking.** Repository instructions, README, manifests,
29
+ routes, schemas, migrations, configuration, existing docs, tests. Every
30
+ question the repository already answers is a question you must not ask.
31
+ 2. **Check provider readiness.** `SD doctor`. It installs nothing. Report what
32
+ is ready and what is not before relying on it.
33
+ 3. **Run `SD init` or `SD adopt`.** This creates the database at
34
+ `.superdev/superdev.db`, adds `.superdev/` to `.gitignore`, opens a discovery
35
+ session, and records supplied material as immutable source records with
36
+ content hashes. Original notes are never rewritten.
37
+ 4. **Brainstorm with the provider.** Superpowers brainstorming shapes the
38
+ product when it is ready. If it is not, say so plainly, run the discovery
39
+ questions below, and do not present your own interview as that methodology.
40
+ 5. **Build the concept map**: users, problems, desired outcomes, possible
41
+ modules, capabilities, constraints, assumptions, unknowns, risks.
42
+ 6. **Walk the readiness checklist.** Below. Every applicable area gets an
43
+ answer or an explicit deferral.
44
+ 7. **Ask the smallest set of material questions.** Below.
45
+ 8. **Produce the high-level plan before any implementation task exists.**
46
+ `SD plan` assembles goals, milestones, modules and feature candidates from
47
+ what has been accepted so far.
48
+ 9. **Present the plan and the material decisions for acceptance.** Nothing is
49
+ stored as accepted until a person accepts it.
50
+ 10. **Store the accepted content**, then `SD docs generate` to render the
51
+ Markdown projection under `talks/`.
52
+ 11. **Derive tasks** from the accepted specifications with `SD derive`, and
53
+ present that plan for acceptance too. See the `task` skill.
54
+ 12. **Open the control center** with `SD ui`.
55
+
56
+ ## Production-readiness checklist
57
+
58
+ Discovery evaluates each applicable area. Silent gaps are invalid.
59
+
60
+ Product purpose and success criteria; users, roles, permissions and tenancy;
61
+ frontend delivery shape; navigation and information architecture; design system
62
+ and accessibility; backend boundaries; API style and public contracts;
63
+ authentication and session lifecycle; authorization enforcement; database and
64
+ data ownership; migrations and rollback; file or object storage; search and
65
+ indexing; real-time behavior; offline behavior and conflict handling;
66
+ background jobs and scheduling; events and webhooks; external integrations;
67
+ notifications; rate limiting and abuse controls; security and privacy;
68
+ compliance (only when explicitly declared); observability and operational
69
+ response; performance and capacity targets; environments and secret management;
70
+ CI and CD; infrastructure and deployment; backups, recovery, retention and
71
+ deletion; product analytics (only when approved); testing strategy for the
72
+ product; release and rollback.
73
+
74
+ Each area ends as exactly one of:
75
+
76
+ - **Applicable and specified.**
77
+ - **Applicable and awaiting a decision** (it becomes an owner question).
78
+ - **Not applicable, with a reason.**
79
+ - **Deferred, with owner, revisit trigger and consequence.**
80
+
81
+ "Not discussed" is not one of the four. An area nobody has looked at is an open
82
+ question, not an absence.
83
+
84
+ ## Questions
85
+
86
+ For each: plain language, why the answer matters, a recommended default, and an
87
+ example when it helps.
88
+
89
+ - Batch three to five related questions.
90
+ - Ask one at a time for architecture, data, security, identity, billing, or
91
+ anything irreversible.
92
+ - Accept "I do not know". Record the recommended default as a reversible
93
+ assumption with what would make it wrong.
94
+ - Do not front-load every feature question. A feature's questions belong to the
95
+ moment that feature enters discovery.
96
+
97
+ ## Adopting an existing project
98
+
99
+ - Existing documentation is never moved, rewritten, restructured or duplicated.
100
+ Adoption reads it and records what it found.
101
+ - Adopt the repository's conventions rather than imposing new ones.
102
+ - Label every inferred fact as inferred, with the file it came from. An
103
+ inference presented as a specification is a lie the project will inherit.
104
+ - Where detection is genuinely ambiguous, ask rather than guess.
105
+ - Reverse-engineering existing behavior into specifications is a Docs operation:
106
+ route to the `docs` skill for that, then store what is accepted.
107
+ - Migrating an existing documentation system into the generated projection is a
108
+ separate decision, taken later and deliberately. Never create two editable
109
+ copies of one specification.
110
+
111
+ ## Verify before handing back
112
+
113
+ - `SD db status` reports integrity, foreign keys and schema version cleanly.
114
+ - `SD status` shows the project, the accepted plan and a next action.
115
+ - `SD docs diff` is empty, or the pending proposals are explained.
116
+ - `.superdev/` is git-ignored, and no per-record tracking file was created
117
+ anywhere in the repository.
118
+ - Re-running `SD init` or `SD adopt` reports an existing project rather than
119
+ overwriting one.
120
+
121
+ Then hand back to the `project` skill. Initialization creates the container and
122
+ the plan; it does not build the product.
123
+
124
+ ## Boundaries
125
+
126
+ - Writes stay under the project root and under `.superdev/` plus generated
127
+ `talks/` documentation.
128
+ - No network installation happens here. Provider gaps are reported with their
129
+ remediation and consent is asked separately.
130
+ - Never store secrets, personal data, private identifiers or absolute machine
131
+ paths in a record or a generated file.
132
+ - A dirty worktree is preserved. Conflicts are surfaced, never forced past.
133
+
134
+ *Standalone note: on skills.sh, install the generated `superdev` package. It
135
+ carries the orchestrator, the Docs capability and the runtime, and needs no
136
+ repository. A single skill copied out on its own has no runtime; say which
137
+ command was unavailable rather than working around it silently.*
@@ -0,0 +1,261 @@
1
+ ---
2
+ name: project
3
+ description: The Superdev entry point for anything about building or understanding a product. Use when someone describes something they want built ("I want to build X"), asks to plan or implement a feature, asks what the project does or why it works a certain way, asks for status ("what is done?", "what is blocked?"), wants the control center opened, or when it is unclear which Superdev skill applies. Clarifies intent, routes to init or adopt, runs discovery, keeps goals, milestones, modules, features, workflows, APIs, data, decisions and tasks in the project database, derives tasks from accepted specifications, enforces the find-or-create, link, claim sequence before any product-changing work, records activity and completes work with evidence, and routes specialist work to its provider.
4
+ ---
5
+
6
+ # Superdev Project Orchestrator
7
+
8
+ The single entry point. People describe what they want in ordinary language.
9
+ You run the loop below, keep the database true, and route specialist work.
10
+ Nobody should have to learn a command name or a provider name.
11
+
12
+ `SD` below means:
13
+ the installed `superdev` command, with `--root <project>` on every call.
14
+ Full surface: `the plugin's skills/project/references/commands.md`.
15
+
16
+ ## What is authoritative
17
+
18
+ One normalized database at `.superdev/superdev.db` holds the product definition
19
+ and all execution state. Markdown under `talks/` is generated from it: a
20
+ projection, never a second place to write. `.superdev/` is git-ignored.
21
+
22
+ A manual edit to generated Markdown is never overwritten silently. It becomes a
23
+ proposal that a human reviews, and accepting it updates the database first.
24
+
25
+ ## Writing style, always
26
+
27
+ Never emit the em dash character (U+2014) and never emit emoji, in anything
28
+ Superdev writes or stores: records, documentation, commit messages it drafts,
29
+ interface copy, generated comments, summaries. Use a comma, colon, semicolon,
30
+ parentheses or a hyphen. This binds text taken from a provider too, so rewrite
31
+ it before storing it. Canonical writes are screened and refused with
32
+ `E_STYLE_EM_DASH` or `E_STYLE_EMOJI`.
33
+
34
+ ## The loop
35
+
36
+ Run in order. Skip a step only when it plainly does not apply, and say so.
37
+
38
+ 1. **Orient.** Read repository instructions, layout, manifests, routes, schemas,
39
+ git state. Never ask what the repository already answers.
40
+ 2. **Understand intent.** Build, plan, question, status, debug, review, docs,
41
+ decision, or an external action.
42
+ 3. **Check the project exists.** `SD status --json`. Nothing in the database
43
+ means new or unadopted, so go to **Starting a project**.
44
+ 4. **Check governing decisions.** `SD decision list --json`, then read the ones
45
+ touching this capability, its dependencies or its files. Surface a conflict
46
+ before proposing anything, never after.
47
+ 5. **Determine what is genuinely missing.** Only what changes the product.
48
+ 6. **Ask** per **Questions** below.
49
+ 7. **Update the model before building.** New or changed behavior is a
50
+ specification change first: feature, acceptance criteria, workflow steps,
51
+ surfaces and UI actions, API operations, data entities, migrations,
52
+ integrations, jobs, webhooks, permissions, NFRs. Route to the `feature`
53
+ skill for the interview and the depth choice.
54
+ 8. **Derive tasks** from the accepted specification, never from a feature title.
55
+ `SD derive <FEAT-id>`, then present the plan for acceptance. The feature is
56
+ positional: as a flag it is ignored and every accepted feature is derived.
57
+ 9. **Run the before-implementation sequence.** Below. It is not optional.
58
+ 10. **Implement** against the accepted specification: smallest sufficient
59
+ change, existing conventions preserved.
60
+ 11. **Verify for real.** Run the product's own required check and read its
61
+ output. Never claim a result you did not observe. Superdev itself has no
62
+ test suite, so never tell anyone to run tests for the plugin.
63
+ 12. **Complete with evidence.** Below.
64
+ 13. **Refresh.** The control center updates from the committed transaction and
65
+ waits for no Markdown rebuild. Run `SD docs generate` when accepted
66
+ specification content changed.
67
+ 14. **Report** the outcome and the single next action.
68
+
69
+ ## Starting a project
70
+
71
+ | Situation | Route |
72
+ |---|---|
73
+ | Empty or new repository, an idea, a brief, or a folder of notes | `SD init`, through the `init` skill |
74
+ | Existing code, existing docs, existing conventions | `SD adopt`, through the `init` skill |
75
+
76
+ Discovery belongs to `init`. What this skill guarantees is that implementation
77
+ does not start before there is an accepted plan: the high-level plan and the
78
+ material decisions are presented and accepted, stored in the database, rendered
79
+ to Markdown, and only then turned into tasks.
80
+
81
+ ## Before implementation
82
+
83
+ Before any product-changing work, in this order (brief section 12.2):
84
+
85
+ 1. **Search for an existing task.** `SD task list --status ready --json`, or
86
+ `SD task show <TASK-id>` when the user named one.
87
+ 2. **If none exists, create a draft task.**
88
+ `SD task create --feature <FEAT-id> --name <t>`.
89
+ 3. **Link it to a feature.** Mandatory. A task with no feature is invalid and
90
+ the database refuses it.
91
+ 4. **Link it to a contract**: workflow step, UI action, API operation, data
92
+ entity, migration, integration, job, webhook, NFR, document or accepted
93
+ decision. Links are passed on creation: `SD task create --link <kind>:<id>`. If the work is
94
+ genuinely enabling, mark it so and name the feature it unblocks:
95
+ `--enabling --unblocks <FEAT-id>`. The refusals `E_TASK_WITHOUT_CONTRACT`
96
+ and `E_ENABLING_WITHOUT_TARGET` are the database telling you the work is not
97
+ yet understood.
98
+ 5. **If no feature exists, stop.** Create or update the feature specification
99
+ first, through the `feature` skill. Do not invent a feature to satisfy the
100
+ constraint.
101
+ 6. **Check governing decisions** for this capability, dependency or path. A
102
+ conflict routes to the `decision` skill before any code changes.
103
+ 7. **Claim it.** `SD task claim <TASK-id>` records developer, agent, branch and
104
+ session.
105
+ 8. **Move it to In Progress.** `SD task update <TASK-id> --status in_progress`.
106
+
107
+ Lifecycle detail, categories, dependencies, subtasks and blocked work live in
108
+ the `task` skill.
109
+
110
+ ## During implementation
111
+
112
+ - Record meaningful activity at natural boundaries:
113
+ `SD task evidence <TASK-id> --summary "<what changed and why>"`. Every mutation
114
+ writes an activity event on its own, so do not narrate every file read or
115
+ shell command. The test is whether a human would want to read it.
116
+ - Scope changed? Update the specification and the task before continuing. New
117
+ work must not live only in conversation or in the code.
118
+ - Blocked? `SD task block <TASK-id> --reason <why>` immediately, not at the end.
119
+ - Behavior outside the accepted scope needs the feature and its docs updated
120
+ first.
121
+
122
+ ## Completion
123
+
124
+ Before completing a task:
125
+
126
+ 1. Run the product's required verification and observe the output.
127
+ 2. `SD task evidence <TASK-id> --summary <what was observed> --result <pass|fail|inconclusive> --reference <path or command>`, once per stated verification requirement, then `SD task complete <TASK-id>`.
128
+ 3. Update affected documentation with `SD docs generate`, then `SD docs diff` to
129
+ see whether anything on disk is now a pending proposal.
130
+ 4. Verify the related acceptance criteria are genuinely satisfied.
131
+ 5. Let dependent work reopen or proceed as the dependency graph says.
132
+ 6. The assignment releases on completion. Use `SD task release <TASK-id>` when
133
+ stepping away without finishing.
134
+ 7. Write the session outcome and the exact next action.
135
+
136
+ Parent progress is derived, never asserted. No command marks a feature,
137
+ milestone or goal complete. If a parent will not close, the open child work
138
+ named in `SD status` is the answer.
139
+
140
+ ## Task derivation
141
+
142
+ Tasks come from accepted specifications: acceptance criteria, workflow steps,
143
+ surfaces and UI actions, API operations, data entities and migrations,
144
+ integrations, jobs and webhooks, permissions, NFRs, observability, the product
145
+ test plan, documentation synchronization, rollout and rollback.
146
+
147
+ - Outcome sized, assignable, verifiable. Not one task per database row.
148
+ - Combine what must change together; split what can be delivered or blocked
149
+ independently.
150
+ - Each task states why it exists, what contract it implements, the expected
151
+ outcome, the boundaries it likely touches, completion criteria, verification
152
+ requirements, documentation impact and dependencies.
153
+ - Present the derived plan for acceptance before implementing any of it.
154
+ - A scope change updates the specification first, then regenerates a task delta.
155
+ - Never rewrite completed tasks. Supersede or reopen them with history.
156
+ - Product test work is derived from the accepted product test plan. Never create
157
+ a test task for the Superdev plugin itself.
158
+
159
+ ## Questions
160
+
161
+ Ask only what changes the product. For each: plain language, why the answer
162
+ matters, a recommended default, and an example when it helps. Accept "I do not
163
+ know", propose the safe default, and record it as a reversible assumption.
164
+
165
+ - Batch three to five related questions.
166
+ - Ask one at a time for architecture, data, security, identity, billing, or
167
+ anything irreversible.
168
+ - Never ask what you can safely infer from the repository.
169
+ - Ask a feature's questions when that feature enters discovery, not up front.
170
+
171
+ Owner questions are durable records. `SD question answer <Q-id> --answer
172
+ <text>` closes one. Unanswered material questions appear in `SD status` and in
173
+ the control center, so an open gap is never silent.
174
+
175
+ ## Providers
176
+
177
+ Specialist work is routed outward. These are externally owned: orchestrate them,
178
+ never reimplement, rename or approximate their methodology.
179
+
180
+ | Need | Provider |
181
+ |---|---|
182
+ | Product brainstorming | Superpowers brainstorming |
183
+ | High-level and implementation planning | Superpowers planning |
184
+ | Product-code test discipline | Superpowers TDD |
185
+ | Debugging | Superpowers systematic debugging |
186
+ | Code review and finishing a branch | Superpowers review and finish workflows |
187
+ | Frontend product direction | Frontend Design |
188
+ | UI critique, accessibility and polish | Impeccable |
189
+ | "Is there a skill for X?" | Find Skills and skills.sh |
190
+ | Reusable methodology observations | Task Observer |
191
+ | Secrets and environment stages | envx (names only, never values) |
192
+ | Transitional recall, when installed | Claude Mem (a cache, never authority) |
193
+
194
+ Rules:
195
+
196
+ - Check readiness first with `SD doctor`. It installs nothing.
197
+ - Never install without explicit consent to a named plan. No `--all`, no silent
198
+ `-y`, and strip those flags from any command you relay.
199
+ - A provider that did not run is named as not run, with its remediation. Work
200
+ you did yourself is never presented as that provider's methodology.
201
+ - Screen provider output before it enters the database: no secrets, no machine
202
+ paths, no em dash, no emoji, no private reasoning.
203
+ - Superdev's own local memory is the durable project memory. Claude Mem may
204
+ supplement recall during the transition and never becomes project authority.
205
+
206
+ ## Control center
207
+
208
+ `SD ui` opens the local control center and starts the service if it is not
209
+ running. `SD services` lists what is running; `SD start`, `SD stop` and
210
+ `SD restart` manage it. The interface reads only the local API and updates from
211
+ committed transactions, so it cannot show anything the database does not say.
212
+
213
+ Open it after initialization, after a derived task plan is accepted, and
214
+ whenever someone asks to see where the project stands.
215
+
216
+ ## Harness honesty
217
+
218
+ Correctness never depends on a lifecycle hook firing.
219
+
220
+ - Claude Code runs the Superdev session hooks, which show the active task and
221
+ persist handoff state.
222
+ - Codex hooks fire only after the user explicitly trusts them. Untrusted means
223
+ no lifecycle automation there.
224
+ - skills.sh has no lifecycle-hook guarantee at all.
225
+
226
+ Where hooks are not active, run the explicit commands: `SD resume` at session
227
+ start, the before-implementation sequence by hand, and `SD status` before any
228
+ handoff. Say which one you ran.
229
+
230
+ ## Routing to other skills
231
+
232
+ | Intent | Skill |
233
+ |---|---|
234
+ | Set up a new project or adopt an existing one | `init` |
235
+ | New or changed product behavior | `feature` |
236
+ | Task lifecycle: claim, block, reopen, derive | `task` |
237
+ | Where the project stands | `status` |
238
+ | Continue after a break or compaction | `resume` |
239
+ | Environment, providers, database health | `doctor` |
240
+ | Inspect, record or supersede a decision | `decision` |
241
+ | Something is failing | `debug` |
242
+ | Review a change before it lands | `review` |
243
+ | Documentation operation or template question | `docs` |
244
+
245
+ ## Boundaries
246
+
247
+ - Completion is evidence, never assertion. If a gate refuses, report why; do not
248
+ route around it.
249
+ - Never silently rewrite or delete a prior decision. Supersede it.
250
+ - Never put secrets, personal data, absolute machine paths or private
251
+ identifiers into a record or a generated file.
252
+ - Superdev is a development orchestrator, not a security sandbox. External,
253
+ destructive, publishing and installation actions need explicit confirmation on
254
+ top of the harness permission model.
255
+ - The plugin has no test suite, by design. Products built with Superdev do get
256
+ tests, derived from their accepted product test plan.
257
+
258
+ *Standalone note: on skills.sh, install the generated `superdev` package. It
259
+ carries the orchestrator, the Docs capability and the runtime, and needs no
260
+ repository. A single skill copied out on its own has no runtime; say which
261
+ command was unavailable rather than working around it silently.*
@@ -0,0 +1,213 @@
1
+ # Command surface
2
+
3
+ One entry point. Users never have to type these; the skills invoke them and
4
+ report the outcome in ordinary language.
5
+
6
+ ```
7
+ superdev <command> --root <project> [options]
8
+ ```
9
+
10
+ Always use that absolute plugin-root form. A bare relative path would resolve
11
+ against whatever the current working directory happens to be.
12
+
13
+ Conventions:
14
+
15
+ - `--root <project>` names the project root. Every command accepts it.
16
+ - `--json` gives machine-readable output for anything you need to parse.
17
+ - `--apply` performs the change. Without it, every mutating command prints its
18
+ plan and changes nothing.
19
+ - Exit `0` ok, `1` refused or findings present, `2` usage error.
20
+ - Mutations are one database transaction and each writes an activity event.
21
+ - **There is no per-command help.** `--help` is read before the command is
22
+ resolved, so `task list --help` prints the same global text as `--help`. This
23
+ file is the flag reference. If it disagrees with `src/cli.mjs`, the code wins
24
+ and this file is the bug.
25
+ - `--actor <name>` records who is responsible for the change and lands in the
26
+ permanent activity trail. It defaults to `superdev`.
27
+ - `--out <path>` writes this command's output to a file. It is global, not
28
+ specific to `export`, where it names the export file itself.
29
+ - An unrecognised flag is not refused by name. Every flag outside a small
30
+ boolean set is parsed as taking a value, so `--bogus` alone exits 2 asking for
31
+ one, and `--bogus TASK-0001` swallows the id and the command then complains it
32
+ was given none. If a command reports a missing argument you are sure you
33
+ passed, suspect the flag before the argument.
34
+
35
+ ## Project lifecycle
36
+
37
+ | Command | Purpose |
38
+ |---|---|
39
+ | `init [--idea <text>] [--brief <path>] [--name <text>] [--notes <text>]` | Detect new versus existing, run discovery, store accepted content, generate Markdown, derive tasks |
40
+ | `adopt` | Bring Superdev into a repository that already has code or documentation, without restructuring what is there |
41
+ | `plan [<FEAT-id>]` | The shape of the work: goals, milestones, modules, features, and what deriving would create. The optional feature narrows only the derivation preview, not the listing |
42
+ | `status` | Project state: active work, progress with its counts, blockers, freshness, next action |
43
+ | `readiness` | The production-readiness checklist, gap by gap |
44
+ | `resume [--objective <text>]` | Reconstruct working context from the database after a break, a new session, or compaction |
45
+ | `resume --end [--session <SES-id>] [--note <text>]` | Close the session and write its outcome. Without `--session` it ends the active one. `--note` applies only here |
46
+ | `doctor` | Storage engine, database, migration history, integrity, documentation, alignment and freshness |
47
+
48
+ `doctor` reports the storage engine, the project database and its
49
+ documentation. It does **not** report provider readiness or harness coverage.
50
+ Those come from a separate program:
51
+
52
+ ```
53
+ node "${CLAUDE_PLUGIN_ROOT}/scripts/doctor/doctor.mjs" inspect --root <project>
54
+ ```
55
+
56
+ The `doctor` skill covers both and says which answers which.
57
+
58
+ ## Service and control center
59
+
60
+ | Command | Purpose |
61
+ |---|---|
62
+ | `ui` | Open the local control center (starts the service if it is not running) |
63
+ | `start` / `stop` / `restart` | Manage the one local service for this project |
64
+ | `services` | List running Superdev services and their ports |
65
+
66
+ The service is local only, reads through its own HTTP API, and never reads
67
+ project files. The interface can show nothing the database does not say.
68
+
69
+ ## Database
70
+
71
+ | Command | Purpose |
72
+ |---|---|
73
+ | `db status` | Schema version, pending migrations, integrity, drift and row counts |
74
+ | `db migrate` | Apply ordered migrations (a backup is taken first) |
75
+ | `db backup [--label <text>]` | Rolling local backup under `.superdev/` |
76
+ | `db restore <file>` | Replace the database with a named backup |
77
+ | `export [--out <path>]` | Portable JSONL snapshot under `.superdev/` |
78
+ | `import <file>` | Load records from a verified export, inserting only what is absent |
79
+
80
+ `db migrate`, `db restore` and `import` all refuse while the control center is
81
+ running. The refusal names the command that frees the database.
82
+
83
+ `.superdev/` is git-ignored in full. Writing an export into the repository
84
+ happens only when the user explicitly asks for it.
85
+
86
+ ## Tasks
87
+
88
+ | Command | Purpose |
89
+ |---|---|
90
+ | `task list [--status <s>] [--feature <FEAT-id>] [--limit <n>] [--all]` | Find work. Oldest first |
91
+ | `task show <TASK-id>` | Full task: contract links, dependencies, subtasks, activity, evidence |
92
+ | `task create --feature <FEAT-id> --name <text> ...` | New task. See the full flag set below |
93
+ | `task update <TASK-id> [fields]` | Change scope or content. Cannot change status |
94
+ | `task claim <TASK-id> [--developer <DEV-id>] [--agent <AGT-id>] [--branch <BR-id>] [--session <SES-id>]` | Assign to this developer, agent, branch and session |
95
+ | `task start <TASK-id> [--note <text>] [--session <SES-id>]` | Move to In Progress |
96
+ | `task release <TASK-id> [--reason <why>]` | Give up the assignment without closing the task |
97
+ | `task block <TASK-id> --reason <why>` | Record a blocker immediately |
98
+ | `task unblock <TASK-id> [--to <status>] [--note <text>]` | Put a blocked task back where it was |
99
+ | `verify [--task <TASK-id>] [--limit <n>]` | Re-run the checks recorded evidence stands on |
100
+ | `task evidence <TASK-id> --summary <what was observed> [--result <pass\|fail\|inconclusive>] [--type <kind>] [--reference <path>] [--criterion <AC-id>] [--command <re-runnable check>]` | Record what verifying it actually showed |
101
+ | `task complete <TASK-id> [--note <text>]` | Close it, once its verification requirements have passing evidence |
102
+ | `task cancel <TASK-id> --reason <why>` | Stop work that should not continue |
103
+ | `task reopen <TASK-id> --reason <why> [--to <status>]` | Reopen with history preserved; never rewrite a completed task |
104
+ | `derive [<FEAT-id>]` | Derive the task plan from accepted specifications. The feature is positional, not a flag |
105
+
106
+ `task create` requires `--feature` and `--name`. Everything else is optional:
107
+ `--description`, `--outcome`, `--why`, `--criterion`, `--verify`, `--boundary`,
108
+ `--priority`, `--risk`, `--category`, `--estimate`, `--due`, `--parent`,
109
+ `--dependsOn`, `--link`, `--status`, and for enabling work `--enabling` with
110
+ `--enabledFeature` and `--rationale`. `--criterion`, `--verify`, `--boundary`,
111
+ `--dependsOn` and `--link` may be repeated.
112
+
113
+ `task update` accepts `--name`, `--description`, `--outcome`, `--why`,
114
+ `--priority`, `--risk`, `--estimate`, `--due`, `--parent`, `--rationale`,
115
+ `--enabledFeature`, `--criterion`, `--verify` and `--boundary`. It **refuses
116
+ `--status`**: status moves through `task claim`, `task start`, `task block`,
117
+ `task unblock`, `task complete` and `task reopen`, so every change leaves
118
+ history.
119
+
120
+ `task claim` flags take identifiers, not names. Passing a person's name gets a
121
+ refusal naming what does not exist. Leaving them off lets Superdev resolve the
122
+ identity itself, which is the normal case.
123
+
124
+ `task complete` records no evidence of its own. Evidence is a
125
+ `verification_evidence` record written by `task evidence`, and completion
126
+ refuses until every verification requirement the task states carries its own
127
+ passing one. So `task evidence` runs once per requirement, and a requirement
128
+ that could not be run takes `--result inconclusive`: that records the attempt
129
+ honestly and leaves the task open rather than closing it on silence.
130
+
131
+ Passing evidence against an acceptance criterion is the only thing that ever
132
+ marks that criterion met, and failing evidence takes it back to unmet.
133
+
134
+ Pass `--command` whenever a command proved it. `superdev verify` re-runs every
135
+ recorded command and marks the evidence stale when a check that used to pass
136
+ stops passing, so a task completed months ago can notice the ground moved.
137
+ Evidence with no command is not a failure: reading a screenshot or confirming a
138
+ decision with the owner are real checks that no command reproduces, and
139
+ inventing one to look rigorous is worse than saying the check is manual. A
140
+ command that cannot run is reported separately from one that ran and failed,
141
+ because a broken check says nothing about whether the product is correct.
142
+
143
+ Statuses, as printed: Draft, Ready, In Progress, In Review, Verifying, Blocked,
144
+ Paused, Complete, Cancelled, Superseded. Status history is append-only.
145
+
146
+ Those are display labels. Every flag that takes a status wants the stored value,
147
+ which is lower case with underscores: `in_progress`, not `In Progress`. Nothing
148
+ normalises them and nothing refuses an unknown one, so a filter written in the
149
+ printed form is not an error, it just quietly matches nothing.
150
+
151
+ Refusal codes worth recognizing:
152
+
153
+ - `E_TASK_WITHOUT_CONTRACT` - the task has no workflow step, UI action, API
154
+ operation, data entity, migration, integration, job, webhook, NFR, document or
155
+ decision behind it, and is not marked enabling.
156
+ - `E_ENABLING_WITHOUT_TARGET` - enabling work that names no feature it unblocks.
157
+ - `E_OPEN_SUBTASKS` - a parent cannot complete while required child work is open.
158
+ - `E_VERSION_CONFLICT` - the record changed under you. Re-read and retry.
159
+ - `E_DB_LOCKED` - another process holds the write lock. Retry; do not remove a
160
+ lock by hand.
161
+
162
+ ## Specifications
163
+
164
+ | Command | Purpose |
165
+ |---|---|
166
+ | `feature depth [<FEAT-id>]` | Whether each feature carries what its declared depth promises |
167
+ | `feature accept <FEAT-id>` | Accept a feature. Refused while its declared depth is unmet, naming everything missing at once |
168
+
169
+ ## Documentation
170
+
171
+ | Command | Purpose |
172
+ |---|---|
173
+ | `docs generate [--only <path>] [--reports]` | Render accepted database content to Markdown under `talks/`. `--reports` adds the summary, status and drift reports |
174
+ | `docs diff [<path>]` | Show manual edits to generated Markdown as pending proposals |
175
+ | `docs accept <path>` | Apply a reviewed proposal to the database, then regenerate |
176
+ | `docs reject <path>` | Discard the manual edit and write the generated version back |
177
+
178
+ Every generated file opens with a marker carrying its source record, database
179
+ revision, and body hash. An authored projection whose on-disk hash differs
180
+ raises a proposal and is never silently overwritten. Derived views (changelog,
181
+ status and drift reports) are always rewritten and carry a do-not-hand-edit
182
+ banner.
183
+
184
+ ## Knowledge
185
+
186
+ | Command | Purpose |
187
+ |---|---|
188
+ | `memory search <text> [--kind <k>] [--task <TASK-id>] [--feature <FEAT-id>] [--limit <n>]` | Session outcomes, facts, blockers, handoffs, with their links. The text is positional, or `--text` |
189
+ | `question answer <Q-id> <text>` | Answer a durable owner question. The answer is positional, or `--answer` |
190
+ | `decision record --title <t> --decision <what was decided> [--context <t>] [--rationale <t>] [--verification <t>] [--governs <type>:<id>] [--status <proposed\|accepted>]` | Record a decision |
191
+ | `decision supersede <DEC-id> --title <t> --decision <t> [--partial --scopeDelta <what stops applying>]` | Replace a decision that no longer holds |
192
+ | `decision list [--all]` | Decisions with status, scope and supersession chain |
193
+
194
+ ## Task categories
195
+
196
+ | Command | Purpose |
197
+ |---|---|
198
+ | `category list` | Categories, what they mean, and how many tasks use each |
199
+ | `category add <name> [--description <text>]` | Add a category of your own |
200
+ | `category rename <CAT-id> <name> [--description <text>]` | Rename one |
201
+ | `category describe <CAT-id> <text>` | Say what a category means in this project |
202
+ | `category retire <CAT-id>` | Take it off the pickable list, keeping history |
203
+ | `category restore <CAT-id>` | Put a retired one back |
204
+
205
+ Memory is recall, not authority. Verify a recalled fact against the current
206
+ specification, decision, code or evidence before acting on it.
207
+
208
+ ## What has no command, deliberately
209
+
210
+ Nothing marks a feature, milestone or goal complete directly. Parent status and
211
+ progress are derived from accepted contract components and completed child work.
212
+ If a parent will not close, the answer is the open child work that `status`
213
+ names, not a manual override.