specpro-cli 0.1.0__py3-none-any.whl

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 (76) hide show
  1. specpro_cli/__init__.py +16 -0
  2. specpro_cli/assets/commands/specpro.analyze.md +1102 -0
  3. specpro_cli/assets/commands/specpro.checklist.md +335 -0
  4. specpro_cli/assets/commands/specpro.clarify.md +581 -0
  5. specpro_cli/assets/commands/specpro.constitution.md +488 -0
  6. specpro_cli/assets/commands/specpro.feature.md +115 -0
  7. specpro_cli/assets/commands/specpro.implement.md +1881 -0
  8. specpro_cli/assets/commands/specpro.manual-test.md +206 -0
  9. specpro_cli/assets/commands/specpro.plan.md +3284 -0
  10. specpro_cli/assets/commands/specpro.qc.md +1489 -0
  11. specpro_cli/assets/commands/specpro.scenarios.md +154 -0
  12. specpro_cli/assets/commands/specpro.specify.md +1449 -0
  13. specpro_cli/assets/commands/specpro.status.md +863 -0
  14. specpro_cli/assets/commands/specpro.tasks.md +1207 -0
  15. specpro_cli/assets/commands/specpro.test-implement.md +462 -0
  16. specpro_cli/assets/commands/specpro.test-plan.md +383 -0
  17. specpro_cli/assets/commands/specpro.user-manual.md +178 -0
  18. specpro_cli/assets/scripts/bash/check-anti-coupling.sh +293 -0
  19. specpro_cli/assets/scripts/bash/check-prerequisites.sh +176 -0
  20. specpro_cli/assets/scripts/bash/common.sh +88 -0
  21. specpro_cli/assets/scripts/bash/create-new-feature.sh +336 -0
  22. specpro_cli/assets/scripts/bash/qc-auto-fix.sh +121 -0
  23. specpro_cli/assets/scripts/bash/setup-plan.sh +60 -0
  24. specpro_cli/assets/scripts/bash/verify-cumulative-records.sh +203 -0
  25. specpro_cli/assets/scripts/bash/verify-deliverables-tracked.sh +147 -0
  26. specpro_cli/assets/scripts/bash/verify-deployment.sh +239 -0
  27. specpro_cli/assets/scripts/bash/verify-frontmatter-yaml.sh +63 -0
  28. specpro_cli/assets/scripts/bash/verify-ledger.sh +376 -0
  29. specpro_cli/assets/scripts/bash/verify-shapes.sh +1082 -0
  30. specpro_cli/assets/scripts/git-hooks/pre-commit +243 -0
  31. specpro_cli/assets/scripts/install-git-hooks.sh +67 -0
  32. specpro_cli/assets/scripts/powershell/check-anti-coupling.ps1 +249 -0
  33. specpro_cli/assets/scripts/powershell/check-prerequisites.ps1 +148 -0
  34. specpro_cli/assets/scripts/powershell/common.ps1 +95 -0
  35. specpro_cli/assets/scripts/powershell/create-new-feature.ps1 +229 -0
  36. specpro_cli/assets/scripts/powershell/qc-auto-fix.ps1 +110 -0
  37. specpro_cli/assets/scripts/powershell/setup-plan.ps1 +61 -0
  38. specpro_cli/assets/scripts/powershell/verify-cumulative-records.ps1 +133 -0
  39. specpro_cli/assets/scripts/powershell/verify-deliverables-tracked.ps1 +112 -0
  40. specpro_cli/assets/scripts/powershell/verify-deployment.ps1 +278 -0
  41. specpro_cli/assets/scripts/powershell/verify-frontmatter-yaml.ps1 +56 -0
  42. specpro_cli/assets/scripts/powershell/verify-ledger.ps1 +383 -0
  43. specpro_cli/assets/scripts/powershell/verify-shapes.ps1 +978 -0
  44. specpro_cli/assets/templates/agent-context-template.md +49 -0
  45. specpro_cli/assets/templates/assumptions-template.md +248 -0
  46. specpro_cli/assets/templates/checklist-template.md +40 -0
  47. specpro_cli/assets/templates/clarifications-template.md +155 -0
  48. specpro_cli/assets/templates/constitution-template.md +50 -0
  49. specpro_cli/assets/templates/feature-spec-template.md +66 -0
  50. specpro_cli/assets/templates/plan-overview-template.md +150 -0
  51. specpro_cli/assets/templates/plan-template.md +387 -0
  52. specpro_cli/assets/templates/protocol-golden-bytes-guide.md +195 -0
  53. specpro_cli/assets/templates/requirements-template.md +356 -0
  54. specpro_cli/assets/templates/spec-template.md +267 -0
  55. specpro_cli/assets/templates/tasks-template.md +252 -0
  56. specpro_cli/assets/templates/test-tasks-template.md +174 -0
  57. specpro_cli/cli/__init__.py +5 -0
  58. specpro_cli/cli/cmd_init.py +416 -0
  59. specpro_cli/cli/cmd_remove.py +122 -0
  60. specpro_cli/cli/entry.py +181 -0
  61. specpro_cli/integrations/__init__.py +36 -0
  62. specpro_cli/integrations/base.py +601 -0
  63. specpro_cli/integrations/claude/__init__.py +101 -0
  64. specpro_cli/integrations/copilot/__init__.py +153 -0
  65. specpro_cli/integrations/cursor_agent/__init__.py +51 -0
  66. specpro_cli/integrations/gemini/__init__.py +44 -0
  67. specpro_cli/integrations/opencode/__init__.py +48 -0
  68. specpro_cli/integrations/qodercli/__init__.py +54 -0
  69. specpro_cli/integrations/registry.py +88 -0
  70. specpro_cli/packaged/__init__.py +5 -0
  71. specpro_cli/packaged/sync.py +106 -0
  72. specpro_cli-0.1.0.dist-info/METADATA +117 -0
  73. specpro_cli-0.1.0.dist-info/RECORD +76 -0
  74. specpro_cli-0.1.0.dist-info/WHEEL +4 -0
  75. specpro_cli-0.1.0.dist-info/entry_points.txt +2 -0
  76. specpro_cli-0.1.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,206 @@
