recreate-fob 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/.gitkeep +0 -0
- package/.claude/commands/FOB/.gitkeep +0 -0
- package/.claude/commands/FOB/experts/codebase/self-improve.md +191 -0
- package/.claude/commands/FOB/init_project.md +135 -0
- package/.claude/commands/FOB/iterate_spec.md +59 -0
- package/.claude/commands/FOB/plan_project.md +142 -0
- package/.claude/skills/.gitkeep +0 -0
- package/.codex/agents/.gitkeep +0 -0
- package/.codex/commands/.gitkeep +0 -0
- package/.codex/commands/FOB/.gitkeep +0 -0
- package/.codex/commands/FOB/experts/codebase/self-improve.md +191 -0
- package/.codex/commands/FOB/init_project.md +135 -0
- package/.codex/commands/FOB/iterate_spec.md +59 -0
- package/.codex/commands/FOB/plan_project.md +142 -0
- package/.codex/skills/.gitkeep +0 -0
- package/.opencode/agents/.gitkeep +0 -0
- package/.opencode/commands/.gitkeep +0 -0
- package/.opencode/commands/FOB/.gitkeep +0 -0
- package/.opencode/commands/FOB/experts/codebase/self-improve.md +191 -0
- package/.opencode/commands/FOB/init_project.md +135 -0
- package/.opencode/commands/FOB/iterate_spec.md +59 -0
- package/.opencode/commands/FOB/plan_project.md +142 -0
- package/.opencode/skills/.gitkeep +0 -0
- package/forward-operating-base/VERSION +1 -1
- package/package.json +1 -1
- package/.claude/agents/FOB-planner.md +0 -52
- package/.claude/agents/FOB-reviewer.md +0 -61
- package/.claude/commands/FOB/help.md +0 -32
- package/.claude/commands/FOB/scan.md +0 -48
- package/.claude/commands/FOB/status.md +0 -47
- package/.claude/skills/FOB-project-setup/skill.md +0 -68
- package/.codex/agents/FOB-planner.md +0 -52
- package/.codex/agents/FOB-reviewer.md +0 -61
- package/.codex/commands/FOB/help.md +0 -32
- package/.codex/commands/FOB/scan.md +0 -48
- package/.codex/commands/FOB/status.md +0 -47
- package/.codex/skills/FOB-project-setup/skill.md +0 -68
- package/.opencode/agents/FOB-planner.md +0 -52
- package/.opencode/agents/FOB-reviewer.md +0 -61
- package/.opencode/commands/FOB/help.md +0 -32
- package/.opencode/commands/FOB/scan.md +0 -48
- package/.opencode/commands/FOB/status.md +0 -47
- package/.opencode/skills/FOB-project-setup/skill.md +0 -68
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: Read, Grep, Glob, Bash, Edit, Write, TodoWrite
|
|
3
|
+
description: Self-improve Codebase expertise by validating against codebase implementation
|
|
4
|
+
argument-hint: [check_git_diff (true/false)] [focus_area (optional)]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Purpose
|
|
8
|
+
|
|
9
|
+
You maintain the Codebase expert system's expertise accuracy by comparing the existing expertise file against the actual codebase implementation. Follow the `Workflow` section to detect and remedy any differences, missing pieces, or outdated information, ensuring the expertise file remains a powerful **mental model** and accurate memory reference for codebase-related tasks.
|
|
10
|
+
|
|
11
|
+
## Variables
|
|
12
|
+
|
|
13
|
+
CHECK_GIT_DIFF: $1 default to false if not specified
|
|
14
|
+
FOCUS_AREA: $2 default to empty string
|
|
15
|
+
EXPERTISE_FILE: .claude/commands/experts/codebase/expertise.yaml
|
|
16
|
+
MAX_LINES: 1000
|
|
17
|
+
|
|
18
|
+
## Instructions
|
|
19
|
+
|
|
20
|
+
- This is a self-improvement workflow to keep Codebase expertise synchronized with the actual codebase
|
|
21
|
+
- Think of the expertise file as your **mental model** and memory reference for all codebase-related functionality
|
|
22
|
+
- Always validate expertise against real implementation, not assumptions
|
|
23
|
+
- Focus exclusively on Codebase-related functionality (File structures, frontend current state, backend current state, authentication patterns, database schema overview, etc.)
|
|
24
|
+
- If FOCUS_AREA is provided, prioritize validation and updates for that specific area
|
|
25
|
+
- Maintain the YAML structure of the expertise file
|
|
26
|
+
- Enforce strict line limit of 1000 lines maximum
|
|
27
|
+
- Prioritize actionable, high-value expertise over verbose documentation
|
|
28
|
+
- When trimming, remove least critical information that won't impact expert performance
|
|
29
|
+
- Git diff checking is optional and controlled by the CHECK_GIT_DIFF variable
|
|
30
|
+
- Be thorough in validation but concise in documentation
|
|
31
|
+
- Don't include 'summaries' of work done in your expertise when a git diff is checked. Focus on true, important information that pertains to the key codebase functionality and implementation.
|
|
32
|
+
- Write as a principle engineer that writes CLEARLY and CONCISELY for future engineers so they can easily understand how to read and update functionality surrounding the codebase implementation.
|
|
33
|
+
- Keep in mind, after your thorough search, there may be nothing to be done - this is perfectly acceptable. If there's nothing to be done, report that and stop.
|
|
34
|
+
|
|
35
|
+
## Workflow
|
|
36
|
+
|
|
37
|
+
1. **Check Git Diff (Conditional)**
|
|
38
|
+
- If CHECK_GIT_DIFF is "true", run `git diff` to identify recent changes to Codebase-related files
|
|
39
|
+
- If changes detected, note them for targeted validation in step 3
|
|
40
|
+
- If CHECK_GIT_DIFF is "false", skip this step
|
|
41
|
+
|
|
42
|
+
2. **Read Current Expertise**
|
|
43
|
+
- Read the entire EXPERTISE_FILE to understand current documented expertise
|
|
44
|
+
- Identify key sections: overview, frontend_current_state, backend_current_state, auth_current_state, database_schema_overview, etc.
|
|
45
|
+
- Note any areas that seem outdated or incomplete
|
|
46
|
+
|
|
47
|
+
3. **Validate Against Codebase**
|
|
48
|
+
- Read the EXPERTISE_FILE to identify which files are documented as key implementation files
|
|
49
|
+
- Read those files to understand current implementation:
|
|
50
|
+
- Compare documented expertise against actual code:
|
|
51
|
+
- Existing frontend structure and pages
|
|
52
|
+
- Existing backend structure and endpoints
|
|
53
|
+
- Authentication patterns and methods
|
|
54
|
+
- Database schema overview (list of tables and their general purpose)
|
|
55
|
+
- If FOCUS_AREA is provided, prioritize validation of that specific area
|
|
56
|
+
- If git diff was checked in step 1, pay special attention to changed areas
|
|
57
|
+
|
|
58
|
+
4. **Identify Discrepancies**
|
|
59
|
+
- List all differences found:
|
|
60
|
+
- Missing files or features
|
|
61
|
+
- Outdated route endpoints or file paths
|
|
62
|
+
- Changed implementation details
|
|
63
|
+
- New features/files not documented
|
|
64
|
+
- Removed features/files still documented
|
|
65
|
+
|
|
66
|
+
5. **Update Expertise File**
|
|
67
|
+
- Remedy all identified discrepancies by updating EXPERTISE_FILE
|
|
68
|
+
- Add missing information
|
|
69
|
+
- Update outdated information
|
|
70
|
+
- Remove obsolete information
|
|
71
|
+
- Maintain YAML structure and formatting
|
|
72
|
+
- Ensure all file paths and line numbers are accurate
|
|
73
|
+
- Keep descriptions concise and actionable
|
|
74
|
+
|
|
75
|
+
6. **Enforce Line Limit**
|
|
76
|
+
- Run: `wc -l .claude/commands/experts/codebase/expertise.yaml`
|
|
77
|
+
- Check if line count exceeds MAX_LINES (1000)
|
|
78
|
+
- If line count > MAX_LINES:
|
|
79
|
+
- Identify least important expertise sections that won't impact expert performance:
|
|
80
|
+
- Overly verbose descriptions
|
|
81
|
+
- Redundant examples
|
|
82
|
+
- Low-priority edge cases
|
|
83
|
+
- Trim identified sections
|
|
84
|
+
- Run line count check again
|
|
85
|
+
- REPEAT this sub-workflow until line count ≤ MAX_LINES
|
|
86
|
+
- Document what was trimmed in the report
|
|
87
|
+
|
|
88
|
+
7. **Validation Check**
|
|
89
|
+
- Read the updated EXPERTISE_FILE
|
|
90
|
+
- Verify all critical Database information is present
|
|
91
|
+
- Ensure line count is within limit
|
|
92
|
+
- Validate YAML syntax by compiling the file:
|
|
93
|
+
- Run: `python3 -c "import yaml; yaml.safe_load(open('EXPERTISE_FILE'))"`
|
|
94
|
+
- Replace EXPERTISE_FILE with the actual path from the variable
|
|
95
|
+
- Confirm no syntax errors are raised
|
|
96
|
+
- If errors occur, fix the YAML structure and re-validate
|
|
97
|
+
|
|
98
|
+
## Report
|
|
99
|
+
|
|
100
|
+
Provide a structured report with the following sections:
|
|
101
|
+
|
|
102
|
+
### Summary
|
|
103
|
+
- Brief overview of self-improvement execution
|
|
104
|
+
- Whether git diff was checked
|
|
105
|
+
- Focus area (if any)
|
|
106
|
+
- Total discrepancies found and remedied
|
|
107
|
+
- Final line count vs MAX_LINES
|
|
108
|
+
|
|
109
|
+
### Discrepancies Found
|
|
110
|
+
- List each discrepancy identified:
|
|
111
|
+
- What was incorrect/missing/outdated
|
|
112
|
+
- Where in the codebase the correct information was found
|
|
113
|
+
- How it was remedied
|
|
114
|
+
|
|
115
|
+
### Updates Made
|
|
116
|
+
- Concise list of all updates to EXPERTISE_FILE:
|
|
117
|
+
- Added sections/information
|
|
118
|
+
- Updated sections/information
|
|
119
|
+
- Removed sections/information
|
|
120
|
+
|
|
121
|
+
### Line Limit Enforcement
|
|
122
|
+
- Initial line count
|
|
123
|
+
- Final line count
|
|
124
|
+
- If trimming was needed:
|
|
125
|
+
- Number of trimming iterations
|
|
126
|
+
- What was trimmed and why
|
|
127
|
+
- Confirmation that trimming didn't impact critical expertise
|
|
128
|
+
|
|
129
|
+
### Validation Results
|
|
130
|
+
- Confirm all critical Codebase expertise is present
|
|
131
|
+
- Confirm line count is within limit
|
|
132
|
+
- Note any areas that may need future attention
|
|
133
|
+
|
|
134
|
+
### Codebase References
|
|
135
|
+
- List of files validated against with line numbers where relevant
|
|
136
|
+
- Key methods and functions verified
|
|
137
|
+
|
|
138
|
+
**Example Report Format:**
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
✅ Self-Improvement Complete
|
|
142
|
+
|
|
143
|
+
Summary:
|
|
144
|
+
- Git diff checked: Yes
|
|
145
|
+
- Focus area: backend_current_state
|
|
146
|
+
- Discrepancies found: 3
|
|
147
|
+
- Discrepancies remedied: 3
|
|
148
|
+
- Final line count: 520/1000 lines
|
|
149
|
+
|
|
150
|
+
Discrepancies Found:
|
|
151
|
+
1. Missing endpoint: 'edit_image' not documented
|
|
152
|
+
- Found in: backend/app/api/routes/images.py
|
|
153
|
+
- Remedied: Added to backend_current_state section
|
|
154
|
+
|
|
155
|
+
2. Outdated endpoint: 'get_image' documented
|
|
156
|
+
- Found in: backend/app/api/routes/images.py
|
|
157
|
+
- Remedied: Updated to 'get_image_by_id'
|
|
158
|
+
|
|
159
|
+
3. New feature: 'delete_image' not documented
|
|
160
|
+
- Found in: backend/app/api/routes/images.py
|
|
161
|
+
- Remedied: Added to backend_current_state section
|
|
162
|
+
|
|
163
|
+
Updates Made:
|
|
164
|
+
- Added: edit_image endpoint to backend_current_state section
|
|
165
|
+
- Updated: get_image endpoint to get_image_by_id in backend_current_state section
|
|
166
|
+
- Added: delete_image endpoint to backend_current_state section
|
|
167
|
+
|
|
168
|
+
Line Limit Enforcement:
|
|
169
|
+
- Initial: 520 lines
|
|
170
|
+
- Required trimming: No
|
|
171
|
+
- Final: 520 lines ✓
|
|
172
|
+
|
|
173
|
+
Validation Results:
|
|
174
|
+
✓ All 6 backend endpoints and features documented
|
|
175
|
+
✓ All 6 frontend pages and features documented
|
|
176
|
+
✓ Core Database schema present
|
|
177
|
+
✓ Core Authentication patterns present
|
|
178
|
+
✓ YAML syntax valid (compiled successfully)
|
|
179
|
+
|
|
180
|
+
Codebase References:
|
|
181
|
+
- backend/app/api/routes/images.py:1-150 (validated)
|
|
182
|
+
- frontend/src/pages/ImageGallery.tsx:1-496 (validated)
|
|
183
|
+
- backend/app/core/auth.py:1-150 (validated)
|
|
184
|
+
- backend/app/models/image.py:1-496 (validated)
|
|
185
|
+
- backend/app/schemas/image.py:1-150 (validated)
|
|
186
|
+
- backend/app/services/image.py:1-496 (validated)
|
|
187
|
+
- backend/app/tests/test_images.py:1-150 (validated)
|
|
188
|
+
- backend/app/tests/test_auth.py:1-496 (validated)
|
|
189
|
+
- backend/app/tests/test_schemas.py:1-150 (validated)
|
|
190
|
+
- backend/app/tests/test_services.py:1-496 (validated)
|
|
191
|
+
```
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, TodoWrite
|
|
3
|
+
description: Initialize a project based on a spec file with frontend/backend structure, Docker, and shell scripts
|
|
4
|
+
argument-hint: [SPEC_FILE_PATH]
|
|
5
|
+
model: opus
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# init_project
|
|
9
|
+
|
|
10
|
+
Initializes a new project based on requirements defined of the `SPEC_FILE_PATH`. Create a full project structure including frontend and backend apps, Docker configuration, and shell scripts for development workflows. Follow the `Workflow` section to complete the initialization and the `Validation` section to verify everything works correctly. Create the necessary files and directory for each module where appropriate eg frontend, backend, etc. and leave empty where not needed eg. no typechecking required for convex.
|
|
11
|
+
|
|
12
|
+
## Variables
|
|
13
|
+
|
|
14
|
+
SPEC_FILE_PATH: $1
|
|
15
|
+
PROJECT_STRUCTURE: |
|
|
16
|
+
.claude
|
|
17
|
+
agents
|
|
18
|
+
commands
|
|
19
|
+
hooks
|
|
20
|
+
skills
|
|
21
|
+
.codex
|
|
22
|
+
prompts
|
|
23
|
+
ai_docs
|
|
24
|
+
PROJECT_NAME_apps
|
|
25
|
+
*name_of_frontend*frontend
|
|
26
|
+
.env.sample (for the frontend)
|
|
27
|
+
Dockerfile
|
|
28
|
+
*name_of_backend*
|
|
29
|
+
.env.sample (for the backend)
|
|
30
|
+
Dockerfile
|
|
31
|
+
scripts
|
|
32
|
+
Docker-compose.yml
|
|
33
|
+
specs
|
|
34
|
+
.env.sample (for the ai engineering layer)
|
|
35
|
+
README.md
|
|
36
|
+
|
|
37
|
+
## Workflow
|
|
38
|
+
|
|
39
|
+
### Setup the project structure
|
|
40
|
+
1. Read the spec file at `SPEC_FILE_PATH` to understand project requirements and extract the PROJECT_NAME
|
|
41
|
+
2. Create the directory structure based on `PROJECT_STRUCTURE`, replacing PROJECT_NAME with the actual project name from the spec
|
|
42
|
+
3. Initialize the frontend app:
|
|
43
|
+
- Set up the frontend application in the `PROJECT_NAME_apps/frontend` directory
|
|
44
|
+
- Install necessary dependencies
|
|
45
|
+
- Create `.env.sample` with required environment variables
|
|
46
|
+
- Build 2 placeholder pages
|
|
47
|
+
4. Initialize the backend app:
|
|
48
|
+
- Set up the backend application in the `PROJECT_NAME_apps/backend` directory
|
|
49
|
+
- Install necessary dependencies
|
|
50
|
+
- Create `.env.sample` with required environment variables
|
|
51
|
+
- Build 1 placeholder endpoint
|
|
52
|
+
5. Create Dockerfiles:
|
|
53
|
+
- Create `PROJECT_NAME_apps/frontend/Dockerfile` for the frontend app
|
|
54
|
+
- Create `PROJECT_NAME_apps/backend/Dockerfile` for the backend app
|
|
55
|
+
6. Create Docker Compose:
|
|
56
|
+
- Create `PROJECT_NAME_apps/docker-compose.yml` to orchestrate frontend and backend containers
|
|
57
|
+
7. Create shell scripts in the `scripts` directory:
|
|
58
|
+
- `run_backend.sh` - Run the backend in local development mode
|
|
59
|
+
- `run_frontend.sh` - Run the frontend in local development mode
|
|
60
|
+
- `run_all.sh` - Run both frontend and backend together in local development mode
|
|
61
|
+
- `run_tests.sh` - Run the test suite
|
|
62
|
+
- `run_lint.sh` - Run linting and type checking
|
|
63
|
+
- `run_frontend_docker.sh` - Run the frontend Docker container
|
|
64
|
+
- `run_backend_docker.sh` - Run the backend Docker container
|
|
65
|
+
- `run_all_docker.sh` - Run both frontend and backend Docker containers together
|
|
66
|
+
8. Create a brief README.md in the root directory with only the essential information about the project:
|
|
67
|
+
- Project name and overview
|
|
68
|
+
- Guide to setting up and installing the project
|
|
69
|
+
- Instruction to copy the .env.sample files to the .env files and fill in the necessary information (cp .env.sample .env)
|
|
70
|
+
- Instructions on how to run the project in development mode
|
|
71
|
+
- Instructions on how to run the project in Docker mode
|
|
72
|
+
9. Create a specific "README.md" file in the `ai_docs` directory with the following information:
|
|
73
|
+
```md
|
|
74
|
+
# AI Docs
|
|
75
|
+
|
|
76
|
+
>Resources to use while working on the project
|
|
77
|
+
<list of URLs of the documentation for the chosen technologies and frameworks>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Validation
|
|
81
|
+
|
|
82
|
+
Execute each validation step sequentially. If any step fails, fix the issue before proceeding to the next step. IMPORTANT: Make sure to use the SCRIPTS/COMMANDS created in the previous step to test the project. DO NOT TEST THE PROJECT MANUALLY with "bun run" or "uv run" commands.
|
|
83
|
+
|
|
84
|
+
1. Test backend locally:
|
|
85
|
+
- Run `scripts/run_backend.sh`
|
|
86
|
+
- Verify the backend starts successfully and the placeholder endpoint responds
|
|
87
|
+
- If the script fails, fix the issue and run the script again until it succeeds.
|
|
88
|
+
- Stop the backend process
|
|
89
|
+
2. Test frontend locally:
|
|
90
|
+
- Run `scripts/run_frontend.sh`
|
|
91
|
+
- Verify the frontend starts successfully and placeholder pages are accessible
|
|
92
|
+
- If the script fails, fix the issue and run the script again until it succeeds.
|
|
93
|
+
- Stop the frontend process
|
|
94
|
+
3. Test combined local development:
|
|
95
|
+
- Run `scripts/run_all.sh`
|
|
96
|
+
- Verify both frontend and backend are running and communicating
|
|
97
|
+
- Use the chrome-devtools mcp tool to view the frontend in the browser
|
|
98
|
+
- If the script fails, fix the issue and run the script again until it succeeds.
|
|
99
|
+
- Stop both processes
|
|
100
|
+
4. Test the test suite:
|
|
101
|
+
- Run `scripts/run_tests.sh`
|
|
102
|
+
- Verify all tests pass
|
|
103
|
+
- If the script fails, fix the issue and run the script again until it succeeds.
|
|
104
|
+
5. Test linting and type checking:
|
|
105
|
+
- Run `scripts/run_lint.sh`
|
|
106
|
+
- Verify no linting or type errors
|
|
107
|
+
- If the script fails, fix the issue and run the script again until it succeeds.
|
|
108
|
+
6. Test individual Docker containers:
|
|
109
|
+
- Run `scripts/run_frontend_docker.sh`
|
|
110
|
+
- Verify the frontend container starts and serves content
|
|
111
|
+
- If the script fails, fix the issue and run the script again until it succeeds.
|
|
112
|
+
- Stop the frontend container
|
|
113
|
+
- Run `scripts/run_backend_docker.sh`
|
|
114
|
+
- Verify the backend container starts and the endpoint responds
|
|
115
|
+
- If the script fails, fix the issue and run the script again until it succeeds.
|
|
116
|
+
- Stop the backend container
|
|
117
|
+
7. Test combined Docker containers:
|
|
118
|
+
- Run `scripts/run_all_docker.sh`
|
|
119
|
+
- Verify both containers are running and communicating
|
|
120
|
+
- Use the chrome-devtools mcp tool to view the frontend in the browser
|
|
121
|
+
- If the script fails, fix the issue and run the script again until it succeeds.
|
|
122
|
+
- Stop both containers
|
|
123
|
+
|
|
124
|
+
## Report
|
|
125
|
+
|
|
126
|
+
After completing the workflow and validation, provide a summary that includes:
|
|
127
|
+
|
|
128
|
+
- Project name and structure created
|
|
129
|
+
- Frontend setup details (framework, dependencies, placeholder pages)
|
|
130
|
+
- Backend setup details (framework, dependencies, placeholder endpoint)
|
|
131
|
+
- Docker configuration summary
|
|
132
|
+
- Shell scripts created and their purposes
|
|
133
|
+
- Validation results for each test step (pass/fail)
|
|
134
|
+
- Any issues encountered and how they were resolved
|
|
135
|
+
- Instructions for the user to get started with the project
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: AskUserQuestion, Read, Edit, Glob
|
|
3
|
+
description: Iterate on the initial codebase specification through guided questions
|
|
4
|
+
argument-hint: [CHANGE_REQUEST]
|
|
5
|
+
model: opus
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Iterate Spec
|
|
9
|
+
|
|
10
|
+
Guide the user through refining their `specs/initial-codebase-spec.md` based on the change request provided in `CHANGE_REQUEST`. Follow the `Workflow` to understand the current spec, clarify the requested changes, and apply updates. Reference the `Instructions` section for behavioral guidelines.
|
|
11
|
+
|
|
12
|
+
## Variables
|
|
13
|
+
|
|
14
|
+
CHANGE_REQUEST: $ARGUMENTS
|
|
15
|
+
SPEC_PATH: `specs/initial-codebase-spec.md`
|
|
16
|
+
|
|
17
|
+
## Instructions
|
|
18
|
+
|
|
19
|
+
- Read and understand the current specification before proposing any changes
|
|
20
|
+
- Use `AskUserQuestion` tool to clarify ambiguous change requests
|
|
21
|
+
- Present the impact of proposed changes before applying them
|
|
22
|
+
- Preserve sections of the spec that are not affected by the change request
|
|
23
|
+
- Offer sensible defaults when the user is unsure about implementation details
|
|
24
|
+
- Summarize each change after it's made before moving to the next
|
|
25
|
+
- If a change affects multiple sections (e.g., adding a feature affects Tech Stack, Schema, and API Endpoints), identify all affected sections upfront
|
|
26
|
+
- Maintain consistency with existing patterns in the spec (naming conventions, formatting, structure)
|
|
27
|
+
- Give the user an option to ask for your recommendation if they are unsure about choices
|
|
28
|
+
- If the `CHANGE_REQUEST` is empty or unclear, ask the user what aspect of the spec they want to modify
|
|
29
|
+
|
|
30
|
+
## Workflow
|
|
31
|
+
|
|
32
|
+
1. Read the current specification at `SPEC_PATH` to understand the existing project structure
|
|
33
|
+
2. Analyze the `CHANGE_REQUEST` to determine which sections of the spec will be affected:
|
|
34
|
+
- Project Summary (name, purpose, users, personas)
|
|
35
|
+
- Core Features
|
|
36
|
+
- Tech Stack
|
|
37
|
+
- Documentation links
|
|
38
|
+
- Codebase Structure
|
|
39
|
+
- Database Schema
|
|
40
|
+
- API Endpoints
|
|
41
|
+
- Environment Variables
|
|
42
|
+
3. If the `CHANGE_REQUEST` is ambiguous or spans multiple areas, use `AskUserQuestion` to clarify:
|
|
43
|
+
- What specific aspect they want to change
|
|
44
|
+
- The scope of the change (additive, replacement, or removal)
|
|
45
|
+
- Any constraints or preferences they have
|
|
46
|
+
4. Present a summary of the proposed changes and which sections will be modified
|
|
47
|
+
5. Use `AskUserQuestion` to confirm the user wants to proceed with the changes
|
|
48
|
+
6. Create a new spec file in the `specs/` directory with the changes named `initial-codebase-spec-<change-number>.md`
|
|
49
|
+
7. If additional changes are discovered during implementation, ask the user before making them
|
|
50
|
+
8. After all changes are applied, summarize what was modified
|
|
51
|
+
|
|
52
|
+
## Report
|
|
53
|
+
|
|
54
|
+
After completing the workflow, respond to the user with:
|
|
55
|
+
|
|
56
|
+
- A summary of all changes made to the specification
|
|
57
|
+
- List of sections that were modified
|
|
58
|
+
- Any follow-up considerations (e.g., "You may also want to update X if you plan to Y")
|
|
59
|
+
- Confirmation that the spec has been saved
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: AskUserQuestion, Write, Read, Bash
|
|
3
|
+
description: Interactive prompt to gather project requirements and generate an initial codebase specification
|
|
4
|
+
argument-hint: [USER_PROMPT]
|
|
5
|
+
model: opus
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Plan Project
|
|
9
|
+
|
|
10
|
+
Generate a `specs/initial-codebase-spec.md` file based on the user's prompt. Follow the `Workflow` in order to gather user input through structured questions and produce a complete specification document. Reference the `Instructions` section for behavioral guidelines.
|
|
11
|
+
|
|
12
|
+
## Variables
|
|
13
|
+
|
|
14
|
+
USER_PROMPT: $1
|
|
15
|
+
PLAN_OUTPUT_DIRECTORY: `specs/`
|
|
16
|
+
|
|
17
|
+
## Instructions
|
|
18
|
+
|
|
19
|
+
- Help the user plan out the project based on the `USER_PROMPT`
|
|
20
|
+
- Use `AskUserQuestion` tool at each decision point to gather input
|
|
21
|
+
- Present sensible defaults where appropriate (e.g., Bun for JS, UV for Python)
|
|
22
|
+
- Allow the user to skip sections if they want to accept defaults
|
|
23
|
+
- Summarize decisions after each major section before moving on
|
|
24
|
+
- Keep the conversation focused and efficient
|
|
25
|
+
- If the user provides partial information, ask clarifying follow-ups
|
|
26
|
+
- Maintain a professional, collaborative tone throughout
|
|
27
|
+
- Give the user an option to ask you for input on the descisions if they are unsure about the choices
|
|
28
|
+
|
|
29
|
+
## Workflow
|
|
30
|
+
|
|
31
|
+
- First, welcome the user and explain that you'll be gathering requirements to create an initial codebase specification
|
|
32
|
+
- Then, gather the project summary:
|
|
33
|
+
- Ask for the project name and purpose (what problem does it solve?)
|
|
34
|
+
- Ask about target users and user personas
|
|
35
|
+
- Ask for 3-5 core features the project must have
|
|
36
|
+
- Summarize project summary decisions and confirm before proceeding
|
|
37
|
+
- Then, gather the tech stack decisions:
|
|
38
|
+
- Frontend: Ask about framework preference (React, NEXT.js, Vue, Svelte, etc.) - note that Bun will be used as the package manager for JS frameworks
|
|
39
|
+
- Backend: Ask about framework preference (FastAPI, Django, Express, Fastify,etc.) - note that UV will be used for Python projects
|
|
40
|
+
- Database: Ask about database type (PostgreSQL, MySQL, SQLite, MongoDB) and ORM/query layer preference
|
|
41
|
+
- Auth: Ask about authentication solution (Clerk, Auth0, Supabase Auth, custom)
|
|
42
|
+
- Hosting: Ask about hosting solution (Vercel, Railway, Render, Supabase, custom)
|
|
43
|
+
- CI/CD: Ask about CI/CD solution (GitHub Actions, GitLab CI, CircleCI, custom)
|
|
44
|
+
- Ask about any specific AI Agents or tools that the user wants to use
|
|
45
|
+
- Summarize tech stack decisions and confirm before proceeding
|
|
46
|
+
- Then, spin up a subagent to use webfetch to find the documentation for the chosen technologies and frameworks.
|
|
47
|
+
- The subagent should return a list of URLs of the documentation for the chosen technologies and frameworks.
|
|
48
|
+
- Then generate the `specs/initial-codebase-spec.md`
|
|
49
|
+
- First check to see if the `specs/` directory exists. If it does not, create it.
|
|
50
|
+
- Then create the `initial-codebase-spec.md` file in the `specs/` directory in the `Output Format`
|
|
51
|
+
|
|
52
|
+
## Output Format
|
|
53
|
+
|
|
54
|
+
```md
|
|
55
|
+
# <PROJECT_NAME> - Project Specification
|
|
56
|
+
|
|
57
|
+
## Project Summary
|
|
58
|
+
|
|
59
|
+
<PROJECT_NAME>
|
|
60
|
+
<PROJECT_PURPOSE>
|
|
61
|
+
<PROJECT_TARGET_USERS>
|
|
62
|
+
<PROJECT_USER_PERSONAS>
|
|
63
|
+
|
|
64
|
+
## Core Features (V0)
|
|
65
|
+
|
|
66
|
+
<List of Core Features (V0)>
|
|
67
|
+
|
|
68
|
+
## Tech Stack
|
|
69
|
+
|
|
70
|
+
<Frontend Technology>
|
|
71
|
+
<Backend Technology>
|
|
72
|
+
<Database Technology>
|
|
73
|
+
<Auth Technology>
|
|
74
|
+
<Hosting Technology>
|
|
75
|
+
<CI/CD Technology>
|
|
76
|
+
<AI Agents or Tools>
|
|
77
|
+
|
|
78
|
+
## Documentation
|
|
79
|
+
|
|
80
|
+
<Frontend Documentation (list of URLs)>
|
|
81
|
+
<Backend Documentation (list of URLs)>
|
|
82
|
+
<Database Documentation (list of URLs)>
|
|
83
|
+
<Auth Documentation (list of URLs)>
|
|
84
|
+
<Hosting Documentation (list of URLs)>
|
|
85
|
+
<CI/CD Documentation (list of URLs)>
|
|
86
|
+
<AI Agents or Tools Documentation (list of URLs)>
|
|
87
|
+
|
|
88
|
+
## Codebase Structure
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
PROJECT_STRUCTURE: |
|
|
92
|
+
├── .claude/
|
|
93
|
+
│ ├── agents/
|
|
94
|
+
│ ├── commands/
|
|
95
|
+
│ ├── hooks/
|
|
96
|
+
│ └── skills/
|
|
97
|
+
├── .codex/
|
|
98
|
+
│ └── prompts/
|
|
99
|
+
├── .github/
|
|
100
|
+
│ └── workflows/
|
|
101
|
+
│ ├── ci.yml
|
|
102
|
+
│ └── deploy.yml
|
|
103
|
+
├── ai_docs/
|
|
104
|
+
├── PROJECT_NAME_apps/
|
|
105
|
+
│ ├── frontend/
|
|
106
|
+
│ │ ├── .env.sample (for the frontend)
|
|
107
|
+
│ │ └─── Dockerfile
|
|
108
|
+
│ └── backend/
|
|
109
|
+
│ ├── .env.sample (for the backend)
|
|
110
|
+
│ └── Dockerfile
|
|
111
|
+
├── scripts/
|
|
112
|
+
├── specs/
|
|
113
|
+
├── .env.sample (for the ai engineering layer)
|
|
114
|
+
├── docker-compose.yml
|
|
115
|
+
└── README.md
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
## Database Schema
|
|
119
|
+
|
|
120
|
+
<suggested DATABASE_SCHEMA>
|
|
121
|
+
|
|
122
|
+
## API Endpoints
|
|
123
|
+
|
|
124
|
+
<suggested API_ENDPOINTS>
|
|
125
|
+
|
|
126
|
+
## Environment Variables
|
|
127
|
+
|
|
128
|
+
<FRONTEND_ENV_VARIABLES>
|
|
129
|
+
<BACKEND_ENV_VARIABLES>
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Report
|
|
134
|
+
|
|
135
|
+
After completing the workflow, respond to the user with:
|
|
136
|
+
|
|
137
|
+
- Confirmation that the specification has been saved to `/specs/initial-codebase-spec.md`
|
|
138
|
+
- A brief summary of the key decisions made:
|
|
139
|
+
- Project name and purpose
|
|
140
|
+
- Core features count
|
|
141
|
+
- Tech stack overview (frontend, backend, database, auth)
|
|
142
|
+
- Guidance on next steps: suggest reviewing the spec and using it to scaffold the project
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|