@sushanglewis/lincoln 1.5.0 → 1.5.1

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 (305) hide show
  1. package/dist/main.d.ts +3 -0
  2. package/dist/main.js +1231 -906
  3. package/dist/main.js.map +1 -1
  4. package/dist/postinstall.d.ts +3 -0
  5. package/dist/postinstall.js +18 -0
  6. package/dist/postinstall.js.map +1 -0
  7. package/framework/.claude/agents/_contract.md +79 -0
  8. package/framework/.claude/agents/architect.md +31 -0
  9. package/framework/.claude/agents/default.md +151 -0
  10. package/framework/.claude/agents/designer.md +33 -0
  11. package/framework/.claude/agents/engineer.md +42 -0
  12. package/framework/.claude/agents/external/NOTICES.md +12 -0
  13. package/framework/.claude/agents/external/everything-claude-code.manifest.yaml +23 -0
  14. package/framework/.claude/agents/external/oh-my-claudecode.manifest.yaml +26 -0
  15. package/framework/.claude/agents/external/wshobson-agents.manifest.yaml +23 -0
  16. package/framework/.claude/agents/frontend-engineer.md +32 -0
  17. package/framework/.claude/agents/knowledge-curator.md +28 -0
  18. package/framework/.claude/agents/pm.md +38 -0
  19. package/framework/.claude/agents/qa.md +28 -0
  20. package/framework/.claude/agents/release-coordinator.md +25 -0
  21. package/framework/.claude/agents/researcher.md +41 -0
  22. package/framework/.claude/harnesses/claude-code.yaml +15 -0
  23. package/framework/.claude/harnesses/codex.yaml +40 -0
  24. package/framework/.claude/harnesses/command-map.yaml +255 -0
  25. package/framework/.claude/harnesses/opencode.yaml +32 -0
  26. package/framework/.claude/harnesses/scenarios.yaml +45 -0
  27. package/framework/.claude/hooks/on-pr-event.sh +69 -0
  28. package/framework/.claude/hooks/on-session-start.sh +427 -0
  29. package/framework/.claude/hooks/on-stop.sh +104 -0
  30. package/framework/.claude/hooks/post-tool-use.sh +161 -0
  31. package/framework/.claude/hooks/pre-tool-use.sh +246 -0
  32. package/framework/.claude/schemas/agent-definition.schema.json +35 -0
  33. package/framework/.claude/schemas/benchmark-report.schema.json +148 -0
  34. package/framework/.claude/schemas/pm-to-ux-handoff.schema.yaml +128 -0
  35. package/framework/.claude/schemas/stage-definition.schema.json +233 -0
  36. package/framework/.claude/schemas/workflow-stage.schema.json +86 -0
  37. package/framework/.claude/schemas/workflow-template.schema.json +88 -0
  38. package/framework/.claude/settings.json +14 -0
  39. package/framework/.claude/skills/build-product-prototype/SKILL.md +35 -0
  40. package/framework/.claude/skills/build-product-prototype/prompts/main.md +78 -0
  41. package/framework/.claude/skills/clarify-requirements/SKILL.md +32 -0
  42. package/framework/.claude/skills/clarify-requirements/prompts/main.md +81 -0
  43. package/framework/.claude/skills/dependencies.yaml +139 -0
  44. package/framework/.claude/skills/draft-product-design/SKILL.md +40 -0
  45. package/framework/.claude/skills/draft-product-design/prompts/main.md +47 -0
  46. package/framework/.claude/skills/lc-analyze-frameworks/SKILL.md +43 -0
  47. package/framework/.claude/skills/lc-analyze-frameworks/prompts/main.md +95 -0
  48. package/framework/.claude/skills/lc-benchmark/SKILL.md +61 -0
  49. package/framework/.claude/skills/lc-build-codebase-knowledge/SKILL.md +38 -0
  50. package/framework/.claude/skills/lc-build-codebase-knowledge/prompts/build-codebase-knowledge.md +61 -0
  51. package/framework/.claude/skills/lc-collect-intelligence/SKILL.md +43 -0
  52. package/framework/.claude/skills/lc-collect-intelligence/prompts/main.md +72 -0
  53. package/framework/.claude/skills/lc-competitive-analysis/SKILL.md +43 -0
  54. package/framework/.claude/skills/lc-competitive-analysis/prompts/main.md +70 -0
  55. package/framework/.claude/skills/lc-explore-opensource/SKILL.md +36 -0
  56. package/framework/.claude/skills/lc-explore-opensource/prompts/explore-opensource.md +77 -0
  57. package/framework/.claude/skills/lc-first-principles/SKILL.md +43 -0
  58. package/framework/.claude/skills/lc-first-principles/prompts/main.md +73 -0
  59. package/framework/.claude/skills/lc-handoff/SKILL.md +34 -0
  60. package/framework/.claude/skills/lc-init-branch/SKILL.md +52 -0
  61. package/framework/.claude/skills/lc-market-research/SKILL.md +43 -0
  62. package/framework/.claude/skills/lc-market-research/prompts/main.md +79 -0
  63. package/framework/.claude/skills/lc-product-research/SKILL.md +43 -0
  64. package/framework/.claude/skills/lc-product-research/prompts/main.md +80 -0
  65. package/framework/.claude/skills/lc-research-report/SKILL.md +43 -0
  66. package/framework/.claude/skills/lc-research-report/prompts/main.md +90 -0
  67. package/framework/.claude/skills/lc-research-scope/SKILL.md +43 -0
  68. package/framework/.claude/skills/lc-research-scope/prompts/main.md +82 -0
  69. package/framework/.claude/skills/lc-setup/SKILL.md +68 -0
  70. package/framework/.claude/skills/lc-setup/prompts/main.md +88 -0
  71. package/framework/.claude/skills/lc-stage/SKILL.md +45 -0
  72. package/framework/.claude/skills/lc-stakeholder-research/SKILL.md +43 -0
  73. package/framework/.claude/skills/lc-stakeholder-research/prompts/main.md +65 -0
  74. package/framework/.claude/skills/lc-status/SKILL.md +25 -0
  75. package/framework/.claude/skills/lc-storytelling/SKILL.md +43 -0
  76. package/framework/.claude/skills/lc-storytelling/prompts/main.md +77 -0
  77. package/framework/.claude/skills/lc-wf/SKILL.md +54 -0
  78. package/framework/.claude/skills/lc-workflow/SKILL.md +48 -0
  79. package/framework/.claude/skills/lc-workflow/validators/validate.py +755 -0
  80. package/framework/.claude/skills/lc-workflow-router/SKILL.md +41 -0
  81. package/framework/.claude/skills/lc-workflow-router/prompts/intake-prompt.md +91 -0
  82. package/framework/.claude/skills/lc-workflow-router/prompts/router-prompt.md +44 -0
  83. package/framework/.claude/skills/plan-tdd-development/SKILL.md +31 -0
  84. package/framework/.claude/skills/plan-tdd-development/prompts/main.md +44 -0
  85. package/framework/.claude/skills/process-interview/SKILL.md +32 -0
  86. package/framework/.claude/skills/process-interview/prompts/main.md +47 -0
  87. package/framework/.claude/skills/propose-with-openspec/SKILL.md +37 -0
  88. package/framework/.claude/skills/propose-with-openspec/prompts/main.md +53 -0
  89. package/framework/.claude/skills/split-to-github/SKILL.md +32 -0
  90. package/framework/.claude/skills/split-to-github/prompts/main.md +42 -0
  91. package/framework/.claude/skills/sync-to-knowledge/SKILL.md +35 -0
  92. package/framework/.claude/skills/sync-to-knowledge/prompts/main.md +54 -0
  93. package/framework/.claude/skills/workflow-continue/SKILL.md +24 -0
  94. package/framework/.claude/skills/workflow-continue/prompts/main.md +25 -0
  95. package/framework/.claude/stages/build-codebase-knowledge.yaml +42 -0
  96. package/framework/.claude/stages/clarify.yaml +59 -0
  97. package/framework/.claude/stages/explore-opensource.yaml +40 -0
  98. package/framework/.claude/stages/implement.yaml +60 -0
  99. package/framework/.claude/stages/ingest.yaml +40 -0
  100. package/framework/.claude/stages/lc-analyze-frameworks.yaml +37 -0
  101. package/framework/.claude/stages/lc-collect-intelligence.yaml +37 -0
  102. package/framework/.claude/stages/lc-competitive-analysis.yaml +37 -0
  103. package/framework/.claude/stages/lc-first-principles.yaml +37 -0
  104. package/framework/.claude/stages/lc-market-research.yaml +37 -0
  105. package/framework/.claude/stages/lc-product-research.yaml +37 -0
  106. package/framework/.claude/stages/lc-research-report.yaml +38 -0
  107. package/framework/.claude/stages/lc-research-scope.yaml +38 -0
  108. package/framework/.claude/stages/lc-stakeholder-research.yaml +37 -0
  109. package/framework/.claude/stages/lc-storytelling.yaml +37 -0
  110. package/framework/.claude/stages/product-design-docs.yaml +66 -0
  111. package/framework/.claude/stages/product-prototype.yaml +53 -0
  112. package/framework/.claude/stages/propose.yaml +45 -0
  113. package/framework/.claude/stages/split.yaml +41 -0
  114. package/framework/.claude/stages/sync-knowledge.yaml +49 -0
  115. package/framework/.claude/stages/tdd-development-plan.yaml +43 -0
  116. package/framework/.claude/stages/workflow-router.yaml +45 -0
  117. package/framework/.claude/templates/solo-workflow-context.yaml +23 -0
  118. package/framework/.claude/workflows/README.md +93 -0
  119. package/framework/.claude/workflows/bug-fix.yaml +81 -0
  120. package/framework/.claude/workflows/design-spike.yaml +55 -0
  121. package/framework/.claude/workflows/existing-project-iteration.yaml +106 -0
  122. package/framework/.claude/workflows/interview-to-knowledge.yaml +189 -0
  123. package/framework/.claude/workflows/oss-first-design.yaml +100 -0
  124. package/framework/.claude/workflows/pm-research.yaml +115 -0
  125. package/framework/.claude-plugin/hooks.json +6 -0
  126. package/framework/.claude-plugin/marketplace.json +32 -0
  127. package/framework/.claude-plugin/plugin.json +57 -0
  128. package/framework/.version-bump.json +43 -0
  129. package/framework/CLAUDE.md +140 -0
  130. package/framework/CONTRIBUTING.md +219 -0
  131. package/framework/LICENSE +21 -0
  132. package/framework/README.en.md +139 -0
  133. package/framework/README.md +139 -0
  134. package/framework/RELEASE.md +334 -0
  135. package/framework/SKILL.md +24 -0
  136. package/framework/USAGE.md +356 -0
  137. package/framework/manifest.json +1214 -0
  138. package/framework/requirements.txt +4 -0
  139. package/framework/scripts/__init__.py +0 -0
  140. package/framework/scripts/build_codebase_knowledge.py +76 -0
  141. package/framework/scripts/bump_version.py +181 -0
  142. package/framework/scripts/check-dependency-drift.py +69 -0
  143. package/framework/scripts/check-harness-drift.sh +57 -0
  144. package/framework/scripts/check-main-merge-hygiene.py +128 -0
  145. package/framework/scripts/check-skill-dependencies.sh +124 -0
  146. package/framework/scripts/init-lincoln-branch.sh +300 -0
  147. package/framework/scripts/init-project.sh +184 -0
  148. package/framework/scripts/lc-benchmark-cli.py +66 -0
  149. package/framework/scripts/lincoln-audit.py +288 -0
  150. package/framework/scripts/lincoln-setup.py +651 -0
  151. package/framework/scripts/lincoln-status.py +448 -0
  152. package/framework/scripts/lincoln_benchmark.py +224 -0
  153. package/framework/scripts/lincoln_benchmark_eval.py +104 -0
  154. package/framework/scripts/lincoln_benchmark_metrics.py +818 -0
  155. package/framework/scripts/lincoln_benchmark_report.py +141 -0
  156. package/framework/scripts/lincoln_command_map.py +289 -0
  157. package/framework/scripts/lincoln_dependency_manager.py +335 -0
  158. package/framework/scripts/lincoln_documents.py +175 -0
  159. package/framework/scripts/lincoln_harness_adapter.py +319 -0
  160. package/framework/scripts/lincoln_index.py +255 -0
  161. package/framework/scripts/lincoln_paths.py +198 -0
  162. package/framework/scripts/lincoln_prd.py +227 -0
  163. package/framework/scripts/lincoln_role.py +46 -0
  164. package/framework/scripts/lincoln_scenario.py +59 -0
  165. package/framework/scripts/lincoln_session_start_metrics.py +71 -0
  166. package/framework/scripts/lincoln_skill_prompt.py +48 -0
  167. package/framework/scripts/lincoln_trace.py +335 -0
  168. package/framework/scripts/lincoln_workflow.py +199 -0
  169. package/framework/scripts/list-active-lincoln-branches.sh +87 -0
  170. package/framework/scripts/package-lincoln-plugin.py +340 -0
  171. package/framework/scripts/run-infrastructure-tests.py +84 -0
  172. package/framework/scripts/stage_loader.py +1071 -0
  173. package/framework/scripts/static-check.sh +356 -0
  174. package/framework/scripts/sync-external-agents.sh +210 -0
  175. package/framework/scripts/sync-framework-package.mjs +218 -0
  176. package/framework/scripts/task_tool_guard.py +213 -0
  177. package/framework/scripts/track-artifacts.py +140 -0
  178. package/framework/scripts/validate_stage.py +350 -0
  179. package/{README.md → framework/tools/lincoln/README.md} +4 -4
  180. package/framework/tools/lincoln/package-lock.json +3349 -0
  181. package/framework/tools/lincoln/package.json +48 -0
  182. package/framework/tools/lincoln/src/cli.tsx +60 -0
  183. package/framework/tools/lincoln/src/components/AudioMeter.tsx +34 -0
  184. package/framework/tools/lincoln/src/components/CancelledScreen.tsx +11 -0
  185. package/framework/tools/lincoln/src/components/DevicesMenu.tsx +79 -0
  186. package/framework/tools/lincoln/src/components/HintBar.tsx +25 -0
  187. package/framework/tools/lincoln/src/components/LogView.tsx +36 -0
  188. package/framework/tools/lincoln/src/components/ModelMenu.tsx +122 -0
  189. package/framework/tools/lincoln/src/components/ReadyScreen.tsx +54 -0
  190. package/framework/tools/lincoln/src/components/RecordingApp.tsx +211 -0
  191. package/framework/tools/lincoln/src/components/RecordingScreen.tsx +41 -0
  192. package/framework/tools/lincoln/src/components/SelectMenu.tsx +53 -0
  193. package/framework/tools/lincoln/src/components/StatusPanel.tsx +52 -0
  194. package/framework/tools/lincoln/src/components/StopConfirmation.tsx +32 -0
  195. package/framework/tools/lincoln/src/config/args.ts +35 -0
  196. package/framework/tools/lincoln/src/config/loadConfig.ts +81 -0
  197. package/framework/tools/lincoln/src/config/resolveConfig.ts +85 -0
  198. package/framework/tools/lincoln/src/devices/listDevices.ts +11 -0
  199. package/framework/tools/lincoln/src/devices/parseDevices.ts +25 -0
  200. package/framework/tools/lincoln/src/hooks/useKeyHandler.ts +63 -0
  201. package/framework/tools/lincoln/src/main.tsx +4 -0
  202. package/framework/tools/lincoln/src/models/models.ts +34 -0
  203. package/framework/tools/lincoln/src/models/runWarmup.ts +46 -0
  204. package/framework/tools/lincoln/src/models/warmupProgress.ts +30 -0
  205. package/framework/tools/lincoln/src/recording/spawnRecorder.ts +127 -0
  206. package/framework/tools/lincoln/src/recording/useRecorder.ts +146 -0
  207. package/framework/tools/lincoln/src/utils/amplitudeToMeter.ts +4 -0
  208. package/framework/tools/lincoln/src/utils/formatDuration.ts +6 -0
  209. package/framework/tools/lincoln/src/utils/sessionId.ts +25 -0
  210. package/framework/tools/lincoln/tests/cli.test.tsx +52 -0
  211. package/framework/tools/lincoln/tests/components/AudioMeter.test.tsx +31 -0
  212. package/framework/tools/lincoln/tests/components/CancelledScreen.test.tsx +12 -0
  213. package/framework/tools/lincoln/tests/components/ReadyScreen.test.tsx +68 -0
  214. package/framework/tools/lincoln/tests/components/RecordingApp.menus.test.tsx +158 -0
  215. package/framework/tools/lincoln/tests/components/RecordingApp.test.tsx +248 -0
  216. package/framework/tools/lincoln/tests/components/RecordingScreen.test.tsx +37 -0
  217. package/framework/tools/lincoln/tests/components/SelectMenu.test.tsx +59 -0
  218. package/framework/tools/lincoln/tests/components/StopConfirmation.test.tsx +38 -0
  219. package/framework/tools/lincoln/tests/config/args.test.ts +49 -0
  220. package/framework/tools/lincoln/tests/config/loadConfig.test.ts +59 -0
  221. package/framework/tools/lincoln/tests/config/resolveConfig.test.ts +72 -0
  222. package/framework/tools/lincoln/tests/devices/parseDevices.test.ts +21 -0
  223. package/framework/tools/lincoln/tests/hooks/useKeyHandler.enabled.test.tsx +44 -0
  224. package/framework/tools/lincoln/tests/hooks/useKeyHandler.test.tsx +130 -0
  225. package/framework/tools/lincoln/tests/models/models.test.ts +27 -0
  226. package/framework/tools/lincoln/tests/models/warmupProgress.test.ts +25 -0
  227. package/framework/tools/lincoln/tests/recording/spawnRecorder.test.ts +85 -0
  228. package/framework/tools/lincoln/tests/recording/useRecorder.test.tsx +172 -0
  229. package/framework/tools/lincoln/tests/utils/amplitudeToMeter.test.ts +22 -0
  230. package/framework/tools/lincoln/tests/utils/formatDuration.test.ts +11 -0
  231. package/framework/tools/lincoln/tests/utils/sessionId.test.ts +30 -0
  232. package/framework/tools/lincoln/tsconfig.json +22 -0
  233. package/framework/tools/lincoln/tsconfig.tests.json +10 -0
  234. package/framework/tools/lincoln/tsup.config.ts +17 -0
  235. package/framework/tools/lincoln/vitest.config.ts +20 -0
  236. package/framework/tools/lincoln-installer/package-lock.json +3611 -0
  237. package/framework/tools/lincoln-installer/package.json +53 -0
  238. package/framework/tools/lincoln-installer/src/cli.tsx +63 -0
  239. package/framework/tools/lincoln-installer/src/components/HarnessSelectScreen.tsx +43 -0
  240. package/framework/tools/lincoln-installer/src/components/InstallerApp.tsx +98 -0
  241. package/framework/tools/lincoln-installer/src/components/OptionsScreen.tsx +56 -0
  242. package/framework/tools/lincoln-installer/src/components/ProgressScreen.tsx +25 -0
  243. package/framework/tools/lincoln-installer/src/components/ResultScreen.tsx +40 -0
  244. package/framework/tools/lincoln-installer/src/components/SelectMenu.tsx +73 -0
  245. package/framework/tools/lincoln-installer/src/components/SummaryScreen.tsx +49 -0
  246. package/framework/tools/lincoln-installer/src/components/UpdateApp.tsx +135 -0
  247. package/framework/tools/lincoln-installer/src/components/WelcomeScreen.tsx +22 -0
  248. package/framework/tools/lincoln-installer/src/config/args.ts +76 -0
  249. package/framework/tools/lincoln-installer/src/config/resolveConfig.ts +33 -0
  250. package/framework/tools/lincoln-installer/src/config/updateArgs.ts +67 -0
  251. package/framework/tools/lincoln-installer/src/hooks/useSetup.ts +149 -0
  252. package/framework/tools/lincoln-installer/src/main.tsx +11 -0
  253. package/framework/tools/lincoln-installer/src/types.ts +19 -0
  254. package/framework/tools/lincoln-installer/src/update-main.tsx +11 -0
  255. package/framework/tools/lincoln-installer/src/update.tsx +90 -0
  256. package/framework/tools/lincoln-installer/src/utils/detectHarness.ts +51 -0
  257. package/framework/tools/lincoln-installer/src/utils/runSetup.ts +62 -0
  258. package/framework/tools/lincoln-installer/src/utils/updateRelease.ts +454 -0
  259. package/framework/tools/lincoln-installer/tests/components/InstallerApp.test.tsx +88 -0
  260. package/framework/tools/lincoln-installer/tests/components/SelectMenu.test.tsx +26 -0
  261. package/framework/tools/lincoln-installer/tests/components/UpdateApp.test.tsx +170 -0
  262. package/framework/tools/lincoln-installer/tests/components/screens.test.tsx +310 -0
  263. package/framework/tools/lincoln-installer/tests/config/args.test.ts +66 -0
  264. package/framework/tools/lincoln-installer/tests/config/resolveConfig.test.ts +75 -0
  265. package/framework/tools/lincoln-installer/tests/config/updateArgs.test.ts +52 -0
  266. package/framework/tools/lincoln-installer/tests/hooks/useSetup.test.tsx +213 -0
  267. package/framework/tools/lincoln-installer/tests/update.test.tsx +108 -0
  268. package/framework/tools/lincoln-installer/tests/utils/detectHarness.test.ts +40 -0
  269. package/framework/tools/lincoln-installer/tests/utils/runSetup.test.ts +45 -0
  270. package/framework/tools/lincoln-installer/tests/utils/updateRelease.test.ts +559 -0
  271. package/framework/tools/lincoln-installer/tsconfig.json +22 -0
  272. package/framework/tools/lincoln-installer/tsconfig.tests.json +8 -0
  273. package/framework/tools/lincoln-installer/tsup.config.ts +17 -0
  274. package/framework/tools/lincoln-installer/vitest.config.ts +20 -0
  275. package/framework/tools/lincoln-record/Cargo.lock +1896 -0
  276. package/framework/tools/lincoln-record/Cargo.toml +24 -0
  277. package/framework/tools/lincoln-record/diarize/diarize.py +117 -0
  278. package/framework/tools/lincoln-record/diarize/merge.py +55 -0
  279. package/framework/tools/lincoln-record/src/audio/capture/microphone.rs +194 -0
  280. package/framework/tools/lincoln-record/src/audio/capture/mod.rs +1 -0
  281. package/framework/tools/lincoln-record/src/audio/devices.rs +20 -0
  282. package/framework/tools/lincoln-record/src/audio/mod.rs +5 -0
  283. package/framework/tools/lincoln-record/src/audio/resampler.rs +44 -0
  284. package/framework/tools/lincoln-record/src/audio/saver.rs +87 -0
  285. package/framework/tools/lincoln-record/src/audio/source.rs +104 -0
  286. package/framework/tools/lincoln-record/src/cli.rs +96 -0
  287. package/framework/tools/lincoln-record/src/config.rs +135 -0
  288. package/framework/tools/lincoln-record/src/lib.rs +6 -0
  289. package/framework/tools/lincoln-record/src/main.rs +242 -0
  290. package/framework/tools/lincoln-record/src/model/mod.rs +248 -0
  291. package/framework/tools/lincoln-record/src/output/metadata.rs +30 -0
  292. package/framework/tools/lincoln-record/src/output/mod.rs +2 -0
  293. package/framework/tools/lincoln-record/src/output/transcript.rs +42 -0
  294. package/framework/tools/lincoln-record/src/transcription/diarization.rs +64 -0
  295. package/framework/tools/lincoln-record/src/transcription/mod.rs +3 -0
  296. package/framework/tools/lincoln-record/src/transcription/provider.rs +43 -0
  297. package/framework/tools/lincoln-record/src/transcription/whisper.rs +176 -0
  298. package/framework/tools/lincoln-record/tests/cli_args.rs +103 -0
  299. package/framework/tools/lincoln-record/tests/config_test.rs +70 -0
  300. package/framework/tools/lincoln-record/tests/devices_test.rs +23 -0
  301. package/framework/tools/lincoln-record/tests/diarization_tests.rs +101 -0
  302. package/framework/tools/lincoln-record/tests/integration_tests.rs +44 -0
  303. package/framework/tools/lincoln-record/tests/model_test.rs +68 -0
  304. package/framework/tools/lincoln-record/tests/transcription_tests.rs +73 -0
  305. package/package.json +19 -13
