Skip to content

Commit b22d1f0

Browse files
committed
docs(opsx): 更新命令文档中的代码块格式和内容结构
- 统一所有命令文档中的代码块格式,将纯文本标记改为适当的 ```text 或 ```bash 格式 - 在多个文档中添加缺失的空行以改善可读性 - 调整 opsx/onboard.md 中的文件结构显示格式,使层次更清晰 - 更新 opsx/bulk-archive.md 和相关技能文档中的列表缩进格式 - 修正 opsx/apply、opsx/archive 等命令的状态检查和输出格式 - 改善 opsx/continue 和 opsx/ff 中的依赖处理说明 - 增强 opsx/sync 中关于智能合并的描述格式 - 优化 opsx/explore 和 opsx/verify 的内容组织结构
1 parent 1dba98e commit b22d1f0

345 files changed

Lines changed: 4591 additions & 2392 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/commands/opsx/apply.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ Implement tasks from an OpenSpec change.
2121
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).
2222

2323
2. **Check status to understand the schema**
24+
2425
```bash
2526
openspec status --change "<name>" --json
2627
```
28+
2729
Parse the JSON to understand:
2830
- `schemaName`: The workflow being used (e.g., "spec-driven")
2931
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
@@ -85,7 +87,7 @@ Implement tasks from an OpenSpec change.
8587

8688
**Output During Implementation**
8789

88-
```
90+
```text
8991
## Implementing: <change-name> (schema: <schema-name>)
9092
9193
Working on task 3/7: <task description>
@@ -99,7 +101,7 @@ Working on task 4/7: <task description>
99101

100102
**Output On Completion**
101103

102-
```
104+
```text
103105
## Implementation Complete
104106
105107
**Change:** <change-name>
@@ -116,7 +118,7 @@ All tasks complete! You can archive this change with `/opsx:archive`.
116118

117119
**Output On Pause (Issue Encountered)**
118120

119-
```
121+
```text
120122
## Implementation Paused
121123
122124
**Change:** <change-name>
@@ -135,6 +137,7 @@ What would you like to do?
135137
```
136138

137139
**Guardrails**
140+
138141
- Keep going through tasks until done or blocked
139142
- Always read context files before starting (from the apply instructions output)
140143
- If task is ambiguous, pause and ask before implementing

.claude/commands/opsx/archive.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Archive a completed change in the experimental workflow.
6464
5. **Perform the archive**
6565

6666
Create the archive directory if it doesn't exist:
67+
6768
```bash
6869
mkdir -p openspec/changes/archive
6970
```
@@ -89,7 +90,7 @@ Archive a completed change in the experimental workflow.
8990

9091
**Output On Success**
9192

92-
```
93+
```text
9394
## Archive Complete
9495
9596
**Change:** <change-name>
@@ -102,7 +103,7 @@ All artifacts complete. All tasks complete.
102103

103104
**Output On Success (No Delta Specs)**
104105

105-
```
106+
```text
106107
## Archive Complete
107108
108109
**Change:** <change-name>
@@ -115,7 +116,7 @@ All artifacts complete. All tasks complete.
115116

116117
**Output On Success With Warnings**
117118

118-
```
119+
```text
119120
## Archive Complete (with warnings)
120121
121122
**Change:** <change-name>
@@ -133,7 +134,7 @@ Review the archive if this was not intentional.
133134

134135
**Output On Error (Archive Exists)**
135136

136-
```
137+
```text
137138
## Archive Failed
138139
139140
**Change:** <change-name>
@@ -148,6 +149,7 @@ Target archive directory already exists.
148149
```
149150

150151
**Guardrails**
152+
151153
- Always prompt for change selection if not provided
152154
- Use artifact graph (openspec status --json) for completion checking
153155
- Don't block archive on warnings - just inform and confirm

.claude/commands/opsx/bulk-archive.md

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,22 @@ This skill allows you to batch-archive changes, handling spec conflicts intellig
3333
For each selected change, collect:
3434

3535
a. **Artifact status** - Run `openspec status --change "<name>" --json`
36-
- Parse `schemaName` and `artifacts` list
37-
- Note which artifacts are `done` vs other states
36+
- Parse `schemaName` and `artifacts` list
37+
- Note which artifacts are `done` vs other states
3838

