Skip to content

Commit 5bcdfb8

Browse files
committed
feat: add Agent Skills for experimental artifact workflow
Implements Task #3 from the experimental release plan: - Create skill templates for openspec-new-change and openspec-continue-change - Add artifact-experimental-setup CLI command - Generate Agent Skills in .claude/skills/ directory - Support cross-editor compatibility (Claude Code, Cursor, Windsurf) Skills follow the Agent Skills specification and provide: - Natural language invocation by AI assistants - Step-by-step artifact creation workflow - Dependency-driven change management
1 parent fb7ff52 commit 5bcdfb8

File tree

3 files changed

+652
-0
lines changed

3 files changed

+652
-0
lines changed

docs/experimental-release-plan.md

Lines changed: 381 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,381 @@
1+
# OpenSpec Experimental Release Plan
2+
3+
This document outlines the plan to release the experimental artifact workflow system for user testing.
4+
5+
## Overview
6+
7+
The goal is to allow users to test the new artifact-driven workflow system alongside the existing OpenSpec commands. This experimental system (`opsx`) provides a more granular, step-by-step approach to creating change artifacts.
8+
9+
## Three Workflow Modes
10+
11+
### 1. Old Workflow (Current Production)
12+
- **Commands**: `/openspec:proposal`, `/openspec:apply`, `/openspec:archive`
13+
- **Behavior**: Hardcoded slash commands that generate all artifacts in one command
14+
- **Status**: Production, unchanged
15+
16+
### 2. New Artifact System - Batch Mode (Future)
17+
- **Commands**: Refactored `/openspec:proposal` using schemas
18+
- **Behavior**: Schema-driven but generates all artifacts at once (like legacy)
19+
- **Status**: Not in scope for this experimental release
20+
- **Note**: This is a future refactor to unify the old system with schemas
21+
22+
### 3. New Artifact System - Granular Mode (Experimental)
23+
- **Commands**: `/opsx:new`, `/opsx:continue`
24+
- **Behavior**: One artifact at a time, dependency-driven, iterative
25+
- **Status**: Target for this experimental release
26+
27+
---
28+
29+
## Work Items
30+
31+
### 1. Rename AWF to OPSX
32+
33+
**Current State:**
34+
- Commands: `/awf:start`, `/awf:continue`
35+
- Files: `.claude/commands/awf/start.md`, `.claude/commands/awf/continue.md`
36+
37+
**Target State:**
38+
- Commands: `/opsx:new`, `/opsx:continue`
39+
- Files: `.claude/commands/opsx/new.md`, `.claude/commands/opsx/continue.md`
40+
41+
**Tasks:**
42+
- [x] Create `.claude/commands/opsx/` directory
43+
- [x] Rename `start.md``new.md` and update content
44+
- [x] Copy `continue.md` with updated references
45+
- [x] Update all references from "awf" to "opsx" in command content
46+
- [x] Update frontmatter (name, description) to use "opsx" naming
47+
- [x] Remove `.claude/commands/awf/` directory
48+
49+
**CLI Commands:**
50+
The underlying CLI commands (`openspec status`, `openspec next`, `openspec instructions`, etc.) remain unchanged. Only the slash command names change.
51+
52+
---
53+
54+
### 2. Remove WF Skill Files
55+
56+
**Current State:**
57+
- `.claude/commands/wf/start.md` - References non-existent `openspec wf` commands
58+
- `.claude/commands/wf/continue.md` - References non-existent `openspec wf` commands
59+
60+
**Target State:**
61+
- Directory and files removed
62+
63+
**Tasks:**
64+
- [x] Delete `.claude/commands/wf/start.md`
65+
- [x] Delete `.claude/commands/wf/continue.md`
66+
- [x] Delete `.claude/commands/wf/` directory
67+
68+
---
69+
70+
### 3. Add Agent Skills for Experimental Workflow
71+
72+
**Purpose:**
73+
Generate experimental workflow skills using the [Agent Skills](https://agentskills.io/specification) open standard.
74+
75+
**Why Skills Instead of Slash Commands:**
76+
- **Cross-editor compatibility**: Skills work in Claude Code, Cursor, Windsurf, and other compatible editors automatically
77+
- **Simpler implementation**: Single directory (`.claude/skills/`) instead of 18+ editor-specific configurators
78+
- **Standard format**: Open standard with simple YAML frontmatter + markdown
79+
- **User invocation**: Users explicitly invoke skills when they want to use them
80+
81+
**Behavior:**
82+
1. Create `.claude/skills/` directory if it doesn't exist
83+
2. Generate two skills using the Agent Skills specification:
84+
- `openspec-new-change/SKILL.md` - Start a new change with artifact workflow
85+
- `openspec-continue-change/SKILL.md` - Continue working on a change (create next artifact)
86+
3. Skills are added **alongside** existing `/openspec:*` commands (not replacing)
87+
88+
**Supported Editors:**
89+
- Claude Code (native support)
90+
- Cursor (native support via Settings → Rules → Import Settings)
91+
- Windsurf (imports `.claude` configs)
92+
- Cline, Codex, and other Agent Skills-compatible editors
93+
94+
**Tasks:**
95+
- [x] Create skill template content for `openspec-new-change` (based on current opsx:new)
96+
- [x] Create skill template content for `openspec-continue-change` (based on current opsx:continue)
97+
- [x] Add temporary `artifact-experimental-setup` command to CLI
98+
- [x] Implement skill file generation (YAML frontmatter + markdown body)
99+
- [x] Add success message with usage instructions
100+
101+
**Note:** The `artifact-experimental-setup` command is temporary and will be merged into `openspec init` once the experimental workflow is promoted to stable.
102+
103+
**Skill Format:**
104+
Each skill is a directory with a `SKILL.md` file:
105+
```
106+
.claude/skills/
107+
├── openspec-new-change/
108+
│ └── SKILL.md # name, description, instructions
109+
└── openspec-continue-change/
110+
└── SKILL.md # name, description, instructions
111+
```
112+
113+
**CLI Interface:**
114+
```bash
115+
openspec artifact-experimental-setup
116+
117+
# Output:
118+
# 🧪 Experimental Artifact Workflow Setup
119+
#
120+
# Created .claude/skills/openspec-new-change/SKILL.md
121+
# Created .claude/skills/openspec-continue-change/SKILL.md
122+
#
123+
# ✅ Skills are now available in:
124+
# - Claude Code (auto-detected)
125+
# - Cursor (enable in Settings → Rules → Import Settings)
126+
# - Windsurf (auto-imported from .claude directory)
127+
#
128+
# 📖 To use:
129+
# Ask Claude naturally:
130+
# • "I want to start a new OpenSpec change to add <feature>"
131+
# • "Continue working on this change"
132+
#
133+
# Claude will automatically use the appropriate skill.
134+
#
135+
# 💡 This is an experimental feature. Feedback welcome at:
136+
# https://github.com/your-org/openspec/issues
137+
```
138+
139+
**Implementation Notes:**
140+
- Simple file writing: Create directories and write templated `SKILL.md` files (no complex logic)
141+
- Use existing `FileSystemUtils.writeFile()` pattern like slash command configurators
142+
- Template structure: YAML frontmatter + markdown body
143+
- Keep existing `/opsx:*` slash commands for now (manual cleanup later)
144+
- Skills use invocation model (user explicitly asks Claude to use them)
145+
- Skill `description` field guides when Claude suggests using the skill
146+
- Each `SKILL.md` has required fields: `name` (matches directory) and `description`
147+
148+
---
149+
150+
### 4. Update `/opsx:new` Command Content
151+
152+
**Current Behavior (awf:start):**
153+
1. Ask user what they want to build (if no input)
154+
2. Create change directory
155+
3. Show artifact status
156+
4. Show what's ready
157+
5. Get instructions for proposal
158+
6. STOP and wait
159+
160+
**New Behavior (opsx:new):**
161+
Same flow but with updated naming:
162+
- References to "awf" → "opsx"
163+
- References to `/awf:continue``/opsx:continue`
164+
- Update frontmatter name/description
165+
166+
**Tasks:**
167+
- [x] Update all "awf" references to "opsx"
168+
- [x] Update command references in prompt text
169+
- [x] Verify CLI commands still work (they use `openspec`, not `awf`)
170+
171+
---
172+
173+
### 5. Update `/opsx:continue` Command Content
174+
175+
**Current Behavior (awf:continue):**
176+
1. Prompt for change selection (if not provided)
177+
2. Check current status
178+
3. Create ONE artifact based on what's ready
179+
4. Show progress and what's unlocked
180+
5. STOP
181+
182+
**New Behavior (opsx:continue):**
183+
Same flow with updated naming.
184+
185+
**Tasks:**
186+
- [x] Update all "awf" references to "opsx"
187+
- [x] Update command references in prompt text
188+
189+
---
190+
191+
### 6. End-to-End Testing
192+
193+
**Objective:**
194+
Run through a complete workflow with Claude using the new skills to create a real feature, validating the entire flow works.
195+
196+
**Test Scenario:**
197+
Use a real OpenSpec feature as the test case (dog-fooding).
198+
199+
**Test Flow:**
200+
1. Run `openspec artifact-experimental-setup` to create skills
201+
2. Verify `.claude/skills/openspec-new-change/SKILL.md` created
202+
3. Verify `.claude/skills/openspec-continue-change/SKILL.md` created
203+
4. Ask Claude: "I want to start a new OpenSpec change to add feature X"
204+
5. Verify Claude invokes the `openspec-new-change` skill
205+
6. Verify change directory created at `openspec/changes/add-feature-x/`
206+
7. Verify proposal template shown
207+
8. Ask Claude: "Continue working on this change"
208+
9. Verify Claude invokes the `openspec-continue-change` skill
209+
10. Verify `proposal.md` created with content
210+
11. Ask Claude: "Continue" (create specs)
211+
12. Verify `specs/*.md` created
212+
13. Ask Claude: "Continue" (create design)
213+
14. Verify `design.md` created
214+
15. Ask Claude: "Continue" (create tasks)
215+
16. Verify `tasks.md` created
216+
17. Verify status shows 4/4 complete
217+
18. Implement the feature based on tasks
218+
19. Run `/openspec:archive` to archive the change
219+
220+
**Validation Checklist:**
221+
- [ ] `openspec artifact-experimental-setup` creates correct directory structure
222+
- [ ] Skills are auto-detected in Claude Code
223+
- [ ] Skill descriptions trigger appropriate invocations
224+
- [ ] Skills create change directory and show proposal template
225+
- [ ] Skills correctly identify ready artifacts
226+
- [ ] Skills create artifacts with meaningful content
227+
- [ ] Dependency detection works (specs requires proposal, etc.)
228+
- [ ] Progress tracking is accurate
229+
- [ ] Template content is useful and well-structured
230+
- [ ] Error handling works (invalid names, missing changes, etc.)
231+
- [ ] Works with different schemas (spec-driven, tdd)
232+
- [ ] Test in Cursor (Settings → Rules → Import Settings)
233+
234+
**Document Results:**
235+
- Create test log documenting what worked and what didn't
236+
- Note any friction points or confusing UX
237+
- Identify bugs or improvements needed before user release
238+
239+
---
240+
241+
### 7. Documentation for Users
242+
243+
**Create user-facing documentation explaining:**
244+
245+
1. **What is the experimental workflow?**
246+
- A new way to create OpenSpec changes step-by-step using Agent Skills
247+
- One artifact at a time with dependency tracking
248+
- More interactive and iterative than the batch approach
249+
- Works across Claude Code, Cursor, Windsurf, and other compatible editors
250+
251+
2. **How to set up experimental workflow**
252+
```bash
253+
openspec artifact-experimental-setup
254+
```
255+
256+
Note: This is a temporary command that will be integrated into `openspec init` once promoted to stable.
257+
258+
3. **Available skills**
259+
- `openspec-new-change` - Start a new change with artifact workflow
260+
- `openspec-continue-change` - Continue working (create next artifact)
261+
262+
4. **How to use**
263+
- **Claude Code**: Skills are auto-detected, just ask Claude naturally
264+
- "I want to start a new OpenSpec change to add X"
265+
- "Continue working on this change"
266+
- **Cursor**: Enable in Settings → Rules → Import Settings
267+
- **Windsurf**: Auto-imports `.claude` directory
268+
269+
5. **Example workflow**
270+
- Step-by-step walkthrough with natural language interactions
271+
- Show how Claude invokes skills based on user requests
272+
273+
6. **Feedback mechanism**
274+
- GitHub issue template for feedback
275+
- What to report (bugs, UX issues, suggestions)
276+
277+
**Tasks:**
278+
- [ ] Create `docs/experimental-workflow.md` user guide
279+
- [ ] Add GitHub issue template for experimental feedback
280+
- [ ] Update README with mention of experimental features
281+
282+
---
283+
284+
## Dependency Graph
285+
286+
```
287+
1. Remove WF skill files
288+
└── (no dependencies)
289+
290+
2. Rename AWF to OPSX
291+
└── (no dependencies)
292+
293+
3. Add Agent Skills
294+
└── Depends on: Rename AWF to OPSX (uses opsx content as templates)
295+
296+
4. Update opsx:new content
297+
└── Depends on: Rename AWF to OPSX
298+
299+
5. Update opsx:continue content
300+
└── Depends on: Rename AWF to OPSX
301+
302+
6. E2E Testing
303+
└── Depends on: Add Agent Skills (tests the skills workflow)
304+
305+
7. User Documentation
306+
└── Depends on: E2E Testing (need to know final behavior)
307+
```
308+
309+
---
310+
311+
## Out of Scope
312+
313+
The following are explicitly NOT part of this experimental release:
314+
315+
1. **Batch mode refactor** - Making legacy `/openspec:proposal` use schemas
316+
2. **New schemas** - Only shipping with existing `spec-driven` and `tdd`
317+
3. **Schema customization UI** - No `openspec schema list` or similar
318+
4. **Multiple editor support in CLI** - Skills work cross-editor automatically via `.claude/skills/`
319+
5. **Replacing existing commands** - Skills are additive, not replacing `/openspec:*` or `/opsx:*`
320+
321+
---
322+
323+
## Success Criteria
324+
325+
The experimental release is ready when:
326+
327+
1. `openspec-new-change` and `openspec-continue-change` skills work end-to-end
328+
2. `openspec artifact-experimental-setup` creates skills in `.claude/skills/`
329+
3. Skills work in Claude Code and are compatible with Cursor/Windsurf
330+
4. At least one complete workflow has been tested manually
331+
5. User documentation exists explaining how to generate and use skills
332+
6. Feedback mechanism is in place
333+
7. WF skill files are removed
334+
8. No references to "awf" remain in user-facing content
335+
336+
---
337+
338+
## Open Questions
339+
340+
1. **Schema selection** - Should `opsx:new` allow selecting a schema, or always use `spec-driven`?
341+
- Current: Always uses `spec-driven` as default
342+
- Consider: Add `--schema tdd` option or prompt
343+
344+
2. **Namespace in CLI** - Should experimental CLI commands be namespaced?
345+
- Current: `openspec status`, `openspec next` (no namespace)
346+
- Alternative: `openspec opsx status` (explicit experimental namespace)
347+
- Recommendation: Keep current, less typing for users
348+
349+
3. **Deprecation path** - If opsx becomes the default, how do we migrate?
350+
- Not needed for experimental release
351+
- Document that command names may change
352+
353+
---
354+
355+
## Estimated Work Breakdown
356+
357+
| Item | Complexity | Notes |
358+
|------|------------|-------|
359+
| Remove WF files | Trivial | Just delete 2 files + directory |
360+
| Rename AWF → OPSX | Low | File renames + content updates |
361+
| Add Agent Skills | **Low** | **Simple: 3-4 files, single output directory, standard format** |
362+
| Update opsx:new content | Low | Text replacements |
363+
| Update opsx:continue content | Low | Text replacements |
364+
| E2E Testing | Medium | Manual testing, documenting results |
365+
| User Documentation | Medium | New docs, issue template |
366+
367+
**Key Improvement:** Switching to Agent Skills reduces complexity significantly:
368+
- **Before:** 20+ files (type definitions, 18+ editor configurators, editor selection UI)
369+
- **After:** 3-4 files (skill templates, simple CLI command)
370+
- **Cross-editor:** Works automatically in Claude Code, Cursor, Windsurf without extra code
371+
372+
---
373+
374+
## Next Steps
375+
376+
1. Review this plan and confirm scope
377+
2. Create tasks/issues for each work item
378+
3. Execute in dependency order
379+
4. Conduct E2E testing
380+
5. Write user docs
381+
6. Release to test users

0 commit comments

Comments
 (0)