Repository navigation
Description
Problem
During a /speckit.clarify session (Spec 028), the agent updated the spec correctly but then also modified Go source code (internal/sandbox/config.go) and test files (internal/sandbox/sandbox_test.go). The clarify command is a specification phase — it should only modify spec artifacts, not implementation code.
The root cause is that no command or behavioral rule explicitly prevents code changes during spec phases. The /speckit.clarify command instructions focus on the spec update workflow but don't include a guardrail saying "do NOT modify source code."
Proposed Fix
1. Add Guardrails section to /speckit.clarify command
Add to .opencode/command/speckit.clarify.md:
## Guardrails
- **NEVER modify source code** — this command updates
spec.md ONLY. Implementation changes belong in
/speckit.implement, /unleash, or /cobalt-crush.
- **NEVER modify test files** — same reason.
- **NEVER modify Go source, Markdown agents, or config
files** outside the specs/NNN-*/ feature directory.
- The ONLY files this command may write are:
- FEATURE_SPEC (the spec.md file)
- Files within FEATURE_DIR (spec artifacts)2. Add Guardrails to other spec-phase commands
Apply the same guardrail to:
.opencode/command/speckit.specify.md.opencode/command/speckit.plan.md.opencode/command/speckit.tasks.md.opencode/command/speckit.analyze.md.opencode/command/speckit.checklist.md
Each should state that it may only write to the specs/NNN-*/ feature directory.
3. Add Workflow Phase Boundaries to AGENTS.md
Add to AGENTS.md Behavioral Constraints:
### Workflow Phase Boundaries
Agents MUST NOT cross workflow phase boundaries:
- **Specify/Clarify/Plan/Tasks/Analyze/Checklist** phases:
spec artifacts ONLY (specs/NNN-*/ directory). No source
code changes.
- **Implement** phase: source code changes allowed, guided
by spec artifacts.
- **Review** phase: findings and minor fixes only. No new
features.4. Add Phase Discipline to constitution
Add to .specify/memory/constitution.md Development Workflow:
- **Phase Discipline**: Each pipeline phase (specify,
clarify, plan, tasks, implement, review) MUST produce
only its designated artifacts. Implementation code
MUST NOT be written during specification phases.Scope
- ~6 Markdown command files updated (add Guardrails section)
- AGENTS.md updated (add Workflow Phase Boundaries subsection)
- constitution.md updated (add Phase Discipline rule)
- Scaffold asset copies synced (~6 files)
- No Go code changes
- OpenSpec tactical change (
opsx/workflow-phase-boundaries)
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
feat: add workflow phase boundaries and externalize speckit commands (c…
feat: add workflow phase boundaries and externalize speckit commands (c…