1
+ ---
2
+ description: Manual acceptance testing (Four-Layer Ownership, Manual layer) - generate the AI-driven manual test task document (specs/manual-test-tasks.md), then interactively guide the human through each scenario, record verdicts, and route failures
3
+ handoffs:
4
+ - label: Analyze For Consistency
5
+ agent: specpro-analyze
6
+ prompt: Run a project analysis including manual acceptance routing results
7
+ send: false
8
+ writes:
9
+ # This command's write surface: only what it produces AS THE PRODUCER of that
10
+ # (artifact, unit) pair. A write this command makes on a non-producer path is a
11
+ # boundary violation by definition (FR-051) and MUST NOT be declared here.
12
+ # The full ownership map is the UNION of every command's writes: block.
13
+ - artifact: specs/manual-test-tasks.md
14
+ unit: "## Task Definitions (MA-NNN) and ## Execution State (per-MA status/evidence/notes/timestamp/routed-to)"
15
+ - artifact: specs/acceptance.md
16
+ unit: "whole file - generated only at the acceptance gate"
17
+ - artifact: specs/implement_issues.md
18
+ unit: "the [tasks] section -> appended ISS-NNN entries for product bugs (scenario ref + repro + evidence)"
19
+ ---
20
+
21
+ ## User Input
22
+
23
+ ```text
24
+ $ARGUMENTS
25
+ ```
26
+
27
+ You **MUST** consider the user input before proceeding (if not empty).
28
+
29
+ **Rerun safety — detect the artifact, default to incremental** ⚠️ [settled 2026-09-13]:
30
+
31
+ **Before writing `specs/manual-test-tasks.md`, detect whether it already exists.** Use the SAME check in every command:
32
+
33
+ ```bash
34
+ [ -s specs/manual-test-tasks.md ] && echo EXISTS || echo NEW # -s: exists AND non-empty (an empty placeholder counts as NEW)
35
+ ```
36
+
37
+ | Detection | Mode |
38
+ |-----------|------|
39
+ | **NEW** (absent or empty) | **Initial** — generate from scratch |
40
+ | **EXISTS** | **Incremental** — evolve it; **never silently regenerate from scratch** |
41
+
42
+ **Overwriting an existing artifact requires explicit, confirmed intent:**
43
+ 1. Only when the user *explicitly* asks (in their own words) does the initial path run on an existing artifact.
44
+ 2. **Even then, confirm once more before writing** — name the artifact that will be replaced and what will be lost; wait for the answer.
45
+ 3. **Silence is not consent.** An unspecified run on an existing artifact is ALWAYS incremental.
46
+
47
+ > **Why a shared rule rather than per-command courtesy**: nine of the twelve non-implementation commands already had some protection, but each wrote it its own way (`EXISTING_SPEC` check · "creates a NEW file" · `NEVER overwrite` · "incremental regeneration" · `AUTO_MODE=false`), and **three had none at all** — not by decision, but because the discipline had no shared carrier. Overwriting an artifact the user has been evolving is not recoverable within the session; the cost of asking is one prompt.
48
+
49
+
50
+ ### Scope Resolution 🆕 (FR-063 / T050 · v0.23)
51
+
52
+ 1. **作用域判定**: 当前工作目录位于 `specs/fNNN-简称/` 内 ⇒ **feature 作用域**(读写范围 = 本 feature 目录,由 `check-prerequisites.sh` 的作用域感知解析);位于仓库根或 `specs/` 根 ⇒ **母作用域**(读写母规格链)。feature 作用域内 MUST NOT 写母产物——唯一例外:**发现登记**(台账路由,`[specify]`/`[plan]` 分区)。
53
+ 2. **新会话首次执行**: 若 `specs/features.md` 存在且含 `active` 行、而用户未指明作用域 ⇒ **询问用户**在母作用域还是某个 feature 内工作,MUST NOT 自行挑选。
54
+ 3. 本命令的产物路径随之解析:feature 作用域下落 `<feature 目录>/`,母作用域下落 `specs/`。
55
+
56
+ ## Key Concept: AI-Driven Manual Acceptance 🧪 [CRITICAL]
57
+
58
+ This command implements the **Manual layer** of the Four-Layer Test Ownership (see `/specpro-test-plan`). Manual acceptance covers FRs whose verification is subjective/exploratory or requires real devices/environments — exactly the rows the coverage matrix marked `manual` and routed here.
59
+
60
+ **Division of labor** [CRITICAL]:
61
+ - **AI is the DRIVER**: AI does EVERYTHING AI can do — launch/stop the app, probe the environment, inspect processes/logs, trigger screenshot tooling, relay instructions, record verdicts, route failures, compute statistics. Do not ask the human for anything AI can do itself.
62
+ - **The technical operator is the CO-EXECUTOR**: the human in this session (developer/QA) performs ONLY what AI cannot — subjective verdicts (visual aesthetics, latency feel, accessibility experience), real-peripheral operation, reaching remote machines. Together with AI they CLOSE the testing loop.
63
+ - **The end user is the ACCEPTOR**: final acceptance is performed by the end user, NOT in this session — they read `specs/acceptance.md` (generated only at the acceptance gate) and verify in their own terms. Acceptance items MUST be phrased in end-user language, never technical assertions.
64
+
65
+ **The document's audience is AI, not humans**: `specs/manual-test-tasks.md` is the "tasks.md for manual testing" — AI reads it to drive the manual testing session, exactly as `/specpro-implement` reads tasks.md. Do NOT write it as a human-readable acceptance guide.
66
+
67
+ **Artifact Language Rule** 🌐: prose follows the project's **Artifact Language** (from `specs/constitution.md`); structural anchors (section headings, `MA-xxx` IDs, status enum) stay English.
68
+
69
+ ## Phase Detection
70
+
71
+ | Condition | Mode |
72
+ |-----------|------|
73
+ | `specs/manual-test-tasks.md` does NOT exist | **Generation Mode** — build the task document, then stop and report |
74
+ | exists | **Execution Mode** — resume guided execution |
75
+
76
+ In Execution Mode: read the Execution State section FIRST, resume from the first unresolved scenario (breakpoint resume). NEVER overwrite existing execution records.
77
+
78
+ ## Generation Mode
79
+
80
+ 1. **Setup**: Run `.specpro/scripts/bash/check-prerequisites.sh --json` from repo root.
81
+ - **spec.md REQUIRED** — missing: ❌ ERROR "Run /specpro-specify first", EXIT 1
82
+ - **test-tasks.md REQUIRED** — missing: ❌ ERROR "Run /specpro-test-plan first (matrix manual rows are the sole entry)", EXIT 1
83
+
84
+ 2. **Extract manual rows** 📋: From the coverage matrix, take every FR with status `manual`. For each, collect:
85
+ - FR id + title, matrix rationale (why it was routed to manual)
86
+ - spec.md **Acceptance Scenarios + Independent Test** (verbatim, per FR)
87
+ - linked Task IDs (the FR's automation legs, from the matrix Task IDs column)
88
+
89
+ 3. **Dependency check** 🔗: For each FR, look up its automation-leg tasks in `specs/test-tasks.md`: any leg unchecked → mark the scenario `Blocked-By: <task-ids>`. The scenario is still generated, but Execution Mode must verify the block is cleared (or get explicit human approval) before running it.
90
+
91
+ 4. **Ground launch commands** 🔍 [CRITICAL — never invent]: For scenarios that need the app running, grounding-scan the REAL launch command (desktop-app build config, quickstart.md, existing run scripts). If no grounded command exists, classify the scenario `human-environment` and note the gap.
92
+
93
+ 5. **Classify execution mode** per scenario:
94
+ - `ai-launchable` — AI launches the app, human operates the UI (dialogs, popups, settings flows)
95
+ - `human-environment` — real peripherals / remote machine / pure subjective judgment (audio latency feel, screen reader, native look-and-feel, real-server smoke); AI guides preparation and records
96
+
97
+ 6. **Generate `specs/manual-test-tasks.md`** 📋 with exactly two sections (see formats below):
98
+ - **Task Definitions** (frozen at generation; updated only by incremental regeneration)
99
+ - **Execution State** (written ONLY during Execution Mode; empty at generation)
100
+ - Header: Manual FR count, generation date, source matrix run reference
101
+ - Number scenarios `MA-001, MA-002, ...` in matrix row order; every scenario carries `(FR-XXX)` annotation
102
+
103
+ 7. **Report** ✨: scenario count per execution mode, blocked list (with blocking legs), launch commands found/gaps, and the instruction: "Run /specpro-manual-test again to start the guided manual testing session."
104
+
105
+ 8. **Incremental regeneration** 🔄: If the matrix `manual` set changed since the generation header reference, add/mark scenarios accordingly (`[DELETED]` kept for audit, same convention as tasks.md) — never touch existing execution records.
106
+
107
+ ## Execution Mode
108
+
109
+ 1. **Locate resume point**: first scenario whose Execution State is missing or `pending`.
110
+
111
+ 2. **Scenario loop** — for the current scenario:
112
+ a. **AI does everything AI can** (do not ask): pre-checks, launch the app (grounded command), probe environment (audio device present? screen reader running?), prepare screenshot tooling, tail relevant logs
113
+ b. **Instruct**: relay the numbered steps **in the project's Artifact Language** (`specs/constitution.md` → `**Artifact Language**`; default `en`), with the expected observable result for each step. ⚠️ 本节此前写死「in Chinese」(`T174`)—— 与本文件自己的 **Artifact Language Rule** 直接冲突:该条款说 prose follows the project's Artifact Language,而这一步**对任何** `Artifact Language ≠ zh` 的项目都会说错语言,且**不报错**
114
+ c. **Collect verdict** from the human: `pass` / `fail` / `blocked` + free-text description (+ evidence: screenshot paths, observed behavior)
115
+ d. **Record**: write back to Execution State (status, evidence, notes, timestamp) — immediately, before moving on
116
+ e. **Route failures immediately** (see Failure Routing)
117
+ f. Human decides: next scenario or pause (state is saved — safe to stop anytime)
118
+
119
+ 3. **Wrap-up & Acceptance Gate** ✨: statistics (pass / fail / blocked / pending), failures routed (with ISS refs).
120
+ - **Gate**: ALL scenarios `pass` AND all `Blocked-By` automation legs cleared → generate `specs/acceptance.md` (see Acceptance Guide below)
121
+ - Otherwise: do NOT generate it; report "acceptance prerequisites not met" + outstanding items
122
+
123
+ 4. **Boundaries** ⚠️ [CRITICAL]:
124
+ - Matrix `manual` rows are planning-final — NEVER modify `specs/test-tasks.md`
125
+ - NEVER modify product code; never edit spec.md / plan.md / tasks.md directly (routing channels only)
126
+ - Environment unavailable mid-session → status `blocked` with reason (mirrors CE environment-guard semantics), not `fail`
127
+
128
+ ## Task Definition Format
129
+
130
+ ```markdown
131
+ ### MA-001 [ai-launchable] Popup z-order & DND interaction (FR-xxx)
132
+
133
+ **Matrix rationale**: pure UI interaction; popup z-order and DND behavior routed to manual
134
+ **Blocked-By**: — (or IT-xxx / CE-xxx, noting incomplete legs)
135
+ **Launch**: `<grounded command>` (or human-environment: environment preparation guidance)
136
+
137
+ **Source** (spec.md verbatim):
138
+ - Given: ... / When: ... / Then: ...
139
+ - Independent Test: ...
140
+
141
+ **Steps**:
142
+ 1. <instruction> → Expect: <observable result>
143
+ 2. ...
144
+
145
+ **Pass Criteria**:
146
+ - [ ] <observable pass criterion 1>
147
+ - [ ] <observable pass criterion 2>
148
+ ```
149
+
150
+ ## Execution State Format
151
+
152
+ ```markdown
153
+ ## Execution State
154
+
155
+ ### MA-001
156
+ - **Status**: pending | pass | fail | blocked
157
+ - **Evidence**: <screenshot paths / observed behavior>
158
+ - **Notes**: <key points of human feedback>
159
+ - **Timestamp**: <date time>
160
+ - **Routed-To**: <ISS-xxx / clarify prompt / —>
161
+ ```
162
+
163
+ ## Failure Routing
164
+
165
+ | Finding | Route |
166
+ |---------|-------|
167
+ | Product bug | Append to the **`[tasks]` section** of `specs/implement_issues.md` (ISS-xxx: scenario ref + repro steps + evidence); continue or pause per human decision. ⚠️ **Route per the table in `/specpro-analyze`'s "Routing — by which stage owns the fix"** — a defect in the product of a `tasks.md` task belongs to `[tasks]`. ⚠️ **The section was unnamed here until 2026-09-17**, which left the write surface undecidable. |
168
+ | Suspected requirement defect | Record in scenario notes + prompt to run `/specpro-clarify` for spec write-back |
169
+ | Environment unavailable | Status `blocked` + reason; retry later |
170
+
171
+ ## Acceptance Guide (`specs/acceptance.md`)
172
+
173
+ Generated ONLY at the acceptance gate. **Audience: the end user** — they do not participate in AI sessions and verify in their own terms. The generated document's prose follows the project's **Artifact Language**; structural anchors below stay English.
174
+
175
+ ```markdown
176
+ # Acceptance Document: <feature name>
177
+
178
+ **Acceptance Prerequisites**: testing loop completed (technical operator × AI collaboration)
179
+ - Automated tests: <matrix summary — X completed / Y planning verdicts (manual/not-applicable/pending-impl)>
180
+ - Manual testing: MA-001~0NN all pass (execution records in manual-test-tasks.md)
181
+
182
+ **Acceptance Checklist** (per FR, end-user language, sourced from spec.md Independent Test / user value):
183
+ - [ ] <end-user verifiable item, no technical assertions>
184
+
185
+ **Outstanding Issues**: <blocked items / conditional-pass items, if any>
186
+
187
+ **Acceptance Verdict**:
188
+ - [ ] ✅ Pass
189
+ - [ ] ⚠️ Conditional pass (conditions: <...>)
190
+ - [ ] ❌ Reject (reason: <...>)
191
+
192
+ **End-user Signature**: ________ Date: ________
193
+ ```
194
+
195
+ If MA/matrix state changes after `acceptance.md` exists → prompt regeneration (the acceptance document follows prerequisite state).
196
+
197
+ ## Anti-Patterns
198
+
199
+ - ❌ AI substituting its own judgment for a human subjective verdict
200
+ - ❌ Overwriting existing execution records — breakpoint resume is MANDATORY
201
+ - ❌ Asking the human to do anything AI can do (launching, log inspection, screenshots, recording)
202
+ - ❌ Writing the document as a human-readable acceptance guide (audience is the AI driver)
203
+ - ❌ Recording a `fail` without routing it
204
+ - ❌ Inventing launch commands or environment facts (must be grounded)
205
+ - ❌ Modifying matrix manual rows, product code, or upstream artifacts directly
206
+ - ❌ Addressing the acceptance guide to engineers or phrasing acceptance items as technical assertions (audience is the end user)