@clawplays/ospec-cli 0.1.1 → 0.3.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/README.ja.md +290 -0
- package/README.md +211 -469
- package/README.zh-CN.md +211 -469
- package/dist/cli.js +104 -8
- package/dist/commands/DocsCommand.js +3 -2
- package/dist/commands/InitCommand.js +69 -11
- package/dist/commands/SkillCommand.js +41 -19
- package/dist/commands/StatusCommand.js +27 -8
- package/dist/commands/UpdateCommand.js +19 -5
- package/dist/services/ProjectService.js +173 -359
- package/dist/services/templates/ProjectTemplateBuilder.js +4 -10
- package/dist/services/templates/TemplateInputFactory.js +14 -7
- package/dist/utils/subcommandHelp.js +5 -5
- package/package.json +9 -2
- package/scripts/postinstall.js +13 -7
package/README.md
CHANGED
|
@@ -1,549 +1,291 @@
|
|
|
1
|
-
|
|
1
|
+
<h1><a href="https://ospec.ai/" target="_blank" rel="noopener noreferrer">OSpec</a></h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://www.npmjs.com/package/@clawplays/ospec-cli"><img src="https://img.shields.io/npm/v/%40clawplays%2Fospec-cli?style=for-the-badge&logo=npm&label=npm" alt="npm"></a>
|
|
5
|
+
<a href="https://www.npmjs.com/package/@clawplays/ospec-cli"><img src="https://img.shields.io/npm/dm/%40clawplays%2Fospec-cli?style=for-the-badge&logo=npm&label=downloads&cacheSeconds=300" alt="npm downloads"></a>
|
|
6
|
+
<a href="https://github.com/clawplays/ospec/stargazers"><img src="https://img.shields.io/github/stars/clawplays/ospec?style=for-the-badge&logo=github" alt="GitHub stars"></a>
|
|
7
|
+
<a href="LICENSE"><img src="https://img.shields.io/github/license/clawplays/ospec?style=for-the-badge&color=green" alt="License"></a>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<img src="https://img.shields.io/badge/Node.js-18%2B-339933?style=flat-square&logo=node.js&logoColor=white" alt="Node.js 18+">
|
|
12
|
+
<img src="https://img.shields.io/badge/npm-8%2B-CB3837?style=flat-square&logo=npm&logoColor=white" alt="npm 8+">
|
|
13
|
+
<img src="https://img.shields.io/badge/language-TypeScript-3178C6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript">
|
|
14
|
+
<img src="https://img.shields.io/badge/workflow-3_steps-0F766E?style=flat-square" alt="3-step workflow">
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<p align="center">
|
|
18
|
+
<strong>English</strong> |
|
|
19
|
+
<a href="README.zh-CN.md">中文</a> |
|
|
20
|
+
<a href="README.ja.md">日本語</a>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
OSpec is a document-driven workflow for AI-assisted development, helping you define requirements and changes in docs first, then drive implementation, validation, and archive through AI collaboration.
|
|
24
|
+
|
|
25
|
+
<p align="center">
|
|
26
|
+
<a href="docs/README.md">Docs</a> |
|
|
27
|
+
<a href="docs/prompt-guide.md">Prompt Guide</a> |
|
|
28
|
+
<a href="docs/usage.md">Usage</a> |
|
|
29
|
+
<a href="docs/project-overview.md">Overview</a> |
|
|
30
|
+
<a href="docs/installation.md">Installation</a> |
|
|
31
|
+
<a href="https://github.com/clawplays/ospec/issues">Issues</a>
|
|
32
|
+
</p>
|
|
33
|
+
|
|
34
|
+
## Install With npm
|
|
2
35
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
It is not a scaffold that starts by generating a pile of business templates. It is a collaboration framework built around a protocol-shell-first approach: establish the minimum collaboration protocol first, explicitly fill in the project knowledge layer second, and then manage execution, verification, and closure through the change workflow.
|
|
8
|
-
|
|
9
|
-
Current version:
|
|
10
|
-
|
|
11
|
-
- CLI: `0.1.1`
|
|
12
|
-
|
|
13
|
-
Documentation:
|
|
14
|
-
|
|
15
|
-
- [Project Overview](docs/project-overview.zh-CN.md)
|
|
16
|
-
- [Installation](docs/installation.zh-CN.md)
|
|
17
|
-
- [Usage](docs/usage.zh-CN.md)
|
|
18
|
-
- [Prompt Guide](docs/prompt-guide.zh-CN.md)
|
|
19
|
-
- [Skills Installation](docs/skills-installation.zh-CN.md)
|
|
20
|
-
- [GitLab Custom Fork Sync](docs/custom-fork-sync.zh-CN.md)
|
|
21
|
-
- [Stitch Plugin Spec](docs/stitch-plugin-spec.zh-CN.md)
|
|
22
|
-
- [Checkpoint Plugin Spec](docs/checkpoint-plugin-spec.zh-CN.md)
|
|
23
|
-
|
|
24
|
-
## What OSpec Is
|
|
25
|
-
|
|
26
|
-
The core goal of OSpec is not to generate a fixed project structure for a team in one shot. Its job is to lock in the basic rules of AI collaboration first.
|
|
27
|
-
|
|
28
|
-
What it does can be summarized in three layers:
|
|
29
|
-
|
|
30
|
-
- Initialize the minimum protocol shell so the project enters a unified collaboration state
|
|
31
|
-
- Fill in the project knowledge layer so AI has stable context to read
|
|
32
|
-
- Use the active change workflow to manage execution, verification, and closure for each request
|
|
33
|
-
|
|
34
|
-
In simpler terms, OSpec is not mainly about deciding which business page to build first. It is about defining the rules by which your team and your AI should collaborate.
|
|
35
|
-
|
|
36
|
-
## Problems It Tries to Solve
|
|
37
|
-
|
|
38
|
-
Once AI joins software delivery, common problems usually look like this:
|
|
39
|
-
|
|
40
|
-
- AI can write code, but does not know the execution rules of the project
|
|
41
|
-
- After a request is completed, the intermediate process is hard to see and hard to trace back
|
|
42
|
-
- Documentation, skill files, and implementation status drift out of sync
|
|
43
|
-
- Different AI clients use inconsistent collaboration protocols
|
|
44
|
-
- Some requests require design approval or extra gates, but there is no unified entry point
|
|
45
|
-
|
|
46
|
-
OSpec does not respond to this by shipping a heavy business scaffold. It establishes the protocol and gates first, so the project becomes inspectable, traceable, and archivable.
|
|
47
|
-
|
|
48
|
-
## Three Core Concepts
|
|
49
|
-
|
|
50
|
-
### 1. Protocol Shell
|
|
51
|
-
|
|
52
|
-
The protocol shell is the minimum collaborative skeleton of the project. Its main purpose is to bring the project into a unified collaboration state first.
|
|
53
|
-
|
|
54
|
-
After initialization, key files and directories usually include:
|
|
55
|
-
|
|
56
|
-
- `.skillrc`
|
|
57
|
-
- `.ospec/`
|
|
58
|
-
- `changes/active/`
|
|
59
|
-
- `changes/archived/`
|
|
60
|
-
- `SKILL.md`
|
|
61
|
-
- `SKILL.index.json`
|
|
62
|
-
- A set of AI collaboration rule documents under `for-ai/`
|
|
63
|
-
|
|
64
|
-
You can think of it as the collaboration foundation of the project.
|
|
65
|
-
|
|
66
|
-
### 2. Project Knowledge Layer
|
|
67
|
-
|
|
68
|
-
After the protocol shell is in place, the project still needs long-lived and stable knowledge context. OSpec uses `docs/project/` and layered `SKILL.md` files to carry that context.
|
|
69
|
-
|
|
70
|
-
Project docs generated by default include:
|
|
71
|
-
|
|
72
|
-
- `docs/project/overview.md`
|
|
73
|
-
- `docs/project/tech-stack.md`
|
|
74
|
-
- `docs/project/architecture.md`
|
|
75
|
-
- `docs/project/module-map.md`
|
|
76
|
-
- `docs/project/api-overview.md`
|
|
77
|
-
|
|
78
|
-
The goal of this step is to make sure AI is not writing blindly later. It should always have stable context to reference.
|
|
79
|
-
|
|
80
|
-
### 3. Active Change
|
|
81
|
-
|
|
82
|
-
OSpec does not leave a request scattered across chat history. It creates an independent execution container for every request.
|
|
83
|
-
|
|
84
|
-
The most important files inside each active change are:
|
|
85
|
-
|
|
86
|
-
- `proposal.md`
|
|
87
|
-
- `tasks.md`
|
|
88
|
-
- `state.json`
|
|
89
|
-
- `verification.md`
|
|
90
|
-
- `review.md`
|
|
91
|
-
|
|
92
|
-
The real source of truth for execution state is:
|
|
93
|
-
|
|
94
|
-
- `state.json`
|
|
36
|
+
```bash
|
|
37
|
+
npm install -g @clawplays/ospec-cli
|
|
38
|
+
```
|
|
95
39
|
|
|
96
|
-
|
|
40
|
+
## Recommended Prompts
|
|
97
41
|
|
|
98
|
-
|
|
42
|
+
Most teams only need 3 steps to use OSpec:
|
|
99
43
|
|
|
100
|
-
|
|
44
|
+
1. initialize OSpec in your project directory
|
|
45
|
+
2. create and advance one change for a requirement, document update, or bug fix
|
|
46
|
+
3. archive the accepted change after deployment and validation are complete
|
|
101
47
|
|
|
102
|
-
1. Initialize
|
|
103
|
-
2. Fill in the project knowledge layer
|
|
104
|
-
3. Execute the active change
|
|
105
|
-
4. Close it out through `verify / archive / finalize`
|
|
48
|
+
### 1. Initialize OSpec In Your Project Directory
|
|
106
49
|
|
|
107
|
-
|
|
50
|
+
Recommended prompt:
|
|
108
51
|
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
ospec init [path]
|
|
112
|
-
ospec docs generate [path]
|
|
113
|
-
ospec new <change-name> [path]
|
|
114
|
-
ospec progress [changes/active/<change>]
|
|
115
|
-
ospec verify [changes/active/<change>]
|
|
116
|
-
ospec archive [changes/active/<change>]
|
|
117
|
-
ospec finalize [changes/active/<change>]
|
|
52
|
+
```text
|
|
53
|
+
Use OSpec to initialize this project.
|
|
118
54
|
```
|
|
119
55
|
|
|
120
|
-
|
|
56
|
+
Claude / Codex skill mode:
|
|
121
57
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
ospec status .
|
|
58
|
+
```text
|
|
59
|
+
Use $ospec to initialize this project.
|
|
126
60
|
```
|
|
127
61
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
- Whether the project has already been initialized
|
|
131
|
-
- Which protocol files are missing
|
|
132
|
-
- How complete the project documentation is
|
|
133
|
-
- Whether skills are complete
|
|
134
|
-
- Whether active changes currently exist
|
|
135
|
-
- What the most recommended next step is
|
|
136
|
-
|
|
137
|
-
### 2. Initialize the Protocol Shell
|
|
62
|
+
<details>
|
|
63
|
+
<summary>Command line</summary>
|
|
138
64
|
|
|
139
65
|
```bash
|
|
140
66
|
ospec init .
|
|
67
|
+
ospec init . --summary "Internal admin portal for operations"
|
|
68
|
+
ospec init . --summary "Internal admin portal for operations" --tech-stack node,react,postgres
|
|
69
|
+
ospec init . --architecture "Single web app with API and shared auth" --document-language en-US
|
|
141
70
|
```
|
|
142
71
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
- Create the OSpec protocol shell
|
|
146
|
-
- Do not generate a web template or business scaffold by default
|
|
147
|
-
- Do not automatically create the first change
|
|
72
|
+
CLI notes:
|
|
148
73
|
|
|
149
|
-
|
|
74
|
+
- `--summary`: project overview text written into the generated docs
|
|
75
|
+
- `--tech-stack`: comma-separated stack list such as `node,react,postgres`
|
|
76
|
+
- `--architecture`: short architecture description
|
|
77
|
+
- `--document-language`: generated doc language, usually `en-US` or `zh-CN`
|
|
78
|
+
- if you pass these values, OSpec uses them directly when generating project docs
|
|
79
|
+
- if you do not pass them, OSpec reuses existing docs when possible and otherwise creates placeholder docs first
|
|
150
80
|
|
|
151
|
-
|
|
81
|
+
</details>
|
|
152
82
|
|
|
153
|
-
|
|
154
|
-
ospec docs generate .
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
This step generates the project knowledge layer docs, layered skill entry points, indexes, and other foundational assets.
|
|
83
|
+
### 2. Create And Advance A Change
|
|
158
84
|
|
|
159
|
-
|
|
85
|
+
Use this for requirement delivery, documentation updates, refactors, and bug fixes.
|
|
160
86
|
|
|
161
|
-
|
|
162
|
-
- It does not automatically apply a business scaffold
|
|
163
|
-
- It does not automatically start a request
|
|
87
|
+
Recommended prompt:
|
|
164
88
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
```bash
|
|
168
|
-
ospec new landing-refresh .
|
|
89
|
+
```text
|
|
90
|
+
Use OSpec to create and advance a change for this requirement.
|
|
169
91
|
```
|
|
170
92
|
|
|
171
|
-
|
|
93
|
+
Claude / Codex skill mode:
|
|
172
94
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
- `tasks.md`: task list
|
|
177
|
-
- `state.json`: execution status
|
|
178
|
-
- `verification.md`: verification items
|
|
179
|
-
- `review.md`: review perspective
|
|
95
|
+
```text
|
|
96
|
+
Use $ospec-change to create and advance a change for this requirement.
|
|
97
|
+
```
|
|
180
98
|
|
|
181
|
-
|
|
99
|
+

|
|
182
100
|
|
|
183
|
-
|
|
101
|
+
<details>
|
|
102
|
+
<summary>Command line</summary>
|
|
184
103
|
|
|
185
104
|
```bash
|
|
186
|
-
ospec
|
|
187
|
-
ospec
|
|
188
|
-
ospec
|
|
105
|
+
ospec new docs-homepage-refresh .
|
|
106
|
+
ospec new fix-login-timeout .
|
|
107
|
+
ospec new update-billing-copy .
|
|
189
108
|
```
|
|
190
109
|
|
|
191
|
-
|
|
110
|
+
</details>
|
|
192
111
|
|
|
193
|
-
|
|
194
|
-
- `verify`: whether the protocol files and verification items of the change are complete
|
|
195
|
-
- `changes status`: the PASS / WARN / FAIL summary for all active changes in the project
|
|
112
|
+
### 3. Archive After Acceptance
|
|
196
113
|
|
|
197
|
-
|
|
114
|
+
After the requirement has passed deployment, testing, QA, or other acceptance checks, archive the validated change.
|
|
198
115
|
|
|
199
|
-
Recommended
|
|
116
|
+
Recommended prompt:
|
|
200
117
|
|
|
201
|
-
```
|
|
202
|
-
|
|
118
|
+
```text
|
|
119
|
+
Use OSpec to archive this accepted change.
|
|
203
120
|
```
|
|
204
121
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
- verify
|
|
208
|
-
- rebuild indexes
|
|
209
|
-
- archive
|
|
210
|
-
|
|
211
|
-
At the end, the change is moved from `changes/active/` to `changes/archived/`, and the repository is left in a state where you can make a manual Git commit.
|
|
122
|
+
Claude / Codex skill mode:
|
|
212
123
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
- `ospec new` still creates one normal active change
|
|
218
|
-
- nothing enters queue mode implicitly
|
|
219
|
-
- queue behavior starts only when you explicitly use `ospec queue ...` or `ospec run ...`
|
|
124
|
+
```text
|
|
125
|
+
Use $ospec to archive this accepted change.
|
|
126
|
+
```
|
|
220
127
|
|
|
221
|
-
|
|
128
|
+
<details>
|
|
129
|
+
<summary>Command line</summary>
|
|
222
130
|
|
|
223
131
|
```bash
|
|
224
|
-
ospec
|
|
225
|
-
ospec
|
|
226
|
-
ospec queue status .
|
|
227
|
-
ospec queue next .
|
|
228
|
-
ospec run start . --profile manual-safe
|
|
229
|
-
ospec run step .
|
|
132
|
+
ospec verify changes/active/<change-name>
|
|
133
|
+
ospec finalize changes/active/<change-name>
|
|
230
134
|
```
|
|
231
135
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
-
|
|
235
|
-
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
- `init`
|
|
282
|
-
- `docs status`
|
|
283
|
-
- `docs generate`
|
|
284
|
-
|
|
285
|
-
This group mainly answers whether the project has entered protocol-based collaboration.
|
|
286
|
-
|
|
287
|
-
### 2. Request Execution Workflow
|
|
288
|
-
|
|
289
|
-
- `new`
|
|
290
|
-
- `progress`
|
|
291
|
-
- `verify`
|
|
292
|
-
- `archive`
|
|
293
|
-
- `finalize`
|
|
294
|
-
- `changes status`
|
|
295
|
-
|
|
296
|
-
This group mainly answers how a request moves from creation to closure.
|
|
297
|
-
|
|
298
|
-
### 3. Skills and Index Management
|
|
299
|
-
|
|
300
|
-
- `skills status`
|
|
301
|
-
- `skill status`
|
|
302
|
-
- `skill install`
|
|
303
|
-
- `index check`
|
|
304
|
-
- `index build`
|
|
305
|
-
|
|
306
|
-
This group mainly answers where AI should read the rules from, and whether those rules are synchronized.
|
|
307
|
-
|
|
308
|
-
### 4. Plugin-Based Workflow
|
|
309
|
-
|
|
310
|
-
- `plugins status`
|
|
311
|
-
- `plugins enable stitch`
|
|
312
|
-
- `plugins run stitch`
|
|
313
|
-
- `plugins approve stitch`
|
|
314
|
-
- `plugins reject stitch`
|
|
315
|
-
- `plugins doctor stitch`
|
|
316
|
-
|
|
317
|
-
This group mainly answers how to handle requests that need extra blocking steps beyond code.
|
|
318
|
-
|
|
319
|
-
The first plugin today is `stitch`, mainly for page design review.
|
|
320
|
-
|
|
321
|
-
### 5. Protocol Update and Distribution
|
|
322
|
-
|
|
323
|
-
- `update`
|
|
324
|
-
- `skill install`
|
|
325
|
-
- `skill install-claude`
|
|
326
|
-
|
|
327
|
-
This allows OSpec not only to manage a single project, but also to distribute the same collaboration protocol to different AI clients.
|
|
328
|
-
|
|
329
|
-
The boundary of `ospec update [path]` is:
|
|
330
|
-
|
|
331
|
-
- It refreshes protocol docs, project tooling, Git hooks, managed skills, and managed workdir assets for enabled plugins
|
|
332
|
-
- It does not automatically `enable/disable` plugins
|
|
333
|
-
- It does not automatically migrate existing active changes to a new plugin workflow
|
|
334
|
-
- If you want to enable Stitch, you still need to run `ospec plugins enable stitch [path]` explicitly
|
|
335
|
-
|
|
336
|
-
## One Easily Confused Detail
|
|
337
|
-
|
|
338
|
-
In the current version, two concepts need to be understood separately:
|
|
339
|
-
|
|
340
|
-
- structure level
|
|
341
|
-
- workflow mode
|
|
342
|
-
|
|
343
|
-
### Structure Level
|
|
344
|
-
|
|
345
|
-
Structure is currently determined only as:
|
|
346
|
-
|
|
347
|
-
- `none`
|
|
348
|
-
|
|
349
|
-
It no longer uses `basic` / `full` to describe repository structure level.
|
|
350
|
-
|
|
351
|
-
### Workflow Mode
|
|
352
|
-
|
|
353
|
-
The default workflow mode in `.skillrc` created by initialization is still:
|
|
354
|
-
|
|
355
|
-
- `full`
|
|
356
|
-
|
|
357
|
-
It affects:
|
|
358
|
-
|
|
359
|
-
- Which feature flags are supported
|
|
360
|
-
- Which optional steps are activated
|
|
361
|
-
- What the archive gate needs to check
|
|
362
|
-
|
|
363
|
-
So the correct way to read it is:
|
|
364
|
-
|
|
365
|
-
- Structure level indicates whether the project has completed protocol-based initialization
|
|
366
|
-
- Workflow mode indicates how strict the request execution process is
|
|
367
|
-
|
|
368
|
-
## Stitch Plugin
|
|
369
|
-
|
|
370
|
-
Stitch demonstrates OSpec's plugin-based extensibility.
|
|
371
|
-
|
|
372
|
-
The idea is not to hardcode design review into the main flow. Instead:
|
|
373
|
-
|
|
374
|
-
- The project enables a plugin to gain a capability
|
|
375
|
-
- The plugin contributes an optional step
|
|
376
|
-
- A change activates that step only if its flags hit the condition
|
|
377
|
-
- `verify / archive / finalize` are blocked or allowed based on approval artifacts
|
|
378
|
-
|
|
379
|
-
For example, after a project enables Stitch, if a new change includes these flags:
|
|
380
|
-
|
|
381
|
-
- `ui_change`
|
|
382
|
-
- `page_design`
|
|
383
|
-
- `landing_page`
|
|
384
|
-
|
|
385
|
-
The system activates:
|
|
386
|
-
|
|
387
|
-
- `stitch_design_review`
|
|
388
|
-
|
|
389
|
-
And generates:
|
|
390
|
-
|
|
391
|
-
- `artifacts/stitch/approval.json`
|
|
392
|
-
|
|
393
|
-
If that approval file is not approved, the change cannot claim completion and cannot be archived.
|
|
394
|
-
|
|
395
|
-
In page design review scenarios, this gate also requires:
|
|
396
|
-
|
|
397
|
-
- The same route may only have one canonical layout
|
|
398
|
-
- `light/dark` must be theme variants of one layout, not two different compositions
|
|
399
|
-
- Delivery must include screen mapping
|
|
400
|
-
- Old drafts and exploration drafts must be archived, not listed beside the canonical page
|
|
401
|
-
|
|
402
|
-
This shows that OSpec plugins do not act as simple reminders. They actually participate in workflow gates.
|
|
403
|
-
|
|
404
|
-
## Design Principles
|
|
405
|
-
|
|
406
|
-
### 1. Protocol-Shell-First
|
|
407
|
-
|
|
408
|
-
Build the protocol shell first, then discuss business specifics.
|
|
409
|
-
|
|
410
|
-
Benefits:
|
|
411
|
-
|
|
412
|
-
- Initialization stays lightweight
|
|
413
|
-
- Project type is less likely to be guessed wrong
|
|
414
|
-
- A repository that is still undefined is not forced into a rigid template
|
|
415
|
-
|
|
416
|
-
### 2. Explicit Over Implicit
|
|
417
|
-
|
|
418
|
-
OSpec rarely does things by guessing what you probably want.
|
|
419
|
-
|
|
420
|
-
For example:
|
|
421
|
-
|
|
422
|
-
- `init` does not automatically generate docs
|
|
423
|
-
- `docs generate` does not automatically create a change
|
|
424
|
-
- `new` does not automatically advance implementation
|
|
425
|
-
|
|
426
|
-
Each step tries to stay clear, controllable, and explainable.
|
|
427
|
-
|
|
428
|
-
### 3. Documentation Is Part of Execution
|
|
429
|
-
|
|
430
|
-
In OSpec:
|
|
431
|
-
|
|
432
|
-
- proposal is not an auxiliary report
|
|
433
|
-
- tasks are not a temporary memo
|
|
434
|
-
- verification is not a final add-on note
|
|
435
|
-
|
|
436
|
-
These documents are part of the workflow itself and directly affect whether later `verify` and `archive` can pass.
|
|
437
|
-
|
|
438
|
-
### 4. `state.json` Is the Source of Truth
|
|
439
|
-
|
|
440
|
-
The project explicitly requires:
|
|
441
|
-
|
|
442
|
-
- Use `state.json` as the basis of current execution state
|
|
443
|
-
- `verification.md` cannot replace `state.json`
|
|
444
|
-
|
|
445
|
-
This prevents workflow drift caused by inconsistent descriptions.
|
|
446
|
-
|
|
447
|
-
### 5. Gate First, Archive Second
|
|
136
|
+
Archive notes:
|
|
137
|
+
|
|
138
|
+
- run your project-specific deploy, test, and QA flow first
|
|
139
|
+
- use `ospec verify` to confirm the active change is ready
|
|
140
|
+
- use `ospec finalize` to rebuild indexes and archive the accepted change
|
|
141
|
+
|
|
142
|
+
</details>
|
|
143
|
+
|
|
144
|
+
## How The OSpec Workflow Works
|
|
145
|
+
|
|
146
|
+
```text
|
|
147
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
148
|
+
│ 1. USER REQUEST │
|
|
149
|
+
│ "Use OSpec to create and advance a change for this task." │
|
|
150
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
151
|
+
│
|
|
152
|
+
▼
|
|
153
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
154
|
+
│ 2. INIT TO CHANGE-READY │
|
|
155
|
+
│ ospec init │
|
|
156
|
+
│ - .skillrc │
|
|
157
|
+
│ - .ospec/ │
|
|
158
|
+
│ - changes/active + changes/archived │
|
|
159
|
+
│ - root SKILL files and for-ai guidance │
|
|
160
|
+
│ - docs/project/* baseline knowledge docs │
|
|
161
|
+
│ - reuse docs or fall back to placeholders │
|
|
162
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
163
|
+
│
|
|
164
|
+
▼
|
|
165
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
166
|
+
│ 3. EXECUTION │
|
|
167
|
+
│ ospec new <change-name> │
|
|
168
|
+
│ ospec progress │
|
|
169
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
170
|
+
│
|
|
171
|
+
▼
|
|
172
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
173
|
+
│ 4. DEPLOY + VALIDATE │
|
|
174
|
+
│ project deploy / test / QA │
|
|
175
|
+
│ ospec verify │
|
|
176
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
177
|
+
│
|
|
178
|
+
▼
|
|
179
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
180
|
+
│ 5. ARCHIVE │
|
|
181
|
+
│ ospec finalize │
|
|
182
|
+
│ rebuild index + archive │
|
|
183
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
184
|
+
```
|
|
448
185
|
|
|
449
|
-
|
|
186
|
+
## Core Concepts
|
|
450
187
|
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
188
|
+
| Concept | What It Means |
|
|
189
|
+
|---------|---------------|
|
|
190
|
+
| **Protocol Shell** | The minimum collaboration skeleton: `.skillrc`, `.ospec/`, `changes/`, root `SKILL.md`, `SKILL.index.json`, and `for-ai/` guidance. |
|
|
191
|
+
| **Project Knowledge Layer** | Explicit project context such as `docs/project/*`, layered skill files, and index state that AI can read consistently. |
|
|
192
|
+
| **Active Change** | A dedicated execution container for one requirement, usually with `proposal.md`, `tasks.md`, `state.json`, `verification.md`, and `review.md`. |
|
|
454
193
|
|
|
455
|
-
|
|
194
|
+
## Features
|
|
456
195
|
|
|
457
|
-
|
|
196
|
+
- **Change-ready initialization**: `ospec init` creates the protocol shell and baseline project knowledge docs in one pass.
|
|
197
|
+
- **Guided initialization**: AI-assisted init can ask once for missing summary or tech stack; direct CLI init falls back to placeholder docs when context is missing.
|
|
198
|
+
- **Docs maintenance**: `ospec docs generate` refreshes or repairs project knowledge docs when you need it later.
|
|
199
|
+
- **Tracked requirement execution**: each change can keep proposal, tasks, state, verification, and review files aligned.
|
|
200
|
+
- **Queue helpers**: `queue` and `run` support explicit multi-change execution when one active change is not enough.
|
|
201
|
+
- **Plugin workflow gates**: built-in plugin commands support Stitch design review and Checkpoint automation.
|
|
202
|
+
- **Skill management**: install and inspect OSpec skills for Codex and Claude Code.
|
|
203
|
+
- **Standard closeout**: `finalize` verifies, rebuilds indexes, and archives the change before manual Git commit.
|
|
458
204
|
|
|
459
|
-
|
|
205
|
+
## Plugin Features
|
|
460
206
|
|
|
461
|
-
|
|
207
|
+
OSpec includes two optional plugins that extend the document-driven workflow with UI review and flow validation.
|
|
462
208
|
|
|
463
|
-
|
|
464
|
-
- security checks
|
|
465
|
-
- other approval capabilities
|
|
209
|
+
### Stitch
|
|
466
210
|
|
|
467
|
-
|
|
211
|
+
Use Stitch for page design review and preview collaboration, especially for landing pages, marketing pages, and UI-heavy changes.
|
|
468
212
|
|
|
469
|
-
|
|
213
|
+
AI conversation:
|
|
470
214
|
|
|
471
|
-
|
|
215
|
+
```text
|
|
216
|
+
Use OSpec to enable the Stitch plugin.
|
|
217
|
+
```
|
|
472
218
|
|
|
473
|
-
|
|
474
|
-
- Claude Code
|
|
219
|
+
Claude / Codex skill mode:
|
|
475
220
|
|
|
476
|
-
|
|
221
|
+
```text
|
|
222
|
+
Use $ospec to enable the Stitch plugin.
|
|
223
|
+
```
|
|
477
224
|
|
|
478
|
-
|
|
225
|
+
<details>
|
|
226
|
+
<summary>Command line</summary>
|
|
479
227
|
|
|
480
|
-
|
|
228
|
+
```bash
|
|
229
|
+
ospec plugins enable stitch .
|
|
230
|
+
```
|
|
481
231
|
|
|
482
|
-
|
|
232
|
+
</details>
|
|
483
233
|
|
|
484
|
-
|
|
234
|
+
### Checkpoint
|
|
485
235
|
|
|
486
|
-
|
|
487
|
-
- `assets/`: protocol docs, convention templates, global skills, and Git hooks
|
|
488
|
-
- `docs/`: external documentation and design specification documents
|
|
489
|
-
- `scripts/`: installation, release, and fork sync scripts
|
|
490
|
-
- `skill.yaml`, `SKILL.md`, `agents/`: skill packaging and distribution entry points
|
|
236
|
+
Use Checkpoint for app flow validation and automated checks, especially for submission flows, critical paths, and pre-acceptance runtime verification.
|
|
491
237
|
|
|
492
|
-
|
|
238
|
+
AI conversation:
|
|
493
239
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
240
|
+
```text
|
|
241
|
+
Use OSpec to enable the Checkpoint plugin.
|
|
242
|
+
```
|
|
497
243
|
|
|
498
|
-
|
|
244
|
+
Claude / Codex skill mode:
|
|
499
245
|
|
|
500
|
-
|
|
501
|
-
|
|
246
|
+
```text
|
|
247
|
+
Use $ospec to enable the Checkpoint plugin.
|
|
248
|
+
```
|
|
502
249
|
|
|
503
|
-
|
|
250
|
+
<details>
|
|
251
|
+
<summary>Command line</summary>
|
|
504
252
|
|
|
505
|
-
|
|
506
|
-
|
|
253
|
+
```bash
|
|
254
|
+
ospec plugins enable checkpoint . --base-url http://127.0.0.1:3000
|
|
255
|
+
```
|
|
507
256
|
|
|
508
|
-
|
|
257
|
+
Notes:
|
|
509
258
|
|
|
510
|
-
|
|
259
|
+
- `--base-url` points to the running app used by automated checks
|
|
511
260
|
|
|
512
|
-
|
|
513
|
-
- `ospec docs generate` fills in the knowledge layer and layered skill entries, but does not apply a business scaffold
|
|
514
|
-
- When the Stitch plugin is not enabled, flags such as `ui_change` and `page_design` are recorded in `proposal.md`, but reported as unsupported flags
|
|
515
|
-
- After the Stitch plugin is enabled, the same flags activate `stitch_design_review` for real and automatically generate `artifacts/stitch/approval.json`
|
|
261
|
+
</details>
|
|
516
262
|
|
|
517
|
-
|
|
263
|
+
## Documentation
|
|
518
264
|
|
|
519
|
-
|
|
520
|
-
- explicit extension
|
|
521
|
-
- inspectable workflow
|
|
522
|
-
- plugins can block progression
|
|
523
|
-
- queue mode only starts when explicitly requested
|
|
265
|
+
### Core Docs
|
|
524
266
|
|
|
525
|
-
|
|
267
|
+
- [Docs Index](docs/README.md)
|
|
268
|
+
- [Prompt Guide](docs/prompt-guide.md)
|
|
269
|
+
- [Usage](docs/usage.md)
|
|
270
|
+
- [Project Overview](docs/project-overview.md)
|
|
271
|
+
- [Installation](docs/installation.md)
|
|
272
|
+
- [Skills Installation](docs/skills-installation.md)
|
|
526
273
|
|
|
527
|
-
|
|
274
|
+
### Plugin Specs
|
|
528
275
|
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
ospec init demo
|
|
532
|
-
ospec docs generate demo
|
|
533
|
-
ospec new landing-refresh demo
|
|
534
|
-
ospec changes status demo
|
|
535
|
-
ospec progress demo/changes/active/landing-refresh
|
|
536
|
-
```
|
|
276
|
+
- [Stitch Plugin Spec](docs/stitch-plugin-spec.zh-CN.md)
|
|
277
|
+
- [Checkpoint Plugin Spec](docs/checkpoint-plugin-spec.zh-CN.md)
|
|
537
278
|
|
|
538
|
-
|
|
279
|
+
## Repository Structure
|
|
539
280
|
|
|
540
|
-
```
|
|
541
|
-
|
|
542
|
-
|
|
281
|
+
```text
|
|
282
|
+
dist/ Compiled CLI runtime
|
|
283
|
+
assets/ Managed protocol assets, hooks, and skill payloads
|
|
284
|
+
docs/ Public documentation
|
|
285
|
+
scripts/ Release and installation helpers
|
|
286
|
+
.ospec/templates/hooks/ Hook templates shipped with the package
|
|
543
287
|
```
|
|
544
288
|
|
|
545
|
-
##
|
|
546
|
-
|
|
547
|
-
In one sentence, OSpec is not a tool for helping teams "generate code faster". It is a tool for helping teams "deliver more reliably with AI".
|
|
289
|
+
## License
|
|
548
290
|
|
|
549
|
-
|
|
291
|
+
This project is licensed under the [MIT License](LICENSE).
|