@codewalla_india/openspec 1.3.0 → 1.3.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.
package/README.md CHANGED
@@ -1,46 +1,25 @@
1
1
  <p align="center">
2
2
  <a href="https://github.com/codewalla-engineering/OpenSpec">
3
3
  <picture>
4
- <source srcset="assets/openspec_bg.png">
5
- <img src="assets/openspec_bg.png" alt="OpenSpec logo">
4
+ <source srcset="assets/codewalla_bg.png">
5
+ <img src="assets/codewalla_bg.png" alt="Codewalla OpenSpec" width="100%">
6
6
  </picture>
7
7
  </a>
8
8
  </p>
9
9
 
10
+ <p align="center"><strong>Codewalla OpenSpec — spec-driven development for AI coding assistants</strong></p>
11
+
10
12
  <p align="center">
11
13
  <a href="https://github.com/codewalla-engineering/OpenSpec/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/codewalla-engineering/OpenSpec/actions/workflows/ci.yml/badge.svg" /></a>
12
14
  <a href="https://www.npmjs.com/package/@codewalla_india/openspec"><img alt="npm version" src="https://img.shields.io/npm/v/@codewalla_india/openspec?style=flat-square" /></a>
13
15
  <a href="./LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square" /></a>
14
- <a href="https://discord.gg/YctCnvvshC"><img alt="Discord" src="https://img.shields.io/discord/1411657095639601154?style=flat-square&logo=discord&logoColor=white&label=Discord&suffix=%20online" /></a>
15
16
  </p>
16
17
 
