Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
385 commits
Select commit Hold shift + click to select a range
12f4292
Update A5 NPU validation skill
Mar 23, 2026
29c4a0c
Refine bitcode skill environment setup
Mar 23, 2026
3a9703b
Reorgnize tile fusion related files
Zhendong404 Mar 24, 2026
c3022dd
Fix HIVM transfer intrinsic names
Mar 24, 2026
a21e470
Refactor PTOAS LLVM and validation skills
Mar 24, 2026
4dd58ff
Revert "docs: tighten VPTO physical ISA spec"
WenboCodes Mar 24, 2026
ca46859
Merge pull request #3 from mouliangyu/revert-1-codex/vpto-spec-isa-doc
WenboCodes Mar 24, 2026
b2d2419
Merge branch 'mouliangyu:feature-vpto-backend' into feature-vpto-backend
WenboCodes Mar 24, 2026
141a87b
Document sync and copy ops without v prefix
WenboCodes Mar 24, 2026
8f7dab5
Finish redundant store elimination
Zhendong404 Mar 24, 2026
c9184a4
Update openspec
Zhendong404 Mar 24, 2026
c349a73
Add PTO A5 installed implementation trace skill
Mar 24, 2026
9f37f47
Merge remote-tracking branch 'remotes/mly/feature-vpto-backend' into …
Zhendong404 Mar 24, 2026
bc16623
docs: replace vpto-spec with A5-merged ISA spec draft
peanutchan Mar 24, 2026
edcf8cd
Change to A5VM backend
Zhendong404 Mar 24, 2026
6582b76
Merge pull request #2 from peanutchan/feature-vpto-backend
WenboCodes Mar 24, 2026
f251a5c
docs: reorganize Part III ISA reference into 13 categorized groups
peanutchan Mar 24, 2026
a128f23
Merge pull request #4 from peanutchan/docs/vpto-isa-reference-v2
peanutchan Mar 24, 2026
bf693b0
Add reusable LLVM IR kernel-so validation flow
Mar 24, 2026
a97b03a
Support sample-level py golden for host validation
Mar 24, 2026
7354bf2
Add A5 LLVM IR validation support for vector ops
Mar 24, 2026
4252d65
Fix A5 LLVM full-mask lowering for Expands
Mar 24, 2026
c71b6e6
Stabilize A5 LLVM validation workflow
Mar 24, 2026
fda0042
Align row-reduce store dist with installed PTO
Mar 25, 2026
388989a
Adapt low level loop fusion to A5VM
Zhendong404 Mar 25, 2026
2d7a576
Update openspec
Zhendong404 Mar 25, 2026
3d0400f
Fix A5VM row-reduce post-update LLVM lowering
Mar 25, 2026
895aed8
docs: expand pipeline sync with patterns, ping/pong, and inter-core
peanutchan Mar 25, 2026
51f35c1
Fix LLVM CVT rounding and add FA op validation goldens
Mar 25, 2026
ae1a0e1
docs: expand DMA copy with register encoding, burst/gap/pad, examples
peanutchan Mar 25, 2026
adcfe5c
docs: fix DMA diagrams — stride-based, 32B pad alignment, de-padding
peanutchan Mar 25, 2026
5585b79
docs: fix register bit field widths for DMA stride/size
peanutchan Mar 25, 2026
c653128
docs: remove valid_rows/valid_cols, add src/dst stride prefix, TBD l2
peanutchan Mar 25, 2026
f4c25e7
Merge pull request #6 from peanutchan/docs/dma-copy-v2
peanutchan Mar 25, 2026
b4a4086
Merge pull request #5 from peanutchan/docs/pipeline-sync-v2
peanutchan Mar 25, 2026
4552985
Add reusable LLVM IR kernel-so validation flow
Mar 24, 2026
b4a4a3c
Support sample-level py golden for host validation
Mar 24, 2026
60b2cdb
Add A5 LLVM IR validation support for vector ops
Mar 24, 2026
5cd7f7c
Fix A5 LLVM full-mask lowering for Expands
Mar 24, 2026
4d8c5c3
Stabilize A5 LLVM validation workflow
Mar 24, 2026
5308a61
Align row-reduce store dist with installed PTO
Mar 25, 2026
b2c20be
add a npu-validated case
Mar 25, 2026
d0e5db7
Refactor host NPU validation dispatch
Mar 25, 2026
10a407c
docs: refine VPTO spec type constraints
WenboCodes Mar 25, 2026
7434fd1
Persist A5 lowering strategy draft and local test common
Mar 25, 2026
4ebe1a7
Merge branch 'feature-vpto-backend' into feature-a5-validation
Mar 26, 2026
76f7566
docs: reorganize VPTO element types section
WenboCodes Mar 26, 2026
2ea529a
docs: document shared arith and scf support
WenboCodes Mar 26, 2026
450ebb2
docs(vpto-spec): update sync model, load/store patterns, and mask sem…
Mar 26, 2026
e386cda
docs: simplify load/store patterns text, rename to vector core pipeli…
peanutchan Mar 26, 2026
9951b42
docs: remove Predication Model section (details now in !pto.mask type)
peanutchan Mar 26, 2026
c554abf
docs: simplify mask section - remove producers/consumers list, use va…
peanutchan Mar 26, 2026
9e9fe6f
docs: add vcmp/vsel example back alongside vadd predication example
peanutchan Mar 26, 2026
b354ca0
Add memref operand format for vld/vst ops
Zhendong404 Mar 26, 2026
f9361e5
docs: clarify full scalar arith support
WenboCodes Mar 26, 2026
3891870
Merge pull request #8 from peanutchan/fix/vpto-spec-sync-mask-updates
WenboCodes Mar 26, 2026
8369ef1
docs: remove CCE mapping notes from VPTO spec
WenboCodes Mar 26, 2026
5397615
Merge upstream/feature-vpto-backend into feature-vpto-backend
WenboCodes Mar 26, 2026
b69ec53
Merge pull request #7 from WenboCodes/feature-vpto-backend
peanutchan Mar 26, 2026
fb62ed0
Align A5VM lowering and LLVM validation flow
Mar 26, 2026
1966af7
Add host validation goldens for scalar samples
Mar 26, 2026
58c4258
Fix A5 vldu lowering and validation flags
Mar 26, 2026
699c84f
Add VPTO host validation cases
Mar 26, 2026
72b1c53
Merge branch 'feature-a5-validation' into feature-vpto-backend
Mar 26, 2026
897c2b5
Adapt load/store elision pass to A5VM
Zhendong404 Mar 26, 2026
73f2b0b
Update openspec
Zhendong404 Mar 26, 2026
570d814
docs: document pto.ptr and pointer ops
WenboCodes Mar 26, 2026
30b2d1d
Merge remote-tracking branch 'upstream/feature-vpto-backend' into fea…
WenboCodes Mar 26, 2026
e745426
Add more VPTO validation cases
Mar 26, 2026
b4bd2e6
docs: rename a5vm ops to pto in spec
WenboCodes Mar 26, 2026
093ca14
Merge pull request #9 from WenboCodes/feature-vpto-backend
mouliangyu Mar 26, 2026
4da52d8
support ca model
Mar 26, 2026
4a2d6f1
support x86 test
Mar 26, 2026
57660ea
Normalize VPTO workspace path
Mar 26, 2026
f4d3dec
Finish redundant predicate elimination
Zhendong404 Mar 26, 2026
7cf2eab
Update openspec
Zhendong404 Mar 26, 2026
2a7daa6
Merge remote-tracking branch 'mly/feature-vpto-backend' into tile-fus…
Zhendong404 Mar 26, 2026
687f9a8
fixup camodel ldflags
Mar 26, 2026
213dc19
docs: rename A5VM references to PTO in ISA docs
WenboCodes Mar 26, 2026
a5b87d8
Merge remote-tracking branch 'upstream/feature-vpto-backend' into fea…
WenboCodes Mar 26, 2026
cdf6b74
Fix expandbin op lowering
Zhendong404 Mar 26, 2026
4292df0
docs: refresh ISA markdown syntax
WenboCodes Mar 26, 2026
6f2cc72
Align A5VM ptr lowering and refresh VPTO cases
Mar 26, 2026
dfcfc99
Add ptr cast regression tests
Mar 26, 2026
518442b
Refresh vpto ptr-only kernels from samples
Mar 26, 2026
7caf638
Tighten A5VM copy ops to typed ptr contracts
Mar 26, 2026
b6273c3
Add version selection pass
Zhendong404 Mar 27, 2026
190c850
Update openspec
Zhendong404 Mar 27, 2026
4f6ea00
Fix load store elimination bugs
Zhendong404 Mar 27, 2026
aa2c824
Refresh VPTO ISA docs for current operand syntax
Mar 27, 2026
c4d85db
Merge pull request #12 from mouliangyu/feature-refresh-docs
mouliangyu Mar 27, 2026
88c78ce
fixup typo
Mar 27, 2026
dd1ec34
Run a scf.if canonicalizer before low level loop fusion
Zhendong404 Mar 27, 2026
6f25e13
Align A5VM unary and binary VPTO interfaces
Mar 27, 2026
055525d
Drop A5VM vlds/vsts mode attrs and re-export VPTO kernels
Mar 27, 2026
a9c7697
reduce the abs case writing
Mar 27, 2026
a65006a
update abs
Mar 27, 2026
632db68
fixup abs
Mar 27, 2026
0f10d35
docs: clarify VPTO vector instruction semantics
zhoubot Mar 27, 2026
a09c42c
Merge pull request #13 from mouliangyu/codex/vpto-doc-instruction-det…
WenboCodes Mar 27, 2026
30a2b41
docs: partial reapply of PR#6 for DMA copy
peanutchan Mar 27, 2026
a2bf011
Merge pull request #15 from peanutchan/docs/dma-copy-partial-pr6
peanutchan Mar 27, 2026
fdd8ff2
update abs
Mar 27, 2026
9711e58
update vabs case
Mar 27, 2026
1196ab5
docs: remove redundant %valid_rows/%valid_cols from DMA copy ops
peanutchan Mar 27, 2026
f06b154
Merge pull request #16 from peanutchan/docs/dma-copy-remove-valid-row…
peanutchan Mar 27, 2026
00cf42c
docs: rename VPTO terminology to PTO micro Instruction
WenboCodes Mar 27, 2026
e76baec
Merge pull request #17 from WenboCodes/feature-vpto-backend
WenboCodes Mar 27, 2026
0c7bc62
Support fusion of rowexpand binary OP
Zhendong404 Mar 27, 2026
1ec9374
Update openspec
Zhendong404 Mar 27, 2026
2e7d51e
Implement compact tile_buf assembly syntax
Zhendong404 Mar 27, 2026
da5fd53
remove redundant valid row/col of dma-copy instruction
Mar 27, 2026
f7946ed
Update openspec
Zhendong404 Mar 28, 2026
6dd494e
Update tile fusion spec
Zhendong404 Mar 28, 2026
9295d09
Merge remote-tracking branch 'mly/feature-vpto-backend' into tile-fus…
Zhendong404 Mar 28, 2026
c54d906
Add a memref to ptr converter
Zhendong404 Mar 28, 2026
df24b96
Fix tile_fusion testcases
Zhendong404 Mar 28, 2026
b86dd75
Merge pull request #18 from Zhendong404/tile-fusion-vpto
mouliangyu Mar 28, 2026
0b4219c
Keep aivector_loop before emiter
Zhendong404 Mar 28, 2026
17385be
Rename A5VM to VPTO in tests and tooling
Mar 29, 2026
f4eb4b1
Sync VPTO regression tests with emit-vpto output
Mar 29, 2026
be2a7af
Merge tile-fusion-vpto and keep VPTO naming
Mar 29, 2026
64747cd
Fix VPTO multi-loop aivector metadata
Mar 29, 2026
0c4d737
Update NPU validation skill notes
Mar 29, 2026
371ec0f
Support VPTO LLVM emission for vcvt
Mar 29, 2026
8712f1f
Add PyPTOIRParser NPU validation goldens
Mar 29, 2026
117d255
Rename VPTO vec type to vreg
Mar 29, 2026
ada2a9a
Replace dummy vecscope loops with pto.vecscope
Mar 30, 2026
073f126
Document pto.vecscope as the VPTO source marker
Mar 30, 2026
e925a39
Move vecscope op definition into VPTO ops
Mar 30, 2026
b8eec19
Add strict vecscope with explicit captures
Mar 30, 2026
d575f57
Update cann to 9.0.0
Zhendong404 Mar 30, 2026
e91bbaa
Add strict vecscope VPTO abs validation case
Mar 30, 2026
23fae15
Document strict vecscope interface semantics
Mar 30, 2026
7190080
Draft pto.vkernel VPTO Python DSL design
Mar 30, 2026
ad153ce
Add strong typed vkernel scalar declarations
Mar 30, 2026
88179b3
Fix and update lit cases
Zhendong404 Mar 31, 2026
e7ef05b
Add a large tile shape online update case
Zhendong404 Mar 31, 2026
8fd9117
Extract vkernel template binding plan
Mar 31, 2026
df29f63
Add granularity info to pto.mask
Zhendong404 Mar 31, 2026
cada13c
Add vkernel struct template binding
Mar 31, 2026
4620715
Add vpto verifier
Zhendong404 Mar 31, 2026
210c5ba
Merge remote-tracking branch 'mly/feature-vpto-backend' into tile-fus…
Zhendong404 Mar 31, 2026
5c0264a
Add support for vecscope region
Zhendong404 Mar 31, 2026
67b3840
Merge pull request #22 from Zhendong404/tile-fusion-vpto
mouliangyu Mar 31, 2026
1c36830
Support post fusion loop unroll
Zhendong404 Apr 1, 2026
7fb6d55
Update openspec
Zhendong404 Apr 1, 2026
2e46127
Fix vpto lit cases
Zhendong404 Apr 1, 2026
6ec45a7
Update openspec
Zhendong404 Apr 1, 2026
3914ee0
Refine DSL spec
Zhendong404 Apr 1, 2026
9224157
Finish the first version of DSL manual
Zhendong404 Apr 1, 2026
6eb2129
Use enums instead of strings
Zhendong404 Apr 1, 2026
f448ffb
Use UBRef instead of BufLike
Zhendong404 Apr 1, 2026
10e4508
Clarify the ptr types in the interface of copy transfer operations
Zhendong404 Apr 1, 2026
3e4f6ed
Add tile types
Zhendong404 Apr 1, 2026
222b862
Update quick start
Zhendong404 Apr 1, 2026
8c7fcd3
Add syntax sugar proposals
Zhendong404 Apr 1, 2026
e67325d
Rename vpto dsl to tilelang dsl
Zhendong404 Apr 2, 2026
c879008
Rename files
Zhendong404 Apr 2, 2026
b806568
Add pto.make_mask op
Zhendong404 Apr 2, 2026
8b91d91
Add tile shape constraints
Zhendong404 Apr 2, 2026
0d31a63
Add tensor view type
Zhendong404 Apr 2, 2026
974cec4
Add high level dma load/store/copy op
Zhendong404 Apr 2, 2026
f0c3a6c
Add tile indexing syntax sugar
Zhendong404 Apr 2, 2026
5932407
Add a pto.get_lanes op
Zhendong404 Apr 2, 2026
bc29f83
Support implicit vecscope inference
Zhendong404 Apr 2, 2026
cee0cf5
docs(isa): §3 vector load/store latency and §6–§9 CA latency tables
peanutchan Apr 2, 2026
b1ac6b6
Update vkernel syntax
Zhendong404 Apr 2, 2026
3e35b70
Merge pull request #21 from peanutchan/docs/isa-03-vector-load-store
WenboCodes Apr 2, 2026
5da1b1d
Add VPTO spec v0.1 draft
WenboCodes Apr 2, 2026
81622e5
docs(isa): restore §3 full text with A5 latency; align §6–§9 CA table…
peanutchan Apr 2, 2026
29e819a
docs(isa): merge §3 per-op latency into PR #24 restore
peanutchan Apr 2, 2026
8ead246
Merge pull request #24 from peanutchan/docs/isa-post21-latency-restore
peanutchan Apr 2, 2026
451e812
Fix release doc heading hierarchy
WenboCodes Apr 2, 2026
f5fa32a
Add VPTO spec release doc v0.2
WenboCodes Apr 2, 2026
9592aa4
Document PTO ISA compilation flows
WenboCodes Apr 2, 2026
c2f63ed
Merge pull request #20 from mouliangyu/feature-vpto-dsl
mouliangyu Apr 3, 2026
761e2da
Add tilelang dsl implementation
Zhendong404 Apr 3, 2026
3b23838
Update openspec
Zhendong404 Apr 3, 2026
14b2983
Support more syntax in tilelang dsl
Zhendong404 Apr 3, 2026
7bbc718
Update openspec
Zhendong404 Apr 3, 2026
3c66dd3
tilelang dsl first working version
Zhendong404 Apr 4, 2026
ce23fd0
Support lowering to 2D memref indices
Zhendong404 Apr 4, 2026
a8dbf7f
Update openspec
Zhendong404 Apr 4, 2026
13f6472
Tighten ptoas for merge preparation
Apr 6, 2026
edfb991
Prepare PTOOps.td for merge
Apr 6, 2026
ef92adc
Prepare PTOToEmitC for merge
Apr 6, 2026
a2516d2
Prepare PTOViewToMemref for merge
Apr 6, 2026
c849193
Prepare PTO.cpp for merge
Apr 6, 2026
2a253fc
Prepare PTOPlanMemory for merge
Apr 6, 2026
8b98e00
Prepare InferPTOLayout for merge
Apr 6, 2026
bf78af4
Prepare PTOViewToMemref for merge
Apr 6, 2026
5231451
Prepare PTOInsertSync for merge
Apr 6, 2026
5654b45
Merge remote-tracking branch 'zhongxuan/main' into feature-vpto-backend
Apr 6, 2026
5c56b21
Merge remote-tracking branch 'origin/feature-vpto-backend' into featu…
Apr 6, 2026
5133a8d
docs: add TileOp expand design and demo
Apr 7, 2026
e9efdab
Support more dsl syntax
Zhendong404 Apr 7, 2026
0dc7c86
Update openspec
Zhendong404 Apr 7, 2026
b343c7e
Amend
Zhendong404 Apr 7, 2026
7089126
Update docs
Zhendong404 Apr 7, 2026
cb6f0a3
feat(transforms): add Tile→Vector template lowering pipeline
Apr 7, 2026
a5d02e3
Merge remote-tracking branch 'qkl/feature-vpto-backend' into feature-…
Zhendong404 Apr 7, 2026
19502d9
Support template-based kernel authoring
Zhendong404 Apr 7, 2026
3c7fd41
feat: Add support for valid_shape in TileSpecialization and SemanticT…
Zhendong404 Apr 7, 2026
730c0d7
Support kernel template
Zhendong404 Apr 7, 2026
149477c
Move tilelang dsl docs
Zhendong404 Apr 7, 2026
790a2d7
Update openspec
Zhendong404 Apr 7, 2026
5ceee7c
fixup vpto main pipeline
Apr 7, 2026
8d911f9
Add language tier to dsl
Zhendong404 Apr 7, 2026
eed5181
Update tilelang dsl
Zhendong404 Apr 7, 2026
055b27b
update tileop expand pipelines
Apr 7, 2026
b95ade0
update doc and path config
Apr 7, 2026
923c44e
Document tilelang tadd test flow
Apr 7, 2026
2f7abab
Support automatic stride inference in dma operations
Zhendong404 Apr 8, 2026
f13ac28
Fix vecscope generation logic
Zhendong404 Apr 8, 2026
a9932b3
Support general dtypes
Zhendong404 Apr 8, 2026
dbe8e55
update tadd template
Apr 8, 2026
da82601
add doc for building with installed llvm
Apr 8, 2026
1cd3f43
feat: Add TPartmul op
FangRui0 Apr 1, 2026
ad07b92
feat: support TEXTRACT_FP/TINSERT_FP/TFILLPAD_INPLACE
FangRui0 Apr 2, 2026
efcb60a
fix tileop expand if scalar in operands
Apr 9, 2026
ea121c7
Support 5D TensorView
Zhendong404 Apr 8, 2026
4ae4c5e
Remove dma_load/dma_store from the DSL spec
Zhendong404 Apr 9, 2026
3bc9f75
Remove dma_load/store in the implementation and rename stable tier to…
Zhendong404 Apr 9, 2026
936d0c8
Support 5D tensor view
Zhendong404 Apr 9, 2026
2655f93
Unify TileLang TensorView metadata and constraints
Zhendong404 Apr 9, 2026
b64ea69
Refactor PTO intrinsic handling and update documentation
Zhendong404 Apr 9, 2026
a568ef0
Update docs
Zhendong404 Apr 9, 2026
9242783
Add a tadds dsl template
Zhendong404 Apr 9, 2026
91cabd9
Support pto.constexpr for compile-time specialization
Zhendong404 Apr 9, 2026
1a23b8a
Add pto.vbr definition in DSL
Zhendong404 Apr 9, 2026
a58be9c
Update DSL doc structure
Zhendong404 Apr 9, 2026
f535ddf
Add missing ops in the dsl user guide
Zhendong404 Apr 9, 2026
9a085aa
Align dsl semantics to vpto specs
Zhendong404 Apr 9, 2026
5bef7e5
Support more arithmetic ops
Zhendong404 Apr 10, 2026
dfc6567
Support docstring syntax in the kernel
Zhendong404 Apr 10, 2026
0ff7cf3
Fix vecscope issues
Zhendong404 Apr 10, 2026
03207c6
CleanCode
Zhendong404 Apr 10, 2026
dbfcf4a
add description for parameters order
Apr 10, 2026
21d3b8e
Support partition tensor view
Zhendong404 Apr 10, 2026
97fb638
Add vkernel argument matching syntax
Zhendong404 Apr 10, 2026
2d48512
Support scalar constructor and fix some vpto bugs
Zhendong404 Apr 10, 2026
1731456
Convert vpto types in the scf op before emitting llvm ir
Zhendong404 Apr 10, 2026
a5ff396
Support function call in tilelang dsl
Zhendong404 Apr 10, 2026
3d7d202
Support more floating-point literals
Zhendong404 Apr 10, 2026
fc19312
Add pto.vreg(dtype) constructor
Zhendong404 Apr 11, 2026
294768c
Remove memref and support mask constructor
Zhendong404 Apr 11, 2026
902199a
Fix pto.vdup lowering
Zhendong404 Apr 11, 2026
a52cd16
add op_tilelang_texpand and op_tilelang_tfillpad
Apr 10, 2026
263fc45
add scalar pto type
Apr 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
152 changes: 152 additions & 0 deletions .claude/commands/opsx/apply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
---
name: "OPSX: Apply"
description: Implement tasks from an OpenSpec change (Experimental)
category: Workflow
tags: [workflow, artifacts, experimental]
---

