pi-openspec 1.0.0
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/LICENSE +21 -0
- package/README.md +66 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +596 -0
- package/dist/index.js.map +1 -0
- package/package.json +62 -0
- package/skills/openspec-workflow/SKILL.md +152 -0
- package/src/index.ts +778 -0
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pi-openspec",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "OpenSpec integration for pi — /openspec commands, auto-naming, and spec-driven workflow skill.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"openspec",
|
|
7
|
+
"pi",
|
|
8
|
+
"pi-package",
|
|
9
|
+
"spec-driven",
|
|
10
|
+
"workflow"
|
|
11
|
+
],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/pankajudhas81/pi-openspec.git"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"src",
|
|
19
|
+
"dist",
|
|
20
|
+
"skills"
|
|
21
|
+
],
|
|
22
|
+
"type": "module",
|
|
23
|
+
"main": "dist/index.js",
|
|
24
|
+
"module": "src/index.ts",
|
|
25
|
+
"types": "dist/index.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"import": "./dist/index.js"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@earendil-works/pi-coding-agent": "latest",
|
|
37
|
+
"@earendil-works/pi-tui": "latest",
|
|
38
|
+
"@types/node": "^25.5.0",
|
|
39
|
+
"oxfmt": "0.41.0",
|
|
40
|
+
"oxlint": "1.56.0",
|
|
41
|
+
"typescript": "^5.0.0"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
45
|
+
"@earendil-works/pi-tui": "*"
|
|
46
|
+
},
|
|
47
|
+
"pi": {
|
|
48
|
+
"extensions": [
|
|
49
|
+
"./src/index.ts"
|
|
50
|
+
],
|
|
51
|
+
"skills": [
|
|
52
|
+
"./skills"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "tsc",
|
|
57
|
+
"test": "echo \"no tests yet\"",
|
|
58
|
+
"lint": "oxlint && oxfmt --check .",
|
|
59
|
+
"lint:fix": "oxlint --fix . && oxfmt --write .",
|
|
60
|
+
"format": "oxfmt --write ."
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openspec-workflow
|
|
3
|
+
description: >-
|
|
4
|
+
Spec-driven development with OpenSpec. Use when the user wants to start a
|
|
5
|
+
new feature/change, write a proposal, create specs, design a solution,
|
|
6
|
+
break work into tasks, or follow the OpenSpec artifact pipeline. Triggers
|
|
7
|
+
on mentions of "openspec", "spec-driven", "proposal", "change proposal",
|
|
8
|
+
"write a spec", "design doc", or when working inside openspec/changes/.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# OpenSpec — Spec-Driven Development Workflow
|
|
12
|
+
|
|
13
|
+
OpenSpec enforces a disciplined pipeline for changes:
|
|
14
|
+
**proposal → specs → design → tasks**. Each artifact unlocks the next.
|
|
15
|
+
Artifacts are blocked until their dependencies are complete.
|
|
16
|
+
|
|
17
|
+
## The Pipeline
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
proposal.md WHY this change is needed
|
|
21
|
+
↓
|
|
22
|
+
specs/*.md WHAT the system must do (requirements)
|
|
23
|
+
↓
|
|
24
|
+
design.md HOW the system will do it (architecture)
|
|
25
|
+
↓
|
|
26
|
+
tasks.md WORK breakdown (implementable steps)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Directory Structure
|
|
30
|
+
|
|
31
|
+
Changes live in `openspec/changes/<name>/` where `<name>` follows the
|
|
32
|
+
format `NNNNN-YYYY-MM-DD-slug` (auto-generated by `/openspec new`):
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
openspec/
|
|
36
|
+
├── changes/
|
|
37
|
+
│ └── 00001-2026-06-04-add-auth/
|
|
38
|
+
│ ├── .openspec.yaml # schema + metadata (auto-created)
|
|
39
|
+
│ ├── proposal.md # artifact 1: why
|
|
40
|
+
│ ├── specs/ # artifact 2: what
|
|
41
|
+
│ │ ├── user-auth/
|
|
42
|
+
│ │ │ └── spec.md
|
|
43
|
+
│ │ └── session-mgmt/
|
|
44
|
+
│ │ └── spec.md
|
|
45
|
+
│ ├── design.md # artifact 3: how
|
|
46
|
+
│ └── tasks.md # artifact 4: work
|
|
47
|
+
├── specs/ # main specs (accumulated from archived changes)
|
|
48
|
+
└── config.yaml # project-level openspec config
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Commands
|
|
52
|
+
|
|
53
|
+
| Command | What it does |
|
|
54
|
+
| -------------------------------- | ------------------------------------------- |
|
|
55
|
+
| `/openspec new <name>` | Create a new change (auto-numbered + dated) |
|
|
56
|
+
| `/openspec status [id]` | Show artifact completion status |
|
|
57
|
+
| `/openspec next [id] [artifact]` | Get enriched instructions for next artifact |
|
|
58
|
+
| `/openspec validate [id]` | Validate a change or all changes |
|
|
59
|
+
| `/openspec archive <id>` | Archive a completed change into main specs |
|
|
60
|
+
| `/openspec list` | List active changes |
|
|
61
|
+
| `/openspec list --specs` | List accumulated specs |
|
|
62
|
+
| `/openspec init` | Initialize OpenSpec in a project |
|
|
63
|
+
| `/openspec schemas` | List available workflow schemas |
|
|
64
|
+
|
|
65
|
+
**Identifiers:** Use the number (`3`), full name
|
|
66
|
+
(`00003-2026-06-04-add-auth`), or slug (`add-auth`).
|
|
67
|
+
|
|
68
|
+
## Workflow — Step by Step
|
|
69
|
+
|
|
70
|
+
### 1. Start a change
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
/openspec new add-auth
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Creates `openspec/changes/00001-2026-06-04-add-auth/` with
|
|
77
|
+
`.openspec.yaml`. The first artifact (proposal) is now **ready**.
|
|
78
|
+
|
|
79
|
+
### 2. Write each artifact
|
|
80
|
+
|
|
81
|
+
Always use `/openspec next` to get enriched instructions before writing
|
|
82
|
+
an artifact. The instructions include the template, output path,
|
|
83
|
+
description, and what the artifact unlocks:
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
/openspec next 1 proposal
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Then write the artifact file at the path indicated. When done, the
|
|
90
|
+
extension auto-detects the edit and shows updated status.
|
|
91
|
+
|
|
92
|
+
### 3. Follow the dependency chain
|
|
93
|
+
|
|
94
|
+
- **proposal** → unlocks **specs** and **design**
|
|
95
|
+
- **specs** → unlocks **design** (if not already unlocked)
|
|
96
|
+
- **design** + **specs** → unlocks **tasks**
|
|
97
|
+
|
|
98
|
+
Check status anytime with `/openspec status`.
|
|
99
|
+
|
|
100
|
+
### 4. Validate and archive
|
|
101
|
+
|
|
102
|
+
When all artifacts are complete:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
/openspec validate 1 # check the change is valid
|
|
106
|
+
/openspec archive 1 # archive + merge into main specs
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Rules for the Agent
|
|
110
|
+
|
|
111
|
+
1. **Always get instructions first.** Before writing any artifact, run
|
|
112
|
+
`/openspec next` to get the enriched template and instructions from
|
|
113
|
+
the OpenSpec CLI. Do not guess the format.
|
|
114
|
+
|
|
115
|
+
2. **Write artifacts in order.** Do not skip ahead. If `design` is
|
|
116
|
+
blocked, write `proposal` or `specs` first.
|
|
117
|
+
|
|
118
|
+
3. **One artifact at a time.** Write, save, then check status before
|
|
119
|
+
moving to the next artifact.
|
|
120
|
+
|
|
121
|
+
4. **Validate before archiving.** Always run `/openspec validate`
|
|
122
|
+
before `/openspec archive`.
|
|
123
|
+
|
|
124
|
+
5. **Use the change number as shorthand.** `/openspec status 1` is
|
|
125
|
+
cleaner than typing the full directory name.
|
|
126
|
+
|
|
127
|
+
6. **Proposal is about WHY, not HOW.** Keep implementation details out
|
|
128
|
+
of the proposal — they belong in design.md.
|
|
129
|
+
|
|
130
|
+
7. **Specs are requirements, not implementation.** Use GIVEN/WHEN/THEN
|
|
131
|
+
scenarios. Specs say what the system SHALL do, not how it does it.
|
|
132
|
+
|
|
133
|
+
8. **Design references specs.** The design document should trace back
|
|
134
|
+
to specific requirements from the specs.
|
|
135
|
+
|
|
136
|
+
9. **Tasks must be implementable.** Each task should be a concrete,
|
|
137
|
+
completable unit of work. Include file paths and specific changes
|
|
138
|
+
where possible.
|
|
139
|
+
|
|
140
|
+
## Artifact Status Icons
|
|
141
|
+
|
|
142
|
+
| Icon | Meaning |
|
|
143
|
+
| ---- | ---------------------------------------- |
|
|
144
|
+
| ✅ ● | Done — artifact file exists |
|
|
145
|
+
| 🔵 ○ | Ready — dependencies met, can be written |
|
|
146
|
+
| ⏳ ◌ | Blocked — waiting on dependencies |
|
|
147
|
+
|
|
148
|
+
## Integration with pi-openspec-status
|
|
149
|
+
|
|
150
|
+
If `pi-openspec-status` is installed, a persistent TUI widget shows
|
|
151
|
+
the active change status above the editor. Press `Ctrl+Alt+O` for
|
|
152
|
+
a detailed overlay. The widget auto-refreshes after each agent turn.
|