Skip to content

Conversation

@cylixlee
Copy link

@cylixlee cylixlee commented Dec 19, 2025

Summary

This PR adds a new slash-command openspec-refine for agents, in order to provide guidance for the feedback loop mentioned in README.

The workflow is now:

┌────────────────────┐
│ Draft Change       │
│ Proposal           │
└────────┬───────────┘
         │ share intent with your AI
         ▼
┌────────────────────┐
│ Review & Align     │
│ (edit specs/tasks) │◀─── **REFINE** loop ────┐
└────────┬───────────┘                          │
         │ approved plan                        │
         ▼                                      │
┌────────────────────┐                          │
│ Implement Tasks    │──────────────────────────┘
│ (AI writes code)   │
└────────┬───────────┘
         │ ship the change
         ▼
┌────────────────────┐
│ Archive & Update   │
│ Specs (source)     │
└────────────────────┘

1. Draft a change proposal that captures the spec updates you want.
2. Review the proposal with your AI assistant until everyone agrees.
3. Implement tasks that reference the agreed specs.
4. If apply feedback requires changes, refine proposal artifacts and re-approve before continuing.
5. Archive the change to merge the approved updates back into the source-of-truth specs.

Motivation

There exist some issues about the feedback loop #355, the idea to refine the specs #264, or "rollback apply operation" #302. They all reflect the same occasion: the code implementation generated by calling /openspec-apply often deviates from expectations. To correct the code implementation, users have two choices:

  1. Archive and create a new proposal. To stay in OpenSpec workflow, users can archive the current change, and create a new proposal to refine code implementations. This could lead to unnecessary proposals, and the implemented-then-removed archives may influence the agents, making them more confused.
  2. Talk to agents without a slash-command. Users can instruct the agent to "refine the code and modify the change accordingly". However, without the prompts and guidance provided by OpenSpec, the agents will soon jump out of the OpenSpec workflow and take unexpected actions. That goes against the original intention of OpenSpec: to align humans and AI coding assistants.

Obviously both choices are not ideal. To make the feedback loop practical, a new command shall be introduced.

Compatibility

The new command does not break the compatibility. It does not change the file structure and no OpenSpec CLI commands needed. Moreover, it respects the /openspec-apply command because /openspec-refine does not change the code. Users should call /openspec-apply again after approving the refined change.

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a new refine workflow to modify OpenSpec change proposals after feedback without making code changes
    • Available across multiple IDE integrations including Claude, Cursor, GitHub Copilot, and others
    • Requires explicit re-approval before re-applying refined changes
    • Includes validation checks and prevents unintended scope expansion
  • Documentation

    • Updated documentation with refinement workflow guidance and examples

✏️ Tip: You can customize this high-level summary in your review settings.

@cylixlee cylixlee requested a review from TabishB as a code owner December 19, 2025 10:56
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 19, 2025

Walkthrough

This PR introduces a new "refine" slash command workflow to OpenSpec, enabling users to refine approved change proposals without code edits. The change extends existing CLI initialization and update specifications, adds refine command support across 20+ AI development tools, and updates documentation and templates to guide refinement workflows with re-approval gating and strict validation.

Changes

Cohort / File(s) Summary
Documentation & Configuration
README.md
Replaces "feedback loop" with "refine loop"; adds refinement phase terminology; extends native slash-command tables with new /openspec-refine command for multiple tools; clarifies refinement workflow steps and re-approval requirements.
Specification Documents
openspec/changes/archive/2025-12-19-add-refine-command/proposal.md
openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-init/spec.md
openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-update/spec.md
openspec/changes/archive/2025-12-19-add-refine-command/specs/docs-agent-instructions/spec.md
openspec/changes/archive/2025-12-19-add-refine-command/tasks.md
Introduces comprehensive specifications for refine workflow, detailing slash-command generation for all supported tools, update/refresh semantics (refresh only if exists, do not create missing), and agent instruction guidance for post-apply refinements including re-approval gating and out-of-scope handling.
Production Specifications
openspec/specs/cli-init/spec.md
openspec/specs/cli-update/spec.md
openspec/specs/docs-agent-instructions/spec.md
Extends production specifications to include refine.md generation and updates across all tool scenarios; defines refine workflow guidance (no code edits, strict validation, re-approval required); maintains existing file creation/update behavior.
Base Slash Command Infrastructure
src/core/configurators/slash/base.ts
src/core/templates/slash-command-templates.ts
Adds 'refine' to ALL_COMMANDS array; extends SlashCommandId type to include 'refine'; introduces refineGuardrails, refineSteps, and refineReferences constants for refine workflow content.
Slash Command Configurators
src/core/configurators/slash/amazon-q.ts
src/core/configurators/slash/antigravity.ts
src/core/configurators/slash/auggie.ts
src/core/configurators/slash/claude.ts
src/core/configurators/slash/cline.ts
src/core/configurators/slash/codebuddy.ts
src/core/configurators/slash/codex.ts
src/core/configurators/slash/costrict.ts
src/core/configurators/slash/crush.ts
src/core/configurators/slash/cursor.ts
src/core/configurators/slash/factory.ts
src/core/configurators/slash/gemini.ts
src/core/configurators/slash/github-copilot.ts
src/core/configurators/slash/iflow.ts
src/core/configurators/slash/kilocode.ts
src/core/configurators/slash/opencode.ts
src/core/configurators/slash/qoder.ts
src/core/configurators/slash/qwen.ts
src/core/configurators/slash/roocode.ts
src/core/configurators/slash/windsurf.ts
Adds refine command mappings and frontmatter to FILE_PATHS and FRONTMATTER/DESCRIPTIONS for each tool, enabling refine slash-command generation with tool-specific file paths and descriptions.
Agent Templates
src/core/templates/agents-template.ts
Adds Stage 2.5 "Refining Changes" section with guidelines disallowing code edits, requiring validation and re-approval before re-applying, and halting scope expansions.