Implement tasks from an OpenSpec change.

**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.

**Steps**

1. **Select the change**

If a name is provided, use it. Otherwise:
- Infer from conversation context if the user mentioned a change
- Auto-select if only one active change exists
- If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select

Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).

2. **Check status to understand the schema**
```bash
openspec status --change "<name>" --json
```
Parse the JSON to understand:
- `schemaName`: The workflow being used (e.g., "spec-driven")
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)

3. **Get apply instructions**

```bash
openspec instructions apply --change "<name>" --json
```

This returns:
- Context file paths (varies by schema)
- Progress (total, complete, remaining)
- Task list with status
- Dynamic instruction based on current state

**Handle states:**
- If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx:continue`
- If `state: "all_done"`: congratulate, suggest archive
- Otherwise: proceed to implementation

4. **Read context files**

Read the files listed in `contextFiles` from the apply instructions output.
The files depend on the schema being used:
- **spec-driven**: proposal, specs, design, tasks
- Other schemas: follow the contextFiles from CLI output

5. **Show current progress**

Display:
- Schema being used
- Progress: "N/M tasks complete"
- Remaining tasks overview
- Dynamic instruction from CLI

6. **Implement tasks (loop until done or blocked)**

For each pending task:
- Show which task is being worked on
- Make the code changes required
- Keep changes minimal and focused
- Mark task complete in the tasks file: `- [ ]` → `- [x]`
- Continue to next task

**Pause if:**
- Task is unclear → ask for clarification
- Implementation reveals a design issue → suggest updating artifacts
- Error or blocker encountered → report and wait for guidance
- User interrupts

7. **On completion or pause, show status**

Display:
- Tasks completed this session
- Overall progress: "N/M tasks complete"
- If all done: suggest archive
- If paused: explain why and wait for guidance

**Output During Implementation**

```
## Implementing: <change-name> (schema: <schema-name>)