17
- <details>
18
- <summary><strong>The most loved spec framework.</strong></summary>
19
-
20
- [![Stars](https://img.shields.io/github/stars/codewalla-engineering/OpenSpec?style=flat-square&label=Stars)](https://github.com/codewalla-engineering/OpenSpec/stargazers)
21
- [![Downloads](https://img.shields.io/npm/dm/@codewalla_india/openspec?style=flat-square&label=Downloads/mo)](https://www.npmjs.com/package/@codewalla_india/openspec)
22
- [![Contributors](https://img.shields.io/github/contributors/codewalla-engineering/OpenSpec?style=flat-square&label=Contributors)](https://github.com/codewalla-engineering/OpenSpec/graphs/contributors)
23
-
24
- </details>
25
- <p></p>
26
- Our philosophy:
27
-
28
- ```text
29
- → fluid not rigid
30
- → iterative not waterfall
31
- → easy not complex
32
- → built for brownfield not just greenfield
33
- → scalable from personal projects to enterprises
34
- ```
35
-
36
18
  > [!TIP]
37
- > **New workflow now available!** We've rebuilt OpenSpec with a new artifact-guided workflow.
19
+ > **Codewalla workflow:** Propose from a Jira ticket or plain description, revise with `/opsx:modify`, then apply.
38
20
  >
39
- > Run `/opsx:propose "your idea"` to get started. → [Learn more here](docs/opsx.md)
40
-
41
- <p align="center">
42
- Follow <a href="https://x.com/0xTab">@0xTab on X</a> for updates · Join the <a href="https://discord.gg/YctCnvvshC">OpenSpec Discord</a> for help and questions.
43
- </p>
21
+ > Run `/opsx:propose CW-1234 add dark mode` or `/opsx:propose "your idea"` to get started.
22
+ > → [Jira integration](docs/workflows.md#jira-integration) · [MCP setup](docs/mcp-setup.md)
44
23
 
45
24
  <!-- TODO: Add GIF demo of /opsx:propose → /opsx:archive workflow -->
46
25
 
@@ -55,17 +34,23 @@ AI: Let me look at your styling setup...
55
34
  with system-preference detection. No new dependencies. Scope it?
56
35
  You: Yes, let's do it.
57
36
 
58
- You: /opsx:propose add-dark-mode
59
- AI: Created openspec/changes/add-dark-mode/
60
- ✓ proposal.md why we're doing this, what's changing
61
- ✓ specs/requirements and scenarios
37
+ You: /opsx:propose CW-1234 add-dark-mode
38
+ AI: Found CW-1234: 'Add dark mode'. Creating change from Jira ticket...
39
+ ✓ proposal.md (Impact: Jira: CW-1234)
40
+ ✓ specs/ui/ (requirements from Jira ACs)
62
41
  ✓ design.md — technical approach
42
+ ✓ plan.md — file-level code map
63
43
  ✓ tasks.md — implementation checklist
64
44
  Ready for implementation!
65
45
 
46
+ You: /opsx:modify add-dark-mode design use CSS variables instead of hardcoded colors
47
+ AI: Updated design.md → propagated to plan.md and tasks.md
48
+ Run /opsx:apply when ready.
49
+
66
50
  You: /opsx:apply
67
- AI: Comprehension check6 questions on your proposal, design, specs, and tasks...
68
- 83%ready to implement.
51
+ AI: Jira context: CW-1234 all ACs covered
52
+ Comprehension check7 questions on proposal, design, specs, plan, and tasks...
53
+ ✓ 86% — ready to implement.
69
54
  Implementing tasks...
70
55
  ✓ 1.1 Add theme context provider
71
56
  ✓ 1.2 Create toggle component
@@ -78,15 +63,6 @@ AI: Archived to openspec/changes/archive/2025-01-23-add-dark-mode/
78
63
  Specs updated. Ready for the next feature.
79
64
  ```
80
65
 
81
- <details>
82
- <summary><strong>OpenSpec Dashboard</strong></summary>
83
-
84
- <p align="center">
85
- <img src="assets/openspec_dashboard.png" alt="OpenSpec dashboard preview" width="90%">
86
- </p>
87
-
88
- </details>
89
-
90
66
  ## Quick Start
91
67
 
92
68
  **Requires Node.js 20.19.0 or higher.**
@@ -104,19 +80,36 @@ cd your-project
104
80
  openspec init
105
81
  ```
106
82
 
83
+ > [!NOTE]
84
+ > **Codewalla identity:** `openspec init` prompts for your Codewalla email or username. All commands require telemetry identity. CI runners should pre-provision `~/.config/openspec/telemetry-identity.json` or set `OPENSPEC_TELEMETRY_USER`.
85
+
107
86
  Now talk to your AI:
108
87
 
109
- - **Not sure what to build yet?** Start with `/opsx:explore`, a no-stakes thinking partner that reads your code, weighs options, and shapes a plan before anything is written. ([Explore guide](docs/explore.md))
110
- - **Already know what you want?** Go straight to `/opsx:propose <what-you-want-to-build>`.
111
- - **Ready to implement?** Run `/opsx:apply` — a short comprehension quiz checks you understand the proposal, design, specs, and tasks before any code is written.
88
+ - **Not sure what you want to build yet?** Start with `/opsx:explore`, a no-stakes thinking partner that reads your code, weighs options, and shapes a plan before anything is written. ([Explore guide](docs/explore.md))
89
+ - **Already know what you want?** Go straight to `/opsx:propose <what-you-want-to-build>` or `/opsx:propose CW-1234 <summary>` to import from Jira.
90
+ - **Need to revise the plan before coding?** Run `/opsx:modify` — pre-apply only; propagates changes to downstream artifacts. ([Editing a change](docs/editing-changes.md))
91
+ - **Ready to implement?** Run `/opsx:apply` — a short comprehension quiz checks you understand the proposal, design, specs, plan, and tasks before any code is written.
112
92
 
113
- The default `core` profile includes `/opsx:explore`, `/opsx:propose`, `/opsx:apply`, `/opsx:sync`, and `/opsx:archive`. If you want the expanded workflow (`/opsx:new`, `/opsx:continue`, `/opsx:ff`, `/opsx:verify`, `/opsx:bulk-archive`, `/opsx:onboard`), select it with `openspec config profile` and apply with `openspec update`.
93
+ The default `core` profile includes `/opsx:explore`, `/opsx:propose`, `/opsx:modify`, `/opsx:apply`, `/opsx:sync`, and `/opsx:archive`. If you want the expanded workflow (`/opsx:new`, `/opsx:continue`, `/opsx:ff`, `/opsx:verify`, `/opsx:bulk-archive`, `/opsx:onboard`), select it with `openspec config profile` and apply with `openspec update`.
114
94
 
115
95
  > [!NOTE]
116
96
  > Not sure if your tool is supported? [View the full list](docs/supported-tools.md) – we support 25+ tools and growing.
117
97
  >
118
98
  > Also works with pnpm, yarn, bun, and nix. [See installation options](docs/installation.md).
119
99
 
100
+ ## Codewalla workflow & MCPs
101
+
102
+ OpenSpec workflows integrate with MCP servers in your AI tool. MCPs are optional — workflows degrade gracefully when a server is unavailable.
103
+
104
+ | MCP | Workflow | Behavior |
105
+ |-----|----------|----------|
106
+ | **Atlassian** | `/opsx:propose`, `/opsx:apply` | Import Jira tickets; enrich and cross-check ACs vs tasks; skips if unavailable |
107
+ | **Context7** | `/opsx:apply` | Fetch current library docs when tasks reference packages; max 3 calls per session |
108
+ | **Browser** | `/opsx:verify` (expanded profile) | Screenshots, a11y snapshot, console errors; not run during apply |
109
+
110
+ → **[MCP Setup guide](docs/mcp-setup.md)** — enable servers in Cursor or your AI tool<br>
111
+ → **[Jira integration](docs/workflows.md#jira-integration)** — naming conventions and ticket flows
112
+
120
113
  ## Docs
121
114
 
122
115
  **Start here:** the **[Documentation Home](docs/README.md)** maps everything. New to OpenSpec? Read [Getting Started](docs/getting-started.md), then [How Commands Work](docs/how-commands-work.md) (where you actually type `/opsx:propose`).
@@ -127,6 +120,7 @@ The default `core` profile includes `/opsx:explore`, `/opsx:propose`, `/opsx:app
127
120
  → **[Core Concepts at a Glance](docs/overview.md)**: the whole mental model, one page<br>
128
121
  → **[Examples & Recipes](docs/examples.md)**: real changes, start to finish<br>
129
122
  → **[Workflows](docs/workflows.md)**: combos and patterns<br>
123
+ → **[MCP Setup](docs/mcp-setup.md)**: Atlassian, Context7, and browser MCPs<br>
130
124
  → **[Existing Projects](docs/existing-projects.md)**: adopt OpenSpec on a brownfield codebase<br>
131
125
  → **[Editing a Change](docs/editing-changes.md)**: update artifacts, go back, reconcile manual edits<br>
132
126
  → **[Commands](docs/commands.md)**: slash commands & skills<br>
@@ -151,18 +145,12 @@ Third-party schema bundles distributed via standalone repositories — these pro
151
145
  AI coding assistants are powerful but unpredictable when requirements live only in chat history. OpenSpec adds a lightweight spec layer so you agree on what to build before any code is written.
152
146
 
153
147
  - **Agree before you build** — human and AI align on specs before code gets written
154
- - **Stay organized** — each change gets its own folder with proposal, specs, design, and tasks
155
- - **Work fluidly** — update any artifact anytime, no rigid phase gates
148
+ - **Stay organized** — each change gets its own folder with proposal, specs, design, plan, and tasks
149
+ - **Work fluidly** — update any artifact anytime with `/opsx:modify`; no rigid phase gates
150
+ - **Jira-native workflow** — propose from ticket keys, enrich from Jira during apply, traceability in proposal Impact
151
+ - **MCP-powered** — Atlassian, Context7, and browser MCPs built into generated skills
156
152
  - **Use your tools** — works with 20+ AI assistants via slash commands
157
153
 
158
- ### How we compare
159
-
160
- **vs. [Spec Kit](https://github.com/github/spec-kit)** (GitHub) — Thorough but heavyweight. Rigid phase gates, lots of Markdown, Python setup. OpenSpec is lighter and lets you iterate freely.
161
-
162
- **vs. [Kiro](https://kiro.dev)** (AWS) — Powerful but you're locked into their IDE and limited to Claude models. OpenSpec works with the tools you already use.
163
-
164
- **vs. nothing** — AI coding without specs means vague prompts and unpredictable results. OpenSpec brings predictability without the ceremony.
165
-
166
154
  ## Updating OpenSpec
167
155
 
168
156
  **Upgrade the package**
@@ -173,7 +161,7 @@ npm install -g @codewalla_india/openspec@latest
173
161
 
174
162
  **Refresh agent instructions**
175
163
 
176
- Run this inside each project to regenerate AI guidance and ensure the latest slash commands are active:
164
+ Run this inside each project to regenerate AI guidance and ensure the latest slash commands and MCP guidance are active:
177
165
 
178
166
  ```bash
179
167
  openspec update
@@ -181,29 +169,11 @@ openspec update
181
169
 
182
170
  ## Usage Notes
183
171
 
184
- **Model selection**: OpenSpec works best with high-reasoning models. We recommend Codex 5.5 and Opus 4.7 for both planning and implementation.
185
-
186
172
  **Context hygiene**: OpenSpec benefits from a clean context window. Clear your context before starting implementation and maintain good context hygiene throughout your session.
187
173
 
188
- **Comprehension check**: `/opsx:apply` runs a short quiz (enabled by default) on proposal, design, specs, and pending tasks before implementation. Questions test holistic understanding of the change, not task numbers or checklist trivia. Disable with `comprehension.enabled: false` in `openspec/config.yaml`. See [Workflows](docs/workflows.md#comprehension-quiz-before-apply).
189
-
190
- ## Contributing
191
-
192
- **Small fixes** — Bug fixes, typo corrections, and minor improvements can be submitted directly as PRs.
174
+ **Modify before apply**: `/opsx:modify` revises planning artifacts and propagates changes downstream. It is pre-apply only once tasks are checked off in `/opsx:apply`, use manual edits or start a new change.
193
175
 
194
- **Larger changes** For new features, significant refactors, or architectural changes, please submit an OpenSpec change proposal first so we can align on intent and goals before implementation begins.
195
-
196
- When writing proposals, keep the OpenSpec philosophy in mind: we serve a wide variety of users across different coding agents, models, and use cases. Changes should work well for everyone.
197
-
198
- **AI-generated code is welcome** — as long as it's been tested and verified. PRs containing AI-generated code should mention the coding agent and model used (e.g., "Generated with Claude Code using claude-opus-4-5-20251101").
199
-
200
- ### Development
201
-
202
- - Install dependencies: `pnpm install`
203
- - Build: `pnpm run build`
204
- - Test: `pnpm test`
205
- - Develop CLI locally: `pnpm run dev` or `pnpm run dev:cli`
206
- - Conventional commits (one-line): `type(scope): subject`
176
+ **Comprehension check**: `/opsx:apply` runs a short quiz (enabled by default) on proposal, design, specs, plan, and pending tasks before implementation. Questions test holistic understanding of the change, not task numbers or checklist trivia; plan receives the majority of questions when present. You need ≥ 80% to proceed. Disable with `comprehension.enabled: false` in `openspec/config.yaml`. See [Workflows](docs/workflows.md#comprehension-quiz-before-apply).
207
177
 
208
178
  ## Other
209
179
 
@@ -212,19 +182,10 @@ When writing proposals, keep the OpenSpec philosophy in mind: we serve a wide va
212
182
 
213
183
  Codewalla OpenSpec collects mandatory usage analytics tied to your email or username. Identity is collected during interactive `openspec init` or `openspec update` and stored at `~/.config/openspec/telemetry-identity.json` (never committed). All other commands require identity. CI runners should pre-provision that file or set `OPENSPEC_TELEMETRY_USER`.
214
184
 
215
- Events include command names, workflow metrics, change names, and workflow input text (via `--workflow-input` on `new change`) — not file paths or artifact/spec body content.
185
+ Events include command names, workflow metrics, change names, workflow input text (via `--workflow-input` on `new change`), and modify requests (`artifact_modify_requested` with modify input) — not file paths or artifact/spec body content.
216
186
 
217
187
  </details>
218
188
 
219
- <details>
220
- <summary><strong>Maintainers & Advisors</strong></summary>
221
-
222
- See [MAINTAINERS.md](MAINTAINERS.md) for the list of core maintainers and advisors who help guide the project.
223
-
224
- </details>
225
-
226
-
227
-
228
189
  ## License
229
190
 
230
191
  MIT
@@ -181,16 +181,13 @@ export function getOpsxApplyCommandTemplate() {
181
181
 
182
182
  ${STORE_SELECTION_GUIDANCE}
183
183
 
184
- **Input**: Optionally specify a change name (e.g., \`/opsx:apply add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
184
+ **Input**: Optionally specify a change name (e.g., \`/opsx:apply add-auth\`). If omitted, infer from conversation context; if ambiguous you MUST prompt for available changes.
185
185
 
186
186
  **Steps**
187
187
 
188
188
  1. **Select the change**
189
189
 
190
- If a name is provided, use it. Otherwise:
191
- - Infer from conversation context if the user mentioned a change
192
- - Auto-select if only one active change exists
193
- - If ambiguous, ${PROMPT_SELECT_CHANGE}
190
+ If a name is provided, use it. Otherwise infer from conversation context, auto-select if only one active change exists, or if ambiguous, ${PROMPT_SELECT_CHANGE}
194
191
 
195
192
  Always announce: "Using change: <name>" and how to override (e.g., \`/opsx:apply <other>\`).
196
193
 
@@ -198,28 +195,19 @@ ${STORE_SELECTION_GUIDANCE}
198
195
  \`\`\`bash
199
196
  openspec status --change "<name>" --json
200
197
  \`\`\`
201
- Parse the JSON to understand:
202
- - \`schemaName\`: The workflow being used (e.g., "spec-driven")
203
- - \`planningHome\`, \`changeRoot\`, and \`actionContext\`: planning scope and edit constraints
204
- - Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
198
+ Parse \`schemaName\`, \`planningHome\`/\`changeRoot\`/\`actionContext\` (planning scope and edit constraints), and which artifact holds the tasks (typically "tasks" for spec-driven).
205
199
 
206
200
  3. **Get apply instructions**
207
-
208
201
  \`\`\`bash
209
202
  openspec instructions apply --change "<name>" --json
210
203
  \`\`\`
211
-
212
- This returns:
213
- - \`contextFiles\`: artifact ID -> array of concrete file paths (varies by schema)
214
- - Progress (total, complete, remaining)
215
- - Task list with status
216
- - Dynamic instruction based on current state
204
+ Returns \`contextFiles\` (artifact ID -> file paths, varies by schema), progress, task list, and a dynamic instruction.
217
205
 
218
206
  **Handle states:**
219
- - If \`state: "blocked"\` and \`missingArtifacts\`: show message, suggest using \`/opsx:continue\`
220
- - If \`state: "blocked"\` and \`missingComprehension\`: proceed to step 4 (comprehension quiz) — do NOT implement
221
- - If \`state: "all_done"\`: congratulate, suggest archive
222
- - If \`state: "ready"\`: proceed to step 5
207
+ - \`blocked\` + \`missingArtifacts\`: show message, suggest \`/opsx:continue\`
208
+ - \`blocked\` + \`missingComprehension\`: proceed to step 4 (comprehension quiz) — do NOT implement
209
+ - \`all_done\`: congratulate, suggest archive
210
+ - \`ready\`: proceed to step 5
223
211
 
224
212
  ${ATLASSIAN_ENRICHMENT_GUIDANCE}
225
213
 
@@ -227,116 +215,29 @@ ${COMPREHENSION_QUIZ_GUIDANCE}
227
215
 
228
216
  5. **Read context files**
229
217
 
230
- After comprehension is passed (or not required), read every file path listed under \`contextFiles\` from the apply instructions output.
231
- The files depend on the schema being used:
232
- - **spec-driven**: proposal, specs, design, plan, tasks
233
- - Other schemas: follow the contextFiles from CLI output
234
-
235
- 6. **Show current progress**
218
+ After comprehension passes (or isn't required), read every path under \`contextFiles\` from the apply instructions output (varies by schema; spec-driven: proposal, specs, design, plan, tasks).
236
219
 
237
- Display:
238
- - Schema being used
239
- - Progress: "N/M tasks complete"
240
- - Remaining tasks overview
241
- - Dynamic instruction from CLI
220
+ 6. **Show current progress** — schema, progress ("N/M tasks complete"), remaining tasks, and the dynamic instruction from the CLI.
242
221
 
243
222
  7. **Implement tasks (loop until done or blocked)**
244
223
 
245
- For each pending task:
246
- - Show which task is being worked on
224
+ For each pending task, announce which task is being worked on.
247
225
 
248
226
  ${CONTEXT7_LOOKUP_GUIDANCE}
249
227
 
250
- - Make the code changes required
251
- - Keep changes minimal and focused
252
- - Mark task complete in the tasks file: \`- [ ]\` \`- [x]\`
253
- - Continue to next task
254
-
255
- **After editing artifacts:** run \`openspec status --change "<name>" --json\` so revision tracking records content changes.
256
-
257
- **Pause if:**
258
- - Task is unclear → ask for clarification
259
- - Implementation reveals a design issue → suggest updating artifacts
260
- - Error or blocker encountered → report and wait for guidance
261
- - User interrupts
262
-
263
- 8. **On completion or pause, show status**
264
-
265
- Display:
266
- - Tasks completed this session
267
- - Overall progress: "N/M tasks complete"
268
- - If all done: suggest archive
269
- - If paused: explain why and wait for guidance
270
-
271
- **Output During Implementation**
272
-
273
- \`\`\`
274
- ## Implementing: <change-name> (schema: <schema-name>)
275
-
276
- Working on task 3/7: <task description>
277
- [...implementation happening...]
278
- ✓ Task complete
279
-
280
- Working on task 4/7: <task description>
281
- [...implementation happening...]
282
- ✓ Task complete
283
- \`\`\`
284
-
285
- **Output On Completion**
286
-
287
- \`\`\`
288
- ## Implementation Complete
289
-
290
- **Change:** <change-name>
291
- **Schema:** <schema-name>
292
- **Progress:** 7/7 tasks complete ✓
293
-
294
- ### Completed This Session
295
- - [x] Task 1
296
- - [x] Task 2
297
- ...
298
-
299
- All tasks complete! You can archive this change with \`/opsx:archive\`.
300
- \`\`\`
301
-
302
- **Output On Pause (Issue Encountered)**
303
-
304
- \`\`\`
305
- ## Implementation Paused
306
-
307
- **Change:** <change-name>
308
- **Schema:** <schema-name>
309
- **Progress:** 4/7 tasks complete
310
-
311
- ### Issue Encountered
312
- <description of the issue>
228
+ - Make the required code changes (minimal and focused), mark the task \`- [ ]\` → \`- [x]\`, and continue.
229
+ - **After editing artifacts:** run \`openspec status --change "<name>" --json\` so revision tracking records content changes.
230
+ - **Pause if** a task is unclear, implementation reveals a design issue, you hit an error/blocker, or the user interrupts.
313
231
 
314
- **Options:**
315
- 1. <option 1>
316
- 2. <option 2>
317
- 3. Other approach
318
-
319
- What would you like to do?
320
- \`\`\`
232
+ 8. **On completion or pause, show status** — announce each task as you start it, mark it \`✓\` when done, and report progress ("N/M tasks complete"). On completion suggest \`/opsx:archive\`; on pause state the issue and options and ask how to proceed.
321
233
 
322
234
  **Guardrails**
323
- - Keep going through tasks until done or blocked
324
- - Always read context files before starting (from the apply instructions output)
325
- - If task is ambiguous, pause and ask before implementing
326
- - If implementation reveals issues, pause and suggest artifact updates
327
- - Keep code changes minimal and scoped to each task
328
- - Update task checkbox immediately after completing each task
329
- - Pause on errors, blockers, or unclear requirements - don't guess
330
- - Use contextFiles from CLI output, don't assume specific file names
235
+ - Keep going until done or blocked; pause on ambiguity, errors, or design issues and ask before guessing
236
+ - Read context files before starting (don't assume file names); keep changes minimal and scoped; update each checkbox immediately
331
237
  ${COMPREHENSION_APPLY_GUARDRAIL}
332
238
  ${PLAYWRIGHT_APPLY_GUARDRAIL}
333
239
 
334
- **Fluid Workflow Integration**
335
-
336
- This skill supports the "actions on a change" model:
337
-
338
- - **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
339
- - **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly`
240
+ **Fluid Workflow Integration** — invoke anytime (before all artifacts are done if tasks exist, after partial implementation, or interleaved). If implementation reveals design issues, suggest updating artifacts; not phase-locked.`
340
241
  };
341
242
  }
342
243
  //# sourceMappingURL=apply-change.js.map
@@ -4,6 +4,6 @@
4
4
  * Interpolated into apply skill and slash command templates so agents run
5
5
  * a spec comprehension gate before implementation.
6
6
  */
7
- export declare const COMPREHENSION_QUIZ_GUIDANCE = "4. **Comprehension quiz (required before implementation)**\n\n After `openspec instructions apply --change \"<name>\" --json`, check comprehension status:\n\n - If `missingComprehension` is true OR `comprehension.required && !comprehension.passed`:\n - Do NOT edit application source code or mark task checkboxes yet\n - Read `contextFiles.proposal`, `contextFiles.design`, `contextFiles.specs`, `contextFiles.plan`, and `contextFiles.tasks` (or the `tasks` array in apply JSON)\n - Use `comprehension.questionCount` and `comprehension.questionAllocation` from the JSON\n\n **Generate questions**\n - Create exactly `comprehension.questionCount` multiple-choice questions\n - **Follow `comprehension.questionAllocation`** \u2014 generate the exact count per category (e.g. plan\u00D74, specs\u00D71); do not invent your own split\n - Each question maps to one artifact category:\n - **Proposal**: motivation, scope, or impact from `proposal.md`\n - **Design**: decisions, trade-offs, or approach from `design.md`\n - **Specs**: a `### Requirement:` or `#### Scenario:` from delta specs\n - **Plan**: code map, file targets, test plan, sequencing, or alignment with design from `plan.md`\n - **Tasks**: conceptual understanding of the implementation approach from pending (unchecked) tasks\n - Do NOT use completed tasks as question sources\n - Each question: **3 options** (`comprehension.optionsPerQuestion`, default 3) \u2014 1 correct from source substance, 2 plausible distractors from other proposal/design/spec/plan/task substance in the change\n\n **Plan question quality**\n - Test code map, file targets, test plan, sequencing, or alignment with design\n - **Forbidden**: section numbers, verbatim headings, trivia answerable without reading plan substance\n\n **Task question quality**\n - Test scope, approach, dependencies, sequencing rationale, or alignment with proposal/design/plan\n - **Forbidden**: task numbers, checklist order, \"which task says X verbatim\", or answers identifiable only by task index or checkbox position\n - Good: \"What is the primary file where quiz rules are centralized?\" (answer from task substance)\n - Bad: \"Which task number updates `comprehension-guidance.ts`?\" or \"What is the exact text of task 2.1?\"\n\n **Present and grade**\n - Present each question in chat with labeled options (A/B/C/D or 1\u20134)\n - Ask ONE question at a time; after each, STOP and wait for the user's answer before the next question\n - NEVER select answers yourself, infer what the user would pick, or call `--record-comprehension-pass` until the user has answered every question\n - On Cursor, you may use the **AskUserQuestion tool** instead of plain chat for this step.\n - Grade: `score_percent = round(correct / question_count * 100)`\n - Pass when `score_percent >= comprehension.thresholdPercent` (default 80)\n\n **On failure (score below threshold)**\n - Announce score and that a new quiz is required\n - Update `.comprehension-session.yaml` in the change dir with `used_sources` from this attempt\n - Generate a NEW question set using different proposal/design/spec/plan/task sources (avoid `used_sources`)\n - Retry until pass\n\n **On pass**\n ```bash\n openspec instructions apply --change \"<name>\" --record-comprehension-pass --score <score> --attempt <n> --question-count <count> --json\n ```\n - Re-run `openspec instructions apply --change \"<name>\" --json`\n - Confirm `state` is `\"ready\"` and `comprehension.passed` is true before continuing\n\n **Output template**\n ```\n ## Applying: <change-name> \u2014 comprehension check\n\n plan\u00D7N, specs\u00D7N, design\u00D7N, proposal\u00D7N, tasks\u00D7N \u2192 <questionCount> questions (3 options each)\n\n Question 1/N: ...\n ...\n \u2713 Comprehension passed (<score>%, attempt <n>)\n ```\n\n Then continue to step 5 (show progress) and implementation.";
7
+ export declare const COMPREHENSION_QUIZ_GUIDANCE = "4. **Comprehension quiz (required before implementation)**\n\n **STOP \u2014 the human developer answers every question.** NEVER answer, infer, or select answers on the user's behalf, and NEVER run `--record-comprehension-pass` until the user has answered every question. Ask one question, then end your turn and wait for their reply.\n\n After `openspec instructions apply --change \"<name>\" --json`, check comprehension status:\n\n - If `missingComprehension` is true OR `comprehension.required && !comprehension.passed`:\n - Do NOT edit application source code or mark task checkboxes yet\n - Read `contextFiles.proposal`, `contextFiles.design`, `contextFiles.specs`, `contextFiles.plan`, and `contextFiles.tasks` (or the `tasks` array in apply JSON)\n - Use `comprehension.questionCount` and `comprehension.questionAllocation` from the JSON\n\n **Generate questions**\n - Create exactly `comprehension.questionCount` multiple-choice questions\n - **Follow `comprehension.questionAllocation`** \u2014 generate the exact count per category (e.g. plan\u00D74, specs\u00D71); do not invent your own split\n - Each question maps to one artifact category:\n - **Proposal**: motivation, scope, or impact from `proposal.md`\n - **Design**: decisions, trade-offs, or approach from `design.md`\n - **Specs**: a `### Requirement:` or `#### Scenario:` from delta specs\n - **Plan**: code map, file targets, test plan, sequencing, or alignment with design from `plan.md`\n - **Tasks**: conceptual understanding of the implementation approach from pending (unchecked) tasks\n - Do NOT use completed tasks as question sources\n - Each question: **3 options** (`comprehension.optionsPerQuestion`, default 3) \u2014 1 correct from source substance, 2 plausible distractors from other proposal/design/spec/plan/task substance in the change\n\n **Plan question quality**\n - Test code map, file targets, test plan, sequencing, or alignment with design\n - **Forbidden**: section numbers, verbatim headings, trivia answerable without reading plan substance\n\n **Task question quality**\n - Test scope, approach, dependencies, sequencing rationale, or alignment with proposal/design/plan\n - **Forbidden**: task numbers, checklist order, \"which task says X verbatim\", or answers identifiable only by task index or checkbox position\n - Good: \"What is the primary file where quiz rules are centralized?\" (answer from task substance)\n - Bad: \"Which task number updates `comprehension-guidance.ts`?\" or \"What is the exact text of task 2.1?\"\n\n **Present and grade**\n - Present each question in chat with labeled options (A/B/C/D or 1\u20134)\n - Ask ONE question at a time; after each, STOP and wait for the user's answer before the next question\n - NEVER select answers yourself, infer what the user would pick, or call `--record-comprehension-pass` until the user has answered every question\n - On Cursor, you may use the **AskUserQuestion tool** instead of plain chat for this step.\n - Grade: `score_percent = round(correct / question_count * 100)`\n - Pass when `score_percent >= comprehension.thresholdPercent` (default 80)\n\n **On failure (score below threshold)**\n - Announce score and that a new quiz is required\n - Update `.comprehension-session.yaml` in the change dir with `used_sources` from this attempt\n - Generate a NEW question set using different proposal/design/spec/plan/task sources (avoid `used_sources`)\n - Retry until pass\n\n **On pass**\n ```bash\n openspec instructions apply --change \"<name>\" --record-comprehension-pass --score <score> --attempt <n> --question-count <count> --json\n ```\n - Re-run `openspec instructions apply --change \"<name>\" --json`\n - Confirm `state` is `\"ready\"` and `comprehension.passed` is true before continuing\n\n **Output template**\n ```\n ## Applying: <change-name> \u2014 comprehension check\n\n plan\u00D7N, specs\u00D7N, design\u00D7N, proposal\u00D7N, tasks\u00D7N \u2192 <questionCount> questions (3 options each)\n\n Question 1/N: ...\n ...\n \u2713 Comprehension passed (<score>%, attempt <n>)\n ```\n\n Then continue to step 5 (show progress) and implementation.";
8
8
  export declare const COMPREHENSION_APPLY_GUARDRAIL = "- NEVER implement code or mark tasks while `missingComprehension` is true\n- NEVER skip the comprehension quiz when the apply JSON requires it\n- NEVER answer comprehension quiz questions yourself \u2014 the human developer must answer every question\n- NEVER call `--record-comprehension-pass` until the user has answered every question\n- If the user asks to skip the quiz, refuse and explain they must pass or set comprehension.enabled: false in openspec/config.yaml";
9
9
  //# sourceMappingURL=comprehension-guidance.d.ts.map
@@ -7,6 +7,8 @@
7
7
  import { COMPREHENSION_PRESENT_AND_GRADE } from './user-prompt-guidance.js';
8
8
  export const COMPREHENSION_QUIZ_GUIDANCE = `4. **Comprehension quiz (required before implementation)**
9
9
 
10
+ **STOP — the human developer answers every question.** NEVER answer, infer, or select answers on the user's behalf, and NEVER run \`--record-comprehension-pass\` until the user has answered every question. Ask one question, then end your turn and wait for their reply.
11
+
10
12
  After \`openspec instructions apply --change "<name>" --json\`, check comprehension status:
11
13
 
12
14
  - If \`missingComprehension\` is true OR \`comprehension.required && !comprehension.passed\`:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codewalla_india/openspec",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "AI-native system for spec-driven development",
5
5
  "keywords": [
6
6
  "openspec",