Sequence Diagram

sequenceDiagram
    participant User
    participant CLI as OpenSpec CLI
    participant Artifacts as Change Artifacts
    participant Agent as AI Agent
    
    User->>CLI: run apply
    CLI->>Artifacts: apply changes to code
    Artifacts-->>User: changes applied
    
    User->>User: review changes, request refinement
    User->>CLI: run refine <change-id>
    
    CLI->>Agent: provide refine guidance (no code edits)
    Agent->>Artifacts: refine proposal/design/spec deltas only
    Artifacts-->>CLI: refined artifacts
    
    CLI->>User: request re-approval (strict validation)
    
    User->>CLI: approve & run apply again
    CLI->>Artifacts: apply refined changes
    Artifacts-->>User: changes applied
    
    alt Scope expanded
        Agent-->>User: recommend new change PR
    else Out of scope
        Agent-->>User: halt and suggest new change
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Key areas requiring attention:
    • Consistency check across 20+ slash command configurators: verify FILE_PATHS, FRONTMATTER/DESCRIPTIONS mappings are aligned across all tools and follow correct path conventions per tool
    • Specification alignment: confirm cli-init, cli-update, and docs-agent-instructions specs are internally consistent and correctly implement refine workflow rules (e.g., "do not create missing files" on update)
    • Template content: verify refineGuardrails, refineSteps, refineReferences in slash-command-templates.ts are semantically correct and integrate cleanly with existing guardrails
    • Integration boundary: ensure SlashCommandId union type extension does not break existing command routing or type inference elsewhere in codebase

Possibly related PRs

Suggested reviewers

  • TabishB
  • Israel-Laguan

🐰 Hop, hop—the refine loop's here!
No code sneaks in, just thoughts sincere.
Polish proposals, refine the way,
Then approve anew to save the day!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding a new /openspec-refine slash command to support the feedback loop in the OpenSpec workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5e1cef3 and b5f3c06.

