Installs: 0
Used in: 1 repos
Updated: 1h ago
$
npx ai-builder add command wiperi/specInstalls to .claude/commands/spec.md
## Spec Workflow System Prompt
### Workflow Overview
The Spec workflow will be executed in three phases: Requirements Gathering → System Design → Implementation Planning. Each phase must receive explicit user approval before proceeding to the next phase.
## Phase One: Requirements Gathering
**Objective:** Generate standardized requirements documentation.
**Constraints:**
- Must create `.claude/specs/{feature_name}/requirements.md` file.
- Must generate initial requirements version based on user's rough ideas, do not ask sequential questions first.
- Must structure the requirements.md document using the following format:
- Clear introduction section, feature summary, hierarchically written requirements list, each containing:
- User story format: "As a [role], I want [functionality], so that [benefit]"
- EARS format acceptance criteria list, example format:
```
# Feature Requirements Document
## User Authentication System
## User Story: As a website user, I want to be able to securely log in, so that I can access my personal account information.
```
Acceptance Criteria:
```
1.1 When a user enters correct username and password, the system should allow login.
1.2 When a user enters incorrect credentials, the system should display an error message.
1.3 When a user fails to login 3 consecutive times, the system should lock the account for 15 minutes.
```
Additional Details:
```
Dependencies: [List any dependencies on other requirements or systems]
Assumptions: [List any assumptions made]
```
- Must consider edge cases, user experience, technical constraints, and success criteria.
- After updating requirements document, must ask: "How do the requirements look? If they're good, we can proceed to the design phase."
- Must wait for explicit user approval before proceeding to the next phase.
## Phase Two: System Design (Design Document Creation)
**Objective:** Create comprehensive design documentation based on approved requirements.
**Constraints:**
- Must create `.claude/specs/{feature_name}/design.md` file.
- Must identify areas requiring research and conduct necessary technical investigation.
- Must include the following sections in the design document:
- Overview
- Architecture
- Components and Interfaces
- Data Models
- Error Handling
- Testing Strategy
- Should include diagrams or visual representations when appropriate (can use Mermaid charts).
- Must ensure design solutions address identified functional requirements.
- Should highlight design decisions and their rationale.
- After updating design document, must ask: "How does the design look? If it's good, we can proceed to implementation planning."
- Must wait for explicit user approval before proceeding to the next phase.
## Phase Three: Implementation Planning
**Objective:** Create executable implementation plan based on requirements and design.
**Constraints:**
- Must create `.claude/specs/{feature_name}/tasks.md` file.
- Must convert feature design into a series of coding task prompts.
- Must prioritize best practices, incremental progress, and early testing.
- Must ensure each prompt builds upon previous prompts.
- Must format implementation plan as numbered list with checkboxes, maximum two-level hierarchy.
- Each task item must include:
- Clear objective involving writing, modifying, or testing code.
- Additional information for task description as sub-bullets.
- References to specific requirements in the requirements document.
- References to relevant design decisions and components in the design document, ensuring implementation aligns with design.
- Expected output or acceptance criteria for verification.
- Ensure each task directly correlates with specific items in requirements and design documents for traceability.
- After task completion, must verify implementation correctness by comparing with original Spec.
- After updating implementation plan, must ask: "How does the implementation plan look? If it's good, we can begin development."
- Must wait for explicit user approval before proceeding to development phase.
### Task Format Example
```markdown
# Implementation Plan
## Core Feature Development
### 1. User Authentication System
- [ ] 1.1 Create user model and database schema.
- Objective: Based on design document, create user table with fields including user ID, username, password hash, email, etc.
- Details: Reference database design section in `design.md`.
- Requirements Reference: "User Authentication System" and related acceptance criteria in `requirements.md`.
- Acceptance: Successfully create `users` table in database with fields meeting design requirements.
- [ ] 1.2 Implement user registration API.
- Objective: Allow new users to register via POST request, storing encrypted passwords.
- Details: Reference user authentication API interface definition in `design.md`.
- Requirements Reference: Registration flow description in "User Authentication System" section of `requirements.md`.
- Acceptance: API can handle valid and invalid registration requests, returning appropriate success or error messages, ensuring password encryption storage.
- [ ] 1.3 Implement user login API.
- Objective: Allow users to login with username and password, returning authentication token.
- Details: Reference user authentication API interface definition in `design.md`.
- Requirements Reference: "User Authentication System" acceptance criteria 1.1 and 1.2 in `requirements.md`.
- Acceptance: Successful login returns token, failed login returns error message.
- [ ] 1.4 Implement password hashing and verification logic.
- Objective: Ensure user passwords are securely hashed before storage and verified during login.
- Details: Use bcrypt or other recommended password hashing algorithms.
- Design Reference: Security considerations and password handling strategy in `design.md`.
- Acceptance: Passwords stored as hashes in database, login verification of hashed passwords works correctly.
### 2. Authorization Management System (Example)
- [ ] 2.1 Create roles and permissions model.
- Objective: Design and implement data models for user roles, permissions and their associations.
- Details: Reference authorization section database design in `design.md`.
- Requirements Reference: User role definitions in `requirements.md`.
- Acceptance: Create `roles` and `permissions` tables in database with proper associations.
```Quick Install
$
npx ai-builder add command wiperi/specDetails
- Type
- command
- Author
- wiperi
- Slug
- wiperi/spec
- Created
- 3d ago