Create specification documents without implementing code. Auto-detects spec type (feature, bug, refactor, integration, infrastructure) and uses the appropriate structure.
Create a specification/design document for: $ARGUMENTS
CLAUDE.md for conventionsdocs/specs/, specs/, docs/ directoriesInfer the spec type from the user's description, then confirm with the user before proceeding:
| Type | Signals |
|---|---|
| Feature | "add", "new", "implement", "support for", user-facing functionality |
| Bug/Fix | "bug", "broken", "error", "doesn't work", "fix", "regression", issue references |
| Refactor | "refactor", "restructure", "migrate", "clean up", "decouple", "extract", pattern changes |
| Integration | "integrate", "connect", external service names (Keycloak, Twilio, Stripe, etc.), API consumption |
| Infrastructure | "pipeline", "CI/CD", "deploy", "Docker", "GCP", "infra", "monitoring", environment changes |
Use AskUserQuestion to confirm: "Detected spec type: [type]. Is this correct?"
Before writing, ensure you understand the scope. Questions vary by type:
Use AskUserQuestion if anything is unclear.
Use the appropriate structure below based on detected type.
# [Feature Name] — Feature Specification
## Overview
Brief description of the feature and its business value.
## User Stories
- As a [role], I want [capability], so that [benefit]
## Requirements
### Functional Requirements
- FR-1: ...
- FR-2: ...
### Non-Functional Requirements
- NFR-1: ...
## Technical Design
### Architecture
How this integrates with the existing system.
### Data Model Changes
Database/schema changes if applicable.
### API Changes
New or modified endpoints/contracts.
### Dependencies
External services, libraries, or modules involved.
## Implementation Steps
Ordered breakdown of how to build this incrementally.
1. Step 1 — ...
2. Step 2 — ...
## QA Criteria
- [ ] Acceptance criteria checklist
- [ ] Edge cases to test
## Open Questions
Unresolved decisions or items needing clarification.
# [Bug Title] — Bug Specification
## Problem Description
Clear description of the incorrect behavior.
## Reproduction Steps
1. Step 1
2. Step 2
3. Observe: [what happens]
## Expected vs Actual Behavior
| | Description |
|---|---|
| **Expected** | What should happen |
| **Actual** | What happens instead |
## Affected Scope
- Environments: [dev/staging/prod]
- Users impacted: [scope]
- Since: [when it started, if known]
- Severity: [critical/high/medium/low]
## Root Cause Analysis
Deep investigation of why this happens. Trace the code path, identify the failing component, explain the underlying cause — not just symptoms.
## Proposed Fix
Detailed description of the solution approach.
### Risks & Side Effects
What else could break. Regression concerns.
### Alternative Approaches Considered
Other options evaluated and why they were discarded.
## QA Criteria
- [ ] Original bug no longer reproducible
- [ ] Regression tests for the fix
- [ ] Related flows still work correctly
## Open Questions
Unresolved decisions or items needing clarification.
# [Refactor Name] — Architecture Specification
## Motivation
Why the current architecture is insufficient. Concrete pain points, not theoretical.
## Current State
How things work today. Diagrams or code references where helpful.
### Problems with Current Approach
- Problem 1: ...
- Problem 2: ...
## Proposed Architecture
How things should work after the refactor.
### Key Design Decisions
| Decision | Choice | Rationale |
|----------|--------|-----------|
| ... | ... | ... |
### Component Changes
Which modules/services/layers change and how.
## Migration Strategy
How to get from current state to proposed state incrementally.
1. Phase 1 — ...
2. Phase 2 — ...
### Backward Compatibility
What breaks, what stays compatible, how to handle the transition.
## Risk Assessment
| Risk | Likelihood | Impact | Mitigation |
|------|-----------|--------|------------|
| ... | ... | ... | ... |
## QA Criteria
- [ ] Existing behavior preserved (no functional regressions)
- [ ] Performance not degraded
- [ ] New architecture validated with [specific test]
## Open Questions
Unresolved decisions or items needing clarification.
# [Service Name] Integration — Specification
## Overview
What service we're integrating with and why.
## Service Overview
- **Provider:** [service name and docs URL]
- **Purpose:** What it does for us
- **Environments:** [sandbox/staging/prod URLs]
## Authentication & Authorization
- Auth method: [API key / OAuth / JWT / etc.]
- Credential management: [where secrets are stored]
- Token lifecycle: [expiry, refresh strategy]
## API Contract
### Endpoints We Consume
| Method | Endpoint | Purpose |
|--------|----------|---------|
| ... | ... | ... |
### Request/Response Examples
Key payloads with example data.
### Error Handling
| Error Code | Meaning | Our Response |
|-----------|---------|-------------|
| ... | ... | ... |
## Data Flow
How data moves between our system and the external service.
## Fallback & Resilience
- What happens if the service is down
- Retry strategy
- Circuit breaker / timeout configuration
## Configuration
Required env vars, feature flags, or config entries.
## QA Criteria
- [ ] Happy path works end-to-end
- [ ] Error scenarios handled gracefully
- [ ] Auth token refresh works
- [ ] Fallback behavior verified
## Open Questions
Unresolved decisions or items needing clarification.
# [Change Name] — Infrastructure Specification
## Overview
What infrastructure change is being made and why.
## Current Setup
How the relevant infrastructure works today.
## Proposed Changes
Detailed description of what changes.
### Affected Components
| Component | Change | Environment |
|-----------|--------|-------------|
| ... | ... | ... |
### Configuration Changes
New or modified env vars, parameters, secrets, IAM roles, etc.
### Pipeline Changes
CI/CD modifications — new stages, modified jobs, updated scripts.
## Rollback Plan
Exact steps to revert if something goes wrong.
1. Step 1 — ...
2. Step 2 — ...
## Deployment Strategy
- Order of operations
- Downtime expectations
- Feature flag requirements
## Monitoring & Validation
How to verify the change works post-deployment.
- [ ] Health check: ...
- [ ] Log verification: ...
- [ ] Metric to watch: ...
## Open Questions
Unresolved decisions or items needing clarification.
specs/feature-name.md)specs/ is excluded from git:
specs/ is already in .git/info/excludespecs/ to .git/info/exclude.gitignore — use .git/info/exclude only (local, not committed)/create-issue skill (GitLab in Latin American Spanish, GitHub in English, audience-appropriate acceptance criteria, default labels and assignee)