3939
b. **Task completion** - Read `openspec/changes/<name>/tasks.md`
40-
- Count `- [ ]` (incomplete) vs `- [x]` (complete)
41-
- If no tasks file exists, note as "No tasks"
40+
- Count `- [ ]` (incomplete) vs `- [x]` (complete)
41+
- If no tasks file exists, note as "No tasks"
4242

4343
c. **Delta specs** - Check `openspec/changes/<name>/specs/` directory
44-
- List which capability specs exist
45-
- For each, extract requirement names (lines matching `### Requirement: <name>`)
44+
- List which capability specs exist
45+
- For each, extract requirement names (lines matching `### Requirement: <name>`)
4646

4747
4. **Detect spec conflicts**
4848

4949
Build a map of `capability -> [changes that touch it]`:
5050

51-
```
51+
```text
5252
auth -> [change-a, change-b] <- CONFLICT (2+ changes)
5353
api -> [change-c] <- OK (only 1 change)
5454
```
@@ -62,24 +62,24 @@ This skill allows you to batch-archive changes, handling spec conflicts intellig
6262
a. **Read the delta specs** from each conflicting change to understand what each claims to add/modify
6363

6464
b. **Search the codebase** for implementation evidence:
65-
- Look for code implementing requirements from each delta spec
66-
- Check for related files, functions, or tests
65+
- Look for code implementing requirements from each delta spec
66+
- Check for related files, functions, or tests
6767

6868
c. **Determine resolution**:
69-
- If only one change is actually implemented -> sync that one's specs
70-
- If both implemented -> apply in chronological order (older first, newer overwrites)
71-
- If neither implemented -> skip spec sync, warn user
69+
- If only one change is actually implemented -> sync that one's specs
70+
- If both implemented -> apply in chronological order (older first, newer overwrites)
71+
- If neither implemented -> skip spec sync, warn user
7272

7373
d. **Record resolution** for each conflict:
74-
- Which change's specs to apply
75-
- In what order (if both)
76-
- Rationale (what was found in codebase)
74+
- Which change's specs to apply
75+
- In what order (if both)
76+
- Rationale (what was found in codebase)
7777

7878
6. **Show consolidated status table**
7979

8080
Display a table summarizing all changes:
8181

82-
```
82+
```text
8383
| Change | Artifacts | Tasks | Specs | Conflicts | Status |
8484
|---------------------|-----------|-------|---------|-----------|--------|
8585
| schema-management | Done | 5/5 | 2 delta | None | Ready |
@@ -89,13 +89,15 @@ This skill allows you to batch-archive changes, handling spec conflicts intellig
8989
```
9090

9191
For conflicts, show the resolution:
92-
```
92+
93+
```text
9394
* Conflict resolution:
9495
- auth spec: Will apply add-oauth then add-jwt (both implemented, chronological order)
9596
```
9697

9798
For incomplete changes, show warnings:
98-
```
99+
100+
```text
99101
Warnings:
100102
- add-verify-skill: 1 incomplete artifact, 3 incomplete tasks
101103
```
@@ -117,26 +119,27 @@ This skill allows you to batch-archive changes, handling spec conflicts intellig
117119
Process changes in the determined order (respecting conflict resolution):
118120

119121
a. **Sync specs** if delta specs exist:
120-
- Use the openspec-sync-specs approach (agent-driven intelligent merge)
121-
- For conflicts, apply in resolved order
122-
- Track if sync was done
122+
- Use the openspec-sync-specs approach (agent-driven intelligent merge)
123+
- For conflicts, apply in resolved order
124+
- Track if sync was done
123125

124126
b. **Perform the archive**:
127+
125128
```bash
126129
mkdir -p openspec/changes/archive
127130
mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
128131
```
129132

130133
c. **Track outcome** for each change:
131-
- Success: archived successfully
132-
- Failed: error during archive (record error)
133-
- Skipped: user chose not to archive (if applicable)
134+
- Success: archived successfully
135+
- Failed: error during archive (record error)
136+
- Skipped: user chose not to archive (if applicable)
134137

135138
9. **Display summary**
136139

137140
Show final results:
138141

139-
```
142+
```text
140143
## Bulk Archive Complete
141144
142145
Archived 3 changes:
@@ -153,15 +156,17 @@ This skill allows you to batch-archive changes, handling spec conflicts intellig
153156
```
154157

155158
If any failures:
156-
```
159+
160+
```text
157161
Failed 1 change:
158162
- some-change: Archive directory already exists
159163
```
160164

161165
**Conflict Resolution Examples**
162166

