Skip to content

Commit b4a6e79

Browse files
aborrusoclaude
andcommitted
release: v0.25.0 — geografia di nascita normalizzata
Bump versione nei 5 punti (package/server/worker/client/manifest). Nuova capacità utente: birth_province/country/region su senators/deputies, regione derivata da SITUAS/ISTAT. 43 tool invariati, 158 test verdi. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 01b311c commit b4a6e79

18 files changed

Lines changed: 1886 additions & 7 deletions

File tree

.claude/commands/opsx/apply.md

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
---
2+
name: "OPSX: Apply"
3+
description: Implement tasks from an OpenSpec change (Experimental)
4+
allowed-tools: Bash(openspec:*)
5+
category: Workflow
6+
tags: [workflow, artifacts, experimental]
7+
---
8+
9+
Implement tasks from an OpenSpec change.
10+
11+
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`). Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
12+
13+
**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.
14+
15+
**Steps**
16+
17+
1. **Select the change**
18+
19+
If a name is provided, use it. Otherwise:
20+
- Infer from conversation context if the user mentioned a change
21+
- Auto-select if only one active change exists
22+
- If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select
23+
24+
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).
25+
26+
2. **Check status to understand the schema**
27+
```bash
28+
openspec status --change "<name>" --json
29+
```
30+
Parse the JSON to understand:
31+
- `schemaName`: The workflow being used (e.g., "spec-driven")
32+
- `planningHome`, `changeRoot`, and `actionContext`: planning scope and edit constraints
33+
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
34+
35+
3. **Get apply instructions**
36+
37+
```bash
38+
openspec instructions apply --change "<name>" --json
39+
```
40+
41+
This returns:
42+
- `contextFiles`: artifact ID -> array of concrete file paths (varies by schema)
43+
- Progress (total, complete, remaining)
44+
- Task list with status
45+
- Dynamic instruction based on current state
46+
47+
**Handle states:**
48+
- If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx:continue`
49+
- If `state: "all_done"`: congratulate, suggest archive
50+
- Otherwise: proceed to implementation
51+
52+
4. **Read context files**
53+
54+
Read every file path listed under `contextFiles` from the apply instructions output.
55+
The files depend on the schema being used:
56+
- **spec-driven**: proposal, specs, design, tasks
57+
- Other schemas: follow the contextFiles from CLI output
58+
59+
5. **Show current progress**
60+
61+
Display:
62+
- Schema being used
63+
- Progress: "N/M tasks complete"
64+
- Remaining tasks overview
65+
- Dynamic instruction from CLI
66+
67+
6. **Implement tasks (loop until done or blocked)**
68+
69+
For each pending task:
70+
- Show which task is being worked on
71+
- Make the code changes required
72+
- Keep changes minimal and focused
73+
- Mark task complete in the tasks file: `- [ ]``- [x]`
74+
- Continue to next task
75+
76+
**Pause if:**
77+
- Task is unclear → ask for clarification
78+
- Implementation reveals a design issue → suggest updating artifacts
79+
- Error or blocker encountered → report and wait for guidance
80+
- User interrupts
81+
82+
7. **On completion or pause, show status**
83+
84+
Display:
85+
- Tasks completed this session
86+
- Overall progress: "N/M tasks complete"
87+
- If all done: suggest archive
88+
- If paused: explain why and wait for guidance
89+
90+
**Output During Implementation**
91+
92+
```
93+
## Implementing: <change-name> (schema: <schema-name>)
94+
95+
Working on task 3/7: <task description>
96+
[...implementation happening...]
97+
✓ Task complete
98+
99+
Working on task 4/7: <task description>
100+
[...implementation happening...]
101+
✓ Task complete
102+
```
103+
104+
**Output On Completion**
105+
106+
```
107+
## Implementation Complete
108+
109+
**Change:** <change-name>
110+
**Schema:** <schema-name>
111+
**Progress:** 7/7 tasks complete ✓
112+
113+
### Completed This Session
114+
- [x] Task 1
115+
- [x] Task 2
116+
...
117+
118+
All tasks complete! You can archive this change with `/opsx:archive`.
119+
```
120+
121+
**Output On Pause (Issue Encountered)**
122+
123+
```
124+
## Implementation Paused
125+
126+
**Change:** <change-name>
127+
**Schema:** <schema-name>
128+
**Progress:** 4/7 tasks complete
129+
130+
### Issue Encountered
131+
<description of the issue>
132+
133+
**Options:**
134+
1. <option 1>
135+
2. <option 2>
136+
3. Other approach
137+
138+
What would you like to do?
139+
```
140+
141+
**Guardrails**
142+
- Keep going through tasks until done or blocked
143+
- Always read context files before starting (from the apply instructions output)
144+
- If task is ambiguous, pause and ask before implementing
145+
- If implementation reveals issues, pause and suggest artifact updates
146+
- Keep code changes minimal and scoped to each task
147+
- Update task checkbox immediately after completing each task
148+
- Pause on errors, blockers, or unclear requirements - don't guess
149+
- Use contextFiles from CLI output, don't assume specific file names
150+
151+
**Fluid Workflow Integration**
152+
153+
This skill supports the "actions on a change" model:
154+
155+
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
156+
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly

.claude/commands/opsx/archive.md

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
---
2+
name: "OPSX: Archive"
3+
description: Archive a completed change in the experimental workflow
4+
allowed-tools: Bash(openspec:*)
5+
category: Workflow
6+
tags: [workflow, archive, experimental]
7+
---
8+
9+
Archive a completed change in the experimental workflow.
10+
11+
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`). Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
12+
13+
**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.
14+
15+
**Steps**
16+
17+
1. **If no change name provided, prompt for selection**
18+
19+
Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
20+
21+
Show only active changes (not already archived).
22+
Include the schema used for each change if available.
23+
24+
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
25+
26+
2. **Check artifact completion status**
27+
28+
Run `openspec status --change "<name>" --json` to check artifact completion.
29+
30+
Parse the JSON to understand:
31+
- `schemaName`: The workflow being used
32+
- `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context
33+
- `artifacts`: List of artifacts with their status (`done` or other)
34+
35+
**If any artifacts are not `done`:**
36+
- Display warning listing incomplete artifacts
37+
- Prompt user for confirmation to continue
38+
- Proceed if user confirms
39+
40+
3. **Check task completion status**
41+
42+
Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
43+
44+
Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
45+
46+
**If incomplete tasks found:**
47+
- Display warning showing count of incomplete tasks
48+
- Prompt user for confirmation to continue
49+
- Proceed if user confirms
50+
51+
**If no tasks file exists:** Proceed without task-related warning.
52+
53+
4. **Assess delta spec sync state**
54+
55+
Use `artifactPaths.specs.existingOutputPaths` from status JSON to check for delta specs. If none exist, proceed without sync prompt.
56+
57+
**If delta specs exist:**
58+
- Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`
59+
- Determine what changes would be applied (adds, modifications, removals, renames)
60+
- Show a combined summary before prompting
61+
62+
**Prompt options:**
63+
- If changes needed: "Sync now (recommended)", "Archive without syncing"
64+
- If already synced: "Archive now", "Sync anyway", "Cancel"
65+
66+
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.
67+
68+
5. **Perform the archive**
69+
70+
Create an `archive` directory under `planningHome.changesDir` if it doesn't exist:
71+
```bash
72+
mkdir -p "<planningHome.changesDir>/archive"
73+
```
74+
75+
Generate target name using current date: `YYYY-MM-DD-<change-name>`
76+
77+
**Check if target already exists:**
78+
- If yes: Fail with error, suggest renaming existing archive or using different date
79+
- If no: Move `changeRoot` to the archive directory
80+
81+
```bash
82+
mv "<changeRoot>" "<planningHome.changesDir>/archive/YYYY-MM-DD-<name>"
83+
```
84+
85+
6. **Display summary**
86+
87+
Show archive completion summary including:
88+
- Change name
89+
- Schema that was used
90+
- Archive location
91+
- Spec sync status (synced / sync skipped / no delta specs)
92+
- Note about any warnings (incomplete artifacts/tasks)
93+
94+
**Output On Success**
95+
96+
```
97+
## Archive Complete
98+
99+
**Change:** <change-name>
100+
**Schema:** <schema-name>
101+
**Archived to:** the archive path derived from `planningHome.changesDir`/YYYY-MM-DD-<name>/
102+
**Specs:** ✓ Synced to main specs
103+
104+
All artifacts complete. All tasks complete.
105+
```
106+
107+
**Output On Success (No Delta Specs)**
108+
109+
```
110+
## Archive Complete
111+
112+
**Change:** <change-name>
113+
**Schema:** <schema-name>
114+
**Archived to:** the archive path derived from `planningHome.changesDir`/YYYY-MM-DD-<name>/
115+
**Specs:** No delta specs
116+
117+
All artifacts complete. All tasks complete.
118+
```
119+
120+
**Output On Success With Warnings**
121+
122+
```
123+
## Archive Complete (with warnings)
124+
125+
**Change:** <change-name>
126+
**Schema:** <schema-name>
127+
**Archived to:** the archive path derived from `planningHome.changesDir`/YYYY-MM-DD-<name>/
128+
**Specs:** Sync skipped (user chose to skip)
129+
130+
**Warnings:**
131+
- Archived with 2 incomplete artifacts
132+
- Archived with 3 incomplete tasks
133+
- Delta spec sync was skipped (user chose to skip)
134+
135+
Review the archive if this was not intentional.
136+
```
137+
138+
**Output On Error (Archive Exists)**
139+
140+
```
141+
## Archive Failed
142+
143+
**Change:** <change-name>
144+
**Target:** the archive path derived from `planningHome.changesDir`/YYYY-MM-DD-<name>/
145+
146+
Target archive directory already exists.
147+
148+
**Options:**
149+
1. Rename the existing archive
150+
2. Delete the existing archive if it's a duplicate
151+
3. Wait until a different date to archive
152+
```
153+
154+
**Guardrails**
155+
- Always prompt for change selection if not provided
156+
- Use artifact graph (openspec status --json) for completion checking
157+
- Don't block archive on warnings - just inform and confirm
158+
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
159+
- Show clear summary of what happened
160+
- If sync is requested, use the Skill tool to invoke `openspec-sync-specs` (agent-driven)
161+
- If delta specs exist, always run the sync assessment and show the combined summary before prompting

0 commit comments

Comments
 (0)