@@ -0,0 +1,233 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://lincoln-framework.dev/schemas/stage-definition.schema.json",
4
+ "title": "Lincoln Stage Definition Schema",
5
+ "description": "Validates a single Lincoln stage YAML file under .claude/stages/.",
6
+ "type": "object",
7
+ "required": [
8
+ "schema_version",
9
+ "id",
10
+ "name",
11
+ "description",
12
+ "templates",
13
+ "prerequisite_stage",
14
+ "next_stage",
15
+ "human_gate",
16
+ "agent",
17
+ "skills",
18
+ "artifacts",
19
+ "context",
20
+ "gates"
21
+ ],
22
+ "properties": {
23
+ "schema_version": {
24
+ "type": "string",
25
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
26
+ "description": "Semantic version of the stage schema"
27
+ },
28
+ "id": {
29
+ "type": "string",
30
+ "pattern": "^[a-z][a-z0-9-]*$",
31
+ "description": "Kebab-case stage identifier"
32
+ },
33
+ "name": {
34
+ "type": "string",
35
+ "minLength": 1,
36
+ "description": "Human-readable stage name"
37
+ },
38
+ "description": {
39
+ "type": "string",
40
+ "minLength": 1,
41
+ "description": "What this stage does and when it is triggered"
42
+ },
43
+ "templates": {
44
+ "oneOf": [
45
+ {
46
+ "type": "string",
47
+ "enum": ["all"],
48
+ "description": "This stage applies to all workflow templates"
49
+ },
50
+ {
51
+ "type": "array",
52
+ "items": {
53
+ "type": "string",
54
+ "pattern": "^[a-z][a-z0-9-]*$"
55
+ },
56
+ "minItems": 1,
57
+ "description": "List of workflow template IDs that include this stage"
58
+ }
59
+ ]
60
+ },
61
+ "prerequisite_stage": {
62
+ "oneOf": [
63
+ { "type": "string", "pattern": "^[a-z][a-z0-9-/]*$" },
64
+ { "type": "null" }
65
+ ],
66
+ "description": "Stage that must complete before this one, or null for entry stages"
67
+ },
68
+ "next_stage": {
69
+ "oneOf": [
70
+ { "type": "string", "pattern": "^[a-z][a-z0-9-/]*$" },
71
+ { "type": "null" }
72
+ ],
73
+ "description": "Stage that follows this one, or null for terminal stages"
74
+ },
75
+ "human_gate": {
76
+ "type": "boolean",
77
+ "description": "Whether human approval is required to exit this stage"
78
+ },
79
+ "agent": {
80
+ "type": "object",
81
+ "required": ["primary"],
82
+ "properties": {
83
+ "primary": {
84
+ "type": "string",
85
+ "pattern": "^[a-z][a-z0-9-]*$",
86
+ "description": "Primary agent role for this stage"
87
+ },
88
+ "reviewers": {
89
+ "type": "array",
90
+ "items": {
91
+ "type": "string",
92
+ "pattern": "^[a-z][a-z0-9-]*$"
93
+ },
94
+ "default": [],
95
+ "description": "Optional reviewer agent roles"
96
+ },
97
+ "handoff_to": {
98
+ "oneOf": [
99
+ { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
100
+ { "type": "null" }
101
+ ],
102
+ "description": "Agent role to hand off to at stage end"
103
+ }
104
+ },
105
+ "additionalProperties": false
106
+ },
107
+ "skills": {
108
+ "type": "object",
109
+ "required": ["required"],
110
+ "properties": {
111
+ "required": {
112
+ "type": "array",
113
+ "items": {
114
+ "type": "string",
115
+ "pattern": "^[a-z][a-z0-9-]*(:[a-z][a-z0-9-]*)*$"
116
+ },
117
+ "default": [],
118
+ "description": "Skills that must be available for this stage"
119
+ },
120
+ "optional": {
121
+ "type": "array",
122
+ "items": {
123
+ "type": "string",
124
+ "pattern": "^[a-z][a-z0-9-]*(:[a-z][a-z0-9-]*)*$"
125
+ },
126
+ "default": [],
127
+ "description": "Skills that may be used but are not mandatory"
128
+ }
129
+ },
130
+ "additionalProperties": false
131
+ },
132
+ "artifacts": {
133
+ "type": "object",
134
+ "required": ["required"],
135
+ "properties": {
136
+ "required": {
137
+ "type": "array",
138
+ "items": {
139
+ "type": "string",
140
+ "minLength": 1
141
+ },
142
+ "default": [],
143
+ "description": "Path templates for artifacts that must be produced"
144
+ },
145
+ "optional": {
146
+ "type": "array",
147
+ "items": {
148
+ "type": "string",
149
+ "minLength": 1
150
+ },
151
+ "default": [],
152
+ "description": "Path templates for optional artifacts"
153
+ }
154
+ },
155
+ "additionalProperties": false
156
+ },
157
+ "context": {
158
+ "type": "object",
159
+ "required": ["goal"],
160
+ "properties": {
161
+ "goal": {
162
+ "type": "string",
163
+ "minLength": 1,
164
+ "description": "What the agent should achieve in this stage"
165
+ },
166
+ "entry": {
167
+ "type": "string",
168
+ "description": "Checks and preparation before stage execution"
169
+ },
170
+ "execution": {
171
+ "type": "string",
172
+ "description": "How to perform the stage work"
173
+ },
174
+ "exit": {
175
+ "type": "string",
176
+ "description": "AI-evaluable criteria for completing the stage"
177
+ },
178
+ "constraints": {
179
+ "type": "string",
180
+ "description": "Additional constraints and guardrails"
181
+ }
182
+ },
183
+ "additionalProperties": false
184
+ },
185
+ "gates": {
186
+ "type": "object",
187
+ "properties": {
188
+ "entry": {
189
+ "type": "array",
190
+ "items": { "$ref": "#/definitions/gateCheck" },
191
+ "default": []
192
+ },
193
+ "exit": {
194
+ "type": "array",
195
+ "items": { "$ref": "#/definitions/gateCheck" },
196
+ "default": []
197
+ }
198
+ },
199
+ "additionalProperties": false
200
+ }
201
+ },
202
+ "additionalProperties": false,
203
+ "definitions": {
204
+ "gateCheck": {
205
+ "type": "object",
206
+ "required": ["check"],
207
+ "properties": {
208
+ "check": {
209
+ "type": "string",
210
+ "enum": [
211
+ "file_exists",
212
+ "artifact_exists",
213
+ "artifacts_present",
214
+ "audio_format_supported",
215
+ "previous_stage_completed",
216
+ "human_approved",
217
+ "gate_review_passed",
218
+ "handoff_contract_valid",
219
+ "handoff_versions_match",
220
+ "prd_has_required_sections",
221
+ "prd_snapshot_present"
222
+ ]
223
+ },
224
+ "args": {
225
+ "type": "array",
226
+ "items": { "type": "string" },
227
+ "default": []
228
+ }
229
+ },
230
+ "additionalProperties": false
231
+ }
232
+ }
233
+ }
@@ -0,0 +1,86 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://lincoln-framework.dev/schemas/workflow-stage.schema.json",
4
+ "title": "Lincoln Workflow Stage State Schema",
5
+ "description": "Validates branch-scoped workflow-stage.yaml files that track stage progression in append-only node history.",
6
+ "type": "object",
7
+ "required": ["schema_version", "workflow", "current_run", "nodes"],
8
+ "properties": {
9
+ "schema_version": {
10
+ "type": "string",
11
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
12
+ },
13
+ "workflow": {
14
+ "type": "object",
15
+ "required": ["name", "version", "template"],
16
+ "properties": {
17
+ "name": { "type": "string" },
18
+ "version": { "type": "string" },
19
+ "template": { "type": "string" }
20
+ }
21
+ },
22
+ "current_run": {
23
+ "type": "object",
24
+ "required": ["run_id", "branch", "current_stage", "status", "variables"],
25
+ "properties": {
26
+ "run_id": { "type": "string" },
27
+ "branch": { "type": "string" },
28
+ "current_stage": { "type": "string" },
29
+ "status": {
30
+ "type": "string",
31
+ "enum": ["not_started", "in_progress", "paused", "waiting_for_human", "validation_failed", "completed"]
32
+ },
33
+ "started_at": { "type": "string" },
34
+ "last_updated_at": { "type": "string" },
35
+ "issue_number": { "type": "string" },
36
+ "execution_mode": { "type": "string", "enum": ["solo", "team"] },
37
+ "variables": {
38
+ "type": "object",
39
+ "properties": {
40
+ "session_id": { "type": "string" },
41
+ "design_id": { "type": "string" },
42
+ "change_name": { "type": "string" },
43
+ "issue_number": { "type": "string" },
44
+ "pr_number": { "type": "string" },
45
+ "feature_slug": { "type": "string" }
46
+ }
47
+ }
48
+ }
49
+ },
50
+ "nodes": {
51
+ "type": "array",
52
+ "items": { "$ref": "#/definitions/nodeEntry" }
53
+ },
54
+ "recovery": {
55
+ "type": "object",
56
+ "properties": {
57
+ "last_validated_checkpoint": { "type": "string" },
58
+ "can_resume_from": { "type": "string" },
59
+ "abort_reason": { "type": ["string", "null"] },
60
+ "abort_at": { "type": ["string", "null"] }
61
+ }
62
+ }
63
+ },
64
+ "definitions": {
65
+ "nodeEntry": {
66
+ "type": "object",
67
+ "required": ["node_id", "status"],
68
+ "properties": {
69
+ "node_id": { "type": "string" },
70
+ "status": {
71
+ "type": "string",
72
+ "enum": ["not_started", "in_progress", "paused", "waiting_for_human", "validation_failed", "completed", "pr_submitted", "merged"]
73
+ },
74
+ "started_at": { "type": "string" },
75
+ "completed_at": { "type": "string" },
76
+ "handoff_file": { "type": "string" },
77
+ "artifacts": {
78
+ "type": "array",
79
+ "items": { "type": "string" }
80
+ },
81
+ "gate_passed": { "type": "boolean" },
82
+ "approved_by": { "type": "string" }
83
+ }
84
+ }
85
+ }
86
+ }
@@ -0,0 +1,88 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://lincoln-framework.dev/schemas/workflow-template.schema.json",
4
+ "title": "Lincoln Workflow Template Schema",
5
+ "description": "Validates workflow template YAML files under .claude/workflows/.",
6
+ "type": "object",
7
+ "required": ["workflow"],
8
+ "properties": {
9
+ "workflow": {
10
+ "type": "object",
11
+ "required": ["name", "version", "description", "execution_mode", "steps"],
12
+ "properties": {
13
+ "name": { "type": "string" },
14
+ "version": { "type": "string" },
15
+ "description": { "type": "string" },
16
+ "execution_mode": { "type": "string", "enum": ["solo", "team"] },
17
+ "engine": { "type": "string" },
18
+ "loop": {
19
+ "type": "object",
20
+ "properties": {
21
+ "engine": { "type": "string" },
22
+ "state_file": { "type": "string" },
23
+ "on_failure": { "type": "string" },
24
+ "max_retries": { "type": "integer" }
25
+ }
26
+ },
27
+ "conventions": {
28
+ "type": "object",
29
+ "properties": {
30
+ "language": { "type": "string" },
31
+ "artifact_encoding": { "type": "string" },
32
+ "timestamp_format": { "type": "string" },
33
+ "session_id_pattern": { "type": "string" }
34
+ }
35
+ },
36
+ "steps": {
37
+ "type": "array",
38
+ "items": { "$ref": "#/definitions/step" }
39
+ },
40
+ "gates": {
41
+ "type": "object",
42
+ "properties": {
43
+ "human_confirmation_prompt": { "type": "string" },
44
+ "on_validation_failure": { "type": "string" },
45
+ "on_human_rejection": { "type": "string" }
46
+ }
47
+ }
48
+ }
49
+ }
50
+ },
51
+ "definitions": {
52
+ "step": {
53
+ "type": "object",
54
+ "required": ["id", "name", "description"],
55
+ "properties": {
56
+ "id": { "type": "string" },
57
+ "name": { "type": "string" },
58
+ "description": { "type": "string" },
59
+ "entry_checks": {
60
+ "type": "array",
61
+ "items": { "$ref": "#/definitions/check" }
62
+ },
63
+ "exit_checks": {
64
+ "type": "array",
65
+ "items": { "$ref": "#/definitions/check" }
66
+ },
67
+ "action": { "type": "string" },
68
+ "human_gate": { "type": "boolean" },
69
+ "artifacts": {
70
+ "type": "array",
71
+ "items": { "type": "string" }
72
+ },
73
+ "trigger": { "type": "string" }
74
+ }
75
+ },
76
+ "check": {
77
+ "type": "object",
78
+ "required": ["check"],
79
+ "properties": {
80
+ "check": { "type": "string" },
81
+ "args": {
82
+ "type": "array",
83
+ "items": { "type": "string" }
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "hooks": {
3
+ "SessionStart": ".claude/hooks/on-session-start.sh",
4
+ "Stop": ".claude/hooks/on-stop.sh",
5
+ "PreToolUse": ".claude/hooks/pre-tool-use.sh",
6
+ "PostToolUse": ".claude/hooks/post-tool-use.sh"
7
+ },
8
+ "lincoln": {
9
+ "state_file": "<process_slug>/workflow-stage.yaml",
10
+ "legacy_state_file": ".claude/workflow-state.yaml",
11
+ "auto_install_dependencies": false,
12
+ "dependency_check_on_startup": true
13
+ }
14
+ }
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: build-product-prototype
3
+ description: 基于已确认设计文档生成字段、界面规格和 Pencil 原型
4
+ triggers:
5
+ - "生成产品原型"
6
+ - "build-product-prototype"
7
+ inputs:
8
+ - name: session_id
9
+ description: 访谈会话 ID
10
+ required: true
11
+ - name: design_id
12
+ description: 产品设计 ID
13
+ required: true
14
+ outputs:
15
+ - "{process_slug}/pages/docs/fields.html"
16
+ - "{process_slug}/pages/docs/ui-spec.html"
17
+ - "{process_slug}/designs/{design_id}/prototype.pen"
18
+ - "{process_slug}/pages/prototype/**/*.html"
19
+ required_tools:
20
+ - Read
21
+ - Bash
22
+ - Write
23
+ - mcp__pencil__batch_design
24
+ ---
25
+
26
+ # build-product-prototype
27
+
28
+ ## Purpose
29
+
30
+ Using [build-product-prototype] to 基于已确认设计文档生成字段、界面规格和 Pencil 原型.
31
+
32
+
33
+ 基于已确认设计文档生成字段规格、UI 规格和 Pencil 原型。
34
+
35
+ 运行入口: prompts/main.md
@@ -0,0 +1,78 @@
1
+ # build-product-prototype
2
+
3
+ You are executing the Lincoln workflow step `product-prototype`: turn approved product design documents into UI/field specifications and an interactive HTML prototype.
4
+
5
+ ## Goal
6
+
7
+ Create field and UI specifications as HTML doc pages, and produce a high-fidelity interactive HTML prototype that the PM can inspect directly in the issue-package portal (`{process_slug}/index.html`). A Pencil prototype is optional; the HTML prototype is the primary review artifact.
8
+
9
+ ## Reference templates
10
+
11
+ Use the following read-only templates as the style/layout reference. Copy/adapt them into the issue package; do not modify the templates themselves.
12
+
13
+ - `.claude/templates/issue-package/page-prototype.html.tpl` — minimal starter page with theme sync support.
14
+ - `.claude/templates/issue-package/prototypes/app/main/page.html.tpl` — main app window with sidebar + WebView placeholder.
15
+ - `.claude/templates/issue-package/prototypes/app/onboarding/page.html.tpl` — login/onboarding card.
16
+ - `.claude/templates/issue-package/prototypes/app/settings/page.html.tpl` — two-column settings page.
17
+ - `.claude/templates/issue-package/prototypes/app/overlays/page.html.tpl` — avatar menu / about / toast overlays.
18
+ - `.claude/templates/issue-package/prototypes/app/tray/page.html.tpl` — system-tray scenario controller. When the product has a macOS menubar presence, create thin scenario pages under `pages/prototype/app/tray/` showing at minimum: default state, unread-badge state, and menu-open state. These pages must **not** redraw the tray inside the app prototype; instead they send `postMessage({type:'lincoln-tray-state', unread:<int>, open:<bool>}, '*')` to the portal so the portal-level macOS tray updates. See the tray template for the exact snippet.
19
+ - `.claude/templates/issue-package/prototypes/app/org/page.html.tpl` — organization list.
20
+ - `.claude/templates/issue-package/prototypes/web/dashboard/page.html.tpl` — web dashboard shell.
21
+ - `.claude/templates/issue-package/prototypes/web/list/page.html.tpl` — web list view shell.
22
+ - `.claude/templates/issue-package/prototypes/web/form/page.html.tpl` — web form shell.
23
+ - `.claude/templates/issue-package/prototypes/web/detail/page.html.tpl` — web detail shell.
24
+ - `.claude/templates/issue-package/prototypes/mobile/home/page.html.tpl` — mobile home feed shell.
25
+ - `.claude/templates/issue-package/prototypes/mobile/chat/page.html.tpl` — mobile chat shell.
26
+ - `.claude/templates/issue-package/prototypes/mobile/settings/page.html.tpl` — mobile settings list shell.
27
+ - `.claude/templates/issue-package/prototypes/mobile/profile/page.html.tpl` — mobile profile shell.
28
+ - `.claude/templates/issue-package/assets/prototype.css` — shared styles (tokens, dark mode, window shell, sidebar, forms, overlays, web/mobile shells).
29
+ - `.claude/templates/issue-package/assets/prototype.js` — shared UI builders and mock data (`window.LincolnPrototype`), including `frameApp`, `frameWeb`, `frameMobile`.
30
+
31
+ ## Input
32
+
33
+ - `session_id`: the interview session identifier
34
+ - `design_id`: the product design identifier
35
+
36
+ ## Steps
37
+
38
+ 1. Verify `{process_slug}/pages/docs/design-review.html` contains `<!-- status: approved -->` or `[x] PM 已确认设计文档`.
39
+ 2. Read the approved design package under `{process_slug}/pages/docs/`, including `flows.html` and `page-map.html`.
40
+ 3. Write `{process_slug}/pages/docs/fields.html` using `.claude/templates/issue-package/page-doc.html.tpl` with screen/form fields, data type, required/optional status, validation, default value, copy, error state, and source data object.
41
+ 4. Write `{process_slug}/pages/docs/ui-spec.html` covering the interaction-document delivery standards:
42
+ - 用户场景与流程: who, when, goal, trigger, completion criteria.
43
+ - 界面流转图: screen-to-screen flow mapped to the business flow in `flows.html`.
44
+ - 页面交互说明: per-screen layout elements, interaction rules (events, responses, navigation), and field validation/error handling.
45
+ - 交互 Demo/原型: links to the HTML prototype pages under `pages/prototype/` and a summary of key interactions.
46
+ 5. **Plan prototype generation granularity.** Before writing prototype pages, list every screen from `flows.html` and `page-map.html`. Group them into cohesive clusters (e.g. onboarding, main shell, settings, overlays, tray). Generate one cluster at a time. After each cluster, verify that every page in the cluster has complete annotation meta tags before starting the next cluster. This prevents agent context exhaustion and keeps each page's documentation and interactions complete.
47
+ 6. Create interactive HTML prototypes under `{process_slug}/pages/prototype/{app,web,mobile}/` by adapting the reference templates above. Pick the right shell (`frameApp`, `frameWeb`, or `frameMobile`) from `LincolnPrototype.ui` for the product form-factor. Every page must:
48
+ - Link to `../../../assets/prototype.css` and `../../../assets/prototype.js` (depth 3) or `../../../../assets/...` (depth 4) depending on its path.
49
+ - Include the theme sync IIFE shown in the starter template.
50
+ - Include `<meta name="prototype-base" content="../../../">` (or `../../../../` for depth 4).
51
+ - Include `<meta name="page-uid" content="...">`, `<meta name="nav-group" content="...">`, and `<meta name="nav-label" content="...">` with a short Chinese label for the left nav.
52
+ - Include the annotation meta tags `doc-purpose`, `doc-layout`, `doc-fields`, `doc-boundaries`, `doc-exceptions`. Also include `doc-stories`, `doc-rules`, `doc-refs` when they add clarity, so the portal right panel explains functionality, layout, fields, boundary cases, and exception flows.
53
+ - Use `LincolnPrototype.ui` builders and `prototype.css` tokens for every visual element so both light and dark themes render correctly; verify both themes by toggling the portal theme switch.
54
+ - Assign a stable `data-uid` attribute to every interactive element, screen region, and WebView placeholder.
55
+ - Override `LincolnPrototype.data` in the page script for issue-specific mock data (user, org, webviews, settings, unread items).
56
+ 7. Optionally create or update `{process_slug}/designs/<design_id>/prototype.pen` with Pencil tools if the PM explicitly asks for a Pencil prototype. If you use Pencil tools, call `get_editor_state(include_schema: true)` first and use `snapshot_layout` to check for clipping/overlap.
57
+ 8. Update the root `{process_slug}/pages/docs/prd.html` section 9 "相关产物链接" with the `ui-spec.html`, `fields.html`, and HTML prototype links. If the PRD already has an approved snapshot, warn the PM that changes require a version bump and re-freeze via `python scripts/lincoln_prd.py freeze`.
58
+ 9. Ask the PM to open `{process_slug}/index.html` in a browser, toggle the theme switch in the macOS menubar, and review both light and dark renderings of each prototype page inside the portal.
59
+ 10. When the PM confirms the prototype, add `<!-- prototype-status: approved -->` to `ui-spec.html`.
60
+ 11. Run `python scripts/stage_loader.py --stage product-prototype --action record-artifacts`.
61
+
62
+ ## Output Artifacts
63
+
64
+ - `{process_slug}/pages/docs/fields.html`
65
+ - `{process_slug}/pages/docs/ui-spec.html`
66
+ - `{process_slug}/pages/prototype/**/*.html` (required interactive HTML prototypes)
67
+ - `{process_slug}/designs/<design_id>/prototype.pen` (optional Pencil prototype)
68
+
69
+ ## Rules
70
+
71
+ - The HTML prototype is the primary review artifact; Pencil is optional.
72
+ - Always reuse the shared `prototype.css` and `prototype.js` assets. Do not inline all styles or rebuild the component library from scratch.
73
+ - Keep controls and states complete enough for implementation: default, hover/focus where relevant, disabled, empty, loading, error, and success.
74
+ - Every interactive element must carry a stable `data-uid`. Do not generate random UIDs that change on every render.
75
+ - Prototype links use relative paths so they work both inside the portal iframe and when opened standalone.
76
+ - Do not add collapse toggles or custom panel chrome to the portal; the right annotation panel is always visible.
77
+ - The system tray is portal-level chrome. Never redraw the tray inside an app prototype page with `.menubar`, `.tray-icon`, `.tray-panel`, `bindTray`, or `trayMenu`. Tray scenario pages must be thin controllers that post `lincoln-tray-state` messages to the portal.
78
+ - After approval, tell the user to run: `claude plan-tdd-development <session_id> <design_id>`.
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: clarify-requirements
3
+ description: 基于访谈内容与人类 PM 多轮澄清需求
4
+ triggers:
5
+ - "澄清需求"
6
+ - "clarify-requirements"
7
+ inputs:
8
+ - name: session_id
9
+ description: 访谈会话 ID,如 2026-06-27-stakeholder
10
+ required: true
11
+ outputs:
12
+ - "{process_slug}/pages/docs/requirements.html"
13
+ - "{process_slug}/pages/docs/user-stories.html"
14
+ - "{process_slug}/pages/docs/prd.html"
15
+ - "{process_slug}/pages/docs/snapshots/prd-v*.html"
16
+ required_tools:
17
+ - Read
18
+ - Bash
19
+ - Write
20
+ - Edit
21
+ ---
22
+
23
+ # clarify-requirements
24
+
25
+ ## Purpose
26
+
27
+ Using [clarify-requirements] to 基于访谈内容与人类 PM 多轮澄清需求.
28
+
29
+
30
+ 基于访谈 transcript 和 summary 与人类 PM 多轮澄清,输出统一需求文档。
31
+
32
+ 运行入口: prompts/main.md
@@ -0,0 +1,81 @@
1
+ # clarify-requirements
2
+
3
+ You are executing the Lincoln workflow step `clarify`: turn interview artifacts into a structured requirements document through multi-round clarification with the human PM.
4
+
5
+ ## Goal
6
+
7
+ Produce a clear, agreed-upon `{process_slug}/pages/docs/requirements.html` and the root-level `{process_slug}/pages/docs/prd.html` that serves as the single source of truth and main thread for this issue.
8
+
9
+ ## Input
10
+
11
+ - `session_id`: the interview session identifier
12
+
13
+ ## 子技能准备
14
+
15
+ 在执行本 prompt 前:
16
+ - 若存在外部需求/计划文件,先调用 `gsd-import` 进行冲突检测。
17
+ - 调用 `superpowers:brainstorming` 与 PM 一起探索 2-3 种可能的需求视角,列出 trade-offs。
18
+ **在 PM 明确选择方向前,禁止继续生成需求文档。**
19
+
20
+ ## Steps
21
+
22
+ 1. Read `{process_slug}/interviews/<session-id>/transcript.md`, `summary.md`, and `raw-insights.md`.
23
+ 2. Draft an initial `{process_slug}/pages/docs/requirements.html` using `.claude/templates/issue-package/page-doc.html.tpl`. Embed the Markdown source in the `<script type="text/markdown" id="docSource">` block and include a `<!-- version: v1.0 -->` marker. Required sections:
24
+ - `背景`
25
+ - `问题`
26
+ - `用户`
27
+ - `方案`
28
+ - `验收标准`
29
+ - `非目标`
30
+ - `开放问题`
31
+ 3. Identify 1-3 ambiguities or missing details, and tag each with its Johari quadrant (认知象限): 知道自己知道 → 复述确认题; 知道自己不知道 → 直接回答 + coach; 不知道自己知道 → 展示已有资产; 不知道自己不知道 → 探查题.
32
+ 4. Ask the human PM these questions one batch at a time in the terminal, using the quadrant-appropriate style.
33
+ 5. Update `requirements.html` based on the answers (always rewrite the full file; do not mutate in-place).
34
+ 6. Repeat until the PM confirms the requirements are clear.
35
+ 7. Also generate `{process_slug}/pages/docs/user-stories.html` from the finalized requirements using the same doc-page template.
36
+ 8. Generate the root-level PRD at `{process_slug}/pages/docs/prd.html` using `.claude/templates/issue-package/page-doc.html.tpl`. It must include:
37
+ - `<!-- version: v1.0 -->` marker inside the `docSource` block.
38
+ - Meta tags: `doc-title`, `nav-group="Docs"`, `doc-version="v1.0"`, and a stable `doc-uid`.
39
+ - All required sections: 1.需求背景, 2.用户故事, 3.功能拆解, 4.业务流程图, 5.验收标准, 6.业务规则, 7.非功能需求, 8.关联系统/接口, 9.相关产物链接, 10.风险与开放问题.
40
+ - A links table in section 9 pointing to interviews, requirements.html, user-stories.html, and downstream design/prototype/OpenSpec artifacts.
41
+ 9. When the PM confirms, add an approval marker inside `requirements.html`: `<!-- status: approved -->`.
42
+ 10. After human approval, run `python scripts/lincoln_prd.py freeze` to create the immutable snapshot `{process_slug}/pages/docs/snapshots/prd-v1.0.html`.
43
+ 11. Run `python scripts/stage_loader.py --stage clarify --action record-artifacts` to persist the artifact paths and refresh `{process_slug}/assets/js/package-data.js`.
44
+
45
+ ## Human Interaction Rules
46
+
47
+ - Ask at most 3 questions per turn.
48
+ - After each answer, update the document and show the changed sections.
49
+ - If the PM edits `requirements.html` or `prd.html` directly and runs `workflow-continue`, re-read the file and continue from there.
50
+ - Do not proceed to the next step until the PM explicitly confirms (e.g., says "confirm" or "确认").
51
+
52
+ ## 认知象限确认(Johari)
53
+
54
+ 澄清问题按 Johari 四象限设计与标注:
55
+
56
+ | 象限 | 问题风格 |
57
+ |------|----------|
58
+ | 知道自己知道 | 复述确认题:用你的话复述需求,防止会错意 |
59
+ | 知道自己不知道 | 直接回答 + coach:先给背景与选项,不反问 |
60
+ | 不知道自己知道 | 展示已有资产:引用 knowledge/、issues、既有文档中已有的答案 |
61
+ | 不知道自己不知道 | 探查题:用具体场景暴露用户未意识到的风险与缺失 |
62
+
63
+ 出口条件(两条都满足才允许进入下一阶段):
64
+
65
+ 1. 每个开放问题都有明确的验收标准答案(用户认可的"怎样算完成")。
66
+ 2. 执行路径已确定(下一步产物、负责角色、进入哪个阶段)。
67
+
68
+ ## Output Artifacts
69
+
70
+ - `{process_slug}/pages/docs/requirements.html`
71
+ - `{process_slug}/pages/docs/user-stories.html`
72
+ - `{process_slug}/pages/docs/prd.html` (root-level PRD, versioned)
73
+ - `{process_slug}/pages/docs/snapshots/prd-v1.0.html` (immutable snapshot after approval)
74
+
75
+ ## Traceability
76
+
77
+ Every requirement must reference the transcript timestamp where it originated, e.g., `(来源: 00:03:22)`.
78
+
79
+ ## Next Step
80
+
81
+ After confirmation and snapshot freeze, tell the user the clarify stage is complete and the next stage is `product-design-docs`.