Prompt file imported from shynlee04/project-alpha-master (
.windsurf/workflows/write-spec/write-spec.md). Copyright stays with the author.
Now that we've initiated and planned the details for a new spec, we will now proceed with drafting the specification document, following these instructions:
Spec Writing
Core Responsibilities
- Analyze Requirements: Load and analyze requirements and visual assets thoroughly
- Search for Reusable Code: Find reusable components and patterns in existing codebase
- Create Specification: Write comprehensive specification document
Workflow
Step 1: Analyze Requirements and Context
Read and understand all inputs and THINK HARD:
# Read the requirements document
cat agent-os/specs/[current-spec]/planning/requirements.md
# Check for visual assets
ls -la agent-os/specs/[current-spec]/planning/visuals/ 2>/dev/null | grep -v "^total" | grep -v "^d"
Parse and analyze:
- User's feature description and goals
- Requirements gathered by spec-shaper
- Visual mockups or screenshots (if present)
- Any constraints or out-of-scope items mentioned
Step 2: Search for Reusable Code
Before creating specifications, search the codebase for existing patterns and components that can be reused.
Based on the feature requirements, identify relevant keywords and search for:
- Similar features or functionality
- Existing UI components that match your needs
- Models, services, or controllers with related logic
- API patterns that could be extended
- Database structures that could be reused
Use appropriate search tools and commands for the project's technology stack to find:
- Components that can be reused or extended
- Patterns to follow from similar features
- Naming conventions used in the codebase
- Architecture patterns already established
Document your findings for use in the specification.
Step 3: Create Core Specification
Write the main specification to agent-os/specs/[current-spec]/spec.md.
DO NOT write actual code in the spec.md document. Just describe the requirements clearly and concisely.
Keep it short and include only essential information for each section.
Follow this structure exactly when creating the content of spec.md:
# Specification: [Feature Name]
## Goal
[1-2 sentences describing the core objective]
## User Stories
- As a [user type], I want to [action] so that [benefit]
- [repeat for up to 2 max additional user stories]
## Specific Requirements
**Specific requirement name**
- [Up to 8 CONCISE sub-bullet points to clarify specific sub-requirements, design or architectual decisions that go into this requirement, or the technical approach to take when implementing this requirement]
[repeat for up to a max of 10 specific requirements]
## Visual Design
[If mockups provided]
**`planning/visuals/[filename]`**
- [up to 8 CONCISE bullets describing specific UI elements found in this visual to address when building]
[repeat for each file in the `planning/visuals` folder]
## Existing Code to Leverage
**Code, component, or existing logic found**
- [up to 5 bullets that describe what this existing code does and how it should be re-used or replicated when building this spec]
[repeat for up to 5 existing code areas]
## Out of Scope
- [up to 10 concise descriptions of specific features that are out of scope and MUST NOT be built in this spec]
Important Constraints
- Always search for reusable code before specifying new components
- Reference visual assets when available
- Do NOT write actual code in the spec
- Keep each section short, with clear, direct, skimmable specifications
- Do NOT deviate from the template above and do not add additional sections
Display confirmation and next step
Display the following message to the user:
The spec has been created at `agent-os/specs/[this-spec]/spec.md`.
Review it closely to ensure everything aligns with your vision and requirements.
Next step: Run the command, 2-create-tasks-list.md