@tothemax/tasking 0.0.0-stage → 0.6.15
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.
- package/README.md +119 -2
- package/README.zh-CN.md +120 -0
- package/assets/skills/install-glab/SKILL.md +70 -0
- package/assets/skills/land/SKILL.md +63 -0
- package/assets/skills/land/land_watch.py +312 -0
- package/assets/skills/openspec-archive-change/SKILL.md +114 -0
- package/assets/skills/opsx-grill-with-docs/SKILL.md +193 -0
- package/assets/skills/opsx-implement/SKILL.md +258 -0
- package/assets/skills/opsx-propose-with-tdd/SKILL.md +271 -0
- package/assets/workflows/WORKFLOW.code-mr.en.md.example +345 -0
- package/assets/workflows/WORKFLOW.code-mr.md.example +339 -0
- package/assets/workflows/WORKFLOW.feishu-direct.en.md.example +267 -0
- package/assets/workflows/WORKFLOW.feishu-direct.md.example +258 -0
- package/assets/workflows/WORKFLOW.grill-openspec.en.md.example +362 -0
- package/assets/workflows/WORKFLOW.grill-openspec.md.example +356 -0
- package/assets/workflows/WORKFLOW.minimal.en.md.example +296 -0
- package/assets/workflows/WORKFLOW.minimal.md.example +289 -0
- package/dist/adapters/feishu/events.d.ts +55 -0
- package/dist/adapters/feishu/events.d.ts.map +1 -0
- package/dist/adapters/feishu/events.js +184 -0
- package/dist/adapters/feishu/events.js.map +1 -0
- package/dist/adapters/feishu/index.d.ts +2 -0
- package/dist/adapters/feishu/index.d.ts.map +1 -0
- package/dist/adapters/feishu/index.js +2 -0
- package/dist/adapters/feishu/index.js.map +1 -0
- package/dist/adapters/feishu/probe.d.ts +31 -0
- package/dist/adapters/feishu/probe.d.ts.map +1 -0
- package/dist/adapters/feishu/probe.js +179 -0
- package/dist/adapters/feishu/probe.js.map +1 -0
- package/dist/adapters/feishu/source.d.ts +124 -0
- package/dist/adapters/feishu/source.d.ts.map +1 -0
- package/dist/adapters/feishu/source.js +715 -0
- package/dist/adapters/feishu/source.js.map +1 -0
- package/dist/adapters/jira/index.d.ts +2 -0
- package/dist/adapters/jira/index.d.ts.map +1 -0
- package/dist/adapters/jira/index.js +2 -0
- package/dist/adapters/jira/index.js.map +1 -0
- package/dist/adapters/jira/tracker.d.ts +63 -0
- package/dist/adapters/jira/tracker.d.ts.map +1 -0
- package/dist/adapters/jira/tracker.js +402 -0
- package/dist/adapters/jira/tracker.js.map +1 -0
- package/dist/bridge/binding-store.d.ts +93 -0
- package/dist/bridge/binding-store.d.ts.map +1 -0
- package/dist/bridge/binding-store.js +365 -0
- package/dist/bridge/binding-store.js.map +1 -0
- package/dist/bridge/commands.d.ts +45 -0
- package/dist/bridge/commands.d.ts.map +1 -0
- package/dist/bridge/commands.js +197 -0
- package/dist/bridge/commands.js.map +1 -0
- package/dist/bridge/comment-bridge.d.ts +116 -0
- package/dist/bridge/comment-bridge.d.ts.map +1 -0
- package/dist/bridge/comment-bridge.js +1473 -0
- package/dist/bridge/comment-bridge.js.map +1 -0
- package/dist/cli/daemon-info.d.ts +17 -0
- package/dist/cli/daemon-info.d.ts.map +1 -0
- package/dist/cli/daemon-info.js +64 -0
- package/dist/cli/daemon-info.js.map +1 -0
- package/dist/cli/daemon.d.ts +27 -0
- package/dist/cli/daemon.d.ts.map +1 -0
- package/dist/cli/daemon.js +77 -0
- package/dist/cli/daemon.js.map +1 -0
- package/dist/cli/doctor.d.ts +7 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +156 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/event-channel.d.ts +16 -0
- package/dist/cli/event-channel.d.ts.map +1 -0
- package/dist/cli/event-channel.js +51 -0
- package/dist/cli/event-channel.js.map +1 -0
- package/dist/cli/help.d.ts +3 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/help.js +155 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +774 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.d.ts +64 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +1296 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/instance-lock.d.ts +13 -0
- package/dist/cli/instance-lock.d.ts.map +1 -0
- package/dist/cli/instance-lock.js +53 -0
- package/dist/cli/instance-lock.js.map +1 -0
- package/dist/cli/prompts.d.ts +13 -0
- package/dist/cli/prompts.d.ts.map +1 -0
- package/dist/cli/prompts.js +26 -0
- package/dist/cli/prompts.js.map +1 -0
- package/dist/cli/style.d.ts +26 -0
- package/dist/cli/style.d.ts.map +1 -0
- package/dist/cli/style.js +58 -0
- package/dist/cli/style.js.map +1 -0
- package/dist/cli/tui-helpers.d.ts +5 -0
- package/dist/cli/tui-helpers.d.ts.map +1 -0
- package/dist/cli/tui-helpers.js +124 -0
- package/dist/cli/tui-helpers.js.map +1 -0
- package/dist/cli/workflow-path.d.ts +12 -0
- package/dist/cli/workflow-path.d.ts.map +1 -0
- package/dist/cli/workflow-path.js +37 -0
- package/dist/cli/workflow-path.js.map +1 -0
- package/dist/config/config-types.d.ts +180 -0
- package/dist/config/config-types.d.ts.map +1 -0
- package/dist/config/config-types.js +71 -0
- package/dist/config/config-types.js.map +1 -0
- package/dist/config/dotenv.d.ts +2 -0
- package/dist/config/dotenv.d.ts.map +1 -0
- package/dist/config/dotenv.js +10 -0
- package/dist/config/dotenv.js.map +1 -0
- package/dist/config/index.d.ts +6 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +6 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +5 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +304 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/manager.d.ts +31 -0
- package/dist/config/manager.d.ts.map +1 -0
- package/dist/config/manager.js +110 -0
- package/dist/config/manager.js.map +1 -0
- package/dist/config/resolver.d.ts +6 -0
- package/dist/config/resolver.d.ts.map +1 -0
- package/dist/config/resolver.js +267 -0
- package/dist/config/resolver.js.map +1 -0
- package/dist/config/validator.d.ts +9 -0
- package/dist/config/validator.d.ts.map +1 -0
- package/dist/config/validator.js +70 -0
- package/dist/config/validator.js.map +1 -0
- package/dist/direct/card.d.ts +49 -0
- package/dist/direct/card.d.ts.map +1 -0
- package/dist/direct/card.js +274 -0
- package/dist/direct/card.js.map +1 -0
- package/dist/direct/command.d.ts +12 -0
- package/dist/direct/command.d.ts.map +1 -0
- package/dist/direct/command.js +23 -0
- package/dist/direct/command.js.map +1 -0
- package/dist/direct/manager.d.ts +159 -0
- package/dist/direct/manager.d.ts.map +1 -0
- package/dist/direct/manager.js +1862 -0
- package/dist/direct/manager.js.map +1 -0
- package/dist/mcp/inject.d.ts +5 -0
- package/dist/mcp/inject.d.ts.map +1 -0
- package/dist/mcp/inject.js +51 -0
- package/dist/mcp/inject.js.map +1 -0
- package/dist/mcp/jira-server.d.ts +29 -0
- package/dist/mcp/jira-server.d.ts.map +1 -0
- package/dist/mcp/jira-server.js +288 -0
- package/dist/mcp/jira-server.js.map +1 -0
- package/dist/observability/activity-store.d.ts +29 -0
- package/dist/observability/activity-store.d.ts.map +1 -0
- package/dist/observability/activity-store.js +32 -0
- package/dist/observability/activity-store.js.map +1 -0
- package/dist/observability/config-view.d.ts +19 -0
- package/dist/observability/config-view.d.ts.map +1 -0
- package/dist/observability/config-view.js +61 -0
- package/dist/observability/config-view.js.map +1 -0
- package/dist/observability/http-dashboard.d.ts +36 -0
- package/dist/observability/http-dashboard.d.ts.map +1 -0
- package/dist/observability/http-dashboard.js +297 -0
- package/dist/observability/http-dashboard.js.map +1 -0
- package/dist/observability/log-buffer.d.ts +21 -0
- package/dist/observability/log-buffer.d.ts.map +1 -0
- package/dist/observability/log-buffer.js +69 -0
- package/dist/observability/log-buffer.js.map +1 -0
- package/dist/observability/logger.d.ts +37 -0
- package/dist/observability/logger.d.ts.map +1 -0
- package/dist/observability/logger.js +114 -0
- package/dist/observability/logger.js.map +1 -0
- package/dist/observability/snapshot.d.ts +11 -0
- package/dist/observability/snapshot.d.ts.map +1 -0
- package/dist/observability/snapshot.js +59 -0
- package/dist/observability/snapshot.js.map +1 -0
- package/dist/observability/terminal-dashboard.d.ts +155 -0
- package/dist/observability/terminal-dashboard.d.ts.map +1 -0
- package/dist/observability/terminal-dashboard.js +1598 -0
- package/dist/observability/terminal-dashboard.js.map +1 -0
- package/dist/observability/wrap.d.ts +4 -0
- package/dist/observability/wrap.d.ts.map +1 -0
- package/dist/observability/wrap.js +80 -0
- package/dist/observability/wrap.js.map +1 -0
- package/dist/scheduler/index.d.ts +2 -0
- package/dist/scheduler/index.d.ts.map +1 -0
- package/dist/scheduler/index.js +2 -0
- package/dist/scheduler/index.js.map +1 -0
- package/dist/scheduler/scheduler.d.ts +52 -0
- package/dist/scheduler/scheduler.d.ts.map +1 -0
- package/dist/scheduler/scheduler.js +535 -0
- package/dist/scheduler/scheduler.js.map +1 -0
- package/dist/shared/agent-resolver.d.ts +11 -0
- package/dist/shared/agent-resolver.d.ts.map +1 -0
- package/dist/shared/agent-resolver.js +20 -0
- package/dist/shared/agent-resolver.js.map +1 -0
- package/dist/shared/errors.d.ts +14 -0
- package/dist/shared/errors.d.ts.map +1 -0
- package/dist/shared/errors.js +24 -0
- package/dist/shared/errors.js.map +1 -0
- package/dist/shared/index.d.ts +4 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +4 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/info-card.d.ts +24 -0
- package/dist/shared/info-card.d.ts.map +1 -0
- package/dist/shared/info-card.js +46 -0
- package/dist/shared/info-card.js.map +1 -0
- package/dist/shared/types.d.ts +148 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +15 -0
- package/dist/shared/types.js.map +1 -0
- package/dist/translate/card.d.ts +2 -0
- package/dist/translate/card.d.ts.map +1 -0
- package/dist/translate/card.js +17 -0
- package/dist/translate/card.js.map +1 -0
- package/dist/translate/dict.d.ts +7 -0
- package/dist/translate/dict.d.ts.map +1 -0
- package/dist/translate/dict.js +895 -0
- package/dist/translate/dict.js.map +1 -0
- package/dist/translate/locale.d.ts +8 -0
- package/dist/translate/locale.d.ts.map +1 -0
- package/dist/translate/locale.js +75 -0
- package/dist/translate/locale.js.map +1 -0
- package/dist/translate/normalize.d.ts +4 -0
- package/dist/translate/normalize.d.ts.map +1 -0
- package/dist/translate/normalize.js +38 -0
- package/dist/translate/normalize.js.map +1 -0
- package/dist/translate/output.d.ts +3 -0
- package/dist/translate/output.d.ts.map +1 -0
- package/dist/translate/output.js +16 -0
- package/dist/translate/output.js.map +1 -0
- package/dist/worker/prompt.d.ts +11 -0
- package/dist/worker/prompt.d.ts.map +1 -0
- package/dist/worker/prompt.js +153 -0
- package/dist/worker/prompt.js.map +1 -0
- package/dist/worker/runner.d.ts +101 -0
- package/dist/worker/runner.d.ts.map +1 -0
- package/dist/worker/runner.js +448 -0
- package/dist/worker/runner.js.map +1 -0
- package/dist/workspace/index.d.ts +2 -0
- package/dist/workspace/index.d.ts.map +1 -0
- package/dist/workspace/index.js +2 -0
- package/dist/workspace/index.js.map +1 -0
- package/dist/workspace/manager.d.ts +37 -0
- package/dist/workspace/manager.d.ts.map +1 -0
- package/dist/workspace/manager.js +157 -0
- package/dist/workspace/manager.js.map +1 -0
- package/package.json +65 -4
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openspec-archive-change
|
|
3
|
+
description: Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires openspec CLI.
|
|
6
|
+
metadata:
|
|
7
|
+
author: openspec
|
|
8
|
+
version: "1.0"
|
|
9
|
+
generatedBy: "1.3.1"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Archive a completed change in the experimental workflow.
|
|
13
|
+
|
|
14
|
+
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
15
|
+
|
|
16
|
+
**Steps**
|
|
17
|
+
|
|
18
|
+
1. **If no change name provided, prompt for selection**
|
|
19
|
+
|
|
20
|
+
Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
21
|
+
|
|
22
|
+
Show only active changes (not already archived).
|
|
23
|
+
Include the schema used for each change if available.
|
|
24
|
+
|
|
25
|
+
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
|
|
26
|
+
|
|
27
|
+
2. **Check artifact completion status**
|
|
28
|
+
|
|
29
|
+
Run `openspec status --change "<name>" --json` to check artifact completion.
|
|
30
|
+
|
|
31
|
+
Parse the JSON to understand:
|
|
32
|
+
- `schemaName`: The workflow being used
|
|
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
|
+
- Use **AskUserQuestion tool** to confirm user wants to proceed
|
|
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
|
+
- Use **AskUserQuestion tool** to confirm user wants to proceed
|
|
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
|
+
Check for delta specs at `openspec/changes/<name>/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 the archive directory if it doesn't exist:
|
|
71
|
+
```bash
|
|
72
|
+
mkdir -p openspec/changes/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 the change directory to archive
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
mv openspec/changes/<name> openspec/changes/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
|
+
- Whether specs were synced (if applicable)
|
|
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:** openspec/changes/archive/YYYY-MM-DD-<name>/
|
|
102
|
+
**Specs:** ✓ Synced to main specs (or "No delta specs" or "Sync skipped")
|
|
103
|
+
|
|
104
|
+
All artifacts complete. All tasks complete.
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Guardrails**
|
|
108
|
+
- Always prompt for change selection if not provided
|
|
109
|
+
- Use artifact graph (openspec status --json) for completion checking
|
|
110
|
+
- Don't block archive on warnings - just inform and confirm
|
|
111
|
+
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
|
|
112
|
+
- Show clear summary of what happened
|
|
113
|
+
- If sync is requested, use openspec-sync-specs approach (agent-driven)
|
|
114
|
+
- If delta specs exist, always run the sync assessment and show the combined summary before prompting
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: opsx-grill-with-docs
|
|
3
|
+
description: A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Interview me relentlessly about every aspect of this until we reach a shared understanding. Walk down each branch of the decision tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
|
|
7
|
+
|
|
8
|
+
Ask the questions one at a time, waiting for feedback on each question before continuing. Asking multiple questions at once is bewildering.
|
|
9
|
+
|
|
10
|
+
If a *fact* can be found by exploring the environment (filesystem, tools, etc.), look it up rather than asking me. The *decisions*, though, are mine — put each one to me and wait for my answer.
|
|
11
|
+
|
|
12
|
+
Do not act on it until I confirm we have reached a shared understanding.
|
|
13
|
+
|
|
14
|
+
When the proposal can be made(After reaching a consensus), run /opsx-propose-with-tdd.
|
|
15
|
+
|
|
16
|
+
# Domain Modeling
|
|
17
|
+
|
|
18
|
+
Actively build and sharpen the project's domain model as you design. This is the *active* discipline — challenging terms, inventing edge-case scenarios, and writing the glossary and decisions down the moment they crystallise. (Merely *reading* `CONTEXT.md` for vocabulary is not this skill — that's a one-line habit any skill can do. This skill is for when you're changing the model, not just consuming it.)
|
|
19
|
+
|
|
20
|
+
## File structure
|
|
21
|
+
|
|
22
|
+
Most repos have a single context:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
/
|
|
26
|
+
├── CONTEXT.md
|
|
27
|
+
├── docs/
|
|
28
|
+
│ └── adr/
|
|
29
|
+
│ ├── 0001-event-sourced-orders.md
|
|
30
|
+
│ └── 0002-postgres-for-write-model.md
|
|
31
|
+
└── src/
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
If a `CONTEXT-MAP.md` exists at the root, the repo has multiple contexts. The map points to where each one lives:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
/
|
|
38
|
+
├── CONTEXT-MAP.md
|
|
39
|
+
├── docs/
|
|
40
|
+
│ └── adr/ ← system-wide decisions
|
|
41
|
+
├── src/
|
|
42
|
+
│ ├── ordering/
|
|
43
|
+
│ │ ├── CONTEXT.md
|
|
44
|
+
│ │ └── docs/adr/ ← context-specific decisions
|
|
45
|
+
│ └── billing/
|
|
46
|
+
│ ├── CONTEXT.md
|
|
47
|
+
│ └── docs/adr/
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Create files lazily — only when you have something to write. If no `CONTEXT.md` exists, create one when the first term is resolved. If no `docs/adr/` exists, create it when the first ADR is needed.
|
|
51
|
+
|
|
52
|
+
## During the session
|
|
53
|
+
|
|
54
|
+
### Challenge against the glossary
|
|
55
|
+
|
|
56
|
+
When the user uses a term that conflicts with the existing language in `CONTEXT.md`, call it out immediately. "Your glossary defines 'cancellation' as X, but you seem to mean Y — which is it?"
|
|
57
|
+
|
|
58
|
+
### Sharpen fuzzy language
|
|
59
|
+
|
|
60
|
+
When the user uses vague or overloaded terms, propose a precise canonical term. "You're saying 'account' — do you mean the Customer or the User? Those are different things."
|
|
61
|
+
|
|
62
|
+
### Discuss concrete scenarios
|
|
63
|
+
|
|
64
|
+
When domain relationships are being discussed, stress-test them with specific scenarios. Invent scenarios that probe edge cases and force the user to be precise about the boundaries between concepts.
|
|
65
|
+
|
|
66
|
+
### Cross-reference with code
|
|
67
|
+
|
|
68
|
+
When the user states how something works, check whether the code agrees. If you find a contradiction, surface it: "Your code cancels entire Orders, but you just said partial cancellation is possible — which is right?"
|
|
69
|
+
|
|
70
|
+
### Update CONTEXT.md inline
|
|
71
|
+
|
|
72
|
+
When a term is resolved, update `CONTEXT.md` right there. Don't batch these up — capture them as they happen. Use the format below.
|
|
73
|
+
|
|
74
|
+
`CONTEXT.md` should be totally devoid of implementation details. Do not treat `CONTEXT.md` as a spec, a scratch pad, or a repository for implementation decisions. It is a glossary and nothing else.
|
|
75
|
+
|
|
76
|
+
### Offer ADRs sparingly
|
|
77
|
+
|
|
78
|
+
Only offer to create an ADR when all three are true:
|
|
79
|
+
|
|
80
|
+
1. **Hard to reverse** — the cost of changing your mind later is meaningful
|
|
81
|
+
2. **Surprising without context** — a future reader will wonder "why did they do it this way?"
|
|
82
|
+
3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons
|
|
83
|
+
|
|
84
|
+
If any of the three is missing, skip the ADR. Use the format below.
|
|
85
|
+
|
|
86
|
+
# CONTEXT.md Format
|
|
87
|
+
|
|
88
|
+
## Structure
|
|
89
|
+
|
|
90
|
+
```md
|
|
91
|
+
# {Context Name}
|
|
92
|
+
|
|
93
|
+
{One or two sentence description of what this context is and why it exists.}
|
|
94
|
+
|
|
95
|
+
## Language
|
|
96
|
+
|
|
97
|
+
**Order**:
|
|
98
|
+
{A one or two sentence description of the term}
|
|
99
|
+
_Avoid_: Purchase, transaction
|
|
100
|
+
|
|
101
|
+
**Invoice**:
|
|
102
|
+
A request for payment sent to a customer after delivery.
|
|
103
|
+
_Avoid_: Bill, payment request
|
|
104
|
+
|
|
105
|
+
**Customer**:
|
|
106
|
+
A person or organization that places orders.
|
|
107
|
+
_Avoid_: Client, buyer, account
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Rules
|
|
111
|
+
|
|
112
|
+
- **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others under `_Avoid_`.
|
|
113
|
+
- **Keep definitions tight.** One or two sentences max. Define what it IS, not what it does.
|
|
114
|
+
- **Only include terms specific to this project's context.** General programming concepts (timeouts, error types, utility patterns) don't belong even if the project uses them extensively. Before adding a term, ask: is this a concept unique to this context, or a general programming concept? Only the former belongs.
|
|
115
|
+
- **Group terms under subheadings** when natural clusters emerge. If all terms belong to a single cohesive area, a flat list is fine.
|
|
116
|
+
|
|
117
|
+
## Single vs multi-context repos
|
|
118
|
+
|
|
119
|
+
**Single context (most repos):** One `CONTEXT.md` at the repo root.
|
|
120
|
+
|
|
121
|
+
**Multiple contexts:** A `CONTEXT-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:
|
|
122
|
+
|
|
123
|
+
```md
|
|
124
|
+
# Context Map
|
|
125
|
+
|
|
126
|
+
## Contexts
|
|
127
|
+
|
|
128
|
+
- [Ordering](./src/ordering/CONTEXT.md) — receives and tracks customer orders
|
|
129
|
+
- [Billing](./src/billing/CONTEXT.md) — generates invoices and processes payments
|
|
130
|
+
- [Fulfillment](./src/fulfillment/CONTEXT.md) — manages warehouse picking and shipping
|
|
131
|
+
|
|
132
|
+
## Relationships
|
|
133
|
+
|
|
134
|
+
- **Ordering → Fulfillment**: Ordering emits `OrderPlaced` events; Fulfillment consumes them to start picking
|
|
135
|
+
- **Fulfillment → Billing**: Fulfillment emits `ShipmentDispatched` events; Billing consumes them to generate invoices
|
|
136
|
+
- **Ordering ↔ Billing**: Shared types for `CustomerId` and `Money`
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
The skill infers which structure applies:
|
|
140
|
+
|
|
141
|
+
- If `CONTEXT-MAP.md` exists, read it to find contexts
|
|
142
|
+
- If only a root `CONTEXT.md` exists, single context
|
|
143
|
+
- If neither exists, create a root `CONTEXT.md` lazily when the first term is resolved
|
|
144
|
+
|
|
145
|
+
When multiple contexts exist, infer which one the current topic relates to. If unclear, ask.
|
|
146
|
+
|
|
147
|
+
# ADR Format
|
|
148
|
+
|
|
149
|
+
ADRs live in `docs/adr/` and use sequential numbering: `0001-slug.md`, `0002-slug.md`, etc.
|
|
150
|
+
|
|
151
|
+
Create the `docs/adr/` directory lazily — only when the first ADR is needed.
|
|
152
|
+
|
|
153
|
+
## Template
|
|
154
|
+
|
|
155
|
+
```md
|
|
156
|
+
# {Short title of the decision}
|
|
157
|
+
|
|
158
|
+
{1-3 sentences: what's the context, what did we decide, and why.}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
That's it. An ADR can be a single paragraph. The value is in recording *that* a decision was made and *why* — not in filling out sections.
|
|
162
|
+
|
|
163
|
+
## Optional sections
|
|
164
|
+
|
|
165
|
+
Only include these when they add genuine value. Most ADRs won't need them.
|
|
166
|
+
|
|
167
|
+
- **Status** frontmatter (`proposed | accepted | deprecated | superseded by ADR-NNNN`) — useful when decisions are revisited
|
|
168
|
+
- **Considered Options** — only when the rejected alternatives are worth remembering
|
|
169
|
+
- **Consequences** — only when non-obvious downstream effects need to be called out
|
|
170
|
+
|
|
171
|
+
## Numbering
|
|
172
|
+
|
|
173
|
+
Scan `docs/adr/` for the highest existing number and increment by one.
|
|
174
|
+
|
|
175
|
+
## When to offer an ADR
|
|
176
|
+
|
|
177
|
+
All three of these must be true:
|
|
178
|
+
|
|
179
|
+
1. **Hard to reverse** — the cost of changing your mind later is meaningful
|
|
180
|
+
2. **Surprising without context** — a future reader will look at the code and wonder "why on earth did they do it this way?"
|
|
181
|
+
3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons
|
|
182
|
+
|
|
183
|
+
If a decision is easy to reverse, skip it — you'll just reverse it. If it's not surprising, nobody will wonder why. If there was no real alternative, there's nothing to record beyond "we did the obvious thing."
|
|
184
|
+
|
|
185
|
+
### What qualifies
|
|
186
|
+
|
|
187
|
+
- **Architectural shape.** "We're using a monorepo." "The write model is event-sourced, the read model is projected into Postgres."
|
|
188
|
+
- **Integration patterns between contexts.** "Ordering and Billing communicate via domain events, not synchronous HTTP."
|
|
189
|
+
- **Technology choices that carry lock-in.** Database, message bus, auth provider, deployment target. Not every library — just the ones that would take a quarter to swap out.
|
|
190
|
+
- **Boundary and scope decisions.** "Customer data is owned by the Customer context; other contexts reference it by ID only." The explicit no-s are as valuable as the yes-s.
|
|
191
|
+
- **Deliberate deviations from the obvious path.** "We're using manual SQL instead of an ORM because X." Anything where a reasonable reader would assume the opposite. These stop the next engineer from "fixing" something that was deliberate.
|
|
192
|
+
- **Constraints not visible in the code.** "We can't use AWS because of compliance requirements." "Response times must be under 200ms because of the partner API contract."
|
|
193
|
+
- **Rejected alternatives when the rejection is non-obvious.** If you considered GraphQL and picked REST for subtle reasons, record it — otherwise someone will suggest GraphQL again in six months.
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: opsx-implement
|
|
3
|
+
description: Implement a piece of work based on an OpenSpec change, spec, or tickets — with code review built in.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Implement the work described by the user in the spec or tickets. If from an OpenSpec change, follow the OpenSpec apply workflow below.
|
|
7
|
+
|
|
8
|
+
Run typechecking regularly, single test files regularly, and the full test suite once at the end.
|
|
9
|
+
|
|
10
|
+
Once done, review the work — see the code-review reference below.
|
|
11
|
+
|
|
12
|
+
Commit your work to the current branch. If from an OpenSpec change, mark completed tasks in `tasks.md`.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# OpenSpec Apply Workflow
|
|
17
|
+
|
|
18
|
+
Implement tasks from an OpenSpec change.
|
|
19
|
+
|
|
20
|
+
**Input**: Optionally specify a change name (e.g., `/opsx-implement add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
21
|
+
|
|
22
|
+
**Steps**
|
|
23
|
+
|
|
24
|
+
1. **Select the change**
|
|
25
|
+
|
|
26
|
+
If a name is provided, use it. Otherwise:
|
|
27
|
+
- Infer from conversation context if the user mentioned a change
|
|
28
|
+
- Auto-select if only one active change exists
|
|
29
|
+
- If ambiguous, run `openspec list --json` to get available changes and use the **question tool** to let the user select
|
|
30
|
+
|
|
31
|
+
Always announce: "Using change: <name>" and how to override (e.g., `/opsx-implement <other>`).
|
|
32
|
+
|
|
33
|
+
2. **Check status to understand the schema**
|
|
34
|
+
```bash
|
|
35
|
+
openspec status --change "<name>" --json
|
|
36
|
+
```
|
|
37
|
+
Parse the JSON to understand:
|
|
38
|
+
- `schemaName`: The workflow being used (e.g., "spec-driven")
|
|
39
|
+
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
|
|
40
|
+
|
|
41
|
+
3. **Get apply instructions**
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
openspec instructions apply --change "<name>" --json
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
This returns:
|
|
48
|
+
- `contextFiles`: artifact ID -> array of concrete file paths (varies by schema)
|
|
49
|
+
- Progress (total, complete, remaining)
|
|
50
|
+
- Task list with status
|
|
51
|
+
- Dynamic instruction based on current state
|
|
52
|
+
|
|
53
|
+
**Handle states:**
|
|
54
|
+
- If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx-continue`
|
|
55
|
+
- If `state: "all_done"`: congratulate, suggest archive
|
|
56
|
+
- Otherwise: proceed to implementation
|
|
57
|
+
|
|
58
|
+
4. **Read context files**
|
|
59
|
+
|
|
60
|
+
Read every file path listed under `contextFiles` from the apply instructions output.
|
|
61
|
+
The files depend on the schema being used:
|
|
62
|
+
- **spec-driven**: proposal, specs, design, tasks
|
|
63
|
+
- Other schemas: follow the contextFiles from CLI output
|
|
64
|
+
|
|
65
|
+
5. **Show current progress**
|
|
66
|
+
|
|
67
|
+
Display:
|
|
68
|
+
- Schema being used
|
|
69
|
+
- Progress: "N/M tasks complete"
|
|
70
|
+
- Remaining tasks overview
|
|
71
|
+
- Dynamic instruction from CLI
|
|
72
|
+
|
|
73
|
+
6. **Implement tasks (loop until done or blocked)**
|
|
74
|
+
|
|
75
|
+
For each pending task:
|
|
76
|
+
- Show which task is being worked on
|
|
77
|
+
- If the task involves testable code (functions, modules, APIs): write the failing test first (red), then implement minimum code to pass it (green). Skip for non-code tasks (docs, config).
|
|
78
|
+
- Make the code changes required
|
|
79
|
+
- Keep changes minimal and focused
|
|
80
|
+
- Mark task complete in the tasks file: `- [ ]` → `- [x]`
|
|
81
|
+
- Continue to next task
|
|
82
|
+
|
|
83
|
+
**Pause if:**
|
|
84
|
+
- Task is unclear → ask for clarification
|
|
85
|
+
- Implementation reveals a design issue → suggest updating artifacts
|
|
86
|
+
- Error or blocker encountered → report and wait for guidance
|
|
87
|
+
- User interrupts
|
|
88
|
+
|
|
89
|
+
7. **Run code review (if code was changed)**
|
|
90
|
+
|
|
91
|
+
Follow the "# Code Review" reference below in full — every step applies on every review.
|
|
92
|
+
|
|
93
|
+
Skip this step for docs-only or config-only changes.
|
|
94
|
+
|
|
95
|
+
8. **On completion or pause, show status**
|
|
96
|
+
|
|
97
|
+
Display:
|
|
98
|
+
- Tasks completed this session
|
|
99
|
+
- Overall progress: "N/M tasks complete"
|
|
100
|
+
- If all done: suggest archive
|
|
101
|
+
- If paused: explain why and wait for guidance
|
|
102
|
+
|
|
103
|
+
**Output During Implementation**
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
## Implementing: <change-name> (schema: <schema-name>)
|
|
107
|
+
|
|
108
|
+
Working on task 3/7: <task description>
|
|
109
|
+
[...implementation happening...]
|
|
110
|
+
✓ Task complete
|
|
111
|
+
|
|
112
|
+
Working on task 4/7: <task description>
|
|
113
|
+
[...implementation happening......]
|
|
114
|
+
✓ Task complete
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Output On Completion**
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
## Implementation Complete
|
|
121
|
+
|
|
122
|
+
**Change:** <change-name>
|
|
123
|
+
**Schema:** <schema-name>
|
|
124
|
+
**Progress:** 7/7 tasks complete ✓
|
|
125
|
+
**Code Review:** ✓ Complete (N findings, all addressed)
|
|
126
|
+
|
|
127
|
+
### Completed This Session
|
|
128
|
+
- [x] Task 1
|
|
129
|
+
- [x] Task 2
|
|
130
|
+
...
|
|
131
|
+
|
|
132
|
+
All tasks complete! You can archive this change with `/opsx-archive`.
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Output On Pause (Issue Encountered)**
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
## Implementation Paused
|
|
139
|
+
|
|
140
|
+
**Change:** <change-name>
|
|
141
|
+
**Schema:** <schema-name>
|
|
142
|
+
**Progress:** 4/7 tasks complete
|
|
143
|
+
|
|
144
|
+
### Issue Encountered
|
|
145
|
+
<description of the issue>
|
|
146
|
+
|
|
147
|
+
**Options:**
|
|
148
|
+
1. <option 1>
|
|
149
|
+
2. <option 2>
|
|
150
|
+
3. Other approach
|
|
151
|
+
|
|
152
|
+
What would you like to do?
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Guardrails**
|
|
156
|
+
- Keep going through tasks until done or blocked
|
|
157
|
+
- Always read context files before starting (from the apply instructions output)
|
|
158
|
+
- If task is ambiguous, pause and ask before implementing
|
|
159
|
+
- If implementation reveals issues, pause and suggest artifact updates
|
|
160
|
+
- Keep code changes minimal and scoped to each task
|
|
161
|
+
- Update task checkbox immediately after completing each task
|
|
162
|
+
- Pause on errors, blockers, or unclear requirements - don't guess
|
|
163
|
+
- Use contextFiles from CLI output, don't assume specific file names
|
|
164
|
+
|
|
165
|
+
**Fluid Workflow Integration**
|
|
166
|
+
|
|
167
|
+
This skill supports the "actions on a change" model:
|
|
168
|
+
|
|
169
|
+
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
|
|
170
|
+
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
# Code Review
|
|
175
|
+
|
|
176
|
+
Two-axis review of the diff between `HEAD` and a fixed point the user supplies:
|
|
177
|
+
|
|
178
|
+
- **Standards** — does the code conform to this repo's documented coding standards?
|
|
179
|
+
- **Spec** — does the code faithfully implement the originating issue / PRD / spec?
|
|
180
|
+
|
|
181
|
+
Both axes run as **parallel sub-agents** so they don't pollute each other's context, then this skill aggregates their findings.
|
|
182
|
+
|
|
183
|
+
## Process
|
|
184
|
+
|
|
185
|
+
### 1. Pin the fixed point
|
|
186
|
+
|
|
187
|
+
Whatever the user said is the fixed point — a commit SHA, branch name, tag, `main`, `HEAD~5`, etc. If they didn't specify one, ask for it.
|
|
188
|
+
|
|
189
|
+
Capture the diff command once: `git diff <fixed-point>...HEAD` (three-dot, so the comparison is against the merge-base). Also note the list of commits via `git log <fixed-point>..HEAD --oneline`.
|
|
190
|
+
|
|
191
|
+
Before going further, confirm the fixed point resolves (`git rev-parse <fixed-point>`) and the diff is non-empty. A bad ref or empty diff should fail here — not inside two parallel sub-agents.
|
|
192
|
+
|
|
193
|
+
### 2. Identify the spec source
|
|
194
|
+
|
|
195
|
+
Look for the originating spec, in this order:
|
|
196
|
+
|
|
197
|
+
1. An active OpenSpec change folder under `openspec/changes/` matching the branch name — spec is `proposal.md`, `specs/`, `design.md`, and `tasks.md`.
|
|
198
|
+
2. Issue references in the commit messages (`#123`, `Closes #45`, GitLab `!67`, etc.) — fetch the issue body.
|
|
199
|
+
3. A path the user passed as an argument.
|
|
200
|
+
4. A PRD/spec file under `docs/`, `specs/`, or `.scratch/` matching the branch name or feature.
|
|
201
|
+
5. If nothing is found, ask the user where the spec is. If they say there isn't one, the **Spec** sub-agent will skip and report "no spec available".
|
|
202
|
+
|
|
203
|
+
### 3. Identify the standards sources
|
|
204
|
+
|
|
205
|
+
Anything in the repo that documents how code should be written, such as `CODING_STANDARDS.md` or `CONTRIBUTING.md`.
|
|
206
|
+
|
|
207
|
+
On top of whatever the repo documents, the Standards axis always carries the **smell baseline** below — a fixed set of Fowler code smells (_Refactoring_, ch.3) that applies even when a repo documents nothing. Two rules bind it:
|
|
208
|
+
|
|
209
|
+
- **The repo overrides.** A documented repo standard always wins; where it endorses something the baseline would flag, suppress the smell.
|
|
210
|
+
- **Always a judgement call.** Each smell is a labelled heuristic ("possible Feature Envy"), never a hard violation — and, like any standard here, skip anything tooling already enforces.
|
|
211
|
+
|
|
212
|
+
Each smell reads *what it is* → *how to fix*; match it against the diff:
|
|
213
|
+
|
|
214
|
+
- **Mysterious Name** — a function, variable, or type whose name doesn't reveal what it does or holds. → rename it; if no honest name comes, the design's murky.
|
|
215
|
+
- **Duplicated Code** — the same logic shape appears in more than one hunk or file in the change. → extract the shared shape, call it from both.
|
|
216
|
+
- **Feature Envy** — a method that reaches into another object's data more than its own. → move the method onto the data it envies.
|
|
217
|
+
- **Data Clumps** — the same few fields or params keep travelling together (a type wanting to be born). → bundle them into one type, pass that.
|
|
218
|
+
- **Primitive Obsession** — a primitive or string standing in for a domain concept that deserves its own type. → give the concept its own small type.
|
|
219
|
+
- **Repeated Switches** — the same `switch`/`if`-cascade on the same type recurs across the change. → replace with polymorphism, or one map both sites share.
|
|
220
|
+
- **Shotgun Surgery** — one logical change forces scattered edits across many files in the diff. → gather what changes together into one module.
|
|
221
|
+
- **Divergent Change** — one file or module is edited for several unrelated reasons. → split so each module changes for one reason.
|
|
222
|
+
- **Speculative Generality** — abstraction, parameters, or hooks added for needs the spec doesn't have. → delete it; inline back until a real need shows.
|
|
223
|
+
- **Message Chains** — long `a.b().c().d()` navigation the caller shouldn't depend on. → hide the walk behind one method on the first object.
|
|
224
|
+
- **Middle Man** — a class or function that mostly just delegates onward. → cut it, call the real target direct.
|
|
225
|
+
- **Refused Bequest** — a subclass or implementer that ignores or overrides most of what it inherits. → drop the inheritance, use composition.
|
|
226
|
+
|
|
227
|
+
### 4. Spawn both sub-agents in parallel
|
|
228
|
+
|
|
229
|
+
Send a single message with two **Task** tool calls. Use the `general` subagent for both.
|
|
230
|
+
|
|
231
|
+
**Standards sub-agent prompt** — include:
|
|
232
|
+
|
|
233
|
+
- The full diff command and commit list.
|
|
234
|
+
- The list of standards-source files you found in step 3, **plus the smell baseline from step 3** pasted in full — the sub-agent has no other access to it.
|
|
235
|
+
- The brief: "Report — per file/hunk where relevant — (a) every place the diff violates a documented standard: cite the standard (file + the rule); and (b) any baseline smell you spot: name it and quote the hunk. Distinguish hard violations from judgement calls — documented-standard breaches can be hard, but baseline smells are always judgement calls, and a documented repo standard overrides the baseline. Skip anything tooling enforces. Under 400 words."
|
|
236
|
+
|
|
237
|
+
**Spec sub-agent prompt** — include:
|
|
238
|
+
|
|
239
|
+
- The diff command and commit list.
|
|
240
|
+
- The path or fetched contents of the spec — for an OpenSpec change, paste the contents of `proposal.md`, `specs/`, `design.md`, and `tasks.md`.
|
|
241
|
+
- The brief: "Report: (a) requirements the spec asked for that are missing or partial; (b) behaviour in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but where the implementation looks wrong. Quote the spec line for each finding. Under 400 words."
|
|
242
|
+
|
|
243
|
+
If the spec is missing, skip the Spec sub-agent and note this in the final report.
|
|
244
|
+
|
|
245
|
+
### 5. Aggregate
|
|
246
|
+
|
|
247
|
+
Present the two reports under `## Standards` and `## Spec` headings, verbatim or lightly cleaned. Do **not** merge or rerank findings — the two axes are deliberately separate (see _Why two axes_).
|
|
248
|
+
|
|
249
|
+
End with a one-line summary: total findings per axis, and the worst issue _within each axis_ (if any). Don't pick a single winner across axes — that's the reranking the separation exists to prevent.
|
|
250
|
+
|
|
251
|
+
## Why two axes
|
|
252
|
+
|
|
253
|
+
A change can pass one axis and fail the other:
|
|
254
|
+
|
|
255
|
+
- Code that follows every standard but implements the wrong thing → **Standards pass, Spec fail.**
|
|
256
|
+
- Code that does exactly what the issue asked but breaks the project's conventions → **Spec pass, Standards fail.**
|
|
257
|
+
|
|
258
|
+
Reporting them separately stops one axis from masking the other.
|