@fission-ai/openspec 0.17.2 โ 0.19.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.md +52 -0
- package/dist/cli/index.js +39 -3
- package/dist/commands/artifact-workflow.d.ts +17 -0
- package/dist/commands/artifact-workflow.js +823 -0
- package/dist/commands/completion.js +42 -6
- package/dist/core/archive.d.ts +0 -5
- package/dist/core/archive.js +4 -257
- package/dist/core/artifact-graph/graph.d.ts +56 -0
- package/dist/core/artifact-graph/graph.js +141 -0
- package/dist/core/artifact-graph/index.d.ts +7 -0
- package/dist/core/artifact-graph/index.js +13 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts +130 -0
- package/dist/core/artifact-graph/instruction-loader.js +173 -0
- package/dist/core/artifact-graph/resolver.d.ts +61 -0
- package/dist/core/artifact-graph/resolver.js +187 -0
- package/dist/core/artifact-graph/schema.d.ts +13 -0
- package/dist/core/artifact-graph/schema.js +108 -0
- package/dist/core/artifact-graph/state.d.ts +12 -0
- package/dist/core/artifact-graph/state.js +54 -0
- package/dist/core/artifact-graph/types.d.ts +45 -0
- package/dist/core/artifact-graph/types.js +43 -0
- package/dist/core/completions/command-registry.js +7 -1
- package/dist/core/completions/factory.d.ts +15 -2
- package/dist/core/completions/factory.js +19 -1
- package/dist/core/completions/generators/bash-generator.d.ts +32 -0
- package/dist/core/completions/generators/bash-generator.js +174 -0
- package/dist/core/completions/generators/fish-generator.d.ts +32 -0
- package/dist/core/completions/generators/fish-generator.js +157 -0
- package/dist/core/completions/generators/powershell-generator.d.ts +32 -0
- package/dist/core/completions/generators/powershell-generator.js +198 -0
- package/dist/core/completions/generators/zsh-generator.d.ts +0 -14
- package/dist/core/completions/generators/zsh-generator.js +55 -124
- package/dist/core/completions/installers/bash-installer.d.ts +87 -0
- package/dist/core/completions/installers/bash-installer.js +318 -0
- package/dist/core/completions/installers/fish-installer.d.ts +43 -0
- package/dist/core/completions/installers/fish-installer.js +143 -0
- package/dist/core/completions/installers/powershell-installer.d.ts +88 -0
- package/dist/core/completions/installers/powershell-installer.js +327 -0
- package/dist/core/completions/installers/zsh-installer.d.ts +1 -12
- package/dist/core/completions/templates/bash-templates.d.ts +6 -0
- package/dist/core/completions/templates/bash-templates.js +24 -0
- package/dist/core/completions/templates/fish-templates.d.ts +7 -0
- package/dist/core/completions/templates/fish-templates.js +39 -0
- package/dist/core/completions/templates/powershell-templates.d.ts +6 -0
- package/dist/core/completions/templates/powershell-templates.js +25 -0
- package/dist/core/completions/templates/zsh-templates.d.ts +6 -0
- package/dist/core/completions/templates/zsh-templates.js +36 -0
- package/dist/core/config.js +1 -0
- package/dist/core/configurators/slash/codebuddy.js +6 -9
- package/dist/core/configurators/slash/continue.d.ts +9 -0
- package/dist/core/configurators/slash/continue.js +46 -0
- package/dist/core/configurators/slash/registry.js +3 -0
- package/dist/core/converters/json-converter.js +2 -1
- package/dist/core/global-config.d.ts +10 -0
- package/dist/core/global-config.js +28 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/list.d.ts +6 -1
- package/dist/core/list.js +88 -6
- package/dist/core/specs-apply.d.ts +73 -0
- package/dist/core/specs-apply.js +384 -0
- package/dist/core/templates/skill-templates.d.ts +86 -0
- package/dist/core/templates/skill-templates.js +1934 -0
- package/dist/core/update.js +1 -1
- package/dist/core/validation/validator.js +2 -1
- package/dist/core/view.js +28 -8
- package/dist/telemetry/config.d.ts +32 -0
- package/dist/telemetry/config.js +68 -0
- package/dist/telemetry/index.d.ts +31 -0
- package/dist/telemetry/index.js +145 -0
- package/dist/utils/change-metadata.d.ts +47 -0
- package/dist/utils/change-metadata.js +130 -0
- package/dist/utils/change-utils.d.ts +51 -0
- package/dist/utils/change-utils.js +100 -0
- package/dist/utils/file-system.d.ts +11 -0
- package/dist/utils/file-system.js +50 -2
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.js +4 -1
- package/package.json +5 -1
- package/schemas/spec-driven/schema.yaml +148 -0
- package/schemas/spec-driven/templates/design.md +19 -0
- package/schemas/spec-driven/templates/proposal.md +23 -0
- package/schemas/spec-driven/templates/spec.md +8 -0
- package/schemas/spec-driven/templates/tasks.md +9 -0
- package/schemas/tdd/schema.yaml +213 -0
- package/schemas/tdd/templates/docs.md +15 -0
- package/schemas/tdd/templates/implementation.md +11 -0
- package/schemas/tdd/templates/spec.md +11 -0
- package/schemas/tdd/templates/test.md +11 -0
package/README.md
CHANGED
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
Follow <a href="https://x.com/0xTab">@0xTab on X</a> for updates ยท Join the <a href="https://discord.gg/YctCnvvshC">OpenSpec Discord</a> for help and questions.
|
|
27
27
|
</p>
|
|
28
28
|
|
|
29
|
+
<p align="center">
|
|
30
|
+
<sub>๐งช <strong>New:</strong> <a href="docs/experimental-workflow.md">Experimental Workflow (OPSX)</a> โ schema-driven, hackable, fluid. Iterate on workflows without code changes.</sub>
|
|
31
|
+
</p>
|
|
32
|
+
|
|
29
33
|
# OpenSpec
|
|
30
34
|
|
|
31
35
|
OpenSpec aligns humans and AI coding assistants with spec-driven development so you agree on what to build before any code is written. **No API keys required.**
|
|
@@ -99,6 +103,7 @@ These tools have built-in OpenSpec commands. Select the OpenSpec integration whe
|
|
|
99
103
|
| **Cline** | Workflows in `.clinerules/workflows/` directory (`.clinerules/workflows/openspec-*.md`) |
|
|
100
104
|
| **CodeBuddy Code (CLI)** | `/openspec:proposal`, `/openspec:apply`, `/openspec:archive` (`.codebuddy/commands/`) โ see [docs](https://www.codebuddy.ai/cli) |
|
|
101
105
|
| **Codex** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` (global: `~/.codex/prompts`, auto-installed) |
|
|
106
|
+
| **Continue** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` (`.continue/prompts/`) |
|
|
102
107
|
| **CoStrict** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` (`.cospec/openspec/commands/`) โ see [docs](https://costrict.ai)|
|
|
103
108
|
| **Crush** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` (`.crush/commands/openspec/`) |
|
|
104
109
|
| **Cursor** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` |
|
|
@@ -368,6 +373,53 @@ Run `openspec update` whenever someone switches tools so your agents pick up the
|
|
|
368
373
|
2. **Refresh agent instructions**
|
|
369
374
|
- Run `openspec update` inside each project to regenerate AI guidance and ensure the latest slash commands are active.
|
|
370
375
|
|
|
376
|
+
## Experimental Features
|
|
377
|
+
|
|
378
|
+
<details>
|
|
379
|
+
<summary><strong>๐งช OPSX: Fluid, Iterative Workflow</strong> (Claude Code only)</summary>
|
|
380
|
+
|
|
381
|
+
**Why this exists:**
|
|
382
|
+
- Standard workflow is locked down โ you can't tweak instructions or customize
|
|
383
|
+
- When AI output is bad, you can't improve the prompts yourself
|
|
384
|
+
- Same workflow for everyone, no way to match how your team works
|
|
385
|
+
|
|
386
|
+
**What's different:**
|
|
387
|
+
- **Hackable** โ edit templates and schemas yourself, test immediately, no rebuild
|
|
388
|
+
- **Granular** โ each artifact has its own instructions, test and tweak individually
|
|
389
|
+
- **Customizable** โ define your own workflows, artifacts, and dependencies
|
|
390
|
+
- **Fluid** โ no phase gates, update any artifact anytime
|
|
391
|
+
|
|
392
|
+
```
|
|
393
|
+
You can always go back:
|
|
394
|
+
|
|
395
|
+
proposal โโโ specs โโโ design โโโ tasks โโโ implement
|
|
396
|
+
โฒ โฒ โฒ โ
|
|
397
|
+
โโโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโ
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
| Command | What it does |
|
|
401
|
+
|---------|--------------|
|
|
402
|
+
| `/opsx:new` | Start a new change |
|
|
403
|
+
| `/opsx:continue` | Create the next artifact (based on what's ready) |
|
|
404
|
+
| `/opsx:ff` | Fast-forward (all planning artifacts at once) |
|
|
405
|
+
| `/opsx:apply` | Implement tasks, updating artifacts as needed |
|
|
406
|
+
| `/opsx:archive` | Archive when done |
|
|
407
|
+
|
|
408
|
+
**Setup:** `openspec artifact-experimental-setup`
|
|
409
|
+
|
|
410
|
+
[Full documentation โ](docs/experimental-workflow.md)
|
|
411
|
+
|
|
412
|
+
</details>
|
|
413
|
+
|
|
414
|
+
<details>
|
|
415
|
+
<summary><strong>Telemetry</strong> โ OpenSpec collects anonymous usage stats (opt-out: <code>OPENSPEC_TELEMETRY=0</code>)</summary>
|
|
416
|
+
|
|
417
|
+
We collect only command names and version to understand usage patterns. No arguments, paths, content, or PII. Automatically disabled in CI.
|
|
418
|
+
|
|
419
|
+
**Opt-out:** `export OPENSPEC_TELEMETRY=0` or `export DO_NOT_TRACK=1`
|
|
420
|
+
|
|
421
|
+
</details>
|
|
422
|
+
|
|
371
423
|
## Contributing
|
|
372
424
|
|
|
373
425
|
- Install dependencies: `pnpm install`
|
package/dist/cli/index.js
CHANGED
|
@@ -14,21 +14,52 @@ import { ValidateCommand } from '../commands/validate.js';
|
|
|
14
14
|
import { ShowCommand } from '../commands/show.js';
|
|
15
15
|
import { CompletionCommand } from '../commands/completion.js';
|
|
16
16
|
import { registerConfigCommand } from '../commands/config.js';
|
|
17
|
+
import { registerArtifactWorkflowCommands } from '../commands/artifact-workflow.js';
|
|
18
|
+
import { maybeShowTelemetryNotice, trackCommand, shutdown } from '../telemetry/index.js';
|
|
17
19
|
const program = new Command();
|
|
18
20
|
const require = createRequire(import.meta.url);
|
|
19
21
|
const { version } = require('../../package.json');
|
|
22
|
+
/**
|
|
23
|
+
* Get the full command path for nested commands.
|
|
24
|
+
* For example: 'change show' -> 'change:show'
|
|
25
|
+
*/
|
|
26
|
+
function getCommandPath(command) {
|
|
27
|
+
const names = [];
|
|
28
|
+
let current = command;
|
|
29
|
+
while (current) {
|
|
30
|
+
const name = current.name();
|
|
31
|
+
// Skip the root 'openspec' command
|
|
32
|
+
if (name && name !== 'openspec') {
|
|
33
|
+
names.unshift(name);
|
|
34
|
+
}
|
|
35
|
+
current = current.parent;
|
|
36
|
+
}
|
|
37
|
+
return names.join(':') || 'openspec';
|
|
38
|
+
}
|
|
20
39
|
program
|
|
21
40
|
.name('openspec')
|
|
22
41
|
.description('AI-native system for spec-driven development')
|
|
23
42
|
.version(version);
|
|
24
43
|
// Global options
|
|
25
44
|
program.option('--no-color', 'Disable color output');
|
|
26
|
-
// Apply global flags before any command runs
|
|
27
|
-
|
|
45
|
+
// Apply global flags and telemetry before any command runs
|
|
46
|
+
// Note: preAction receives (thisCommand, actionCommand) where:
|
|
47
|
+
// - thisCommand: the command where hook was added (root program)
|
|
48
|
+
// - actionCommand: the command actually being executed (subcommand)
|
|
49
|
+
program.hook('preAction', async (thisCommand, actionCommand) => {
|
|
28
50
|
const opts = thisCommand.opts();
|
|
29
51
|
if (opts.color === false) {
|
|
30
52
|
process.env.NO_COLOR = '1';
|
|
31
53
|
}
|
|
54
|
+
// Show first-run telemetry notice (if not seen)
|
|
55
|
+
await maybeShowTelemetryNotice();
|
|
56
|
+
// Track command execution (use actionCommand to get the actual subcommand)
|
|
57
|
+
const commandPath = getCommandPath(actionCommand);
|
|
58
|
+
await trackCommand(commandPath, version);
|
|
59
|
+
});
|
|
60
|
+
// Shutdown telemetry after command completes
|
|
61
|
+
program.hook('postAction', async () => {
|
|
62
|
+
await shutdown();
|
|
32
63
|
});
|
|
33
64
|
const availableToolIds = AI_TOOLS.filter((tool) => tool.available).map((tool) => tool.value);
|
|
34
65
|
const toolsOptionDescription = `Configure AI tools non-interactively. Use "all", "none", or a comma-separated list of: ${availableToolIds.join(', ')}`;
|
|
@@ -90,11 +121,14 @@ program
|
|
|
90
121
|
.description('List items (changes by default). Use --specs to list specs.')
|
|
91
122
|
.option('--specs', 'List specs instead of changes')
|
|
92
123
|
.option('--changes', 'List changes explicitly (default)')
|
|
124
|
+
.option('--sort <order>', 'Sort order: "recent" (default) or "name"', 'recent')
|
|
125
|
+
.option('--json', 'Output as JSON (for programmatic use)')
|
|
93
126
|
.action(async (options) => {
|
|
94
127
|
try {
|
|
95
128
|
const listCommand = new ListCommand();
|
|
96
129
|
const mode = options?.specs ? 'specs' : 'changes';
|
|
97
|
-
|
|
130
|
+
const sort = options?.sort === 'name' ? 'name' : 'recent';
|
|
131
|
+
await listCommand.execute('.', mode, { sort, json: options?.json });
|
|
98
132
|
}
|
|
99
133
|
catch (error) {
|
|
100
134
|
console.log(); // Empty line for spacing
|
|
@@ -307,5 +341,7 @@ program
|
|
|
307
341
|
process.exitCode = 1;
|
|
308
342
|
}
|
|
309
343
|
});
|
|
344
|
+
// Register artifact workflow commands (experimental)
|
|
345
|
+
registerArtifactWorkflowCommands(program);
|
|
310
346
|
program.parse();
|
|
311
347
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Artifact Workflow CLI Commands (Experimental)
|
|
3
|
+
*
|
|
4
|
+
* This file contains all artifact workflow commands in isolation for easy removal.
|
|
5
|
+
* Commands expose the ArtifactGraph and InstructionLoader APIs to users and agents.
|
|
6
|
+
*
|
|
7
|
+
* To remove this feature:
|
|
8
|
+
* 1. Delete this file
|
|
9
|
+
* 2. Remove the registerArtifactWorkflowCommands() call from src/cli/index.ts
|
|
10
|
+
*/
|
|
11
|
+
import type { Command } from 'commander';
|
|
12
|
+
/**
|
|
13
|
+
* Registers all artifact workflow commands on the given program.
|
|
14
|
+
* All commands are marked as experimental in their help text.
|
|
15
|
+
*/
|
|
16
|
+
export declare function registerArtifactWorkflowCommands(program: Command): void;
|
|
17
|
+
//# sourceMappingURL=artifact-workflow.d.ts.map
|