Skip to content

Support Rebuilding Downstream Artifacts from Modified Intermediate Files #705

@zzing1874

Description

@zzing1874

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:

  1. I run opsx-new → generate proposal.md
  2. I run opsx-continue → generates design.mdtasks.yamlspec.yaml → code
  3. I realize the generated implementation is incorrect or incomplete
  4. I edit proposal.md (or design.md) to refine requirements or design
  5. There is no command like opsx-rebuild --from=proposal to 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 design

This 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 opsx workflow

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-regen or enhance opsx-ff)
  • Accept a --from flag 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-continue only 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions