@waltcow/claude-code-spec-workflow
Version:
Automated spec-driven workflow for Claude Code. Transforms feature ideas into complete implementations through Requirements → Design → Tasks → Implementation.
203 lines (156 loc) • 4.64 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRequirementsTemplate = getRequirementsTemplate;
exports.getDesignTemplate = getDesignTemplate;
exports.getTasksTemplate = getTasksTemplate;
function getRequirementsTemplate() {
return `
[]
**User Story:** As a [role], I want [feature], so that [benefit]
1. WHEN [event] THEN [system] SHALL [response]
2. IF [precondition] THEN [system] SHALL [response]
3. WHEN [event] AND [condition] THEN [system] SHALL [response]
**User Story:** As a [role], I want [feature], so that [benefit]
1. WHEN [event] THEN [system] SHALL [response]
2. IF [precondition] THEN [system] SHALL [response]
- [Performance requirements]
- [Security requirements]
- [Reliability requirements]
- [Usability requirements]
`;
}
function getDesignTemplate() {
return `
[]
[]
\`\`\`mermaid
graph TD
A[Component A] --> B[Component B]
B --> C[Component C]
\`\`\`
- **Purpose:** [What this component does]
- **Interfaces:** [Public methods/APIs]
- **Dependencies:** [What it depends on]
- **Purpose:** [What this component does]
- **Interfaces:** [Public methods/APIs]
- **Dependencies:** [What it depends on]
\`\`\`typescript
interface Model1 {
id: string;
name: string;
// Additional properties
}
\`\`\`
\`\`\`typescript
interface Model2 {
id: string;
// Additional properties
}
\`\`\`
1. **Scenario 1:** [Description]
- **Handling:** [How to handle]
- **User Impact:** [What user sees]
2. **Scenario 2:** [Description]
- **Handling:** [How to handle]
- **User Impact:** [What user sees]
- [Unit testing approach]
- [Key components to test]
- [Integration testing approach]
- [Key flows to test]
- [E2E testing approach]
- [User scenarios to test]
`;
}
function getTasksTemplate() {
return `
[]
- [ ] 1. Set up project structure and core interfaces
- Create directory structure for components
- Define core interfaces and types
- Set up basic configuration
- _Requirements: 1.1_
- [ ] 2. Implement data models and validation
- [ ] 2.1 Create base model classes
- Define TypeScript interfaces
- Implement validation methods
- Write unit tests for models
- _Requirements: 2.1, 2.2_
- [ ] 2.2 Implement specific model classes
- Create concrete model implementations
- Add relationship handling
- Test model interactions
- _Requirements: 2.3_
- [ ] 3. Create service layer
- [ ] 3.1 Implement core service interfaces
- Define service contracts
- Create base service classes
- Add dependency injection
- _Requirements: 3.1_
- [ ] 3.2 Implement business logic services
- Create specific service implementations
- Add error handling
- Write service unit tests
- _Requirements: 3.2, 3.3_
- [ ] 4. Create API endpoints
- [ ] 4.1 Set up routing and middleware
- Configure Express/Fastify routes
- Add authentication middleware
- Set up error handling middleware
- _Requirements: 4.1_
- [ ] 4.2 Implement CRUD endpoints
- Create REST API endpoints
- Add request validation
- Write API integration tests
- _Requirements: 4.2, 4.3_
- [ ] 5. Add frontend components
- [ ] 5.1 Create base UI components
- Set up component structure
- Implement reusable components
- Add styling and theming
- _Requirements: 5.1_
- [ ] 5.2 Implement feature-specific components
- Create feature components
- Add state management
- Connect to API endpoints
- _Requirements: 5.2, 5.3_
- [ ] 6. Integration and testing
- [ ] 6.1 Write end-to-end tests
- Set up E2E testing framework
- Write user journey tests
- Add test automation
- _Requirements: All_
- [ ] 6.2 Final integration and cleanup
- Integrate all components
- Fix any integration issues
- Clean up code and documentation
- _Requirements: All_
`;
}
//# sourceMappingURL=templates.js.map