بنقرة واحدة
spectra-propose-plus
Create a Spectra change proposal with sub-agent quality gates
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Create a Spectra change proposal with sub-agent quality gates
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Implement Spectra tasks with a sub-agent quality gate after completion
Create a Spectra change proposal with sub-agent quality gates
Implement Spectra tasks with a sub-agent quality gate after completion
| name | spectra-propose-plus |
| description | Create a Spectra change proposal with sub-agent quality gates |
| license | MIT |
| compatibility | Requires spectra CLI. |
| metadata | {"author":"spectra","version":"1.0","generatedBy":"Spectra"} |
Create a complete Spectra change proposal — from requirement to validated artifacts — in a single workflow.
Input: The argument after /spectra-propose is the requirement description. Examples:
/spectra-propose add dark mode/spectra-propose fix the login page crash/spectra-propose improve search performanceIf no argument is provided, the workflow will extract requirements from conversation context or ask.
Prerequisites: This skill requires the spectra CLI. If any spectra command fails with "command not found" or similar, report the error and STOP.
Steps
Determine the requirement source
a. Argument provided (e.g., "add dark mode") → use it as the requirement description, skip to deriving the change name below.
b. Plan file available:
~/.claude/plans/<name>.md)~/.claude/plans/plan_title (H1 heading) → use as requirement descriptionplan_context (Context section) → use as proposal Why/Motivation contentplan_stages (numbered implementation stages) → use for artifact creationplan_files (all file paths mentioned) → use for Impact sectionc. Conversation context → attempt to extract requirements from conversation history
From the resolved description, derive a kebab-case change name (e.g., "add dark mode" → add-dark-mode).
Do not keep archive-style date prefixes in active change names. If the source name starts with YYYY-MM-DD-, strip that date prefix before running spectra new change; archived change names and directories are historical references, not active names to reuse.
IMPORTANT: Do NOT proceed without understanding what the user wants to build.
Classify the change type
Based on the requirement, classify the change into one of three types:
| Type | When to use |
|---|---|
| Feature | New functionality, new capabilities |
| Bug Fix | Fixing existing behavior, resolving errors |
| Refactor | Architecture improvements, performance optimization, UI adjustments |
This determines the proposal template format in step 5.
Scan existing specs for relevance
Before creating the change, check if any existing specs overlap:
openspec/specs/*/spec.mdIMPORTANT:
Create the change directory
spectra new change "<name>" --agent claude
If a change with that name already exists, suggest continuing the existing change instead of creating a new one.
Write the proposal
IMPORTANT — file path rules for the ## Impact section:
src/lib/foo.ts, src-tauri/crates/core/src/bar.rs, docs/specs/specs/auth/spec.md).parser/mod.rs, core/mod.rs) — preflight rejects them as non-anchored paths.`git mv a.rs b.rs`) — preflight's backtick extractor will otherwise mis-parse the command as a file reference.Get instructions:
spectra instructions proposal --change "<name>" --json
Generate the proposal content based on change type (see formats below), then write it via CLI:
spectra new artifact proposal --change "<name>" --stdin <<'ARTIFACT_EOF'
<proposal content>
ARTIFACT_EOF
If the command fails with a validation error, fix the content and retry.
Use the following format based on change type:
## Why
<!-- Why this functionality is needed -->
## What Changes
<!-- What will be different -->
## Non-Goals (optional)
<!-- Scope exclusions and rejected approaches. Required when design.md is skipped. -->
## Capabilities
### New Capabilities
- `<capability-name>`: <brief description>
### Modified Capabilities
(none)
## Impact
- Affected specs: <new or modified capabilities>
- Affected code:
- New: <paths to be created, relative to project root>
- Modified: <paths that already exist>
- Removed: <paths to be deleted>
## Problem
<!-- Current broken behavior -->
## Root Cause
<!-- Why it happens -->
## Proposed Solution
<!-- How to fix -->
## Non-Goals (optional)
<!-- Scope exclusions and rejected approaches. Required when design.md is skipped. -->
## Success Criteria
<!-- Expected behavior after fix, verifiable conditions -->
## Impact
- Affected code:
- Modified: <paths that already exist>
- New: <paths to be created, relative to project root>
- Removed: <paths to be deleted>
## Summary
<!-- One sentence description -->
## Motivation
<!-- Why this is needed -->
## Proposed Solution
<!-- How to do it -->
## Non-Goals (optional)
<!-- Scope exclusions and rejected approaches. Required when design.md is skipped. -->
## Alternatives Considered (optional)
<!-- Other approaches considered and why not -->
## Impact
- Affected specs: <affected capabilities>
- Affected code:
- Modified: <paths that already exist>
- New: <paths to be created, relative to project root>
- Removed: <paths to be deleted>
Get the artifact build order
spectra status --change "<name>" --json
Parse the JSON to get:
applyRequires: array of artifact IDs needed before implementationartifacts: list of all artifacts with their status and dependenciesCreate remaining artifacts in sequence
Loop through artifacts in dependency order (skip proposal since it's already done):
a. For each artifact that is ready (dependencies satisfied):
Check if the artifact is optional: If the artifact is NOT in the dependency chain of any applyRequires artifact (i.e., removing it would not block reaching apply), it is optional. Get its instructions and read the instruction field. If the instruction contains conditional criteria (e.g., "create only if any apply"), evaluate whether any criteria apply to this change based on the proposal content. If none apply, skip the artifact and show: "⊘ Skipped (not needed for this change)". Then continue to the next artifact.
Get instructions:
spectra instructions <artifact-id> --change "<name>" --json
The instructions JSON includes:
context: Project background (constraints for you - do NOT include in output)rules: Artifact-specific rules (constraints for you - do NOT include in output)template: The structure to use for your output fileinstruction: Schema-specific guidanceoutputPath: Where to write the artifactdependencies: Completed artifacts to read for contextlocale: The language to write the artifact in (e.g., "Japanese (日本語)"). If present, you MUST write the artifact content in this language. Exception: spec files (specs/*/.md) MUST always be written in English regardless of locale, because they use normative language (SHALL/MUST).Read any completed dependency files for context
Generate the artifact content using template as the structure
Apply context and rules as constraints - but do NOT copy them into the file
Write the artifact via CLI (the CLI handles directory creation and format validation):
For design or tasks:
spectra new artifact <artifact-id> --change "<name>" --stdin <<'ARTIFACT_EOF'
<content>
ARTIFACT_EOF
For specs (one command per capability):
spectra new artifact spec <capability-name> --change "<name>" --stdin <<'ARTIFACT_EOF'
<delta spec content>
ARTIFACT_EOF
If the command fails with a validation error, fix the content and retry.
Show brief progress: "✓ Created "
b. Continue until all applyRequires artifacts are complete
spectra status --change "<name>" --jsonapplyRequires has status: "done"applyRequires artifacts are donec. If an artifact requires user input (unclear context):
Artifact language for propose-plus
All change artifacts produced by spectra-propose-plus (proposal.md, design.md, tasks.md, and any other non-spec artifact under openspec/changes/<change>/) MUST be written in Traditional Chinese, regardless of whether the CLI provides a locale field.
This applies to artifacts generated in step 5 (proposal) and step 7 (remaining artifacts), and to any artifacts modified during the review loop fix actions.
Exception — spec files stay in English:
openspec/changes/<change>/specs/<capability>/spec.md (delta spec)openspec/specs/<capability>/spec.md (master spec)Spec files MUST always be written in English because they use normative SHALL/MUST wording, and delta specs are later merged into master specs — mixing languages would cause merge conflicts and semantic drift. This is consistent with the existing locale rule documented above for spec files.
Keep the following verbatim (do not translate) even inside Chinese prose:
applyRequires, outputPath, dependencies)If the user explicitly requests another language later, follow the latest user instruction.
The goal is predictable Chinese-facing artifacts for propose-plus while preserving exact technical references and keeping spec deltas compatible with master specs.
Sub-Agent Review/Rating/Fix Loop
Run this review/rating/fix loop once per change, after the normal workflow has completed its required artifact or task work.
Entry conditions
spectra-propose-plus, start this loop only after proposal, design, specs, and tasks artifacts required for apply are complete.spectra-apply-plus, start this loop only after all implementation tasks are complete and tasks.md 全 [x].Round limit and pass condition
quality_score > 9 and critical_gap == false.decision: aborted, print the unresolved findings, and end the plus workflow.decision: passed, stop the loop, and continue to the normal final validation or completion summary.Fresh sub-agent calls
design.md Implementation Contract, tasks.md task descriptions, and spec.md requirements; implementation-notes.md deviations are justified.##### Example: blocks.location + summary) and applies the confidence filter (see below) before passing the filtered set to the rater.quality_score, critical_gap, and rationale.Reviewer output requirements
severity: one of Critical, Warning, Suggestion (before filtering)confidence: integer 0–100, using the rubric belowlocation: artifact + section, or file path + line rangesummary: one-line description of the issuerecommendation: concrete action to resolvedecision: aborted instead of continuing fixes.Confidence scoring rubric (per finding)
0 — Not confident at all. False positive or pre-existing issue. SHOULD NOT be reported.25 — Somewhat confident. Could be a real issue but the reviewer was unable to verify against artifacts or code.50 — Moderately confident. Verified to be real, but minor / unlikely to hit in practice / outside the changed scope.75 — Highly confident. Verified to be real and will hit in practice. Use this when judgment-based impact assessment supports the finding but no direct artifact citation exists.100 — Certain. Evidence directly confirms the issue, OR the finding cites a specific artifact clause (a SHALL in spec.md, an Implementation Contract item in design.md, a task description line in tasks.md, a non-goal in proposal.md) that the artifact set or implementation provably does not satisfy.100. If a reviewer can name the exact SHALL / contract item / task line being violated, the finding is objectively verifiable and SHALL NOT be downgraded below 100. This invariant guarantees the confidence filter never demotes an artifact violation to Suggestion.Confidence filter (applied by main agent before rater)
confidence < 50. These do not appear in the round file.confidence ∈ [50, 80) to Suggestion regardless of original severity. They appear in the round file under Suggestion for visibility but do NOT count as Critical.confidence ≥ 80 may be classified as Critical or Warning in the final round file.critical_gap is true only when at least one finding survives filtering with severity == Critical AND confidence ≥ 80.Common false positives — do NOT flag The following SHOULD NOT be reported, or if reported MUST be scored ≤ 25:
tasks.md or design.md explicitly required the test, or a spec ##### Example: block is not exercised.design.md, implementation-notes.md, the proposal's Non-Goals section, or ## Alternatives Considered.## What Changes or ## Proposed Solution.Failure handling
decision: aborted and include the failure note in ## Decision.Rater output requirements
quality_score as a number from 0 to 10.critical_gap as true or false.Round file path
openspec/changes/<change>/reviews/.spectra-propose-plus, write openspec/changes/<change>/reviews/propose-r<N>.md.spectra-apply-plus, write openspec/changes/<change>/reviews/apply-r<N>.md.<N> as the 1-based round number.openspec/changes/<change>/reviews/<skill>-r<N>.md.Round file schema
# Propose Plus Review — Round <N> or # Apply Plus Review — Round <N>## Reviewer Findings — list aggregated, post-filter findings grouped under Critical / Warning / Suggestion. Each entry MUST include severity, confidence, location, summary, recommendation, and which reviewer raised it (A or B; A+B if both raised it independently).## Rating — quality_score, critical_gap, rationale paragraph.## Fix Actions## Decision — value MUST be exactly one of passed, next_round, or aborted.Fix actions
next_round, fix the concrete findings before starting the next round.## Fix Actions.None; pass condition met.Round file language
openspec/changes/<change>/reviews/<skill>-r<N>.md) prose content — Reviewer Findings, Rater rationale, Fix Actions descriptions, and the ## Decision explanation — MUST be written in Traditional Chinese.# Propose Plus Review — Round <N>, # Apply Plus Review — Round <N>, ## Reviewer Findings, ## Rating, ## Fix Actions, ## Decision.decision value: one of passed, next_round, aborted.quality_score (number 0–10), critical_gap (true / false), severity, confidence, location, summary, recommendation.spectra-propose-plus and spectra-apply-plus round files because they share this review-loop template.Validation
spectra validate "<name>"
If validation fails, fix errors and re-validate.
Finish the plus proposal workflow
Show summary:
Do not move the change out of openspec/changes/.
The plus proposal workflow ends with the active change still available for implementation.
If the user wants to temporarily set the change aside, they can do that manually after this workflow ends.
Inform the user:
/spectra-apply <change-name> or /spectra-apply-plus <change-name> later can start implementation.If you are currently in Codex Plan Mode, also remind the user to switch the session to normal mode before running an apply workflow. This is only a reminder: do NOT try to use ExitPlanMode or EnterPlanMode, do NOT ask whether to switch modes, and do NOT invoke apply.
The propose-plus workflow ENDS here.
Do NOT invoke /spectra-apply.
Do NOT call AskUserQuestion to ask whether to apply.
Do NOT run any command that parks the change.
This behavior is identical across Auto Mode, interactive mode, and any other agent mode.
The end state is explicit: artifacts exist, validation has run, review records exist, and the change remains active. Artifact Creation Guidelines
instruction field from spectra instructions for each artifact typetemplate as the structure for your output file - fill in its sectionscontext and rules are constraints for YOU, not content for the file
<context>, <rules>, <project_context> blocks into the artifact[P]): When creating the tasks artifact, first read .spectra.yaml. If parallel_tasks: true is set, add [P] markers to tasks that can be executed in parallel. Format: - [ ] [P] Task description. A task qualifies for [P] if it targets different files from other pending tasks AND has no dependency on incomplete tasks in the same group. When parallel_tasks is not enabled, do NOT add [P] markers.Guardrails
applyRequires dependency chain) may be skipped if their inclusion criteria don't apply./spectra-apply — this workflow ends after artifact creation. The user decides when to start implementation