pipeline-analytics-sdk 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pipeline_analytics_sdk-0.1.2/.claude/commands/opsx/apply.md +198 -0
- pipeline_analytics_sdk-0.1.2/.claude/commands/opsx/archive.md +246 -0
- pipeline_analytics_sdk-0.1.2/.claude/commands/opsx/explore.md +239 -0
- pipeline_analytics_sdk-0.1.2/.claude/commands/opsx/propose.md +170 -0
- pipeline_analytics_sdk-0.1.2/.claude/commands/opsx/sync.md +286 -0
- pipeline_analytics_sdk-0.1.2/.claude/commands/opsx/update.md +99 -0
- pipeline_analytics_sdk-0.1.2/.claude/skills/openspec-apply-change/SKILL.md +202 -0
- pipeline_analytics_sdk-0.1.2/.claude/skills/openspec-archive-change/SKILL.md +203 -0
- pipeline_analytics_sdk-0.1.2/.claude/skills/openspec-explore/SKILL.md +354 -0
- pipeline_analytics_sdk-0.1.2/.claude/skills/openspec-propose/SKILL.md +174 -0
- pipeline_analytics_sdk-0.1.2/.claude/skills/openspec-sync-specs/SKILL.md +290 -0
- pipeline_analytics_sdk-0.1.2/.claude/skills/openspec-update-change/SKILL.md +103 -0
- pipeline_analytics_sdk-0.1.2/.commitlintrc.json +3 -0
- pipeline_analytics_sdk-0.1.2/.editorconfig +18 -0
- pipeline_analytics_sdk-0.1.2/.github/ISSUE_TEMPLATE/bug_report.yml +24 -0
- pipeline_analytics_sdk-0.1.2/.github/ISSUE_TEMPLATE/feature_request.yml +24 -0
- pipeline_analytics_sdk-0.1.2/.github/PULL_REQUEST_TEMPLATE.md +10 -0
- pipeline_analytics_sdk-0.1.2/.github/dependabot.yml +14 -0
- pipeline_analytics_sdk-0.1.2/.github/workflows/ci.yml +138 -0
- pipeline_analytics_sdk-0.1.2/.github/workflows/dependabot-auto-merge.yml +23 -0
- pipeline_analytics_sdk-0.1.2/.github/workflows/docs.yml +42 -0
- pipeline_analytics_sdk-0.1.2/.github/workflows/regenerate.yml +120 -0
- pipeline_analytics_sdk-0.1.2/.github/workflows/release-auto-merge.yml +20 -0
- pipeline_analytics_sdk-0.1.2/.github/workflows/release.yml +78 -0
- pipeline_analytics_sdk-0.1.2/.gitignore +15 -0
- pipeline_analytics_sdk-0.1.2/.release-please-manifest.json +1 -0
- pipeline_analytics_sdk-0.1.2/CHANGELOG.md +29 -0
- pipeline_analytics_sdk-0.1.2/CONTRIBUTING.md +61 -0
- pipeline_analytics_sdk-0.1.2/LICENSE +21 -0
- pipeline_analytics_sdk-0.1.2/PKG-INFO +146 -0
- pipeline_analytics_sdk-0.1.2/README.md +127 -0
- pipeline_analytics_sdk-0.1.2/SECURITY.md +13 -0
- pipeline_analytics_sdk-0.1.2/bun.lock +202 -0
- pipeline_analytics_sdk-0.1.2/codecov.yml +5 -0
- pipeline_analytics_sdk-0.1.2/docs/index.md +6 -0
- pipeline_analytics_sdk-0.1.2/docs/reference.md +7 -0
- pipeline_analytics_sdk-0.1.2/hack/fetch-spec.sh +10 -0
- pipeline_analytics_sdk-0.1.2/lefthook.yml +33 -0
- pipeline_analytics_sdk-0.1.2/mkdocs.yml +20 -0
- pipeline_analytics_sdk-0.1.2/openapi/SPEC_COMMIT +1 -0
- pipeline_analytics_sdk-0.1.2/openapi/openapi.yaml +770 -0
- pipeline_analytics_sdk-0.1.2/openspec/changes/archive/.gitkeep +0 -0
- pipeline_analytics_sdk-0.1.2/openspec/config.yaml +32 -0
- pipeline_analytics_sdk-0.1.2/openspec/specs/.gitkeep +0 -0
- pipeline_analytics_sdk-0.1.2/package.json +8 -0
- pipeline_analytics_sdk-0.1.2/pyproject.toml +88 -0
- pipeline_analytics_sdk-0.1.2/release-please-config.json +7 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/__init__.py +27 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/README.md +10 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/__init__.py +8 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/__init__.py +1 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/auth/__init__.py +1 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/auth/webauthn_login.py +186 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/auth/webauthn_login_options.py +158 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/auth/webauthn_logout.py +154 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/auth/webauthn_register.py +193 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/auth/webauthn_register_options.py +158 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/insights/__init__.py +1 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/insights/get_git_hub_rate_limit_insights.py +191 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/meta/__init__.py +1 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/meta/get_version.py +162 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/pipelines/__init__.py +1 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/pipelines/get_pipeline.py +208 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/pipelines/get_pipeline_steps.py +213 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/pipelines/list_pipelines.py +163 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/pipelines/list_unhealthy_steps.py +193 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/repos/__init__.py +1 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/repos/discover_repos.py +209 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/repos/get_repo_usage.py +213 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/repos/list_repos.py +223 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/repos/register_repo.py +205 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/repos/untrack_repo.py +194 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/webhooks/__init__.py +1 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/webhooks/forgejo_webhook.py +212 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/api/webhooks/github_webhook.py +212 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/client.py +271 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/errors.py +14 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/__init__.py +53 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/error.py +84 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/forge.py +8 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/forgejo_webhook_body.py +66 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/git_hub_token_usage.py +112 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/github_webhook_body.py +66 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/health_status.py +8 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/ingestion_status.py +9 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/pipeline_detail.py +196 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/pipeline_steps_group.py +118 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/pipeline_summary.py +154 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/pipeline_summary_triggered_signals_item.py +9 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/rate_limit_status.py +105 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/repo.py +136 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/repo_discovery_request.py +98 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/repo_list.py +102 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/repo_registration.py +106 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/step.py +134 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/trend.py +134 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/usage_entry.py +84 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/version.py +76 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/web_authn_assertion_response.py +66 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/web_authn_attestation_response.py +66 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/web_authn_creation_options.py +66 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/models/web_authn_request_options.py +66 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/_generated/types.py +53 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/client.py +139 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/errors.py +107 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/pagination.py +95 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/py.typed +0 -0
- pipeline_analytics_sdk-0.1.2/src/pipeline_analytics/retry.py +178 -0
- pipeline_analytics_sdk-0.1.2/tests/__init__.py +0 -0
- pipeline_analytics_sdk-0.1.2/tests/test_client.py +206 -0
- pipeline_analytics_sdk-0.1.2/tests/test_errors.py +79 -0
- pipeline_analytics_sdk-0.1.2/tests/test_pagination.py +207 -0
- pipeline_analytics_sdk-0.1.2/tests/test_retry.py +389 -0
- pipeline_analytics_sdk-0.1.2/uv.lock +1855 -0
|
@@ -0,0 +1,198 @@
|
|
|
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`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. 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
|
+
**Project check:** These steps expect a project that already uses OpenSpec. Before the first step that writes anything (`new change`, `archive`, `sync specs`, or authoring an artifact file), confirm the project has a root: run `openspec list --json` (with `--store <id>` when a store is selected, since the store is then the root) and read `root`. A root object means the project is set up. `"root": null` means it is not - there is no `openspec/` directory here, and a write such as `openspec new change` would create one as a side effect. The command also exits non-zero, which is that answer rather than a broken CLI, so read the JSON instead of retrying or working around it.
|
|
14
|
+
|
|
15
|
+
One `"root": null` is not about setup: when a `status` error message starts with `Declared in` or `Invalid store declaration in` and names this project's `openspec/config.yaml` (or `config.yml`), the project does use OpenSpec through a store it declares, which this machine cannot resolve (the store is not registered, or the `store:` line is malformed). Do not treat it as uninitialized and skip the branches below: stop before writing and show the user that error's `message` and `fix`.
|
|
16
|
+
|
|
17
|
+
Otherwise, with no root, what happens next depends on how this workflow was reached:
|
|
18
|
+
|
|
19
|
+
- **Auto-selected**: you chose this workflow yourself, without the user naming OpenSpec, naming this skill, or running its slash command. Stop using OpenSpec and answer the request normally, as you would with no OpenSpec installed. Do not ask them to set anything up and do not mention OpenSpec setup.
|
|
20
|
+
- **Explicit OpenSpec request**: the user named OpenSpec, named this skill, or ran its slash command. Stop before writing and ask how to proceed: set this project up (`openspec init`), target a store they already have (`--store <id>`), or continue without OpenSpec for this request. Wait for their answer.
|
|
21
|
+
|
|
22
|
+
In both branches, never create the root as a side effect: do not run `openspec init` until the user asks for it, do not hand-create `openspec/` files, and do not let a command create it.
|
|
23
|
+
|
|
24
|
+
**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.
|
|
25
|
+
|
|
26
|
+
**Steps**
|
|
27
|
+
|
|
28
|
+
1. **Select the change**
|
|
29
|
+
|
|
30
|
+
If a name is provided, use it. Otherwise:
|
|
31
|
+
- Infer from conversation context if the user mentioned a change
|
|
32
|
+
- Auto-select if only one active change exists
|
|
33
|
+
- If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
|
|
34
|
+
|
|
35
|
+
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).
|
|
36
|
+
|
|
37
|
+
2. **Check status to understand the schema**
|
|
38
|
+
```bash
|
|
39
|
+
openspec status --change "<name>" --json
|
|
40
|
+
```
|
|
41
|
+
Parse the JSON to understand:
|
|
42
|
+
- `schemaName`: The workflow being used (e.g., "spec-driven")
|
|
43
|
+
- `planningHome`, `changeRoot`, and `actionContext`: planning scope and edit constraints
|
|
44
|
+
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
|
|
45
|
+
|
|
46
|
+
3. **Get apply instructions**
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
openspec instructions apply --change "<name>" --json
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
This returns:
|
|
53
|
+
- `contextFiles`: artifact ID -> array of concrete file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)
|
|
54
|
+
- Progress (total, complete, remaining)
|
|
55
|
+
- Task list with status
|
|
56
|
+
- Dynamic instruction based on current state
|
|
57
|
+
- Optional `context`: current required project instruction input from the selected root
|
|
58
|
+
- Optional `operationGuidance`: current advisory guidance for apply
|
|
59
|
+
- `missingArtifacts` (when present): required artifact ids with no output
|
|
60
|
+
|
|
61
|
+
**Handle states:**
|
|
62
|
+
- If `state: "blocked"`: show the message and pause implementation.
|
|
63
|
+
- If `missingArtifacts` is non-empty: suggest completing the missing artifacts. Run `openspec status --change "<name>" --json`, select the next `ready` artifact (not `skipped` or `blocked`), and use `openspec instructions "<artifact-id>" --change "<name>" --json` for its rules and template. Keep the selected `--store <id>` on both commands.
|
|
64
|
+
- Otherwise, follow the CLI instruction to create or repair the schema-configured tracking file from existing planning artifacts. Do not assume another artifact is ready or start implementation while blocked.
|
|
65
|
+
- If `state: "all_done"`: congratulate, suggest archive
|
|
66
|
+
- Otherwise: proceed to implementation
|
|
67
|
+
|
|
68
|
+
Treat `context` as a required prompt-level input. Read and consider it, and
|
|
69
|
+
apply relevant project facts, conventions, and constraints while implementing.
|
|
70
|
+
Treat `operationGuidance` as optional additive advice. Read and consider every
|
|
71
|
+
entry, and follow entries that are applicable and compatible with the built-in
|
|
72
|
+
workflow.
|
|
73
|
+
|
|
74
|
+
Keep both fields separate from CLI-returned state, missing artifacts, tasks,
|
|
75
|
+
progress, `contextFiles`, and the built-in `instruction`. They are not
|
|
76
|
+
evidence of task completion, do not replace the built-in instruction, and do
|
|
77
|
+
not permit bypassing a blocked state. If context conflicts with the built-in
|
|
78
|
+
instruction, an explicit user choice, or a CLI-controlled value, report the
|
|
79
|
+
conflict and preserve the controlling value. If guidance is inapplicable or
|
|
80
|
+
conflicts with those controlling inputs, do not follow it and explain why.
|
|
81
|
+
These are prompt-level behavior contracts, not enforceable checks.
|
|
82
|
+
|
|
83
|
+
4. **Read context files**
|
|
84
|
+
|
|
85
|
+
Read every file path listed under `contextFiles` from the apply instructions output.
|
|
86
|
+
The files depend on the schema being used:
|
|
87
|
+
- **spec-driven**: proposal, specs, design, tasks
|
|
88
|
+
- Other schemas: follow the contextFiles from CLI output
|
|
89
|
+
|
|
90
|
+
Do not copy `context` or `operationGuidance` verbatim into implementation
|
|
91
|
+
files or planning artifacts unless the user separately asks for that content.
|
|
92
|
+
|
|
93
|
+
5. **Show current progress**
|
|
94
|
+
|
|
95
|
+
Display:
|
|
96
|
+
- Schema being used
|
|
97
|
+
- Progress: "N/M tasks complete"
|
|
98
|
+
- Remaining tasks overview
|
|
99
|
+
- Dynamic instruction from CLI
|
|
100
|
+
|
|
101
|
+
6. **Implement tasks (loop until done or blocked)**
|
|
102
|
+
|
|
103
|
+
For each pending task:
|
|
104
|
+
- Show which task is being worked on
|
|
105
|
+
- Make the code changes required
|
|
106
|
+
- Keep changes minimal and focused
|
|
107
|
+
- Mark task complete in the tasks file: `- [ ]` → `- [x]`
|
|
108
|
+
- Continue to next task
|
|
109
|
+
|
|
110
|
+
**Pause if:**
|
|
111
|
+
- Task is unclear → ask for clarification
|
|
112
|
+
- Implementation reveals a design issue → suggest updating artifacts
|
|
113
|
+
- A task needs work beyond what the spec and tasks describe, or you are tempted to drop, narrow, defer, or accept exceptions to specified behavior to make it fit → surface the added scope and ask; do not absorb it silently
|
|
114
|
+
- Error or blocker encountered → report and wait for guidance
|
|
115
|
+
- User interrupts
|
|
116
|
+
|
|
117
|
+
7. **On completion or pause, show status**
|
|
118
|
+
|
|
119
|
+
Display:
|
|
120
|
+
- Tasks completed this session
|
|
121
|
+
- Overall progress: "N/M tasks complete"
|
|
122
|
+
- If all done: suggest archive
|
|
123
|
+
- If paused: explain why and wait for guidance
|
|
124
|
+
|
|
125
|
+
**Output During Implementation**
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
## Implementing: <change-name> (schema: <schema-name>)
|
|
129
|
+
|
|
130
|
+
Working on task 3/7: <task description>
|
|
131
|
+
[...implementation happening...]
|
|
132
|
+
✓ Task complete
|
|
133
|
+
|
|
134
|
+
Working on task 4/7: <task description>
|
|
135
|
+
[...implementation happening...]
|
|
136
|
+
✓ Task complete
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Output On Completion**
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
## Implementation Complete
|
|
143
|
+
|
|
144
|
+
**Change:** <change-name>
|
|
145
|
+
**Schema:** <schema-name>
|
|
146
|
+
**Progress:** 7/7 tasks complete ✓
|
|
147
|
+
|
|
148
|
+
### Completed This Session
|
|
149
|
+
- [x] Task 1
|
|
150
|
+
- [x] Task 2
|
|
151
|
+
...
|
|
152
|
+
|
|
153
|
+
All tasks complete! You can archive this change with `/opsx:archive`.
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**Output On Pause (Issue Encountered)**
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
## Implementation Paused
|
|
160
|
+
|
|
161
|
+
**Change:** <change-name>
|
|
162
|
+
**Schema:** <schema-name>
|
|
163
|
+
**Progress:** 4/7 tasks complete
|
|
164
|
+
|
|
165
|
+
### Issue Encountered
|
|
166
|
+
<description of the issue>
|
|
167
|
+
|
|
168
|
+
**Options:**
|
|
169
|
+
1. <option 1>
|
|
170
|
+
2. <option 2>
|
|
171
|
+
3. Other approach
|
|
172
|
+
|
|
173
|
+
What would you like to do?
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Guardrails**
|
|
177
|
+
- Keep going through tasks until done or blocked
|
|
178
|
+
- Always read context files before starting (from the apply instructions output)
|
|
179
|
+
- If task is ambiguous, pause and ask before implementing
|
|
180
|
+
- If implementation reveals issues, pause and suggest artifact updates
|
|
181
|
+
- Keep code changes minimal and scoped to each task
|
|
182
|
+
- Update task checkbox immediately after completing each task
|
|
183
|
+
- Pause on errors, blockers, or unclear requirements - don't guess
|
|
184
|
+
- When a task needs work beyond what the spec describes, surface the added scope and pause - never silently narrow, defer, or simplify away specified behavior
|
|
185
|
+
- Only mark a task `- [x]` when its specified behavior is fully implemented, not when it is partially done or deferred
|
|
186
|
+
- Use contextFiles from CLI output, don't assume specific file names
|
|
187
|
+
- Do not use context or operation guidance as proof that a task is complete
|
|
188
|
+
- Apply relevant project context; report conflicts with controlling workflow inputs
|
|
189
|
+
- Consider every guidance entry; explain any inapplicable or conflicting advice
|
|
190
|
+
- Do not copy runtime context or operation guidance into implementation files or planning artifacts
|
|
191
|
+
- Preserve CLI-controlled blocked/ready/all-done behavior and completion criteria
|
|
192
|
+
|
|
193
|
+
**Fluid Workflow Integration**
|
|
194
|
+
|
|
195
|
+
This skill supports the "actions on a change" model:
|
|
196
|
+
|
|
197
|
+
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
|
|
198
|
+
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
|
|
@@ -0,0 +1,246 @@
|
|
|
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`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. 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
|
+
**Project check:** These steps expect a project that already uses OpenSpec. Before the first step that writes anything (`new change`, `archive`, `sync specs`, or authoring an artifact file), confirm the project has a root: run `openspec list --json` (with `--store <id>` when a store is selected, since the store is then the root) and read `root`. A root object means the project is set up. `"root": null` means it is not - there is no `openspec/` directory here, and a write such as `openspec new change` would create one as a side effect. The command also exits non-zero, which is that answer rather than a broken CLI, so read the JSON instead of retrying or working around it.
|
|
14
|
+
|
|
15
|
+
One `"root": null` is not about setup: when a `status` error message starts with `Declared in` or `Invalid store declaration in` and names this project's `openspec/config.yaml` (or `config.yml`), the project does use OpenSpec through a store it declares, which this machine cannot resolve (the store is not registered, or the `store:` line is malformed). Do not treat it as uninitialized and skip the branches below: stop before writing and show the user that error's `message` and `fix`.
|
|
16
|
+
|
|
17
|
+
Otherwise, with no root, what happens next depends on how this workflow was reached:
|
|
18
|
+
|
|
19
|
+
- **Auto-selected**: you chose this workflow yourself, without the user naming OpenSpec, naming this skill, or running its slash command. Stop using OpenSpec and answer the request normally, as you would with no OpenSpec installed. Do not ask them to set anything up and do not mention OpenSpec setup.
|
|
20
|
+
- **Explicit OpenSpec request**: the user named OpenSpec, named this skill, or ran its slash command. Stop before writing and ask how to proceed: set this project up (`openspec init`), target a store they already have (`--store <id>`), or continue without OpenSpec for this request. Wait for their answer.
|
|
21
|
+
|
|
22
|
+
In both branches, never create the root as a side effect: do not run `openspec init` until the user asks for it, do not hand-create `openspec/` files, and do not let a command create it.
|
|
23
|
+
|
|
24
|
+
`<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve the full path from each delta spec when resolving its main spec.
|
|
25
|
+
|
|
26
|
+
**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.
|
|
27
|
+
|
|
28
|
+
**Steps**
|
|
29
|
+
|
|
30
|
+
1. **Select the change**
|
|
31
|
+
|
|
32
|
+
If a name is provided, use it. Otherwise:
|
|
33
|
+
- Infer from conversation context if the user mentioned a change
|
|
34
|
+
- Auto-select if only one active change exists
|
|
35
|
+
- If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
|
|
36
|
+
|
|
37
|
+
When prompting, show only active changes (not already archived).
|
|
38
|
+
Include the schema used for each change if available.
|
|
39
|
+
|
|
40
|
+
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:archive <other>`).
|
|
41
|
+
|
|
42
|
+
**Load current archive inputs before the existing archive checks:**
|
|
43
|
+
|
|
44
|
+
After resolving the selected change and planning root, run:
|
|
45
|
+
```bash
|
|
46
|
+
openspec instructions archive --change "<name>" --json
|
|
47
|
+
```
|
|
48
|
+
Keep the same selected-root flags on this command. This lookup is advisory and
|
|
49
|
+
optional: it only supplies extra prompt inputs, so it must never block archiving.
|
|
50
|
+
If it exits non-zero or returns invalid JSON — for example on an older CLI that
|
|
51
|
+
does not support this command yet — continue the archive workflow with no
|
|
52
|
+
context and no operation guidance. Do not report an error and do not stop.
|
|
53
|
+
|
|
54
|
+
A successful response may omit both optional fields. Treat `context` as a
|
|
55
|
+
required prompt-level input: read and consider it, and apply relevant project
|
|
56
|
+
facts, conventions, and constraints. Treat `operationGuidance` as optional
|
|
57
|
+
additive advice: read and consider every entry, and follow entries that are
|
|
58
|
+
applicable and compatible with the built-in archive workflow.
|
|
59
|
+
|
|
60
|
+
Keep both fields separate from built-in steps, explicit user choices, resolved
|
|
61
|
+
paths, CLI checks, and command contracts. If context conflicts with one of those
|
|
62
|
+
controlling inputs, report the conflict and preserve the controlling value. If
|
|
63
|
+
guidance is inapplicable or conflicts with a controlling input, do not follow it
|
|
64
|
+
and explain why. Do not infer replacement paths, skipped prompts, or flags from
|
|
65
|
+
either field, and do not copy their text verbatim into specs, change artifacts,
|
|
66
|
+
or archive summaries unless the user separately asks for it. These are
|
|
67
|
+
prompt-level behavior contracts, not enforceable checks.
|
|
68
|
+
|
|
69
|
+
2. **Check artifact completion status**
|
|
70
|
+
|
|
71
|
+
Run `openspec status --change "<name>" --json` to check artifact completion.
|
|
72
|
+
|
|
73
|
+
Parse the JSON to understand:
|
|
74
|
+
- `schemaName`: The workflow being used
|
|
75
|
+
- `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context
|
|
76
|
+
- `artifacts`: List of artifacts with their status (`done`, `skipped`, or other)
|
|
77
|
+
|
|
78
|
+
**If any artifacts are neither `done` nor `skipped`** (skipped artifacts satisfy the requirement - the change declares skip_specs):
|
|
79
|
+
- Display warning listing incomplete artifacts
|
|
80
|
+
- Prompt user for confirmation to continue
|
|
81
|
+
- Proceed if user confirms
|
|
82
|
+
|
|
83
|
+
3. **Check task completion status**
|
|
84
|
+
|
|
85
|
+
Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
|
|
86
|
+
|
|
87
|
+
A checkbox is complete when its only content is `x` or `X`; spacing inside
|
|
88
|
+
the brackets does not matter, so `- [ x]` counts as complete too. Every
|
|
89
|
+
other marker is incomplete - `- [ ]`, an empty `- []`, and markers OpenSpec
|
|
90
|
+
assigns no meaning to such as `- [~]` or `- [-]`. Never read an unfamiliar
|
|
91
|
+
marker as complete.
|
|
92
|
+
|
|
93
|
+
**If incomplete tasks found:**
|
|
94
|
+
- Display warning showing count of incomplete tasks
|
|
95
|
+
- Prompt user for confirmation to continue
|
|
96
|
+
- Proceed if user confirms
|
|
97
|
+
|
|
98
|
+
**If no tasks file exists:** Proceed without task-related warning.
|
|
99
|
+
|
|
100
|
+
4. **Assess delta spec sync state**
|
|
101
|
+
|
|
102
|
+
Use `artifactPaths.specs.existingOutputPaths` from status JSON as the only
|
|
103
|
+
delta-spec source. If the `specs` entry is missing or
|
|
104
|
+
`existingOutputPaths` is empty, proceed without a sync prompt and do not infer
|
|
105
|
+
delta specs from other artifacts.
|
|
106
|
+
|
|
107
|
+
**If delta specs exist:**
|
|
108
|
+
- Compare each delta spec with its corresponding main spec at `<planningHome.root>/openspec/specs/<capability-path>/spec.md` (use the store-aware `planningHome.root` from step 2, not a hardcoded repo path)
|
|
109
|
+
- A missing main spec is **not automatically** "already synced". For a new capability, the main spec is an *output* of the sync, not an input:
|
|
110
|
+
- If the delta has MODIFIED or RENAMED requirements, report that only ADDED requirements can create a new main spec and mark that capability as sync-blocked. Never invent a requirement that has no current version.
|
|
111
|
+
- Otherwise, if the delta has only REMOVED requirements and the change's `.openspec.yaml` declares `retire_capabilities: true`, the capability is already retired: count it as already synced, warn that there is nothing left to remove, and do not recreate the main spec. Apply this rule both now and when verifying a completed sync.
|
|
112
|
+
- Otherwise, if the delta has no ADDED requirements, report that no sync is possible and mark that capability as sync-blocked. For a REMOVED-only delta, warn that there is no main spec to remove from and leave the main-spec tree unchanged. `openspec archive` refuses the unmarked REMOVED-only case with `Spec must have at least one requirement`.
|
|
113
|
+
- Otherwise, count the capability as needing sync and name it in the summary (`<capability-path>: new main spec will be created`). If the delta also has REMOVED requirements, warn that they will be ignored because there is no main spec to remove from. The sync creates the main spec from only the delta's ADDED requirements, exactly as `openspec archive` does.
|
|
114
|
+
- Determine what changes would be applied (adds, modifications, removals, renames)
|
|
115
|
+
- Continue assessing the remaining capabilities even when one is sync-blocked. Show a combined summary before prompting.
|
|
116
|
+
|
|
117
|
+
**Prompt options:**
|
|
118
|
+
- If any capability is sync-blocked: explain why and offer only "Archive without syncing", "Cancel"
|
|
119
|
+
- Otherwise, if changes needed: "Sync now (recommended)", "Archive without syncing"
|
|
120
|
+
- Otherwise, if already synced: "Archive now", "Sync anyway", "Cancel"
|
|
121
|
+
|
|
122
|
+
Route on the answer:
|
|
123
|
+
- "Cancel" — stop, do not archive
|
|
124
|
+
- "Archive without syncing" or "Archive now" — proceed to archive
|
|
125
|
+
- "Sync now" or "Sync anyway" — sync, then verify (below). Do not start any sync while a capability is sync-blocked; explain the blocker and repeat the available choices.
|
|
126
|
+
- Anything else — ask again rather than archiving
|
|
127
|
+
|
|
128
|
+
Before a selected sync writes any main spec, run
|
|
129
|
+
`openspec instructions specs --change "<name>" --json` once with the same
|
|
130
|
+
selected-root flags. Require a zero exit status and valid artifact-instruction
|
|
131
|
+
JSON. If the lookup fails or returns invalid JSON, report the error and stop
|
|
132
|
+
before writing any main spec or moving the change. A valid response with omitted
|
|
133
|
+
`rules` is the no-rules case. Apply returned `rules` only to the content and
|
|
134
|
+
form of main specs produced by this merge; do not use them as archive guidance,
|
|
135
|
+
change CLI behavior, or copy the rule text into any output file.
|
|
136
|
+
|
|
137
|
+
Then run the `/opsx:sync` workflow inline (agent-driven intelligent merge) for change '<name>', passing the delta spec analysis and the fetched specs-rule snapshot from above, and wait for it to finish. The inline sync must reuse that snapshot without fetching `specs` instructions again. Do not delegate it to a background task — step 5 would move `changeRoot` out from under a sync that is still reading it, leaving the change archived and the main specs never updated. If your agent can only run it by delegation, delegate synchronously and wait for the result.
|
|
138
|
+
|
|
139
|
+
Then re-run the comparison from the top of this step, including the explicitly retired, missing-spec case, against every capability that has a delta spec in `artifactPaths.specs.existingOutputPaths` — not only the ones the sync reports it touched. A successful sync leaves nothing left to apply, so each capability must now read as already synced:
|
|
140
|
+
- ADDED requirements present
|
|
141
|
+
- MODIFIED requirements carrying the scenario and description changes named in the delta, with their other scenarios intact
|
|
142
|
+
- REMOVED requirements gone — and where this sync retired a capability (removed its last requirement, leaving `## Requirements` empty), its main spec deleted rather than left empty; a spec the sync deliberately kept and reported is also a match
|
|
143
|
+
- RENAMED requirements present under the new name and absent under the old one
|
|
144
|
+
|
|
145
|
+
If the sync failed, or any capability does not match, report what differs and stop — do not archive. Nothing has moved and `changeRoot` is intact, so the user can fix the mismatch or re-run the sync and start the archive again.
|
|
146
|
+
|
|
147
|
+
5. **Perform the archive**
|
|
148
|
+
|
|
149
|
+
Create an `archive` directory under `planningHome.changesDir` if it doesn't exist:
|
|
150
|
+
```bash
|
|
151
|
+
mkdir -p "<planningHome.changesDir>/archive"
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Generate the target name: use the change name as-is when it already starts with a `YYYY-MM-DD-` prefix; otherwise prepend the current date as `YYYY-MM-DD-<change-name>`. Never stack a second date (same rule as `openspec archive`).
|
|
155
|
+
|
|
156
|
+
**Check if target already exists:**
|
|
157
|
+
- If yes: Fail with error, suggest renaming existing archive or using different date
|
|
158
|
+
- If no: Move `changeRoot` to the archive directory
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
mv "<changeRoot>" "<planningHome.changesDir>/archive/<target-name>"
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
6. **Display summary**
|
|
165
|
+
|
|
166
|
+
Show archive completion summary including:
|
|
167
|
+
- Change name
|
|
168
|
+
- Schema that was used
|
|
169
|
+
- Archive location
|
|
170
|
+
- Spec sync status (synced / sync skipped / no delta specs)
|
|
171
|
+
- Note about any warnings (incomplete artifacts/tasks)
|
|
172
|
+
|
|
173
|
+
**Output On Success**
|
|
174
|
+
|
|
175
|
+
```markdown
|
|
176
|
+
## Archive Complete
|
|
177
|
+
|
|
178
|
+
**Change:** <change-name>
|
|
179
|
+
**Schema:** <schema-name>
|
|
180
|
+
**Archived to:** the archive path derived from `planningHome.changesDir`/<target-name>/
|
|
181
|
+
**Specs:** ✓ Synced to main specs
|
|
182
|
+
|
|
183
|
+
All artifacts complete. All tasks complete.
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Output On Success (No Delta Specs)**
|
|
187
|
+
|
|
188
|
+
```markdown
|
|
189
|
+
## Archive Complete
|
|
190
|
+
|
|
191
|
+
**Change:** <change-name>
|
|
192
|
+
**Schema:** <schema-name>
|
|
193
|
+
**Archived to:** the archive path derived from `planningHome.changesDir`/<target-name>/
|
|
194
|
+
**Specs:** No delta specs
|
|
195
|
+
|
|
196
|
+
All artifacts complete. All tasks complete.
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**Output On Success With Warnings**
|
|
200
|
+
|
|
201
|
+
```markdown
|
|
202
|
+
## Archive Complete (with warnings)
|
|
203
|
+
|
|
204
|
+
**Change:** <change-name>
|
|
205
|
+
**Schema:** <schema-name>
|
|
206
|
+
**Archived to:** the archive path derived from `planningHome.changesDir`/<target-name>/
|
|
207
|
+
**Specs:** Sync skipped (user chose to skip)
|
|
208
|
+
|
|
209
|
+
**Warnings:**
|
|
210
|
+
- Archived with 2 incomplete artifacts
|
|
211
|
+
- Archived with 3 incomplete tasks
|
|
212
|
+
- Delta spec sync was skipped (user chose to skip)
|
|
213
|
+
|
|
214
|
+
Review the archive if this was not intentional.
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**Output On Error (Archive Exists)**
|
|
218
|
+
|
|
219
|
+
```markdown
|
|
220
|
+
## Archive Failed
|
|
221
|
+
|
|
222
|
+
**Change:** <change-name>
|
|
223
|
+
**Target:** the archive path derived from `planningHome.changesDir`/<target-name>/
|
|
224
|
+
|
|
225
|
+
Target archive directory already exists.
|
|
226
|
+
|
|
227
|
+
**Options:**
|
|
228
|
+
1. Rename the existing archive
|
|
229
|
+
2. Delete the existing archive if it's a duplicate
|
|
230
|
+
3. Wait until a different date to archive
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
**Guardrails**
|
|
234
|
+
- Announce the selected change; prompt for selection when it is ambiguous
|
|
235
|
+
- Use artifact graph (openspec status --json) for completion checking
|
|
236
|
+
- Don't block archive on warnings - just inform and confirm
|
|
237
|
+
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
|
|
238
|
+
- Show clear summary of what happened
|
|
239
|
+
- If sync is requested, run the `/opsx:sync` workflow inline (agent-driven)
|
|
240
|
+
- Never archive while a spec sync is still in flight — run the sync inline and verify the main specs before moving `changeRoot`
|
|
241
|
+
- If delta specs exist, always run the sync assessment and show the combined summary before prompting
|
|
242
|
+
- Apply relevant runtime context and report conflicts; operation guidance remains advisory
|
|
243
|
+
- Consider every guidance entry and explain any inapplicable or conflicting advice
|
|
244
|
+
- Existing CLI checks, resolved paths, prompts, and command contracts are unchanged
|
|
245
|
+
- Artifact rules constrain only the specs being written and are never operation guidance
|
|
246
|
+
- Never copy runtime context, operation guidance, or artifact-rule text verbatim into output files
|