You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: inject config.yaml context and rules into apply/verify phases
Previously, config.yaml rules only worked for artifact generation phases
(proposal, specs, design, tasks). The apply and verify phases had no access
to project-level rules, making it impossible to customize execution strategies
(e.g., subagent dispatching, parallel verification scans).
Changes:
- Apply: generateApplyInstructions() now reads config.yaml context + rules.apply
- Verify: new generateVerifyInstructions() reads config.yaml context + rules.verify
- CLI: `openspec instructions verify` is now a valid command
- Validation: apply/verify are accepted as valid rule keys in config.yaml
- Templates: generated command/skill prompts instruct AI to follow rules as
mandatory execution constraints
This enables teams to define custom execution strategies in config.yaml:
rules:
apply:
- "Use subagent for each task"
verify:
- "Run 4 parallel scan subagents"
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@@ -386,6 +394,21 @@ export async function generateApplyInstructions(
386
394
instruction=schemaInstruction?.trim()??'Read context files, work through pending tasks, mark complete as you go.\nPause if you hit blockers or need clarification.';
387
395
}
388
396
397
+
// Read project config for context and rules injection
Copy file name to clipboardExpand all lines: src/core/templates/workflows/apply-change.ts
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,8 @@ export function getApplyChangeSkillTemplate(): SkillTemplate {
44
44
- Progress (total, complete, remaining)
45
45
- Task list with status
46
46
- Dynamic instruction based on current state
47
+
- \`context\`: Project context from config.yaml (if present)
48
+
- \`rules\`: Apply-phase rules from config.yaml (if present) — **these are mandatory constraints, you MUST follow them**
47
49
48
50
**Handle states:**
49
51
- If \`state: "blocked"\` (missing artifacts): show message, suggest using openspec-continue-change
@@ -64,9 +66,13 @@ export function getApplyChangeSkillTemplate(): SkillTemplate {
64
66
- Progress: "N/M tasks complete"
65
67
- Remaining tasks overview
66
68
- Dynamic instruction from CLI
69
+
- If rules are present, display them as "Apply Rules" section
67
70
68
71
6. **Implement tasks (loop until done or blocked)**
69
72
73
+
**IMPORTANT**: If \`rules\` are present in the apply instructions output, you MUST follow them as mandatory execution constraints. Rules may specify execution strategies (e.g., using subagents, specific testing requirements, retry policies). Follow them exactly.
74
+
75
+
If no rules are present, use the default behavior:
70
76
For each pending task:
71
77
- Show which task is being worked on
72
78
- Make the code changes required
@@ -201,6 +207,8 @@ export function getOpsxApplyCommandTemplate(): CommandTemplate {
201
207
- Progress (total, complete, remaining)
202
208
- Task list with status
203
209
- Dynamic instruction based on current state
210
+
- \`context\`: Project context from config.yaml (if present)
211
+
- \`rules\`: Apply-phase rules from config.yaml (if present) — **these are mandatory constraints, you MUST follow them**
204
212
205
213
**Handle states:**
206
214
- If \`state: "blocked"\` (missing artifacts): show message, suggest using \`/opsx:continue\`
@@ -221,9 +229,13 @@ export function getOpsxApplyCommandTemplate(): CommandTemplate {
221
229
- Progress: "N/M tasks complete"
222
230
- Remaining tasks overview
223
231
- Dynamic instruction from CLI
232
+
- If rules are present, display them as "Apply Rules" section
224
233
225
234
6. **Implement tasks (loop until done or blocked)**
226
235
236
+
**IMPORTANT**: If \`rules\` are present in the apply instructions output, you MUST follow them as mandatory execution constraints. Rules may specify execution strategies (e.g., using subagents, specific testing requirements, retry policies). Follow them exactly.
237
+
238
+
If no rules are present, use the default behavior:
0 commit comments