freeharness 0.4.1
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/NOTICE +108 -0
- package/README.md +134 -0
- package/canonical/HARVEST.yaml +858 -0
- package/canonical/PROVENANCE.yaml +740 -0
- package/canonical/agents/README.md +95 -0
- package/canonical/agents/agentic-architect.md +18 -0
- package/canonical/agents/database-reviewer.md +41 -0
- package/canonical/agents/explorer-ai-engineer-analyst.md +65 -0
- package/canonical/agents/pr-reviewer.md +96 -0
- package/canonical/agents/python-reviewer.md +55 -0
- package/canonical/agents/report-formatter.md +19 -0
- package/canonical/agents/security-reviewer.md +53 -0
- package/canonical/agents/test-writer.md +34 -0
- package/canonical/commands/fh-context.md +37 -0
- package/canonical/evals/promptfoo.redteam.yaml +108 -0
- package/canonical/hooks/cost-prices.json +14 -0
- package/canonical/hooks/freeharness-auto-memory.mjs +158 -0
- package/canonical/hooks/freeharness-config-guard.mjs +162 -0
- package/canonical/hooks/freeharness-context-monitor.mjs +198 -0
- package/canonical/hooks/freeharness-converge.mjs +227 -0
- package/canonical/hooks/freeharness-cost-tracker.mjs +1027 -0
- package/canonical/hooks/freeharness-memory-guard.mjs +57 -0
- package/canonical/hooks/freeharness-output-pruner.mjs +333 -0
- package/canonical/hooks/freeharness-precompact.mjs +323 -0
- package/canonical/hooks/freeharness-repeat-tool.mjs +208 -0
- package/canonical/hooks/freeharness-security-guidance.mjs +164 -0
- package/canonical/hooks/freeharness-session-start +583 -0
- package/canonical/hooks/hooks.auto-memory.claude-code.json +16 -0
- package/canonical/hooks/hooks.claude-code.json +17 -0
- package/canonical/hooks/hooks.config-guard.claude-code.json +16 -0
- package/canonical/hooks/hooks.context-monitor.claude-code.json +15 -0
- package/canonical/hooks/hooks.converge.claude-code.json +15 -0
- package/canonical/hooks/hooks.cost-tracker.claude-code.json +37 -0
- package/canonical/hooks/hooks.memory-guard.claude-code.json +16 -0
- package/canonical/hooks/hooks.output-pruner.claude-code.json +16 -0
- package/canonical/hooks/hooks.precompact.claude-code.json +15 -0
- package/canonical/hooks/hooks.repeat-tool.claude-code.json +25 -0
- package/canonical/hooks/hooks.security-guidance.claude-code.json +16 -0
- package/canonical/mcp/servers.json +20 -0
- package/canonical/openspec/config.base.yaml +89 -0
- package/canonical/openspec/schema.spec-driven.yaml +277 -0
- package/canonical/openspec/templates/data-contract.md +36 -0
- package/canonical/openspec/templates/design.md +84 -0
- package/canonical/openspec/templates/eval-plan.md +33 -0
- package/canonical/openspec/templates/follow-ups.md +2 -0
- package/canonical/openspec/templates/proposal.md +45 -0
- package/canonical/openspec/templates/spec.md +42 -0
- package/canonical/openspec/templates/tasks.md +38 -0
- package/canonical/profiles/local-llamacpp.LOCAL-MODELS.md +47 -0
- package/canonical/profiles/local-llamacpp.json +27 -0
- package/canonical/profiles/local-ollama.json +20 -0
- package/canonical/profiles/mcp.json +91 -0
- package/canonical/rules/CLAUDE.md +78 -0
- package/canonical/rules/project-CLAUDE.template.md +62 -0
- package/canonical/rules/routing.md +20 -0
- package/canonical/rules/safety.md +41 -0
- package/canonical/settings/settings.cache-hygiene.claude-code.json +5 -0
- package/canonical/skills/agent-evaluation/SKILL.md +102 -0
- package/canonical/skills/agent-evaluation/assets/evaluation_report_template.md +206 -0
- package/canonical/skills/agent-evaluation/evals/cases.yaml +106 -0
- package/canonical/skills/agent-evaluation/references/dataset-preparation.md +351 -0
- package/canonical/skills/agent-evaluation/references/scorers-constraints.md +165 -0
- package/canonical/skills/agent-evaluation/references/scorers.md +431 -0
- package/canonical/skills/agent-evaluation/references/setup-guide.md +252 -0
- package/canonical/skills/agent-evaluation/references/tracing-integration.md +164 -0
- package/canonical/skills/agent-evaluation/references/troubleshooting.md +514 -0
- package/canonical/skills/agent-evaluation/scripts/analyze_results.py +462 -0
- package/canonical/skills/agent-evaluation/scripts/create_dataset_template.py +382 -0
- package/canonical/skills/agent-evaluation/scripts/list_datasets.py +273 -0
- package/canonical/skills/agent-evaluation/scripts/run_evaluation_template.py +309 -0
- package/canonical/skills/agent-evaluation/scripts/setup_mlflow.py +353 -0
- package/canonical/skills/agent-evaluation/scripts/utils/__init__.py +27 -0
- package/canonical/skills/agent-evaluation/scripts/utils/env_validation.py +123 -0
- package/canonical/skills/agent-evaluation/scripts/utils/tracing_utils.py +108 -0
- package/canonical/skills/agent-evaluation/scripts/validate_agent_tracing.py +148 -0
- package/canonical/skills/agent-evaluation/scripts/validate_auth.py +240 -0
- package/canonical/skills/agent-evaluation/scripts/validate_environment.py +185 -0
- package/canonical/skills/agent-evaluation/scripts/validate_tracing_runtime.py +318 -0
- package/canonical/skills/agentic-architecture/SKILL.md +41 -0
- package/canonical/skills/agentic-architecture/evals/cases.yaml +94 -0
- package/canonical/skills/agentic-architecture/reference/context-engineering.md +75 -0
- package/canonical/skills/agentic-architecture/reference/patterns.md +76 -0
- package/canonical/skills/agentic-architecture/reference/reliability-observability.md +94 -0
- package/canonical/skills/agentic-architecture/reference/review-framework.md +59 -0
- package/canonical/skills/code-review/SKILL.md +52 -0
- package/canonical/skills/code-review/evals/cases.yaml +197 -0
- package/canonical/skills/git-workflow/SKILL.md +41 -0
- package/canonical/skills/git-workflow/evals/cases.yaml +92 -0
- package/canonical/skills/local-code/SKILL.md +24 -0
- package/canonical/skills/local-code/evals/cases.yaml +85 -0
- package/canonical/skills/local-code/scripts/query_llama.py +68 -0
- package/canonical/skills/report-formatting/SKILL.md +62 -0
- package/canonical/skills/report-formatting/evals/cases.yaml +83 -0
- package/canonical/skills/report-formatting/reference/ARCHITECTURE.md +135 -0
- package/canonical/skills/report-formatting/reference/HELPERS.md +120 -0
- package/canonical/skills/report-formatting/reference/PPTX.md +136 -0
- package/canonical/skills/report-formatting/reference/RELEASE.md +99 -0
- package/canonical/skills/report-formatting/reference/TEMPLATES.md +48 -0
- package/canonical/skills/report-formatting/reference/authoring.md +66 -0
- package/canonical/skills/report-formatting/scripts/architecture-template.md +271 -0
- package/canonical/skills/report-formatting/scripts/assets/claro-logo.png +0 -0
- package/canonical/skills/report-formatting/scripts/assets/claro-wordmark.svg +1 -0
- package/canonical/skills/report-formatting/scripts/build-architecture.js +57 -0
- package/canonical/skills/report-formatting/scripts/build-md-claro.js +224 -0
- package/canonical/skills/report-formatting/scripts/build-release.js +51 -0
- package/canonical/skills/report-formatting/scripts/check-env.js +58 -0
- package/canonical/skills/report-formatting/scripts/docmodel.js +283 -0
- package/canonical/skills/report-formatting/scripts/example-build.js +119 -0
- package/canonical/skills/report-formatting/scripts/example_build_ArchitectureReview_docx.js +195 -0
- package/canonical/skills/report-formatting/scripts/example_build_ExecutiveReport_docx.js +114 -0
- package/canonical/skills/report-formatting/scripts/package.json +17 -0
- package/canonical/skills/report-formatting/scripts/pptx/example_build_StatusReport_pptx.py +223 -0
- package/canonical/skills/report-formatting/scripts/pptx/example_build_WeeklyStatus_pptx.py +245 -0
- package/canonical/skills/report-formatting/scripts/pptx/pptx_office.py +144 -0
- package/canonical/skills/report-formatting/scripts/pptx/requirements.txt +7 -0
- package/canonical/skills/report-formatting/scripts/pptx/status_report_blocks.py +193 -0
- package/canonical/skills/report-formatting/scripts/pptx/theme_claro_pptx.py +473 -0
- package/canonical/skills/report-formatting/scripts/release-template.md +80 -0
- package/canonical/skills/report-formatting/scripts/render-mermaid.js +105 -0
- package/canonical/skills/report-formatting/scripts/theme-claro.js +403 -0
- package/canonical/skills/subagent-driven-development/SKILL.md +60 -0
- package/canonical/skills/subagent-driven-development/evals/cases.yaml +208 -0
- package/canonical/skills/subagent-driven-development/reference/brief.md +91 -0
- package/canonical/skills/subagent-driven-development/reference/handoff.md +118 -0
- package/canonical/skills/subagent-driven-development/scripts/validate-handoff.mjs +850 -0
- package/canonical/skills/systematic-debugging/SKILL.md +44 -0
- package/canonical/skills/systematic-debugging/evals/cases.yaml +90 -0
- package/canonical/skills/test-driven-development/SKILL.md +42 -0
- package/canonical/skills/test-driven-development/evals/cases.yaml +86 -0
- package/canonical/skills/test-driven-development/reference/writing-good-tests.md +52 -0
- package/canonical/skills/verification-before-completion/SKILL.md +53 -0
- package/canonical/skills/verification-before-completion/evals/cases.yaml +107 -0
- package/dist/adapters/content/language-lint.d.ts +46 -0
- package/dist/adapters/content/language-lint.js +191 -0
- package/dist/adapters/harness/claude-code.d.ts +57 -0
- package/dist/adapters/harness/claude-code.js +385 -0
- package/dist/adapters/harness/index.d.ts +3 -0
- package/dist/adapters/harness/index.js +17 -0
- package/dist/adapters/harness/opencode.d.ts +7 -0
- package/dist/adapters/harness/opencode.js +166 -0
- package/dist/adapters/harness/plugin.d.ts +22 -0
- package/dist/adapters/harness/plugin.js +257 -0
- package/dist/adapters/memory/doctor.d.ts +480 -0
- package/dist/adapters/memory/doctor.js +1217 -0
- package/dist/adapters/memory/vendored.d.ts +150 -0
- package/dist/adapters/memory/vendored.js +487 -0
- package/dist/adapters/package/node.d.ts +9 -0
- package/dist/adapters/package/node.js +20 -0
- package/dist/adapters/prompt/readline.d.ts +19 -0
- package/dist/adapters/prompt/readline.js +53 -0
- package/dist/adapters/sync/diff.d.ts +43 -0
- package/dist/adapters/sync/diff.js +380 -0
- package/dist/cli/cleanup.d.ts +86 -0
- package/dist/cli/cleanup.js +382 -0
- package/dist/cli/cost.d.ts +304 -0
- package/dist/cli/cost.js +501 -0
- package/dist/cli/doctor.d.ts +205 -0
- package/dist/cli/doctor.js +654 -0
- package/dist/cli/executor.d.ts +5 -0
- package/dist/cli/executor.js +48 -0
- package/dist/cli/plugin-validate.d.ts +37 -0
- package/dist/cli/plugin-validate.js +256 -0
- package/dist/cli/prefix.d.ts +68 -0
- package/dist/cli/prefix.js +218 -0
- package/dist/cli/profile.d.ts +170 -0
- package/dist/cli/profile.js +285 -0
- package/dist/cli/runner.d.ts +10 -0
- package/dist/cli/runner.js +27 -0
- package/dist/cli/uninstall.d.ts +65 -0
- package/dist/cli/uninstall.js +147 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +989 -0
- package/dist/infra/dogfood.d.ts +31 -0
- package/dist/infra/dogfood.js +51 -0
- package/dist/infra/fsutil.d.ts +40 -0
- package/dist/infra/fsutil.js +143 -0
- package/dist/infra/manifest.d.ts +76 -0
- package/dist/infra/manifest.js +92 -0
- package/dist/infra/paths.d.ts +19 -0
- package/dist/infra/paths.js +74 -0
- package/dist/infra/routing.d.ts +4 -0
- package/dist/infra/routing.js +7 -0
- package/node_modules/@freeharness/core/dist/context.d.ts +30 -0
- package/node_modules/@freeharness/core/dist/context.js +1 -0
- package/node_modules/@freeharness/core/dist/index.d.ts +5 -0
- package/node_modules/@freeharness/core/dist/index.js +6 -0
- package/node_modules/@freeharness/core/dist/planner.d.ts +13 -0
- package/node_modules/@freeharness/core/dist/planner.js +18 -0
- package/node_modules/@freeharness/core/dist/ports.d.ts +90 -0
- package/node_modules/@freeharness/core/dist/ports.js +1 -0
- package/node_modules/@freeharness/core/dist/registry.d.ts +41 -0
- package/node_modules/@freeharness/core/dist/registry.js +124 -0
- package/node_modules/@freeharness/core/dist/tiers.d.ts +30 -0
- package/node_modules/@freeharness/core/dist/tiers.js +99 -0
- package/node_modules/@freeharness/core/package.json +34 -0
- package/node_modules/@freeharness/sdd/PROVENANCE.yaml +175 -0
- package/node_modules/@freeharness/sdd/dist/src/bin/openspec.d.ts +2 -0
- package/node_modules/@freeharness/sdd/dist/src/bin/openspec.js +166 -0
- package/node_modules/@freeharness/sdd/dist/src/index.d.ts +14 -0
- package/node_modules/@freeharness/sdd/dist/src/index.js +11 -0
- package/node_modules/@freeharness/sdd/dist/src/init.d.ts +39 -0
- package/node_modules/@freeharness/sdd/dist/src/init.js +190 -0
- package/node_modules/@freeharness/sdd/dist/src/root-resolver.d.ts +8 -0
- package/node_modules/@freeharness/sdd/dist/src/root-resolver.js +32 -0
- package/node_modules/@freeharness/sdd/dist/src/shim/archive.d.ts +81 -0
- package/node_modules/@freeharness/sdd/dist/src/shim/archive.js +483 -0
- package/node_modules/@freeharness/sdd/dist/src/shim/context.d.ts +4 -0
- package/node_modules/@freeharness/sdd/dist/src/shim/context.js +48 -0
- package/node_modules/@freeharness/sdd/dist/src/shim/follow-up.d.ts +57 -0
- package/node_modules/@freeharness/sdd/dist/src/shim/follow-up.js +279 -0
- package/node_modules/@freeharness/sdd/dist/src/shim/instructions.d.ts +67 -0
- package/node_modules/@freeharness/sdd/dist/src/shim/instructions.js +460 -0
- package/node_modules/@freeharness/sdd/dist/src/shim/list.d.ts +5 -0
- package/node_modules/@freeharness/sdd/dist/src/shim/list.js +95 -0
- package/node_modules/@freeharness/sdd/dist/src/shim/new-change.d.ts +6 -0
- package/node_modules/@freeharness/sdd/dist/src/shim/new-change.js +150 -0
- package/node_modules/@freeharness/sdd/dist/src/shim/schemas.d.ts +4 -0
- package/node_modules/@freeharness/sdd/dist/src/shim/schemas.js +23 -0
- package/node_modules/@freeharness/sdd/dist/src/shim/shared.d.ts +56 -0
- package/node_modules/@freeharness/sdd/dist/src/shim/shared.js +140 -0
- package/node_modules/@freeharness/sdd/dist/src/shim/status.d.ts +8 -0
- package/node_modules/@freeharness/sdd/dist/src/shim/status.js +85 -0
- package/node_modules/@freeharness/sdd/dist/src/shim/validate.d.ts +6 -0
- package/node_modules/@freeharness/sdd/dist/src/shim/validate.js +229 -0
- package/node_modules/@freeharness/sdd/dist/src/validate-change.d.ts +40 -0
- package/node_modules/@freeharness/sdd/dist/src/validate-change.js +114 -0
- package/node_modules/@freeharness/sdd/dist/src/validate.d.ts +24 -0
- package/node_modules/@freeharness/sdd/dist/src/validate.js +72 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/apply/specs-apply.d.ts +130 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/apply/specs-apply.js +981 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/change-metadata.d.ts +46 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/change-metadata.js +128 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/change-status-policy.d.ts +26 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/change-status-policy.js +32 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/file-system.d.ts +50 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/file-system.js +394 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/global-config.d.ts +15 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/global-config.js +49 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/graph.d.ts +71 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/graph.js +164 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/index.d.ts +11 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/index.js +21 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/instruction-loader.d.ts +102 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/instruction-loader.js +230 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/outputs.d.ts +18 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/outputs.js +138 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/resolver.d.ts +82 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/resolver.js +333 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/schema.d.ts +12 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/schema.js +110 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/state.d.ts +11 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/state.js +32 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/task-progress.d.ts +33 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/task-progress.js +149 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/types.d.ts +39 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/types.js +49 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/adapters/claude.d.ts +12 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/adapters/claude.js +31 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/adapters/index.d.ts +10 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/adapters/index.js +10 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/adapters/opencode.d.ts +12 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/adapters/opencode.js +26 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/generator.d.ts +28 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/generator.js +41 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/index.d.ts +23 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/index.js +25 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/invocation.d.ts +72 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/invocation.js +76 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/registry.d.ts +39 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/registry.js +53 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/types.d.ts +62 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/types.js +7 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/yaml.d.ts +35 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/yaml.js +47 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-references.d.ts +33 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-references.js +55 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/shared/allowed-tools.d.ts +11 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/shared/allowed-tools.js +11 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/shared/skill-generation.d.ts +48 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/shared/skill-generation.js +99 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/skill-templates.d.ts +19 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/skill-templates.js +18 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/types.d.ts +18 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/types.js +4 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/apply-change.d.ts +19 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/apply-change.js +207 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/archive-change.d.ts +12 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/archive-change.js +409 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/bulk-archive-change.d.ts +9 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/bulk-archive-change.js +673 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/continue-change.d.ts +9 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/continue-change.js +230 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/explore.d.ts +12 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/explore.js +550 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/feedback.d.ts +8 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/feedback.js +107 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/ff-change.d.ts +12 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/ff-change.js +228 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/new-change.d.ts +9 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/new-change.js +147 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/onboard.d.ts +9 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/onboard.js +571 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/propose.d.ts +12 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/propose.js +322 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/store-selection.d.ts +7 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/store-selection.js +7 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/sync-specs.d.ts +9 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/sync-specs.js +518 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/update-change.d.ts +9 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/update-change.js +176 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/verify-change.d.ts +9 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/verify-change.js +344 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/constants.d.ts +39 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/constants.js +54 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/delta-resolution.d.ts +35 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/delta-resolution.js +171 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/change-parser.d.ts +27 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/change-parser.js +210 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/code-fence.d.ts +14 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/code-fence.js +48 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/markdown-parser.d.ts +22 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/markdown-parser.js +186 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/requirement-blocks.d.ts +65 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/requirement-blocks.js +409 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/requirement-text.d.ts +55 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/requirement-text.js +98 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/spec-structure.d.ts +8 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/spec-structure.js +77 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/purpose-placeholder.d.ts +44 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/purpose-placeholder.js +116 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/schemas/base.schema.d.ts +12 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/schemas/base.schema.js +17 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/schemas/change.schema.d.ts +72 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/schemas/change.schema.js +30 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/schemas/index.d.ts +3 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/schemas/index.js +3 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/schemas/spec.schema.d.ts +17 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/schemas/spec.schema.js +14 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/spec-discovery.d.ts +39 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/spec-discovery.js +114 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/task-lines.d.ts +45 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/task-lines.js +105 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/task-numbering.d.ts +15 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/task-numbering.js +56 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/types.d.ts +17 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/types.js +1 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/validator.d.ts +94 -0
- package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/validator.js +756 -0
- package/node_modules/@freeharness/sdd/package.json +57 -0
- package/node_modules/@freeharness/sdd/vendor/openspec/LICENSE.upstream +22 -0
- package/node_modules/@freeharness/sdd/vendor/openspec/assets/schema.upstream.yaml +232 -0
- package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/README.md +19 -0
- package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-apply-change/SKILL.md +187 -0
- package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-archive-change/SKILL.md +181 -0
- package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-bulk-archive-change/SKILL.md +338 -0
- package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-continue-change/SKILL.md +117 -0
- package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-explore/SKILL.md +342 -0
- package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-ff-change/SKILL.md +116 -0
- package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-new-change/SKILL.md +76 -0
- package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-onboard/SKILL.md +560 -0
- package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-propose/SKILL.md +162 -0
- package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-sync-specs/SKILL.md +261 -0
- package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-update-change/SKILL.md +90 -0
- package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-verify-change/SKILL.md +174 -0
- package/package.json +70 -0
- package/provenance/canonical.PROVENANCE.yaml +740 -0
- package/provenance/claude-mem.LICENSE.upstream +202 -0
- package/provenance/memory.PROVENANCE.yaml +399 -0
- package/provenance/sdd.PROVENANCE.yaml +175 -0
- package/vendor-licenses/caveman.LICENSE +27 -0
- package/vendor-licenses/deepseek-harness.LICENSE +21 -0
- package/vendor-licenses/ecc.LICENSE +21 -0
- package/vendor-licenses/pi.LICENSE +21 -0
- package/vendor-licenses/superpowers.LICENSE +21 -0
package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-archive-change/SKILL.md
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
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
|
+
allowed-tools: Bash(openspec:*)
|
|
5
|
+
license: MIT
|
|
6
|
+
compatibility: Requires openspec CLI.
|
|
7
|
+
metadata:
|
|
8
|
+
author: openspec
|
|
9
|
+
version: "1.0"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Archive a completed change in the experimental workflow.
|
|
13
|
+
|
|
14
|
+
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
|
|
15
|
+
|
|
16
|
+
`<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve the full path from each delta spec when resolving its main spec.
|
|
17
|
+
|
|
18
|
+
**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.
|
|
19
|
+
|
|
20
|
+
**Steps**
|
|
21
|
+
|
|
22
|
+
1. **Select the change**
|
|
23
|
+
|
|
24
|
+
If a name is provided, use it. Otherwise:
|
|
25
|
+
- Infer from conversation context if the user mentioned a change
|
|
26
|
+
- Auto-select if only one active change exists
|
|
27
|
+
- If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
|
|
28
|
+
|
|
29
|
+
When prompting, show only active changes (not already archived).
|
|
30
|
+
Include the schema used for each change if available.
|
|
31
|
+
|
|
32
|
+
Always announce: "Using change: <name>" and how to override (e.g., `/openspec-archive-change <other>`).
|
|
33
|
+
|
|
34
|
+
**Load current archive inputs before the existing archive checks:**
|
|
35
|
+
|
|
36
|
+
After resolving the selected change and planning root, run:
|
|
37
|
+
```bash
|
|
38
|
+
openspec instructions archive --change "<name>" --json
|
|
39
|
+
```
|
|
40
|
+
Keep the same selected-root flags on this command. This lookup is advisory and
|
|
41
|
+
optional: it only supplies extra prompt inputs, so it must never block archiving.
|
|
42
|
+
If it exits non-zero or returns invalid JSON — for example on an older CLI that
|
|
43
|
+
does not support this command yet — continue the archive workflow with no
|
|
44
|
+
context and no operation guidance. Do not report an error and do not stop.
|
|
45
|
+
|
|
46
|
+
A successful response may omit both optional fields. Treat `context` as a
|
|
47
|
+
required prompt-level input: read and consider it, and apply relevant project
|
|
48
|
+
facts, conventions, and constraints. Treat `operationGuidance` as optional
|
|
49
|
+
additive advice: read and consider every entry, and follow entries that are
|
|
50
|
+
applicable and compatible with the built-in archive workflow.
|
|
51
|
+
|
|
52
|
+
Keep both fields separate from built-in steps, explicit user choices, resolved
|
|
53
|
+
paths, CLI checks, and command contracts. If context conflicts with one of those
|
|
54
|
+
controlling inputs, report the conflict and preserve the controlling value. If
|
|
55
|
+
guidance is inapplicable or conflicts with a controlling input, do not follow it
|
|
56
|
+
and explain why. Do not infer replacement paths, skipped prompts, or flags from
|
|
57
|
+
either field, and do not copy their text verbatim into specs, change artifacts,
|
|
58
|
+
or archive summaries unless the user separately asks for it. These are
|
|
59
|
+
prompt-level behavior contracts, not enforceable checks.
|
|
60
|
+
|
|
61
|
+
2. **Check artifact completion status**
|
|
62
|
+
|
|
63
|
+
Run `openspec status --change "<name>" --json` to check artifact completion.
|
|
64
|
+
|
|
65
|
+
Parse the JSON to understand:
|
|
66
|
+
- `schemaName`: The workflow being used
|
|
67
|
+
- `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context
|
|
68
|
+
- `artifacts`: List of artifacts with their status (`done`, `skipped`, or other)
|
|
69
|
+
|
|
70
|
+
**If any artifacts are neither `done` nor `skipped`** (skipped artifacts satisfy the requirement - the change declares skip_specs):
|
|
71
|
+
- Display warning listing incomplete artifacts
|
|
72
|
+
- Ask the user to confirm they want to proceed
|
|
73
|
+
- Proceed if user confirms
|
|
74
|
+
|
|
75
|
+
3. **Check task completion status**
|
|
76
|
+
|
|
77
|
+
Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
|
|
78
|
+
|
|
79
|
+
Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
|
|
80
|
+
|
|
81
|
+
**If incomplete tasks found:**
|
|
82
|
+
- Display warning showing count of incomplete tasks
|
|
83
|
+
- Ask the user to confirm they want to proceed
|
|
84
|
+
- Proceed if user confirms
|
|
85
|
+
|
|
86
|
+
**If no tasks file exists:** Proceed without task-related warning.
|
|
87
|
+
|
|
88
|
+
4. **Assess delta spec sync state**
|
|
89
|
+
|
|
90
|
+
Use `artifactPaths.specs.existingOutputPaths` from status JSON as the only
|
|
91
|
+
delta-spec source. If the `specs` entry is missing or
|
|
92
|
+
`existingOutputPaths` is empty, proceed without a sync prompt and do not infer
|
|
93
|
+
delta specs from other artifacts.
|
|
94
|
+
|
|
95
|
+
**If delta specs exist:**
|
|
96
|
+
- Compare each delta spec with its corresponding main spec at `<planningHome.root>/openspec/specs/<capability-path>/spec.md` (use the store-aware `planningHome.root` from step 2, not a hardcoded repo path)
|
|
97
|
+
- Determine what changes would be applied (adds, modifications, removals, renames)
|
|
98
|
+
- Show a combined summary before prompting
|
|
99
|
+
|
|
100
|
+
**Prompt options:**
|
|
101
|
+
- If changes needed: "Sync now (recommended)", "Archive without syncing"
|
|
102
|
+
- If already synced: "Archive now", "Sync anyway", "Cancel"
|
|
103
|
+
|
|
104
|
+
Route on the answer:
|
|
105
|
+
- "Cancel" — stop, do not archive
|
|
106
|
+
- "Archive without syncing" or "Archive now" — proceed to archive
|
|
107
|
+
- "Sync now" or "Sync anyway" — sync, then verify (below)
|
|
108
|
+
- Anything else — ask again rather than archiving
|
|
109
|
+
|
|
110
|
+
Before a selected sync writes any main spec, run
|
|
111
|
+
`openspec instructions specs --change "<name>" --json` once with the same
|
|
112
|
+
selected-root flags. Require a zero exit status and valid artifact-instruction
|
|
113
|
+
JSON. If the lookup fails or returns invalid JSON, report the error and stop
|
|
114
|
+
before writing any main spec or moving the change. A valid response with omitted
|
|
115
|
+
`rules` is the no-rules case. Apply returned `rules` only to the content and
|
|
116
|
+
form of main specs produced by this merge; do not use them as archive guidance,
|
|
117
|
+
change CLI behavior, or copy the rule text into any output file.
|
|
118
|
+
|
|
119
|
+
Then run the `openspec-sync-specs` workflow inline (agent-driven intelligent merge) for change '<name>', passing the delta spec analysis and the fetched specs-rule snapshot from above, and wait for it to finish. The inline sync must reuse that snapshot without fetching `specs` instructions again. Do not delegate it to a background task — step 5 would move `changeRoot` out from under a sync that is still reading it, leaving the change archived and the main specs never updated. If your agent can only run it by delegation, delegate synchronously and wait for the result.
|
|
120
|
+
|
|
121
|
+
Then re-run the comparison from the top of this step against every capability that has a delta spec in `artifactPaths.specs.existingOutputPaths` — not only the ones the sync reports it touched. A successful sync leaves nothing left to apply, so each capability must now read as already synced:
|
|
122
|
+
- ADDED requirements present
|
|
123
|
+
- MODIFIED requirements carrying the scenario and description changes named in the delta, with their other scenarios intact
|
|
124
|
+
- REMOVED requirements gone — and where this sync retired a capability (removed its last requirement, leaving `## Requirements` empty), its main spec deleted rather than left empty; a spec the sync deliberately kept and reported is also a match
|
|
125
|
+
- RENAMED requirements present under the new name and absent under the old one
|
|
126
|
+
|
|
127
|
+
If the sync failed, or any capability does not match, report what differs and stop — do not archive. Nothing has moved and `changeRoot` is intact, so the user can fix the mismatch or re-run the sync and start the archive again.
|
|
128
|
+
|
|
129
|
+
5. **Perform the archive**
|
|
130
|
+
|
|
131
|
+
Create an `archive` directory under `planningHome.changesDir` if it doesn't exist:
|
|
132
|
+
```bash
|
|
133
|
+
mkdir -p "<planningHome.changesDir>/archive"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Generate the target name: use the change name as-is when it already starts with a `YYYY-MM-DD-` prefix; otherwise prepend the current date as `YYYY-MM-DD-<change-name>`. Never stack a second date (same rule as `openspec archive`).
|
|
137
|
+
|
|
138
|
+
**Check if target already exists:**
|
|
139
|
+
- If yes: Fail with error, suggest renaming existing archive or using different date
|
|
140
|
+
- If no: Move `changeRoot` to the archive directory
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
mv "<changeRoot>" "<planningHome.changesDir>/archive/<target-name>"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
6. **Display summary**
|
|
147
|
+
|
|
148
|
+
Show archive completion summary including:
|
|
149
|
+
- Change name
|
|
150
|
+
- Schema that was used
|
|
151
|
+
- Archive location
|
|
152
|
+
- Whether specs were synced (if applicable)
|
|
153
|
+
- Note about any warnings (incomplete artifacts/tasks)
|
|
154
|
+
|
|
155
|
+
**Output On Success**
|
|
156
|
+
|
|
157
|
+
```markdown
|
|
158
|
+
## Archive Complete
|
|
159
|
+
|
|
160
|
+
**Change:** <change-name>
|
|
161
|
+
**Schema:** <schema-name>
|
|
162
|
+
**Archived to:** the archive path derived from `planningHome.changesDir`/<target-name>/
|
|
163
|
+
**Specs:** <"✓ Synced to main specs" only if the step 4 verification passed; otherwise "No delta specs" or "Sync skipped">
|
|
164
|
+
|
|
165
|
+
<"All artifacts complete. All tasks complete." — or, if archived with warnings, list them instead (e.g. "Archived with 2 incomplete tasks")>
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**Guardrails**
|
|
169
|
+
- Announce the selected change; prompt for selection when it is ambiguous
|
|
170
|
+
- Use artifact graph (openspec status --json) for completion checking
|
|
171
|
+
- Don't block archive on warnings - just inform and confirm
|
|
172
|
+
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
|
|
173
|
+
- Show clear summary of what happened
|
|
174
|
+
- If sync is requested, run the `openspec-sync-specs` workflow inline (agent-driven)
|
|
175
|
+
- Never archive while a spec sync is still in flight — run the sync inline and verify the main specs before moving `changeRoot`
|
|
176
|
+
- If delta specs exist, always run the sync assessment and show the combined summary before prompting
|
|
177
|
+
- Apply relevant runtime context and report conflicts; operation guidance remains advisory
|
|
178
|
+
- Consider every guidance entry and explain any inapplicable or conflicting advice
|
|
179
|
+
- Existing CLI checks, resolved paths, prompts, and command contracts are unchanged
|
|
180
|
+
- Artifact rules constrain only the specs being written and are never operation guidance
|
|
181
|
+
- Never copy runtime context, operation guidance, or artifact-rule text verbatim into output files
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openspec-bulk-archive-change
|
|
3
|
+
description: Archive multiple completed changes at once. Use when archiving several parallel changes.
|
|
4
|
+
allowed-tools: Bash(openspec:*)
|
|
5
|
+
license: MIT
|
|
6
|
+
compatibility: Requires openspec CLI.
|
|
7
|
+
metadata:
|
|
8
|
+
author: openspec
|
|
9
|
+
version: "1.0"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Archive multiple completed changes in a single operation.
|
|
13
|
+
|
|
14
|
+
This skill allows you to batch-archive changes, handling spec conflicts intelligently by checking the codebase to determine what's actually implemented.
|
|
15
|
+
|
|
16
|
+
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
|
|
17
|
+
|
|
18
|
+
`<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve the full path from each delta spec when resolving its main spec.
|
|
19
|
+
|
|
20
|
+
**Input**: None required (prompts for selection)
|
|
21
|
+
|
|
22
|
+
**Steps**
|
|
23
|
+
|
|
24
|
+
1. **Get active changes**
|
|
25
|
+
|
|
26
|
+
Run `openspec list --json` to get all active changes.
|
|
27
|
+
|
|
28
|
+
If no active changes exist, inform user and stop.
|
|
29
|
+
|
|
30
|
+
2. **Prompt for change selection**
|
|
31
|
+
|
|
32
|
+
Ask the user to choose changes (multi-select):
|
|
33
|
+
- Show each change with its schema
|
|
34
|
+
- Include an option for "All changes"
|
|
35
|
+
- Allow any number of selections (1+ works, 2+ is the typical use case)
|
|
36
|
+
|
|
37
|
+
**IMPORTANT**: Do NOT auto-select. Always let the user choose.
|
|
38
|
+
|
|
39
|
+
**Load current archive inputs once for the selected root before batch validation:**
|
|
40
|
+
|
|
41
|
+
Choose one selected change from this root and run
|
|
42
|
+
`openspec instructions archive --change "<selected-change>" --json` with the
|
|
43
|
+
same selected-root flags. This lookup is advisory and optional: it only supplies
|
|
44
|
+
extra prompt inputs, so it must never block the batch. If it fails or returns
|
|
45
|
+
invalid JSON — for example on an older CLI that does not support this command
|
|
46
|
+
yet — continue the batch with no context and no operation guidance. Do not
|
|
47
|
+
report an error and do not stop.
|
|
48
|
+
|
|
49
|
+
A valid response may omit `context` and `operationGuidance`. Treat
|
|
50
|
+
`context` as a required prompt-level input across the batch: read and consider
|
|
51
|
+
it, and apply relevant project facts, conventions, and constraints. Treat
|
|
52
|
+
`operationGuidance` as optional additive advice: read and consider every
|
|
53
|
+
entry, and follow entries that are applicable and compatible with the built-in
|
|
54
|
+
batch workflow.
|
|
55
|
+
|
|
56
|
+
Keep both fields separate from conflict analysis, explicit user choices,
|
|
57
|
+
resolved paths, CLI checks, and command contracts. If context conflicts with one
|
|
58
|
+
of those controlling inputs, report the conflict and preserve the controlling
|
|
59
|
+
value. If guidance is inapplicable or conflicts with a controlling input, do not
|
|
60
|
+
follow it and explain why. Do not infer skipped prompts, replacement paths, or
|
|
61
|
+
flags from either field, and do not copy their text verbatim into specs, changes,
|
|
62
|
+
or summaries. These are prompt-level behavior contracts, not enforceable checks.
|
|
63
|
+
|
|
64
|
+
3. **Batch validation - gather status for all selected changes**
|
|
65
|
+
|
|
66
|
+
For each selected change, collect:
|
|
67
|
+
|
|
68
|
+
a. **Artifact status** - Run `openspec status --change "<name>" --json`
|
|
69
|
+
- Parse `schemaName`, `artifacts`, `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`
|
|
70
|
+
- Note which artifacts are `done` vs other states
|
|
71
|
+
|
|
72
|
+
b. **Task completion** - Read `artifactPaths.tasks.existingOutputPaths` from status JSON
|
|
73
|
+
- Count `- [ ]` (incomplete) vs `- [x]` (complete)
|
|
74
|
+
- If no tasks file exists, note as "No tasks"
|
|
75
|
+
|
|
76
|
+
c. **Delta specs** - Check `artifactPaths.specs.existingOutputPaths` from status JSON
|
|
77
|
+
- List which capability specs exist
|
|
78
|
+
- For each, extract requirement names (lines matching `### Requirement: <name>`)
|
|
79
|
+
- Treat this list as the only delta-spec source. If the `specs` entry is
|
|
80
|
+
missing or the list is empty, perform no spec sync or specs-instruction
|
|
81
|
+
lookup for that change; do not infer deltas from unrelated artifacts.
|
|
82
|
+
- Evaluate this independently for every change, including mixed-schema
|
|
83
|
+
batches where some schemas have no `specs` artifact.
|
|
84
|
+
4. **Detect spec conflicts**
|
|
85
|
+
|
|
86
|
+
Build a map keyed by `<capability-path>`, the exact path relative to `specs/`:
|
|
87
|
+
|
|
88
|
+
```text
|
|
89
|
+
identity/user-auth -> [change-a, change-b] <- CONFLICT (2+ changes)
|
|
90
|
+
billing/user-auth -> [change-c] <- OK (different full path)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
A conflict exists when 2+ selected changes have delta specs for the exact same `<capability-path>`.
|
|
94
|
+
|
|
95
|
+
5. **Resolve conflicts agentically**
|
|
96
|
+
|
|
97
|
+
**For each conflict**, investigate the codebase:
|
|
98
|
+
|
|
99
|
+
a. **Read the delta specs** from each conflicting change to understand what each claims to add/modify
|
|
100
|
+
|
|
101
|
+
b. **Search the codebase** for implementation evidence:
|
|
102
|
+
- Look for code implementing requirements from each delta spec
|
|
103
|
+
- Check for related files, functions, or tests
|
|
104
|
+
|
|
105
|
+
c. **Determine resolution**:
|
|
106
|
+
- If only one change is actually implemented -> sync that one's specs
|
|
107
|
+
- If both implemented -> apply in chronological order (older first, newer overwrites)
|
|
108
|
+
- If neither implemented -> skip spec sync, warn user
|
|
109
|
+
|
|
110
|
+
d. **Record resolution** for each conflict:
|
|
111
|
+
- An inclusion or exclusion decision for every delta spec, keyed by change and `<capability-path>`
|
|
112
|
+
- Which included delta specs to apply and in what order
|
|
113
|
+
- Which delta specs to exclude from sync because their implementation is missing
|
|
114
|
+
- Rationale (what was found in codebase)
|
|
115
|
+
|
|
116
|
+
6. **Show consolidated status table**
|
|
117
|
+
|
|
118
|
+
Display a table summarizing all changes:
|
|
119
|
+
|
|
120
|
+
```markdown
|
|
121
|
+
| Change | Artifacts | Tasks | Specs | Conflicts | Status |
|
|
122
|
+
|---------------------|-----------|-------|---------|-----------|--------|
|
|
123
|
+
| schema-management | Done | 5/5 | 2 delta | None | Ready |
|
|
124
|
+
| project-config | Done | 3/3 | 1 delta | None | Ready |
|
|
125
|
+
| add-oauth | Done | 4/4 | 1 delta | identity/user-auth (!) | Ready* |
|
|
126
|
+
| add-verify-skill | 1 left | 2/5 | None | None | Warn |
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
For conflicts, show the resolution:
|
|
130
|
+
```text
|
|
131
|
+
* Conflict resolution:
|
|
132
|
+
- identity/user-auth spec: Will apply add-oauth then add-jwt (both implemented, chronological order)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
For incomplete changes, show warnings:
|
|
136
|
+
```text
|
|
137
|
+
Warnings:
|
|
138
|
+
- add-verify-skill: 1 incomplete artifact, 3 incomplete tasks
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
7. **Confirm batch operation**
|
|
142
|
+
|
|
143
|
+
Ask the user a single confirmation question:
|
|
144
|
+
|
|
145
|
+
- "Archive N changes?" with options based on status
|
|
146
|
+
- Options might include:
|
|
147
|
+
- "Archive all N changes"
|
|
148
|
+
- "Archive only N ready changes (skip incomplete)"
|
|
149
|
+
- "Cancel"
|
|
150
|
+
|
|
151
|
+
If there are incomplete changes, make clear they'll be archived with warnings.
|
|
152
|
+
|
|
153
|
+
Route on the answer by intent, not by exact label — you wrote these labels,
|
|
154
|
+
so match what the user picked rather than the wording above:
|
|
155
|
+
- "Cancel" — stop, do not archive. Report that nothing was archived and skip the remaining steps.
|
|
156
|
+
- The archive-everything option — proceed with every selected change
|
|
157
|
+
- The ready-only option — proceed with only the changes the step 6 table marks `Ready` or `Ready*`, and record the rest as Skipped in step 8d. If a `Ready*` change's conflict partner is skipped, re-derive that conflict's resolution using only the changes being archived.
|
|
158
|
+
- Anything else — ask again rather than archiving
|
|
159
|
+
|
|
160
|
+
Before step 8 writes the first main spec or moves any change, fetch every
|
|
161
|
+
required specs-rule snapshot for the confirmed batch. For each change that will
|
|
162
|
+
sync concrete `artifactPaths.specs.existingOutputPaths`, run
|
|
163
|
+
`openspec instructions specs --change "<name>" --json` exactly once with the
|
|
164
|
+
same selected-root flags. Obtain all snapshots before the first write or move.
|
|
165
|
+
If any lookup exits non-zero or returns invalid artifact-instruction JSON,
|
|
166
|
+
identify the affected change, report the error, and stop the whole batch before
|
|
167
|
+
any main-spec write or change move. Do not treat lookup failure as omitted
|
|
168
|
+
rules. A valid response without `rules` is the no-rules case.
|
|
169
|
+
|
|
170
|
+
8. **Execute archive for each confirmed change**
|
|
171
|
+
|
|
172
|
+
Before processing, carry the recorded decisions from step 5 (after any step 7 re-derivation) into two per-delta sets:
|
|
173
|
+
- `includedDeltas`: all non-conflicting delta specs from confirmed changes plus conflict deltas selected for sync
|
|
174
|
+
- `excludedDeltas`: conflict deltas from confirmed changes excluded because their implementation is missing
|
|
175
|
+
- A single change can have both included and excluded delta specs. Keep the decision per delta; do not collapse it into a per-change sync flag.
|
|
176
|
+
|
|
177
|
+
Process changes in the determined order (respecting conflict resolution):
|
|
178
|
+
|
|
179
|
+
a. **Sync included delta specs**:
|
|
180
|
+
- Run the `openspec-sync-specs` workflow inline (agent-driven intelligent merge) only for changes with entries in `includedDeltas`, passing only the included delta paths and explicitly instructing it to ignore that change's `excludedDeltas`. Wait for it to finish.
|
|
181
|
+
- For conflicts, apply in resolved order.
|
|
182
|
+
- Pass that change's fetched specs-rule snapshot into inline sync; inline
|
|
183
|
+
sync must reuse it without fetching instructions again
|
|
184
|
+
- Apply artifact rules only to main specs produced by that change. They do
|
|
185
|
+
not change conflict resolution, archive behavior, or CLI contracts, and
|
|
186
|
+
their text is not copied into an output file
|
|
187
|
+
- Do not delegate to a background task — step 8c would move `changeRoot` out from under a sync that is still reading it.
|
|
188
|
+
- If a change has no included delta specs, do not run the sync workflow for it.
|
|
189
|
+
|
|
190
|
+
b. **Verify included delta specs before moving changeRoot**:
|
|
191
|
+
- Re-run the comparison only for delta specs in `includedDeltas` against main spec at `<planningHome.root>/openspec/specs/<capability-path>/spec.md` (use the store-aware `planningHome.root` from step 3 status JSON, not a hardcoded repo path).
|
|
192
|
+
- Verify that main specs are updated:
|
|
193
|
+
- ADDED requirements present
|
|
194
|
+
- MODIFIED requirements carrying scenario and description changes named in the delta, with their other scenarios intact
|
|
195
|
+
- REMOVED requirements gone — and where this sync retired a capability (removed its last requirement, leaving `## Requirements` empty), its main spec deleted rather than left empty; a spec the sync deliberately kept and reported is also a match
|
|
196
|
+
- RENAMED requirements present under the new name and absent under the old one
|
|
197
|
+
- Do not verify delta specs in `excludedDeltas`; they are intentionally left unsynced.
|
|
198
|
+
- If sync failed or any capability does not match verification, report what differs and fail/skip moving that change's `changeRoot` — do not archive that change. `changeRoot` remains intact.
|
|
199
|
+
|
|
200
|
+
c. **Perform the archive**:
|
|
201
|
+
|
|
202
|
+
Target name: use the change name as-is when it already starts with a `YYYY-MM-DD-` prefix; otherwise prepend the current date as `YYYY-MM-DD-<name>` (same rule as `openspec archive`).
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
mkdir -p "<planningHome.changesDir>/archive"
|
|
206
|
+
mv "<changeRoot>" "<planningHome.changesDir>/archive/<target-name>"
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
d. **Track outcome** for each change:
|
|
210
|
+
- Success: archived successfully
|
|
211
|
+
- Failed: error during archive or spec verification (record error)
|
|
212
|
+
- Skipped: user chose not to archive (if applicable)
|
|
213
|
+
- Sync skipped: for every delta in `excludedDeltas`, report `sync skipped` with the change, `<capability-path>`, and recorded reason. This is distinct from skipping the archive.
|
|
214
|
+
|
|
215
|
+
9. **Display summary**
|
|
216
|
+
|
|
217
|
+
Show final results:
|
|
218
|
+
|
|
219
|
+
```markdown
|
|
220
|
+
## Bulk Archive Complete
|
|
221
|
+
|
|
222
|
+
Archived 3 changes:
|
|
223
|
+
- schema-management-cli -> archive/2026-01-19-schema-management-cli/
|
|
224
|
+
- project-config -> archive/2026-01-19-project-config/
|
|
225
|
+
- add-oauth -> archive/2026-01-19-add-oauth/
|
|
226
|
+
|
|
227
|
+
Skipped 1 change:
|
|
228
|
+
- add-verify-skill (user chose not to archive incomplete)
|
|
229
|
+
|
|
230
|
+
Spec sync summary:
|
|
231
|
+
- 4 delta specs synced to main specs
|
|
232
|
+
- 1 delta spec sync skipped (add-jwt, identity/user-auth: implementation not found)
|
|
233
|
+
- 1 conflict resolved (identity/user-auth: synced add-oauth, skipped add-jwt)
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
If any failures:
|
|
237
|
+
```text
|
|
238
|
+
Failed 1 change:
|
|
239
|
+
- some-change: Archive directory already exists
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
**Conflict Resolution Examples**
|
|
243
|
+
|
|
244
|
+
Example 1: Only one implemented
|
|
245
|
+
```text
|
|
246
|
+
Conflict: <planningHome.root>/openspec/specs/auth/spec.md touched by [add-oauth, add-jwt]
|
|
247
|
+
|
|
248
|
+
Checking add-oauth:
|
|
249
|
+
- Delta adds "OAuth Provider Integration" requirement
|
|
250
|
+
- Searching codebase... found src/auth/oauth.ts implementing OAuth flow
|
|
251
|
+
|
|
252
|
+
Checking add-jwt:
|
|
253
|
+
- Delta adds "JWT Token Handling" requirement
|
|
254
|
+
- Searching codebase... no JWT implementation found
|
|
255
|
+
|
|
256
|
+
Resolution: Only add-oauth is implemented. Will sync add-oauth specs only.
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Example 2: Both implemented
|
|
260
|
+
```text
|
|
261
|
+
Conflict: <planningHome.root>/openspec/specs/api/spec.md touched by [add-rest-api, add-graphql]
|
|
262
|
+
|
|
263
|
+
Checking add-rest-api (created 2026-01-10):
|
|
264
|
+
- Delta adds "REST Endpoints" requirement
|
|
265
|
+
- Searching codebase... found src/api/rest.ts
|
|
266
|
+
|
|
267
|
+
Checking add-graphql (created 2026-01-15):
|
|
268
|
+
- Delta adds "GraphQL Schema" requirement
|
|
269
|
+
- Searching codebase... found src/api/graphql.ts
|
|
270
|
+
|
|
271
|
+
Resolution: Both implemented. Will apply add-rest-api specs first,
|
|
272
|
+
then add-graphql specs (chronological order, newer takes precedence).
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
**Output On Success**
|
|
276
|
+
|
|
277
|
+
```markdown
|
|
278
|
+
## Bulk Archive Complete
|
|
279
|
+
|
|
280
|
+
Archived N changes:
|
|
281
|
+
- <change-1> -> archive/<target-name-1>/
|
|
282
|
+
- <change-2> -> archive/<target-name-2>/
|
|
283
|
+
|
|
284
|
+
Spec sync summary:
|
|
285
|
+
- N delta specs synced to main specs
|
|
286
|
+
- No conflicts (or: M conflicts resolved)
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
**Output On Partial Success**
|
|
290
|
+
|
|
291
|
+
```markdown
|
|
292
|
+
## Bulk Archive Complete (partial)
|
|
293
|
+
|
|
294
|
+
Archived N changes:
|
|
295
|
+
- <change-1> -> archive/<target-name-1>/
|
|
296
|
+
|
|
297
|
+
Skipped M changes:
|
|
298
|
+
- <change-2> (user chose not to archive incomplete)
|
|
299
|
+
|
|
300
|
+
Failed K changes:
|
|
301
|
+
- <change-3>: Archive directory already exists
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
**Output When No Changes**
|
|
305
|
+
|
|
306
|
+
```markdown
|
|
307
|
+
## No Changes to Archive
|
|
308
|
+
|
|
309
|
+
No active changes found. Create a new change to get started.
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
**Guardrails**
|
|
313
|
+
- Allow any number of changes (1+ is fine, 2+ is the typical use case)
|
|
314
|
+
- Always prompt for selection, never auto-select
|
|
315
|
+
- Detect spec conflicts early and resolve by checking codebase
|
|
316
|
+
- When both changes are implemented, apply specs in chronological order
|
|
317
|
+
- Skip spec sync only when implementation is missing (warn user)
|
|
318
|
+
- Show clear per-change status before confirming
|
|
319
|
+
- Use single confirmation for entire batch
|
|
320
|
+
- Never archive after the user cancels the confirmation — a cancelled batch archives nothing
|
|
321
|
+
- Track and report all outcomes (success/skip/fail)
|
|
322
|
+
- Preserve .openspec.yaml when moving to archive
|
|
323
|
+
- Archive directory target uses current date: YYYY-MM-DD-<name>; a name that already starts with a `YYYY-MM-DD-` prefix is used as-is (never stack a second date)
|
|
324
|
+
- If archive target exists, fail that change but continue with others
|
|
325
|
+
- If sync is requested, run the `openspec-sync-specs` workflow inline (agent-driven) for each change with included delta specs
|
|
326
|
+
- Carry the per-delta `includedDeltas` and `excludedDeltas` decisions into execution; sync and verify only included deltas
|
|
327
|
+
- Report every excluded delta as `sync skipped` without treating the archive itself as skipped
|
|
328
|
+
- Never archive a change while a spec sync is still in flight — run the sync inline and verify main specs at `<planningHome.root>/openspec/specs/<capability-path>/spec.md` before moving `changeRoot`
|
|
329
|
+
- Fetch archive inputs once per selected root before spec inspection or moves
|
|
330
|
+
- Fetch all required specs-rule snapshots before the batch's first main-spec write or move
|
|
331
|
+
- A failed archive-inputs lookup never blocks the batch; it proceeds with no context or guidance
|
|
332
|
+
- A failed specs instruction lookup stops the whole batch atomically
|
|
333
|
+
- Changes without concrete `artifactPaths.specs.existingOutputPaths` continue without spec sync
|
|
334
|
+
- Apply relevant runtime context across the batch and report conflicts
|
|
335
|
+
- Operation guidance remains advisory; consider every entry and explain rejected advice
|
|
336
|
+
- Keep runtime inputs, conflict analysis, CLI-derived values, and artifact rules separate
|
|
337
|
+
- Artifact rules constrain only written specs
|
|
338
|
+
- Never copy runtime input or artifact-rule text verbatim into output files
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openspec-continue-change
|
|
3
|
+
description: Continue working on an OpenSpec change by creating the next artifact. Use when the user wants to progress their change, create the next artifact, or continue their workflow.
|
|
4
|
+
allowed-tools: Bash(openspec:*)
|
|
5
|
+
license: MIT
|
|
6
|
+
compatibility: Requires openspec CLI.
|
|
7
|
+
metadata:
|
|
8
|
+
author: openspec
|
|
9
|
+
version: "1.0"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Continue working on a change by creating the next artifact.
|
|
13
|
+
|
|
14
|
+
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
|
|
15
|
+
|
|
16
|
+
**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.
|
|
17
|
+
|
|
18
|
+
**Steps**
|
|
19
|
+
|
|
20
|
+
1. **Select the change**
|
|
21
|
+
|
|
22
|
+
If a name is provided, use it. Otherwise:
|
|
23
|
+
- Infer from conversation context if the user mentioned a change
|
|
24
|
+
- Auto-select if only one active change exists
|
|
25
|
+
- If ambiguous, run `openspec list --json` to get available changes sorted by most recently modified, and ask the user to select one
|
|
26
|
+
|
|
27
|
+
When prompting, present the top 3-4 most recently modified changes as options, showing:
|
|
28
|
+
- Change name
|
|
29
|
+
- Schema (from `schema` field if present, otherwise "spec-driven")
|
|
30
|
+
- Status (e.g., "0/5 tasks", "complete", "no tasks")
|
|
31
|
+
- How recently it was modified (from `lastModified` field)
|
|
32
|
+
|
|
33
|
+
Mark the most recently modified change as "(Recommended)" since it's likely what the user wants to continue.
|
|
34
|
+
|
|
35
|
+
Always announce: "Using change: <name>" and how to override (e.g., `/openspec-continue-change <other>`).
|
|
36
|
+
|
|
37
|
+
2. **Check current status**
|
|
38
|
+
```bash
|
|
39
|
+
openspec status --change "<name>" --json
|
|
40
|
+
```
|
|
41
|
+
Parse the JSON to understand current state. The response includes:
|
|
42
|
+
- `schemaName`: The workflow schema being used (e.g., "spec-driven")
|
|
43
|
+
- `artifacts`: Array of artifacts with their status ("done", "skipped", "ready", "blocked")
|
|
44
|
+
- `isPlanningComplete`: Boolean indicating if all planning artifacts are complete. Older CLI versions expose the same value as `isComplete`.
|
|
45
|
+
- `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
|
|
46
|
+
|
|
47
|
+
3. **Act based on status**:
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
**If all planning artifacts are complete (`isPlanningComplete: true`, or legacy `isComplete: true`)**:
|
|
52
|
+
- Congratulate the user
|
|
53
|
+
- Show final status including the schema used
|
|
54
|
+
- Suggest: "Planning is complete! You can now implement this change. Once implementation and any tracked work are complete, archive it."
|
|
55
|
+
- STOP
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
**If artifacts are ready to create** (status shows artifacts with `status: "ready"`):
|
|
60
|
+
- Pick the FIRST artifact with `status: "ready"` from the status output
|
|
61
|
+
- Get its instructions:
|
|
62
|
+
```bash
|
|
63
|
+
openspec instructions <artifact-id> --change "<name>" --json
|
|
64
|
+
```
|
|
65
|
+
- Parse the JSON. The key fields are:
|
|
66
|
+
- `context`: Project background (constraints for you - do NOT include in output)
|
|
67
|
+
- `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
|
|
68
|
+
- `template`: The structure to use for your output file
|
|
69
|
+
- `instruction`: Schema-specific guidance
|
|
70
|
+
- `resolvedOutputPath`: Resolved path or pattern to write the artifact
|
|
71
|
+
- `dependencies`: Completed artifacts to read for context (entries with `skipped: true` have no files - do not look for them)
|
|
72
|
+
- `skipped`/`warning`: present when the change declares skip_specs and this artifact must NOT be created - pick another artifact
|
|
73
|
+
- **Create the artifact file**:
|
|
74
|
+
- Read any completed dependency files for context - always re-read them from disk, even if you saw them earlier in the conversation (the user may have edited them)
|
|
75
|
+
- If the `instruction` field delegates creation to a specific skill or command, invoke it to produce the artifact instead of writing the file yourself, then verify the artifact file exists at `resolvedOutputPath`
|
|
76
|
+
- Otherwise use `template` as the structure - fill in its sections
|
|
77
|
+
- Apply `context` and `rules` as constraints when writing - but do NOT copy them into the file
|
|
78
|
+
- Write to the `resolvedOutputPath` specified in instructions. If it is a glob pattern, choose the concrete file path using the schema instruction and the change's context
|
|
79
|
+
- Show what was created and what's now unlocked
|
|
80
|
+
- STOP after creating ONE artifact
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
**If no artifacts are ready (all blocked)**:
|
|
85
|
+
- This shouldn't happen with a valid schema
|
|
86
|
+
- Show status and suggest checking for issues
|
|
87
|
+
|
|
88
|
+
4. **After creating an artifact, show progress**
|
|
89
|
+
```bash
|
|
90
|
+
openspec status --change "<name>"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Output**
|
|
94
|
+
|
|
95
|
+
After each invocation, show:
|
|
96
|
+
- Which artifact was created
|
|
97
|
+
- Schema workflow being used
|
|
98
|
+
- Current progress (N/M complete)
|
|
99
|
+
- What artifacts are now unlocked
|
|
100
|
+
- Prompt: "Want to continue? Just ask me to continue or tell me what to do next."
|
|
101
|
+
|
|
102
|
+
**Artifact Creation Guidelines**
|
|
103
|
+
|
|
104
|
+
The artifact types and their purpose depend on the schema. The `instruction` field from the instructions output is the authoritative guidance for each artifact - follow it even when the artifact has a familiar name (proposal.md, tasks.md, etc.), since custom schemas may define different content or a different process for the same file names.
|
|
105
|
+
|
|
106
|
+
If the `instruction` field directs you to use a specific skill or command to create the artifact, invoke it instead of writing the artifact directly.
|
|
107
|
+
|
|
108
|
+
**Guardrails**
|
|
109
|
+
- Create ONE artifact per invocation
|
|
110
|
+
- Always read dependency artifacts before creating a new one - re-read from disk, not from conversation memory (files may have changed since you last saw them)
|
|
111
|
+
- Never skip artifacts or create out of order
|
|
112
|
+
- If context is unclear, ask the user before creating
|
|
113
|
+
- Verify the artifact file exists after writing before marking progress
|
|
114
|
+
- Use the schema's artifact sequence, don't assume specific artifact names
|
|
115
|
+
- **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
|
|
116
|
+
- Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
|
|
117
|
+
- These guide what you write, but should never appear in the output
|