📒 Files selected for processing (32)
  • README.md (6 hunks)
  • openspec/changes/archive/2025-12-19-add-refine-command/proposal.md (1 hunks)
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-init/spec.md (1 hunks)
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-update/spec.md (1 hunks)
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/docs-agent-instructions/spec.md (1 hunks)
  • openspec/changes/archive/2025-12-19-add-refine-command/tasks.md (1 hunks)
  • openspec/specs/cli-init/spec.md (1 hunks)
  • openspec/specs/cli-update/spec.md (1 hunks)
  • openspec/specs/docs-agent-instructions/spec.md (1 hunks)
  • src/core/configurators/slash/amazon-q.ts (3 hunks)
  • src/core/configurators/slash/antigravity.ts (1 hunks)
  • src/core/configurators/slash/auggie.ts (2 hunks)
  • src/core/configurators/slash/base.ts (1 hunks)
  • src/core/configurators/slash/claude.ts (2 hunks)
  • src/core/configurators/slash/cline.ts (2 hunks)
  • src/core/configurators/slash/codebuddy.ts (2 hunks)
  • src/core/configurators/slash/codex.ts (2 hunks)
  • src/core/configurators/slash/costrict.ts (3 hunks)
  • src/core/configurators/slash/crush.ts (3 hunks)
  • src/core/configurators/slash/cursor.ts (2 hunks)
  • src/core/configurators/slash/factory.ts (2 hunks)
  • src/core/configurators/slash/gemini.ts (1 hunks)
  • src/core/configurators/slash/github-copilot.ts (2 hunks)
  • src/core/configurators/slash/iflow.ts (2 hunks)
  • src/core/configurators/slash/kilocode.ts (1 hunks)
  • src/core/configurators/slash/opencode.ts (2 hunks)
  • src/core/configurators/slash/qoder.ts (5 hunks)
  • src/core/configurators/slash/qwen.ts (3 hunks)
  • src/core/configurators/slash/roocode.ts (2 hunks)
  • src/core/configurators/slash/windsurf.ts (2 hunks)
  • src/core/templates/agents-template.ts (1 hunks)
  • src/core/templates/slash-command-templates.ts (3 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
openspec/changes/**/*.md

📄 CodeRabbit inference engine (openspec/AGENTS.md)

Scaffold proposal using proposal.md, tasks.md, optional design.md, and delta specs under openspec/changes/<id>/

Files:

  • openspec/changes/archive/2025-12-19-add-refine-command/proposal.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-init/spec.md
  • openspec/changes/archive/2025-12-19-add-refine-command/tasks.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-update/spec.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/docs-agent-instructions/spec.md
openspec/changes/**/specs/**/spec.md

📄 CodeRabbit inference engine (openspec/AGENTS.md)

openspec/changes/**/specs/**/spec.md: Use ## ADDED|MODIFIED|REMOVED|RENAMED Requirements headers in spec delta files
Include at least one #### Scenario: per requirement in spec delta files
Use #### Scenario: Name format (4 hashtags) for scenario headers, not bullets or bold text
Use ## ADDED Requirements for new orthogonal capabilities that can stand alone; use ## MODIFIED Requirements for behavior changes of existing requirements
When using MODIFIED Requirements, paste the full requirement block including header and all scenarios

Files:

  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-init/spec.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-update/spec.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/docs-agent-instructions/spec.md
openspec/specs/**/spec.md

📄 CodeRabbit inference engine (openspec/AGENTS.md)

Use SHALL/MUST for normative requirements in spec files; avoid should/may unless intentionally non-normative

Files:

  • openspec/specs/docs-agent-instructions/spec.md
  • openspec/specs/cli-update/spec.md
  • openspec/specs/cli-init/spec.md
🧠 Learnings (21)
📓 Common learnings
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:02.839Z
Learning: Use `@/openspec/AGENTS.md` to learn how to create and apply change proposals, spec format and conventions, and project structure and guidelines
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:02.839Z
Learning: Always open `@/openspec/AGENTS.md` when the request mentions planning or proposals (words like proposal, spec, change, plan), introduces new capabilities, breaking changes, architecture shifts, or performance/security work, or sounds ambiguous and needs the authoritative spec before coding
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Run `openspec validate [change-id] --strict` before requesting approval
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/*.md : Scaffold proposal using `proposal.md`, `tasks.md`, optional `design.md`, and delta specs under `openspec/changes/<id>/`
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/*/proposal.md : Ensure `proposal.md` includes sections: Why (1-2 sentences), What Changes (bullet list with breaking change markers), and Impact (affected specs and code)
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/*.md : Scaffold proposal using `proposal.md`, `tasks.md`, optional `design.md`, and delta specs under `openspec/changes/<id>/`

Applied to files:

  • openspec/changes/archive/2025-12-19-add-refine-command/proposal.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-init/spec.md
  • src/core/configurators/slash/gemini.ts
  • src/core/templates/slash-command-templates.ts
  • src/core/configurators/slash/iflow.ts
  • src/core/configurators/slash/amazon-q.ts
  • openspec/changes/archive/2025-12-19-add-refine-command/tasks.md
  • openspec/specs/docs-agent-instructions/spec.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-update/spec.md
  • src/core/configurators/slash/github-copilot.ts
  • src/core/configurators/slash/auggie.ts
  • src/core/configurators/slash/costrict.ts
  • openspec/specs/cli-update/spec.md
  • src/core/configurators/slash/codebuddy.ts
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/docs-agent-instructions/spec.md
  • openspec/specs/cli-init/spec.md
  • src/core/configurators/slash/crush.ts
  • src/core/configurators/slash/qoder.ts
  • src/core/configurators/slash/claude.ts
  • src/core/templates/agents-template.ts
  • src/core/configurators/slash/factory.ts
  • README.md
  • src/core/configurators/slash/opencode.ts
  • src/core/configurators/slash/cursor.ts
📚 Learning: 2025-11-25T01:08:02.839Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:02.839Z
Learning: Use `@/openspec/AGENTS.md` to learn how to create and apply change proposals, spec format and conventions, and project structure and guidelines

Applied to files:

  • openspec/changes/archive/2025-12-19-add-refine-command/proposal.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-init/spec.md
  • src/core/templates/slash-command-templates.ts
  • src/core/configurators/slash/iflow.ts
  • src/core/configurators/slash/amazon-q.ts
  • openspec/changes/archive/2025-12-19-add-refine-command/tasks.md
  • openspec/specs/docs-agent-instructions/spec.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-update/spec.md
  • src/core/configurators/slash/github-copilot.ts
  • src/core/configurators/slash/auggie.ts
  • src/core/configurators/slash/costrict.ts
  • openspec/specs/cli-update/spec.md
  • src/core/configurators/slash/codebuddy.ts
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/docs-agent-instructions/spec.md
  • src/core/configurators/slash/codex.ts
  • openspec/specs/cli-init/spec.md
  • src/core/configurators/slash/crush.ts
  • src/core/configurators/slash/qoder.ts
  • src/core/configurators/slash/claude.ts
  • src/core/templates/agents-template.ts
  • src/core/configurators/slash/factory.ts
  • README.md
  • src/core/configurators/slash/opencode.ts
  • src/core/configurators/slash/cursor.ts
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Run `openspec validate [change-id] --strict` before requesting approval

Applied to files:

  • openspec/changes/archive/2025-12-19-add-refine-command/proposal.md
  • src/core/configurators/slash/iflow.ts
  • src/core/configurators/slash/amazon-q.ts
  • openspec/changes/archive/2025-12-19-add-refine-command/tasks.md
  • src/core/configurators/slash/github-copilot.ts
  • src/core/configurators/slash/auggie.ts
  • src/core/configurators/slash/costrict.ts
  • src/core/configurators/slash/codebuddy.ts
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/docs-agent-instructions/spec.md
  • src/core/configurators/slash/codex.ts
  • src/core/configurators/slash/crush.ts
  • src/core/configurators/slash/qoder.ts
  • src/core/configurators/slash/claude.ts
  • src/core/templates/agents-template.ts
  • src/core/configurators/slash/factory.ts
  • README.md
  • src/core/configurators/slash/opencode.ts
  • src/core/configurators/slash/cursor.ts
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/specs/**/spec.md : Use `## ADDED|MODIFIED|REMOVED|RENAMED Requirements` headers in spec delta files

Applied to files:

  • openspec/changes/archive/2025-12-19-add-refine-command/proposal.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-init/spec.md
  • src/core/configurators/slash/iflow.ts
  • src/core/configurators/slash/amazon-q.ts
  • openspec/specs/docs-agent-instructions/spec.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-update/spec.md
  • src/core/configurators/slash/github-copilot.ts
  • src/core/configurators/slash/auggie.ts
  • src/core/configurators/slash/costrict.ts
  • openspec/specs/cli-update/spec.md
  • src/core/configurators/slash/codebuddy.ts
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/docs-agent-instructions/spec.md
  • openspec/specs/cli-init/spec.md
  • src/core/configurators/slash/crush.ts
  • src/core/configurators/slash/qoder.ts
  • src/core/configurators/slash/claude.ts
  • src/core/configurators/slash/factory.ts
  • README.md
  • src/core/configurators/slash/cursor.ts
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/*/proposal.md : Ensure `proposal.md` includes sections: Why (1-2 sentences), What Changes (bullet list with breaking change markers), and Impact (affected specs and code)

Applied to files:

  • openspec/changes/archive/2025-12-19-add-refine-command/proposal.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-init/spec.md
  • src/core/templates/slash-command-templates.ts
  • src/core/configurators/slash/amazon-q.ts
  • openspec/specs/docs-agent-instructions/spec.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-update/spec.md
  • src/core/configurators/slash/auggie.ts
  • src/core/configurators/slash/costrict.ts
  • openspec/specs/cli-update/spec.md
  • src/core/configurators/slash/codebuddy.ts
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/docs-agent-instructions/spec.md
  • openspec/specs/cli-init/spec.md
  • src/core/configurators/slash/crush.ts
  • src/core/configurators/slash/qoder.ts
  • src/core/configurators/slash/claude.ts
  • src/core/templates/agents-template.ts
  • src/core/configurators/slash/factory.ts
  • README.md
📚 Learning: 2025-11-25T01:08:02.839Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:02.839Z
Learning: Always open `@/openspec/AGENTS.md` when the request mentions planning or proposals (words like proposal, spec, change, plan), introduces new capabilities, breaking changes, architecture shifts, or performance/security work, or sounds ambiguous and needs the authoritative spec before coding

Applied to files:

  • openspec/changes/archive/2025-12-19-add-refine-command/proposal.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-init/spec.md
  • src/core/templates/slash-command-templates.ts
  • src/core/configurators/slash/amazon-q.ts
  • openspec/changes/archive/2025-12-19-add-refine-command/tasks.md
  • openspec/specs/docs-agent-instructions/spec.md
  • src/core/configurators/slash/costrict.ts
  • openspec/specs/cli-update/spec.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/docs-agent-instructions/spec.md
  • openspec/specs/cli-init/spec.md
  • src/core/configurators/slash/qoder.ts
  • README.md
  • src/core/configurators/slash/opencode.ts
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/specs/**/spec.md : Use `## ADDED Requirements` for new orthogonal capabilities that can stand alone; use `## MODIFIED Requirements` for behavior changes of existing requirements

Applied to files:

  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-init/spec.md
  • src/core/configurators/slash/iflow.ts
  • openspec/specs/docs-agent-instructions/spec.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-update/spec.md
  • src/core/configurators/slash/auggie.ts
  • src/core/configurators/slash/costrict.ts
  • openspec/specs/cli-update/spec.md
  • src/core/configurators/slash/codebuddy.ts
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/docs-agent-instructions/spec.md
  • openspec/specs/cli-init/spec.md
  • src/core/configurators/slash/crush.ts
  • src/core/configurators/slash/qoder.ts
  • src/core/configurators/slash/claude.ts
  • src/core/configurators/slash/factory.ts
  • README.md
  • src/core/configurators/slash/cursor.ts
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/specs/**/spec.md : When using MODIFIED Requirements, paste the full requirement block including header and all scenarios

Applied to files:

  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-init/spec.md
  • openspec/specs/docs-agent-instructions/spec.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-update/spec.md
  • openspec/specs/cli-update/spec.md
  • src/core/configurators/slash/codebuddy.ts
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/docs-agent-instructions/spec.md
  • src/core/configurators/slash/crush.ts
  • src/core/configurators/slash/qoder.ts
  • src/core/configurators/slash/claude.ts
📚 Learning: 2025-11-17T12:07:21.701Z
Learnt from: ydai-hub
Repo: Fission-AI/OpenSpec PR: 268
File: src/core/configurators/iflow.ts:14-21
Timestamp: 2025-11-17T12:07:21.701Z
Learning: In the OpenSpec repository, `TemplateManager.getClaudeTemplate()` returns a generic template that works for iFlow and other CLI tools, not just Claude-specific content. It's acceptable to use this template across different tool configurators.

Applied to files:

  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-init/spec.md
  • openspec/specs/cli-init/spec.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/specs/**/spec.md : Include at least one `#### Scenario:` per requirement in spec delta files

Applied to files:

  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-init/spec.md
  • openspec/specs/docs-agent-instructions/spec.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-update/spec.md
  • openspec/specs/cli-update/spec.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/docs-agent-instructions/spec.md
  • openspec/specs/cli-init/spec.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Use kebab-case, verb-led change IDs: `add-`, `update-`, `remove-`, `refactor-`

Applied to files:

  • src/core/templates/slash-command-templates.ts
  • src/core/configurators/slash/amazon-q.ts
  • src/core/configurators/slash/auggie.ts
  • src/core/configurators/slash/costrict.ts
  • src/core/configurators/slash/codex.ts
  • src/core/configurators/slash/qoder.ts
  • src/core/configurators/slash/factory.ts
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Use `openspec archive <change-id> --skip-specs --yes` for tooling-only changes

Applied to files:

  • src/core/configurators/slash/iflow.ts
  • src/core/configurators/slash/amazon-q.ts
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-update/spec.md
  • src/core/configurators/slash/github-copilot.ts
  • src/core/configurators/slash/auggie.ts
  • src/core/configurators/slash/costrict.ts
  • src/core/configurators/slash/codebuddy.ts
  • src/core/configurators/slash/codex.ts
  • src/core/configurators/slash/crush.ts
  • src/core/configurators/slash/qoder.ts
  • src/core/configurators/slash/claude.ts
  • src/core/configurators/slash/factory.ts
  • README.md
  • src/core/configurators/slash/opencode.ts
  • src/core/configurators/slash/cursor.ts
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/*/tasks.md : Ensure `tasks.md` contains implementation checklist with numbered sections and checkbox items

Applied to files:

  • src/core/configurators/slash/iflow.ts
  • openspec/specs/docs-agent-instructions/spec.md
  • src/core/configurators/slash/github-copilot.ts
  • src/core/configurators/slash/auggie.ts
  • src/core/configurators/slash/costrict.ts
  • src/core/configurators/slash/codebuddy.ts
  • src/core/configurators/slash/crush.ts
  • src/core/configurators/slash/qoder.ts
  • src/core/configurators/slash/claude.ts
  • src/core/templates/agents-template.ts
  • src/core/configurators/slash/factory.ts
  • README.md
  • src/core/configurators/slash/cursor.ts
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Check `openspec/project.md` for project conventions before creating specs

Applied to files:

  • src/core/configurators/slash/iflow.ts
  • src/core/configurators/slash/codebuddy.ts
  • src/core/configurators/slash/crush.ts
  • src/core/configurators/slash/qoder.ts
  • src/core/configurators/slash/claude.ts
  • README.md
  • src/core/configurators/slash/cursor.ts
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Search existing work using `openspec spec list --long`, `openspec list` for enumerating changes; use `rg` only for full-text search

Applied to files:

  • src/core/configurators/slash/iflow.ts
  • README.md
  • src/core/configurators/slash/cursor.ts
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Create `design.md` only when needed: cross-cutting changes, new external dependencies, significant data model changes, security/performance complexity, or pre-coding ambiguity

Applied to files:

  • openspec/specs/docs-agent-instructions/spec.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-update/spec.md
  • openspec/specs/cli-update/spec.md
  • openspec/specs/cli-init/spec.md
  • README.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/specs/**/spec.md : Use SHALL/MUST for normative requirements in spec files; avoid should/may unless intentionally non-normative

Applied to files:

  • openspec/specs/docs-agent-instructions/spec.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-update/spec.md
  • openspec/changes/archive/2025-12-19-add-refine-command/specs/docs-agent-instructions/spec.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Use `file.ts:42` format for code location references and `specs/auth/spec.md` format for spec references

Applied to files:

  • src/core/configurators/slash/costrict.ts
  • src/core/configurators/slash/qoder.ts
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/specs/**/spec.md : Use `#### Scenario: Name` format (4 hashtags) for scenario headers, not bullets or bold text

Applied to files:

  • openspec/specs/cli-update/spec.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Do not start implementation until proposal is approved

Applied to files:

  • src/core/templates/agents-template.ts
🧬 Code graph analysis (5)
src/core/configurators/slash/gemini.ts (1)
src/core/templates/slash-command-templates.ts (1)
  • SlashCommandId (1-1)
src/core/templates/slash-command-templates.ts (1)
src/core/templates/index.ts (1)
  • SlashCommandId (50-50)
src/core/configurators/slash/base.ts (1)
src/core/templates/slash-command-templates.ts (1)
  • SlashCommandId (1-1)
src/core/configurators/slash/qwen.ts (1)
src/core/templates/slash-command-templates.ts (1)
  • SlashCommandId (1-1)
src/core/configurators/slash/qoder.ts (1)
src/core/templates/slash-command-templates.ts (1)
  • SlashCommandId (1-1)
🪛 LanguageTool
openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-init/spec.md

[uncategorized] ~70-~70: The official name of this software platform is spelled with a capital “H”.
Context: ...during initialization - THEN create .github/prompts/openspec-proposal.prompt.md, `...

(GITHUB)


[uncategorized] ~70-~70: The official name of this software platform is spelled with a capital “H”.
Context: ...b/prompts/openspec-proposal.prompt.md, .github/prompts/openspec-apply.prompt.md, .gi...

(GITHUB)


[uncategorized] ~70-~70: The official name of this software platform is spelled with a capital “H”.
Context: ...thub/prompts/openspec-apply.prompt.md, .github/prompts/openspec-refine.prompt.md`, and...

(GITHUB)

openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-update/spec.md

[uncategorized] ~65-~65: The official name of this software platform is spelled with a capital “H”.
Context: ... commands for GitHub Copilot - WHEN .github/prompts/ contains `openspec-proposal.p...

(GITHUB)

openspec/specs/cli-update/spec.md

[uncategorized] ~115-~115: The official name of this software platform is spelled with a capital “H”.
Context: ... commands for GitHub Copilot - WHEN .github/prompts/ contains `openspec-proposal.p...

(GITHUB)

openspec/specs/cli-init/spec.md

[uncategorized] ~240-~240: The official name of this software platform is spelled with a capital “H”.
Context: ...during initialization - THEN create .github/prompts/openspec-proposal.prompt.md, `...

(GITHUB)


[uncategorized] ~240-~240: The official name of this software platform is spelled with a capital “H”.
Context: ...b/prompts/openspec-proposal.prompt.md, .github/prompts/openspec-apply.prompt.md, .gi...

(GITHUB)


[uncategorized] ~240-~240: The official name of this software platform is spelled with a capital “H”.
Context: ...thub/prompts/openspec-apply.prompt.md, .github/prompts/openspec-refine.prompt.md`, and...

(GITHUB)

README.md

[uncategorized] ~108-~108: The official name of this software platform is spelled with a capital “H”.
Context: .../openspec-refine, /openspec-archive (.github/prompts/`) ...

(GITHUB)

🪛 markdownlint-cli2 (0.18.1)
openspec/changes/archive/2025-12-19-add-refine-command/proposal.md

5-5: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


11-11: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


17-17: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


23-23: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

🔇 Additional comments (48)
openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-update/spec.md (1)

1-85: Spec structure and formatting comply with guidelines.

The requirement properly uses ## MODIFIED Requirements header, includes 14 comprehensive scenarios with correct #### Scenario: Name format (4 hashtags), and employs normative "SHALL" language per coding guidelines. All scenarios consistently address the core concern: refreshing existing slash command files without creating new ones, and specify tool-specific implementation details (TOML markers, YAML preservation, frontmatter handling, etc.).

The compound requirement (lines 1–3) addresses both updating slash commands across all tools and ensuring OpenCode archive accepts change ID arguments. This dual concern is properly scoped: the first part applies broadly across all tool scenarios, while the second is appropriately isolated to the OpenCode scenario (lines 39–43). The inclusion of refine.md across all scenarios aligns with the PR objective of adding /openspec-refine support.

src/core/templates/agents-template.ts (1)

59-66: LGTM! Clear refine workflow boundaries defined.

The Stage 2.5 documentation clearly articulates the refine workflow's scope and constraints. The explicit "No code edits" directive and re-approval gate align well with the PR's goal of preventing agents from deviating during refinement iterations.

openspec/changes/archive/2025-12-19-add-refine-command/specs/docs-agent-instructions/spec.md (1)

1-12: LGTM! Specification follows OpenSpec conventions.

The requirement correctly uses ## ADDED Requirements for a new orthogonal capability, includes a properly formatted #### Scenario:, and uses normative SHALL language. The scenario comprehensively covers all aspects of refine workflow guidance that must appear in generated instructions.

Based on coding guidelines for spec delta files.

openspec/changes/archive/2025-12-19-add-refine-command/tasks.md (1)

1-15: LGTM! Task checklist follows conventions.

The task structure follows the required format with numbered sections and checkbox items. All implementation steps are complete and include the mandatory validation step with --strict flag.

Based on learnings for tasks.md structure.

openspec/changes/archive/2025-12-19-add-refine-command/specs/cli-init/spec.md (1)

1-97: LGTM! Comprehensive slash command expansion following guidelines.

The requirement correctly uses ## MODIFIED Requirements and includes the full requirement block with all scenarios as required. Each scenario properly documents refine.md generation alongside existing commands, maintaining tool-specific formatting requirements (YAML frontmatter, TOML structure, OpenSpec markers, etc.).

Note: The static analysis hints about .github capitalization are false positives—this is the correct directory name per GitHub conventions for storing workflows and prompts.

Based on coding guidelines for MODIFIED Requirements in spec delta files.

src/core/configurators/slash/windsurf.ts (1)

4-28: LGTM! Consistent refine command integration.

The refine entry correctly extends both the file path mapping and frontmatter descriptions. The description "Refine an approved OpenSpec change without editing code" clearly communicates the command's purpose and matches the pattern used across other configurators.

src/core/configurators/slash/antigravity.ts (1)

4-29: LGTM! Refine command properly integrated.

The additions correctly extend the Antigravity configurator with the refine command, following the same pattern as proposal/apply/archive. The description is consistent with other configurators.

src/core/configurators/slash/codebuddy.ts (1)

4-36: LGTM! Complete refine command integration with proper frontmatter.

The refine command addition follows CodeBuddy's established YAML frontmatter pattern with name, description, category, and tags. The frontmatter structure is consistent with other commands, and the trailing delimiter on line 23 aligns the apply block formatting with the new refine entry.

src/core/configurators/slash/kilocode.ts (1)

4-9: LGTM! The refine path mapping follows the established pattern and is correctly typed. The SlashCommandId type union includes 'refine', ensuring compile-time safety for the FILE_PATHS mapping.

src/core/configurators/slash/costrict.ts (2)

7-7: LGTM: Refine command path added.

The refine path mapping is correctly added and follows the existing pattern for other commands.


20-23: LGTM: Refine frontmatter added.

The frontmatter block for the refine command is well-structured with appropriate description and argument-hint, consistent with other commands in this configurator.

src/core/configurators/slash/opencode.ts (2)

9-9: LGTM: Refine command path added.

The refine path mapping follows the established pattern for OpenCode commands.


30-37: LGTM: Comprehensive refine frontmatter added.

The frontmatter provides clear instructions with the UserRequest template, maintaining consistency with the apply command's structure while appropriately describing the refinement workflow.

src/core/configurators/slash/claude.ts (2)

7-7: LGTM: Refine command path added.

The refine path mapping is correctly placed in the FILE_PATHS record.


24-29: LGTM: Refine frontmatter added with proper metadata.

The frontmatter includes all required fields (name, description, category, tags) consistent with Claude's command structure.

src/core/configurators/slash/base.ts (1)

11-11: LGTM: Core change enables refine command across all configurators.

The addition of 'refine' to ALL_COMMANDS properly extends the slash command framework. This change is type-safe and consistent with the SlashCommandId type expansion.

src/core/configurators/slash/roocode.ts (2)

7-7: LGTM: Refine command path added.

The refine path mapping is correctly added to NEW_FILE_PATHS.


23-23: LGTM: Refine description added.

The description is concise and consistent with the command's purpose across all configurators.

src/core/configurators/slash/github-copilot.ts (2)

7-7: LGTM: Refine command path added.

The refine path mapping follows GitHub Copilot's prompt file naming convention.


22-26: LGTM: Refine frontmatter added.

The frontmatter structure with description and $ARGUMENTS placeholder is consistent with other GitHub Copilot commands.

src/core/configurators/slash/amazon-q.ts (2)

7-7: LGTM: Refine command path added.

The refine path mapping is correctly added to Amazon Q's prompts directory structure.


30-38: LGTM: Detailed refine frontmatter added.

The frontmatter provides comprehensive guidance for the refine workflow with clear instructions and the UserRequest template, maintaining consistency with Amazon Q's command structure.

src/core/configurators/slash/auggie.ts (2)

7-7: LGTM: Refine command path added.

The refine path mapping is correctly added to Auggie's commands directory.


20-23: LGTM: Refine frontmatter added.

The frontmatter includes appropriate description and argument-hint fields, consistent with Auggie's command structure.

src/core/configurators/slash/cline.ts (1)

7-7: LGTM: Refine command integration is clean and consistent.

The refine command path and description follow the established pattern for Cline slash commands. The description clearly communicates that refinement happens without code edits.

Also applies to: 23-23

src/core/configurators/slash/qoder.ts (2)

16-17: LGTM: Well-documented refine command addition.

The refine command is properly integrated with comprehensive inline documentation and YAML frontmatter. The tags and categorization align with the existing command structure.

Also applies to: 41-46


59-59: Good practice: Documentation kept in sync.

The class and method documentation has been updated to reflect the new four-command workflow, maintaining consistency across the codebase.

Also applies to: 74-74, 87-87

src/core/configurators/slash/factory.ts (1)

7-7: LGTM: Refine command with appropriate argument hints.

The refine command is properly integrated with Factory's slash command system. The argument-hint "change-id and refinement notes" appropriately guides users on the expected input format.

Also applies to: 20-23

src/core/configurators/slash/gemini.ts (1)

7-7: LGTM: Refine command properly configured for Gemini's TOML format.

The refine command is correctly integrated using Gemini's TOML-based slash command structure. The file path and description are consistent with the other commands.

Also applies to: 14-14

src/core/configurators/slash/cursor.ts (1)

7-7: LGTM: Refine command properly integrated with Cursor's frontmatter format.

The refine command follows Cursor's established pattern with proper name, id, category, and description fields. The slash command format (/openspec-refine) is consistent with the other commands.

Also applies to: 24-29

openspec/specs/docs-agent-instructions/spec.md (1)

39-50: LGTM: Normative requirement with clear refine workflow guidance.

The new requirement uses proper normative language (SHALL) and provides comprehensive guidance for the refine workflow. The scenario clearly specifies:

  • Refinement is limited to proposal artifacts (no code edits)
  • Re-approval is mandatory before proceeding
  • Scope expansions should trigger a new change proposal
  • Strict validation is required post-refinement

This aligns well with the PR objectives and maintains consistency with OpenSpec conventions.

As per coding guidelines, the requirement correctly uses SHALL for normative specifications.

src/core/templates/slash-command-templates.ts (3)

1-1: LGTM: Type definition extended to support refine command.

The SlashCommandId type now correctly includes 'refine' alongside the existing proposal, apply, and archive commands.


37-55: LGTM: Comprehensive refine workflow with strong guardrails.

The refine command implementation includes:

Strong guardrails (lines 37-38):

  • Explicit prohibition on code edits during refine
  • Scope expansion prevention with recommendation to create new changes
  • User-driven refinement requirements

Robust change ID resolution (lines 40-45):

  • Multiple fallback strategies for determining the change ID
  • Handles various input formats (explicit blocks, slash command args, conversation context)
  • Appropriate validation via openspec list

Clear workflow (lines 46-52):

  • Updates limited to proposal artifacts (proposal, design, tasks, spec deltas)
  • Maintains spec format requirements (#### Scenario: entries)
  • Mandatory strict validation before completion
  • Explicit re-approval gate before any apply work continues

The implementation effectively prevents agents from deviating into uncontrolled refinements while maintaining flexibility in how users invoke the command.


74-74: LGTM: Refine command body properly wired into the template system.

The refine command is correctly composed from guardrails, steps, and references, following the same pattern as the other commands.

src/core/configurators/slash/qwen.ts (2)

18-18: LGTM: Refine command properly configured for Qwen's TOML format.

The refine command is correctly integrated with the appropriate TOML file path and consistent description. The implementation follows Qwen's established slash command patterns.

Also applies to: 25-25


36-37: Good practice: Documentation reflects the complete command set.

The class documentation has been updated to enumerate all four slash commands, including the new /openspec-refine command, maintaining clarity for future maintainers.

src/core/configurators/slash/codex.ts (2)

12-12: LGTM: Refine command path added correctly.

The refine entry follows the established naming convention and is consistent with other command paths.


40-45: LGTM: Frontmatter block is well-structured.

The frontmatter correctly includes description, argument-hint, and the $ARGUMENTS placeholder, matching the pattern used by other commands.

openspec/changes/archive/2025-12-19-add-refine-command/proposal.md (1)

1-31: LGTM: Proposal structure follows guidelines.

The proposal correctly includes Why (motivation), What Changes (with detailed From/To/Reason/Impact breakdown), and Impact sections as required by the coding guidelines.

src/core/configurators/slash/iflow.ts (2)

7-7: LGTM: Refine command path added correctly.

The refine entry follows the iflow naming convention and is consistent with other command paths.


24-29: LGTM: Frontmatter block is complete.

The frontmatter correctly includes all required fields (name, id, category, description) and follows the iflow pattern.

src/core/configurators/slash/crush.ts (2)

7-7: LGTM: Refine command path added correctly.

The refine entry follows the crush naming convention and is consistent with other command paths.


24-29: LGTM: Frontmatter block is complete.

The frontmatter correctly includes all required fields (name, description, category, tags) and follows the crush pattern with appropriate tags.

openspec/specs/cli-update/spec.md (1)

56-56: LGTM: Refine command integration is consistent across all tools.

All tool scenarios correctly include refine.md in their respective file lists, maintaining consistency with the existing proposal.md, apply.md, and archive.md pattern. The spec follows the required SHALL/MUST normative language.

Also applies to: 61-61, 66-66, 72-72, 78-78, 83-83, 90-90, 96-96, 102-102, 108-108, 115-115, 121-122, 127-127

openspec/specs/cli-init/spec.md (1)

177-177: LGTM: Refine command initialization is consistent across all tools.

All tool scenarios correctly include refine.md in their file generation steps, maintaining consistency with the existing three-file pattern (proposal, apply, archive). The spec follows the required SHALL/MUST normative language and proper scenario format.

Also applies to: 183-183, 189-189, 196-196, 203-203, 209-209, 216-216, 222-222, 228-228, 234-234, 240-240, 248-251, 255-255, 263-263

README.md (3)

63-83: LGTM: Workflow diagram clearly illustrates the refine loop.

The updated workflow diagram effectively shows how the refine loop connects the implementation stage back to the Review & Align stage, making the iterative refinement process clear to users.


94-116: LGTM: Tool table comprehensively documents refine command support.

The table consistently includes the refine command for all supported tools with correct path specifications and command syntax. The documentation is thorough and follows the established pattern.


207-215: LGTM: Getting Started section effectively demonstrates refine workflow.

The updated example clearly shows how to use the refine command in both natural language and slash command forms, with practical context about when to refine proposal artifacts.

Teams often need to adjust an approved change after an apply pass produces unexpected results. Today that forces either a brand-new proposal or ad-hoc instructions outside the OpenSpec workflow. A dedicated refine command keeps adjustments inside the workflow while enforcing re-approval and leaving code changes to apply.

## What Changes
**Slash command templates**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Use markdown headings instead of bold text for subsections.

The subsection titles "Slash command templates", "Init scaffolding", "Update behavior", and "Agent instructions" are using bold emphasis rather than proper markdown headings. This affects document structure and readability.

🔎 Proposed fix
 ## What Changes
-**Slash command templates**
+### Slash command templates
 - From: Only `proposal`, `apply`, and `archive` shared templates exist.
 - To: Add a `refine` shared template that updates proposal/design/tasks/spec deltas only, runs strict validation, and stops for re-approval.
 - Reason: Provide a first-class refinement loop without mixing in code changes.
 - Impact: New `openspec-refine` command body and template entry.
 
-**Init scaffolding**
+### Init scaffolding
 - From: `openspec init` scaffolds proposal/apply/archive command files.
 - To: Scaffold refine command files alongside the existing three for every supported tool.
 - Reason: Make refine available wherever slash commands are generated.
 - Impact: One additional command file per tool.
 
-**Update behavior**
+### Update behavior
 - From: `openspec update` refreshes only proposal/apply/archive command files.
 - To: Refresh refine files when they already exist, without creating missing ones.
 - Reason: Keep refine guidance current while preserving update semantics.
 - Impact: Update covers refine templates too.
 
-**Agent instructions**
+### Agent instructions
 - From: The workflow guidance focuses on proposal → apply → archive only.
 - To: Add refine guidance for post-apply adjustments, including no code changes, re-approval gating, and out-of-scope handling.
 - Reason: Keep the documented workflow aligned with the new command.
 - Impact: Updated `openspec/AGENTS.md` content.

Also applies to: 11-11, 17-17, 23-23

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

5-5: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

🤖 Prompt for AI Agents
In openspec/changes/archive/2025-12-19-add-refine-command/proposal.md around
lines 5, 11, 17, and 23, replace the subsection titles currently formatted with
bold emphasis (e.g., **Slash command templates**, **Init scaffolding**, **Update
behavior**, **Agent instructions**) with proper markdown headings (use an
appropriate level such as "##" or "###") so they become real document headings;
update each instance so the heading syntax is used and remove the surrounding
bold markup to improve document structure and readability.

@cylixlee
Copy link
Author

Hi @TabishB, do you think we should convert this PR to draft if you're cautious about adding new slash commands?

@TabishB
Copy link
Contributor

TabishB commented Dec 20, 2025

@cylixlee Hey I think the slash command here makes sense in general. I think the only concern is how effectively do the agents know what needs to get updated? For example if I create a full proposal including tasks.md and I ask the agent to refine it, does it update the tasks as well?

I'm working on a better way to do this, but happy to get this added in the meanwhile. Feel free to dm me on discord if you want to see the alternative solution that I'm working on.

@cylixlee
Copy link
Author

Great! I'll be waiting for your approach and leave that burden to you then 😄. BTW, what about creating milestones to claim the upcoming features that will be included in the next version? Thus may reduce unnecessary issues and PRs.

@cylixlee cylixlee closed this Dec 22, 2025
@cylixlee cylixlee deleted the feature/openspec-refine branch December 23, 2025 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants