一键导入
team-openspec-guard
Use when creating, reviewing, or updating OpenSpec proposals, designs, tasks, spec deltas, acceptance criteria, or archiving changes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when creating, reviewing, or updating OpenSpec proposals, designs, tasks, spec deltas, acceptance criteria, or archiving changes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when implementing OpenSpec tasks, writing code, running tests, or fixing bugs. Guards TDD flow, execution modes, and spec compliance.
Use when diagnosing and fixing bugs, applying security patches, or making small enhancements with /team-repair. Guards DIVE protocol, dual-track closure, and evidence-driven repair.
Use when exploring requirements, doing deep design exploration, or brainstorming before proposing. Guards OpenSpec environment and brainstorm output location.
Use when reviewing task breakdowns, checking dependency ordering, optimizing task granularity, or deciding whether to proceed to implementation.
Use when implementing an approved OpenSpec change, progressing through tasks, updating task status, or continuing an incomplete implementation.
Use when retrospecting on AI collaboration, recording bad cases, updating skill rules, or managing skill versions.
| name | team-openspec-guard |
| description | Use when creating, reviewing, or updating OpenSpec proposals, designs, tasks, spec deltas, acceptance criteria, or archiving changes. |
OpenSpec artifacts are executable contracts: specific enough to drive implementation, review, and regression verification. All artifacts MUST follow OpenSpec CLI standard format, or openspec validate --strict will fail.
These 3 rules are the minimum to pass validation. Even if Gate 2 details are compressed, these MUST be followed:
## ADDED Requirements / ### Requirement: <name> / #### Scenario: <name> (the word "Requirement:" is mandatory, 4 hashes for Scenario)SHALL or MUST (not "should"/"will"). Scenario body uses ONLY - **WHEN** / - **THEN** / - **AND**Use this skill when:
openspec/changes/<id>/proposal.md (for medium/high complexity features)design.mdopenspec/changes/<id>/specs/For bug fixes, security patches, and small enhancements, use /team-repair (with team-repair-guard) instead of the full OpenSpec pipeline.
Do NOT use this skill when:
team-repair-guard with /team-repair)team-implementation-guard)team-verification-guard)Before any OpenSpec operation, verify the CLI is installed and accessible:
openspec --version
If the command fails (not found / not recognized):
OpenSpec CLI is not installed or not in PATH. Install it first:
npm install -g @fission-ai/openspecThen verify with
openspec --version.
If the command succeeds, proceed to Gate 1.
proposal.md MUST use these sections (OpenSpec CLI hard-codes English header matching):
## Why
<!-- 1-2 sentences. Minimum 50 characters. -->
## What Changes
<!-- Bullet list. Mark breaking changes with **BREAKING**. -->
## Capabilities
### New Capabilities
- `<name>`: <brief description> <!-- kebab-case -->
### Modified Capabilities
- `<existing-name>`: <what requirement is changing>
## Impact
<!-- Affected code, APIs, dependencies, systems -->
Checklist:
## Why header correct, content ≥ 50 chars## What Changes non-empty with specific changes## Capabilities lists all new/modified capabilities## Impact describes affected scopeEvery spec delta (specs/<capability>/spec.md) MUST follow this format:
## ADDED Requirements
### Requirement: User can reset password
The system SHALL allow registered users to request a password reset email.
#### Scenario: Valid registered email
- **WHEN** user submits the reset form with a registered email
- **THEN** system sends a password reset email
#### Scenario: Unregistered email
- **WHEN** user submits the reset form with an unregistered email
- **THEN** system displays "If the email exists, a reset link will be sent"
## MODIFIED Requirements
### Requirement: Login rate limiting
The system SHALL limit login attempts to 5 per minute per account.
#### Scenario: Rate limit exceeded
- **WHEN** user exceeds 5 login attempts within 1 minute
- **THEN** system returns HTTP 429 and locks the account for 15 minutes
## REMOVED Requirements
### Requirement: Legacy password policy
**Reason**: Replaced by new password policy in ADDED section
**Migration**: Existing passwords will be re-hashed on next login
## RENAMED Requirements
- FROM: `### Requirement: Old Name`
- TO: `### Requirement: New Name`
Critical rules (violating any causes --strict validation failure):
## ADDED Requirements / ## MODIFIED Requirements / ## REMOVED Requirements / ## RENAMED Requirements### Requirement: <name> (the Requirement: prefix is hard-coded in the parser)SHALL or MUST#### Scenario: <name> (3 hashes won't be recognized as a scenario)- **WHEN** ... / - **THEN** ... / - **AND** ...Quick reference:
| Element | Correct | Wrong |
|---|---|---|
| Delta section | ## ADDED Requirements | ## 新增需求, ## Added |
| Requirement | ### Requirement: Name | ### 需求 1:名称 |
| Scenario | #### Scenario: Name | #### 场景:名称 |
| Steps | - **WHEN** / - **THEN** | - **假设**:/ - **当**: |
| Keywords | Contains SHALL or MUST | No normative keyword |
The implementation plan (plan.md) is created by invoking superpowers:writing-plans skill. The tasks.md is extracted from plan.md.
Team workflow commit override: After writing-plans generates the plan, REMOVE all per-task "Commit" steps (e.g., Step N: Commit with git add/commit). In team workflow, commits are managed at the change level by /team-apply, NOT per-task.
plan.md is generated by superpowers:writing-plans and follows its format:
# [Feature Name] Implementation Plan
> **For agentic workers:** ...
**Goal:** ...
**Architecture:** ...
**Tech Stack:** ...
---
### Task N: [Component Name]
**Files:**
- Create: `exact/path/to/file`
- Modify: `exact/path/to/file`
- [ ] **Step 1: Description**
- [ ] **Step 2: Description**
Extract each - [ ] step from plan.md and renumber:
Input (plan.md):
### Task 1: Create user model
- [ ] Step 1: Write failing test
- [ ] Step 2: Run test to verify it fails
- [ ] Step 3: Implement User model
Output (tasks.md):
> **Working Directory:** All file paths below are relative to the project root (PROJECT_DIR).
## 1. Create user model
- [ ] 1.1 Write failing test
- [ ] 1.2 Run test to verify it fails
- [ ] 1.3 Implement User model
Extraction rules:
### Task N: <name> becomes ## N. <name>- [ ] Step N: <description> becomes - [ ] N.M <description>Open questions are hard blockers (must resolve before implementation) when they affect:
If hard blockers exist, do NOT proceed to implementation.
Format:
## Open Questions
### [Q1] API field naming
- Impact: API contract, database model
- Options:
- A: `user_email`
- B: `email_address`
- Recommendation: A
- Blocking: 🔴 Hard (must resolve before implementation)
### [Q2] Error message wording
- Impact: UX
- Options: [list]
- Blocking: 🟡 Soft (can resolve during implementation)
Every task in tasks.md MUST:
Wrong:
- [ ] Implement authentication
Right:
## 1. Data Layer
- [ ] 1.1 Add reset-token persistence model
- Requirement: password-reset
- Verification: Write unit tests for token expiry and single-use
- Estimate: 30 min
- [ ] 1.2 Create password reset API endpoint
- Requirement: password-reset
- Verification: Integration test for reset flow
- Estimate: 45 min
- Depends on: 1.1
Required task format:
- [ ] X.Y <Task title>
- Requirement: <requirement name or ID>
- Verification: `<command or manual scenario>`
- Estimate: <minutes>
- Depends on: <preceding task, if any>
Before reporting proposal work as done:
openspec validate <change-id> --strict
If validation fails, fix artifacts before reporting done. Common failures:
## Why less than 50 characters## ADDED Requirements etc.)SHALL/MUST#### Scenario: blockdesign.md is REQUIRED when ANY of these apply: new components/modules, multiple implementation approaches, data schema or API changes, cross-subsystem impact, migration concerns, non-trivial error handling/security decisions. Only skip for simple changes (add field, fix bug, update config).
# Design: <change-id>
## Context
<!-- Background, current state, constraints, stakeholders -->
## Goals / Non-Goals
**Goals:** ...
**Non-Goals:** ...
## Decisions
### Decision 1: [Title]
- Background: [why needed]
- Alternatives considered: [options]
- Choice: [what was chosen]
- Rationale: [why]
## Risks / Trade-offs
| Risk | Mitigation |
|------|------------|
| ... | ... |
## Migration Plan
<!-- Steps to deploy, rollback strategy -->
## Open Questions
<!-- Outstanding decisions or unknowns -->
## Why in English, ≥ 50 chars## What Changes has specific bullets## Capabilities lists kebab-case names## Impact describes scopeopenspec validate <change-id> --strict passes## ADDED Requirements etc.)### Requirement: <name>SHALL or MUST#### Scenario: <name> (4 hashes)WHEN/THEN formatopenspec validate <change-id> --strict passesopenspec validate --strict passes| Mistake | Fix |
|---|---|
| Chinese headers like "## 问题" | Use "## Why" |
| Requirement as "### 需求 1:..." | Use "### Requirement: ..." |
| Scenario as "#### 场景:..." | Use "#### Scenario: ..." |
| Scenario uses 假设/当/那么 | Use WHEN/THEN/AND |
| Requirement text has no SHALL/MUST | Explicitly add SHALL or MUST |
| Acceptance criteria says "works correctly" | Replace with specific scenarios |
| Task too broad | Split by user-visible vertical slices |
| Open questions buried in paragraphs | Put in explicit list |
| Missing design trade-offs | Add design.md before implementation |
| Non-goals not listed | Explicitly state "NOT doing X, Y, Z" |
When this skill fails, record in badCases/ directory:
See badCases/ for case history.