Repository navigation
Description
Problem Statement
In the current OpenSpec workflow, once a proposal has been applied (via opsx-apply or similar), there is no built-in command to regenerate downstream artifacts (e.g., design.md, tasks.yaml, spec.yaml, or code) after modifying an upstream file like proposal.md or design.md.
For example:
- I run
opsx-new→ generateproposal.md - I run
opsx-continue→ generatesdesign.md→tasks.yaml→spec.yaml→ code - I realize the generated implementation is incorrect or incomplete
- I edit
proposal.md(ordesign.md) to refine requirements or design - There is no command like
opsx-rebuild --from=proposalto re-trigger the pipeline from that point onward
As a result, users are forced to:
- Manually craft prompts for their AI assistant to "reprocess from X file"
- Or delete downstream files and re-run
opsx-continue(which may not be reliable or idempotent) - Or write custom scripts to orchestrate regeneration
This breaks the promise of a declarative, spec-driven workflow, as the toolchain does not support iterative refinement of intermediate artifacts.
Expected Behavior
OpenSpec should provide a command (e.g., opsx-regen, opsx-rebuild, or opsx-ff) that allows users to:
# Regenerate everything starting from proposal.md
openspec regen --from proposal
# Or from design.md
openspec regen --from designThis command would:
- Re-parse the specified upstream file (
proposal.md,design.md, etc.) - Re-generate all dependent downstream artifacts in order
- Preserve user intent and avoid manual prompt engineering
- Integrate cleanly with the existing
opsxworkflow
Why This Matters
Iterative refinement of specs/designs is extremely common during real-world development. The inability to safely and automatically propagate changes from upstream documents undermines the core value proposition of Spec-Driven Development (SDD): “Edit the spec, not the code.”
Without this capability, teams are incentivized to either:
- Edit code directly (breaking SDD discipline), or
- Resort to error-prone manual AI prompting
Suggested Implementation
- Add a new subcommand (e.g.,
opsx-regenor enhanceopsx-ff) - Accept a
--fromflag indicating the starting artifact (proposal,design,tasks) - Re-execute the generation pipeline from that stage forward
- Optionally back up or diff overwritten files for safety
Related Context
- Current commands like
opsx-continueonly resume from the last unexecuted step, not from a modified earlier step. - Users currently work around this by hand-crafting AI prompts referencing specific files — which is fragile and non-scalable.
Thank you for considering this enhancement! This would significantly improve the usability and robustness of OpenSpec for iterative, AI-assisted development.
Activity
21st-connector commentedon Feb 13, 2026
Task completed.
The comment has been posted on issue #705. Here's a summary of what the analysis found:
Key findings:
Existing in-repo proposal — There's already an active change at
openspec/changes/add-artifact-regeneration-support/proposal.mdthat addresses this exact problem with a detailed design covering staleness detection and regeneration capability.6 related open issues — Issues Clarify command (update existing artifacts before continue) #673, How to update specifications during the apply phase? #684, Questions about general workflow of this Openspec SDD #694, Best workflow to fix mistakes in a completed change? #618, Bug Report: spec-driven schema dependency order #695, and Agent does not ask for
/ospx-continue#663 all describe overlapping pain points around the same fundamental gap: no built-in mechanism for iterative refinement of intermediate artifacts.Implementation path — The existing
ArtifactGraphinfrastructure (getBuildOrder(),getNextArtifacts(),detectCompleted()) provides a solid foundation. The main gap is instate.tswhere completion is determined solely by file existence with no modification time tracking, making staleness detection impossible today.Recommendation — Consolidate requirements from this issue and the related ones into the existing change proposal rather than treating them as separate efforts.
View full conversation
Powered by 1Code
21st-connector commentedon Feb 13, 2026
Issue Triage: Codebase Analysis
Existing Work
There is already an active change in the repo that addresses this exact problem:
📁
openspec/changes/add-artifact-regeneration-support/proposal.mdThis proposal covers:
--regenerateflag oncontinue, a separate/opsx:regeneratecommand, or interactive prompts during/opsx:apply).openspec-meta.json), YAML frontmatter in generated artifacts, or git-based mtime comparisonThe proposal explicitly notes the same gap described in this issue: "The documentation claims you can 'update artifacts mid-flight and continue' but there's no mechanism that actually supports this."
Related Open Issues
This issue overlaps significantly with several existing issues:
/opsx-clarifyto update artifacts mid-workflow without auto-continuingdesignonly requiresproposal(notspecs), which affects the regeneration dependency chainRelevant Code
Artifact dependency graph — The pipeline is defined in
schemas/spec-driven/schema.yaml:Key implementation files:
src/core/artifact-graph/graph.ts—ArtifactGraphclass withgetBuildOrder()(topological sort via Kahn's algorithm),getNextArtifacts(),getBlocked(). This is the foundation any regeneration command would build on.src/core/artifact-graph/state.ts:16-31—detectCompleted()determines artifact completion purely by file existence on disk. There is no modification time tracking, which means there's currently no way to detect staleness.src/core/artifact-graph/types.ts— Core types (Artifact,CompletedSet,BlockedArtifacts)src/core/templates/skill-templates.ts— Skill templates for all/opsx:*commands. A new regeneration command would need a template added here.src/cli/index.ts— CLI command definitions (Commander.js). New subcommand would be registered here.Implementation Notes
The
--fromflag proposed in this issue maps well to the existing graph infrastructure. A possible approach:--from=proposal, useArtifactGraph.getBuildOrder()to get the topological orderproposalin the build orderdetectCompleted()will then naturally show them as incompletegetNextArtifacts()will return them as ready (in dependency order)/opsx:continueor/opsx:ffflow can then regenerate themThe main gap is staleness detection —
state.tscurrently only checksfs.existsSync()with no timestamp tracking. The existing proposal's Option A (.openspec-meta.jsonmetadata file) or Option C (git-based) would need to be implemented first.Suggestion
This issue is a near-duplicate of the work already planned in
openspec/changes/add-artifact-regeneration-support/. Consider consolidating the requirements from this issue (#705) and the related issues (#673, #684, #694, #618) into that existing change to capture all the use cases in one place. The--fromflag idea from this issue is a useful addition to the existing proposal's options.docs(openspec): propose add-update-workflow — graph-driven /opsx:upda…
docs(openspec): propose add-update-workflow — graph-driven /opsx:upda…
feat(skills): propose /opsx:update planning-artifact update skill (Fi…
合并英文上游 v1.6.0-beta.1 + 双语解析保住 + 增量汉化 (#5)
clay-good commentedon Aug 5, 2026
This is now covered by the
/opsx:updateworkflow (shipped in the defaultcoreprofile). After you editproposal.mdordesign.md, run/opsx:update <change>: it reads the edit plus the change's other artifacts, reconciles them in either direction, and rewrites the affected downstream artifacts one at a time (with confirmation), then points you to/opsx:applyto carry the revised plan into code (src/core/templates/workflows/update-change.ts). If a specific propagation case isn't handled, please reopen with details.