163167
Example 1: Only one implemented
164-
```
168+
169+
```text
165170
Conflict: specs/auth/spec.md touched by [add-oauth, add-jwt]
166171
167172
Checking add-oauth:
@@ -176,7 +181,8 @@ Resolution: Only add-oauth is implemented. Will sync add-oauth specs only.
176181
```
177182

178183
Example 2: Both implemented
179-
```
184+
185+
```text
180186
Conflict: specs/api/spec.md touched by [add-rest-api, add-graphql]
181187
182188
Checking add-rest-api (created 2026-01-10):
@@ -193,7 +199,7 @@ then add-graphql specs (chronological order, newer takes precedence).
193199

194200
**Output On Success**
195201

196-
```
202+
```text
197203
## Bulk Archive Complete
198204
199205
Archived N changes:
@@ -207,7 +213,7 @@ Spec sync summary:
207213

208214
**Output On Partial Success**
209215

210-
```
216+
```text
211217
## Bulk Archive Complete (partial)
212218
213219
Archived N changes:
@@ -222,13 +228,14 @@ Failed K changes:
222228

223229
**Output When No Changes**
224230

225-
```
231+
```text
226232
## No Changes to Archive
227233
228234
No active changes found. Create a new change to get started.
229235
```
230236

231237
**Guardrails**
238+
232239
- Allow any number of changes (1+ is fine, 2+ is the typical use case)
233240
- Always prompt for selection, never auto-select
234241
- Detect spec conflicts early and resolve by checking codebase

.claude/commands/opsx/continue.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,32 +26,36 @@ Continue working on a change by creating the next artifact.
2626
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
2727

2828
2. **Check current status**
29+
2930
```bash
3031
openspec status --change "<name>" --json
3132
```
33+
3234
Parse the JSON to understand current state. The response includes:
3335
- `schemaName`: The workflow schema being used (e.g., "spec-driven")
3436
- `artifacts`: Array of artifacts with their status ("done", "ready", "blocked")
3537
- `isComplete`: Boolean indicating if all artifacts are complete
3638

3739
3. **Act based on status**:
3840

39-
---
41+
---
4042

4143
**If all artifacts are complete (`isComplete: true`)**:
4244
- Congratulate the user
4345
- Show final status including the schema used
4446
- Suggest: "All artifacts created! You can now implement this change with `/opsx:apply` or archive it with `/opsx:archive`."
4547
- STOP
4648

47-
---
49+
---
4850

4951
**If artifacts are ready to create** (status shows artifacts with `status: "ready"`):
5052
- Pick the FIRST artifact with `status: "ready"` from the status output
5153
- Get its instructions:
54+
5255
```bash
5356
openspec instructions <artifact-id> --change "<name>" --json
5457
```
58+
5559
- Parse the JSON. The key fields are:
5660
- `context`: Project background (constraints for you - do NOT include in output)
5761
- `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
@@ -67,20 +71,22 @@ Continue working on a change by creating the next artifact.
6771
- Show what was created and what's now unlocked
6872
- STOP after creating ONE artifact
6973
70-
---
74+
---
7175
7276
**If no artifacts are ready (all blocked)**:
7377
- This shouldn't happen with a valid schema
7478
- Show status and suggest checking for issues
7579

7680
4. **After creating an artifact, show progress**
81+
7782
```bash
7883
openspec status --change "<name>"
7984
```
8085

8186
**Output**
8287

8388
After each invocation, show:
89+
8490
- Which artifact was created
8591
- Schema workflow being used
8692
- Current progress (N/M complete)
@@ -94,6 +100,7 @@ The artifact types and their purpose depend on the schema. Use the `instruction`
94100
Common artifact patterns:
95101

96102
**spec-driven schema** (proposal → specs → design → tasks):
103+
97104
- **proposal.md**: Ask user about the change if not clear. Fill in Why, What Changes, Capabilities, Impact.
98105
- The Capabilities section is critical - each capability listed will need a spec file.
99106
- **specs/<capability>/spec.md**: Create one spec per capability listed in the proposal's Capabilities section (use the capability name, not the change name).
@@ -103,6 +110,7 @@ Common artifact patterns:
103110
For other schemas, follow the `instruction` field from the CLI output.
104111
105112
**Guardrails**
113+
106114
- Create ONE artifact per invocation
107115
- Always read dependency artifacts before creating a new one
108116
- Never skip artifacts or create out of order

0 commit comments

Comments
 (0)