Working on task 3/7: <task description>
[...implementation happening...]
✓ Task complete

Working on task 4/7: <task description>
[...implementation happening...]
✓ Task complete
```

**Output On Completion**

```
## Implementation Complete

**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 7/7 tasks complete ✓

### Completed This Session
- [x] Task 1
- [x] Task 2
...

All tasks complete! You can archive this change with `/opsx:archive`.
```

**Output On Pause (Issue Encountered)**

```
## Implementation Paused

**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 4/7 tasks complete

### Issue Encountered
<description of the issue>

**Options:**
1. <option 1>
2. <option 2>
3. Other approach

What would you like to do?
```

**Guardrails**
- Keep going through tasks until done or blocked
- Always read context files before starting (from the apply instructions output)
- If task is ambiguous, pause and ask before implementing
- If implementation reveals issues, pause and suggest artifact updates
- Keep code changes minimal and scoped to each task
- Update task checkbox immediately after completing each task
- Pause on errors, blockers, or unclear requirements - don't guess
- Use contextFiles from CLI output, don't assume specific file names

**Fluid Workflow Integration**

This skill supports the "actions on a change" model:

- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
157 changes: 157 additions & 0 deletions .claude/commands/opsx/archive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
---
name: "OPSX: Archive"
description: Archive a completed change in the experimental workflow
category: Workflow
tags: [workflow, archive, experimental]
---

Archive a completed change in the experimental workflow.

**Input**: Optionally specify a change name after `/opsx:archive` (e.g., `/opsx:archive add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.

