--- name: mspec-delta description: delta step of mspec workflow — generate Delta Spec with auto-numbered FR-NNN when_to_use: User runs /mspec:delta, or workflow auto-continues to delta --- ## Procedure 1. Run `mspec status --change --json` first. 2. Read `proposal.md` → extract capability names from `## Capabilities (touched)`. 3. For each capability, run `mspec delta init --capability --change `. The CLI auto-numbers FR-NNN by reading existing `specs//spec.md`. 4. Edit each generated `changes//specs//spec.md`: - Replace placeholders in `### Requirement: FR-NNN — ` headers (H3). - Write the Requirement body in **EARS format** using RFC 2119 keywords with the following semantics (per Constitution): - `SHALL` — 機能要件(system の振る舞いを規定するデフォルト) - `MUST` — 制約・安全要件(絶対的強制または禁止) - `SHOULD` — 推奨(逸脱可能だが理由が必要) - `MAY` — 任意(オプション機能) - EARS pattern guidance — read `"locale"` from the `mspec status --json` output (step 1) and use the matching format: - **locale=ja の場合**: - Ubiquitous: `このシステムは SHALL <振る舞い>.` - Event-Driven: `<トリガー> のとき、このシステムは SHALL <振る舞い>.` - State-Driven: `<状態> の間、このシステムは SHALL <振る舞い>.` - Unwanted Behavior: `<条件> の場合、このシステムは SHALL <振る舞い>.` - Optional Feature: `<機能> が有効な場合、このシステムは SHALL <振る舞い>.` - **locale=en の場合**(locale フィールドが undefined の場合も含む): - Ubiquitous: `The system SHALL .` - Event-Driven: `When , the system SHALL .` - State-Driven: `While , the system SHALL .` - Unwanted Behavior: `If , then the system SHALL .` - Optional Feature: `Where , the system SHALL .` - Add at least one `#### Scenario: ` (must be H4) with `- GIVEN`, `- WHEN`, `- THEN` bullets nested inside each Requirement. 5. `readme.md` の `## Artifacts` 節の `- [ ] specs/*/spec.md (Delta Spec)` を `- [x] specs/*/spec.md (Delta Spec)` に更新する。 6. Run `mspec validate --change ` (validates FR-ID uniqueness and H4 Scenarios). validate が失敗した場合は `- [x] specs/*/spec.md (Delta Spec)` を `- [ ] specs/*/spec.md (Delta Spec)` にロールバックする。 7. `block: false` — auto-continue via `/mspec:continue`. ## Verification (C2) - `mspec validate --change ` — アーティファクト整合性チェック - `mspec anchor check --change ` — アンカー解決確認 - `mspec spec lint` — Delta Spec実装詳細漏洩チェック ## Learning (C3) このスキルの実行で発生した学習候補を記録する: ``` ``` `mspec learn` コマンドが archive 済み changes からこれらを収集してpost-condition候補をproposeする。