**Steps**

1. **If no change name provided, prompt for selection**

Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.

Show only active changes (not already archived).
Include the schema used for each change if available.

**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.

2. **Check artifact completion status**

Run `openspec status --change "<name>" --json` to check artifact completion.

Parse the JSON to understand:
- `schemaName`: The workflow being used
- `artifacts`: List of artifacts with their status (`done` or other)

**If any artifacts are not `done`:**
- Display warning listing incomplete artifacts
- Prompt user for confirmation to continue
- Proceed if user confirms

3. **Check task completion status**

Read the tasks file (typically `tasks.md`) to check for incomplete tasks.

Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).

**If incomplete tasks found:**
- Display warning showing count of incomplete tasks
- Prompt user for confirmation to continue
- Proceed if user confirms

**If no tasks file exists:** Proceed without task-related warning.

4. **Assess delta spec sync state**

Check for delta specs at `openspec/changes/<name>/specs/`. If none exist, proceed without sync prompt.

**If delta specs exist:**
- Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`
- Determine what changes would be applied (adds, modifications, removals, renames)
- Show a combined summary before prompting

**Prompt options:**
- If changes needed: "Sync now (recommended)", "Archive without syncing"
- If already synced: "Archive now", "Sync anyway", "Cancel"

If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke openspec-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.

5. **Perform the archive**

Create the archive directory if it doesn't exist:
```bash
mkdir -p openspec/changes/archive
```

Generate target name using current date: `YYYY-MM-DD-<change-name>`

**Check if target already exists:**
- If yes: Fail with error, suggest renaming existing archive or using different date
- If no: Move the change directory to archive

```bash
mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
```

6. **Display summary**

Show archive completion summary including:
- Change name
- Schema that was used
- Archive location
- Spec sync status (synced / sync skipped / no delta specs)
- Note about any warnings (incomplete artifacts/tasks)

**Output On Success**

```
## Archive Complete

**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
**Specs:** ✓ Synced to main specs

All artifacts complete. All tasks complete.
```

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

```
## Archive Complete

**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
**Specs:** No delta specs

All artifacts complete. All tasks complete.
```

**Output On Success With Warnings**

```
## Archive Complete (with warnings)

**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
**Specs:** Sync skipped (user chose to skip)

**Warnings:**
- Archived with 2 incomplete artifacts
- Archived with 3 incomplete tasks
- Delta spec sync was skipped (user chose to skip)

Review the archive if this was not intentional.
```

**Output On Error (Archive Exists)**

```
## Archive Failed

**Change:** <change-name>
**Target:** openspec/changes/archive/YYYY-MM-DD-<name>/

Target archive directory already exists.

**Options:**
1. Rename the existing archive
2. Delete the existing archive if it's a duplicate
3. Wait until a different date to archive
```

**Guardrails**
- Always prompt for change selection if not provided
- Use artifact graph (openspec status --json) for completion checking
- Don't block archive on warnings - just inform and confirm
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
- Show clear summary of what happened
- If sync is requested, use the Skill tool to invoke `openspec-sync-specs` (agent-driven)
- If delta specs exist, always run the sync assessment and show the combined summary before prompting
Loading
Loading