claude-fsd 1.5.24 → 1.5.26
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/README.md +9 -19
- package/bin/claudefsd +1 -17
- package/bin/claudefsd-analyze-brief +4 -11
- package/bin/claudefsd-analyze-brief-personas +1 -8
- package/bin/claudefsd-check-dependencies +3 -25
- package/bin/claudefsd-create-plan +18 -96
- package/bin/claudefsd-dev +21 -82
- package/bin/claudefsd-interview +1 -1
- package/package.json +1 -1
- package/bin/claudefsd-dev 2 +0 -69
package/README.md
CHANGED
|
@@ -69,10 +69,6 @@ claude-fsd create-plan # Generate development plan from requirements
|
|
|
69
69
|
claude-fsd --working-dir=project1 dev
|
|
70
70
|
claude-fsd --working-dir=backend interview
|
|
71
71
|
|
|
72
|
-
# Fast mode (skips slow o3-pro planning)
|
|
73
|
-
claude-fsd create-plan --fast
|
|
74
|
-
claude-fsd --working-dir=project1 --fast create-plan
|
|
75
|
-
|
|
76
72
|
# claudefsd also works the same way
|
|
77
73
|
claudefsd # Same as claude-fsd
|
|
78
74
|
```
|
|
@@ -87,7 +83,7 @@ Runs the development agent fleet. This command:
|
|
|
87
83
|
- Updates the plan to track progress
|
|
88
84
|
- Repeats until all tasks are done
|
|
89
85
|
|
|
90
|
-
Every 4th cycle, it activates "megathinking mode" using
|
|
86
|
+
Every 4th cycle, it activates "megathinking mode" using ultrathink for deep architectural planning.
|
|
91
87
|
|
|
92
88
|
#### claudefsd-interview
|
|
93
89
|
Interactive expert Q&A session that:
|
|
@@ -101,8 +97,7 @@ Generates a comprehensive development plan based on:
|
|
|
101
97
|
- Your project brief (BRIEF.md)
|
|
102
98
|
- Interview answers (QUESTIONS.md) or requirements (REQUIREMENTS.md)
|
|
103
99
|
- Creates PLAN.md with prioritized tasks and CLAUDE-NOTES.md with architectural analysis
|
|
104
|
-
- Uses
|
|
105
|
-
- Use `--fast` flag to skip o3-pro step for quicker results
|
|
100
|
+
- Uses Claude Sonnet with ultrathink for deep strategic planning
|
|
106
101
|
|
|
107
102
|
## How it Works
|
|
108
103
|
|
|
@@ -113,7 +108,6 @@ Generates a comprehensive development plan based on:
|
|
|
113
108
|
- Analyzes all open tasks in PLAN.md
|
|
114
109
|
- Intelligently executes tasks (sequentially or in parallel)
|
|
115
110
|
- Updates the plan to track progress
|
|
116
|
-
- Runs unit tests before declaring completion (if docs/unit-test exists)
|
|
117
111
|
- Repeats until all tasks are complete or **<ALL DONE>** is detected
|
|
118
112
|
|
|
119
113
|
## Monitoring Progress (Like Tesla FSD)
|
|
@@ -159,7 +153,6 @@ your-project/
|
|
|
159
153
|
│ ├── QUESTIONS.md # Interview questions and answers
|
|
160
154
|
│ ├── REQUIREMENTS.md # Consolidated requirements from interview
|
|
161
155
|
│ ├── IDEAS.md # Future ideas and improvements
|
|
162
|
-
│ ├── unit-test # Executable test script (exit 0 = pass)
|
|
163
156
|
│ └── INTERVIEW-SESSION.json # Interview session metadata
|
|
164
157
|
├── logs/ # Logs from each AI session
|
|
165
158
|
└── [your code files]
|
|
@@ -190,21 +183,18 @@ your-project/
|
|
|
190
183
|
|
|
191
184
|
## Model Selection Strategy
|
|
192
185
|
|
|
193
|
-
The system
|
|
186
|
+
The system uses Claude Sonnet throughout with strategic ultrathinking for complex work:
|
|
194
187
|
|
|
195
|
-
- **
|
|
196
|
-
-
|
|
197
|
-
-
|
|
198
|
-
|
|
199
|
-
- **Opus Model**: Used for complex architectural work
|
|
200
|
-
- Requirements gathering (interview)
|
|
201
|
-
- Standard architecture planning (create-plan with --fast or when codex unavailable)
|
|
188
|
+
- **Sonnet + Ultrathink**: Used for complex architectural work requiring deep thinking
|
|
189
|
+
- Requirements consolidation (interview)
|
|
190
|
+
- Deep strategic planning (create-plan)
|
|
202
191
|
- Megathinking mode (every 4th dev iteration)
|
|
203
|
-
|
|
204
|
-
- **Sonnet
|
|
192
|
+
|
|
193
|
+
- **Sonnet (Standard)**: Used for regular development
|
|
205
194
|
- Standard development tasks
|
|
206
195
|
- Code implementation and reviews
|
|
207
196
|
- Most development iterations
|
|
197
|
+
- Question generation in interview
|
|
208
198
|
|
|
209
199
|
|
|
210
200
|
## License
|
package/bin/claudefsd
CHANGED
|
@@ -10,7 +10,6 @@ NC='\033[0m' # No Color
|
|
|
10
10
|
|
|
11
11
|
# Parse command line parameters
|
|
12
12
|
WORKING_DIR="docs"
|
|
13
|
-
FAST_MODE=""
|
|
14
13
|
for arg in "$@"; do
|
|
15
14
|
case $arg in
|
|
16
15
|
--working-dir=*)
|
|
@@ -18,10 +17,6 @@ for arg in "$@"; do
|
|
|
18
17
|
# Remove this argument from the list
|
|
19
18
|
shift
|
|
20
19
|
;;
|
|
21
|
-
--fast)
|
|
22
|
-
FAST_MODE="--fast"
|
|
23
|
-
shift
|
|
24
|
-
;;
|
|
25
20
|
esac
|
|
26
21
|
done
|
|
27
22
|
export CLAUDEFSD_WORKING_DIR="$WORKING_DIR"
|
|
@@ -246,17 +241,6 @@ if [ $# -eq 0 ]; then
|
|
|
246
241
|
echo "- Success criterion 1" >> "$WORKING_DIR/BRIEF.md"
|
|
247
242
|
echo "- Success criterion 2" >> "$WORKING_DIR/BRIEF.md"
|
|
248
243
|
|
|
249
|
-
# Create placeholder unit-test script
|
|
250
|
-
cat > "$WORKING_DIR/unit-test" << 'EOF'
|
|
251
|
-
#!/bin/bash
|
|
252
|
-
# Unit tests for the project
|
|
253
|
-
# Add your tests here. Exit 0 for success, non-zero for failure.
|
|
254
|
-
|
|
255
|
-
echo "No tests defined yet - placeholder passes"
|
|
256
|
-
exit 0
|
|
257
|
-
EOF
|
|
258
|
-
chmod +x "$WORKING_DIR/unit-test"
|
|
259
|
-
|
|
260
244
|
open_with_editor "$WORKING_DIR/BRIEF.md"
|
|
261
245
|
echo
|
|
262
246
|
echo -e "${GREEN}Brief created! Run claudefsd again to start the interview.${NC}"
|
|
@@ -282,7 +266,7 @@ EOF
|
|
|
282
266
|
if [ -f "$WORKING_DIR/REQUIREMENTS.md" ] || [ -f "$WORKING_DIR/QUESTIONS.md" ]; then
|
|
283
267
|
echo -e "${GREEN}Creating plan from project inputs...${NC}"
|
|
284
268
|
echo
|
|
285
|
-
exec "$(dirname "$0")/claudefsd-create-plan" --working-dir="$WORKING_DIR"
|
|
269
|
+
exec "$(dirname "$0")/claudefsd-create-plan" --working-dir="$WORKING_DIR"
|
|
286
270
|
else
|
|
287
271
|
echo -e "${RED}No requirements or questions found. Please run the interview first.${NC}"
|
|
288
272
|
exit 1
|
|
@@ -32,14 +32,7 @@ if [ "$EDITOR" == "" ]; then
|
|
|
32
32
|
EDITOR="nano"
|
|
33
33
|
fi
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
if [ "$WORKING_DIR" != "docs" ]; then
|
|
37
|
-
# Extract a clean token from the working directory path
|
|
38
|
-
WORKING_DIR_TOKEN=$(echo "$WORKING_DIR" | sed 's/[^a-zA-Z0-9]/-/g' | sed 's/^-\+//;s/-\+$//')
|
|
39
|
-
LOGFILE="logs/claude-${WORKING_DIR_TOKEN}-$(date +%Y%m%d_%H%M%S).txt"
|
|
40
|
-
else
|
|
41
|
-
LOGFILE="logs/claude-$(date +%Y%m%d_%H%M%S).txt"
|
|
42
|
-
fi
|
|
35
|
+
LOGFILE="logs/claude-$(date +%Y%m%d_%H%M%S).txt"
|
|
43
36
|
|
|
44
37
|
echo -e "\033[32m==================================================================\033[0m"
|
|
45
38
|
echo -e "\033[32m== ANALYZING PROJECT BRIEF\033[0m"
|
|
@@ -55,7 +48,7 @@ Read all of these documents if they exist:
|
|
|
55
48
|
- docs/WEBTESTS.md -- the project web tests
|
|
56
49
|
- README.md -- the project README
|
|
57
50
|
|
|
58
|
-
Your job, as
|
|
51
|
+
Your job, as an ultrathinker business analyst, is to analyze the project brief and generate clarifying questions.
|
|
59
52
|
|
|
60
53
|
1. Read through the BRIEF.md and any existing documents to understand the project.
|
|
61
54
|
2. Generate 10-15 relevant questions to clarify ambiguous aspects of the brief.
|
|
@@ -74,8 +67,8 @@ DO NOT answer the questions yourself - just generate them for the user to answer
|
|
|
74
67
|
"
|
|
75
68
|
|
|
76
69
|
# run BA's
|
|
77
|
-
echo "Running claude with
|
|
78
|
-
claude --model
|
|
70
|
+
echo "Running claude with sonnet model with ultrathink..."
|
|
71
|
+
claude --model sonnet --dangerously-skip-permissions -p "$prompt1" | tee >(cat > $LOGFILE-ba1)
|
|
79
72
|
|
|
80
73
|
# Only run codex if available
|
|
81
74
|
if command -v codex >/dev/null 2>&1; then
|
|
@@ -54,14 +54,7 @@ if [ $? -ne 0 ]; then
|
|
|
54
54
|
exit 1
|
|
55
55
|
fi
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
if [ "$WORKING_DIR" != "docs" ]; then
|
|
59
|
-
# Extract a clean token from the working directory path
|
|
60
|
-
WORKING_DIR_TOKEN=$(echo "$WORKING_DIR" | sed 's/[^a-zA-Z0-9]/-/g' | sed 's/^-\+//;s/-\+$//')
|
|
61
|
-
LOGFILE="logs/claude-${WORKING_DIR_TOKEN}-$(date +%Y%m%d_%H%M%S).txt"
|
|
62
|
-
else
|
|
63
|
-
LOGFILE="logs/claude-$(date +%Y%m%d_%H%M%S).txt"
|
|
64
|
-
fi
|
|
57
|
+
LOGFILE="logs/claude-$(date +%Y%m%d_%H%M%S).txt"
|
|
65
58
|
|
|
66
59
|
echo -e "\033[32m==================================================================\033[0m"
|
|
67
60
|
echo -e "\033[32m== ANALYZING PROJECT BRIEF WITH EXPERT PERSONAS\033[0m"
|
|
@@ -13,26 +13,13 @@ command_exists() {
|
|
|
13
13
|
|
|
14
14
|
# Function to check dependencies
|
|
15
15
|
check_dependencies() {
|
|
16
|
-
local check_codex=${1:-true} # Check codex by default
|
|
17
16
|
local missing_deps=()
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
# Check for claude
|
|
17
|
+
|
|
18
|
+
# Check for claude (only required dependency)
|
|
21
19
|
if ! command_exists claude; then
|
|
22
20
|
missing_deps+=("claude")
|
|
23
21
|
fi
|
|
24
|
-
|
|
25
|
-
# Check for codex (optional but recommended)
|
|
26
|
-
if [ "$check_codex" = true ] && ! command_exists codex; then
|
|
27
|
-
warnings+=("codex is not installed. Some review features will be unavailable.")
|
|
28
|
-
fi
|
|
29
|
-
|
|
30
|
-
# Check for OPENAI_API_KEY (optional for codex)
|
|
31
|
-
if [ "$check_codex" = true ] && [ -z "${OPENAI_API_KEY:-}" ]; then
|
|
32
|
-
warnings+=("OPENAI_API_KEY is not set. Codex features will be limited.")
|
|
33
|
-
warnings+=("Set it with: export OPENAI_API_KEY='your-key-here'")
|
|
34
|
-
fi
|
|
35
|
-
|
|
22
|
+
|
|
36
23
|
# Show critical errors
|
|
37
24
|
if [ ${#missing_deps[@]} -ne 0 ]; then
|
|
38
25
|
echo -e "${RED}❌ Missing required dependencies:${NC}"
|
|
@@ -45,15 +32,6 @@ check_dependencies() {
|
|
|
45
32
|
echo
|
|
46
33
|
exit 1
|
|
47
34
|
fi
|
|
48
|
-
|
|
49
|
-
# Show warnings
|
|
50
|
-
if [ ${#warnings[@]} -ne 0 ]; then
|
|
51
|
-
echo -e "${YELLOW}⚠️ Optional dependencies:${NC}"
|
|
52
|
-
for warning in "${warnings[@]}"; do
|
|
53
|
-
echo -e " - $warning"
|
|
54
|
-
done
|
|
55
|
-
echo
|
|
56
|
-
fi
|
|
57
35
|
}
|
|
58
36
|
|
|
59
37
|
# If sourced directly, run the check
|
|
@@ -4,17 +4,12 @@ set -e
|
|
|
4
4
|
|
|
5
5
|
# Parse command line parameters
|
|
6
6
|
WORKING_DIR="docs"
|
|
7
|
-
FAST_MODE=false
|
|
8
7
|
for arg in "$@"; do
|
|
9
8
|
case $arg in
|
|
10
9
|
--working-dir=*)
|
|
11
10
|
WORKING_DIR="${arg#*=}"
|
|
12
11
|
shift
|
|
13
12
|
;;
|
|
14
|
-
--fast)
|
|
15
|
-
FAST_MODE=true
|
|
16
|
-
shift
|
|
17
|
-
;;
|
|
18
13
|
esac
|
|
19
14
|
done
|
|
20
15
|
export CLAUDEFSD_WORKING_DIR="$WORKING_DIR"
|
|
@@ -44,14 +39,7 @@ if [ ! -f "$WORKING_DIR/QUESTIONS.md" ] && [ ! -f "$WORKING_DIR/REQUIREMENTS.md"
|
|
|
44
39
|
exit 1
|
|
45
40
|
fi
|
|
46
41
|
|
|
47
|
-
|
|
48
|
-
if [ "$WORKING_DIR" != "docs" ]; then
|
|
49
|
-
# Extract a clean token from the working directory path
|
|
50
|
-
WORKING_DIR_TOKEN=$(echo "$WORKING_DIR" | sed 's/[^a-zA-Z0-9]/-/g' | sed 's/^-\+//;s/-\+$//')
|
|
51
|
-
LOGFILE="logs/claude-${WORKING_DIR_TOKEN}-$(date +%Y%m%d_%H%M%S).txt"
|
|
52
|
-
else
|
|
53
|
-
LOGFILE="logs/claude-$(date +%Y%m%d_%H%M%S).txt"
|
|
54
|
-
fi
|
|
42
|
+
LOGFILE="logs/claude-$(date +%Y%m%d_%H%M%S).txt"
|
|
55
43
|
|
|
56
44
|
echo -e "\033[32m==================================================================\033[0m"
|
|
57
45
|
echo -e "\033[32m== CREATING PLAN FROM PROJECT INPUTS\033[0m"
|
|
@@ -97,92 +85,26 @@ INFRASTRUCTURE PROPORTIONALITY RULES:
|
|
|
97
85
|
- Follow existing claude-fsd pattern: separate focused scripts, not monoliths
|
|
98
86
|
- FAIL LOUD - simple error handling, exit on failure
|
|
99
87
|
- Choose infrastructure complexity appropriate to solution size
|
|
88
|
+
"
|
|
89
|
+
|
|
90
|
+
# Add ultrathink instruction to the beginning
|
|
91
|
+
ultrathink_instruction="<ultrathink>
|
|
92
|
+
You are entering deep strategic planning mode. Before responding, engage in extended reasoning to:
|
|
93
|
+
- Analyze the full scope and implications of the project
|
|
94
|
+
- Consider architectural tradeoffs and long-term consequences
|
|
95
|
+
- Identify edge cases, failure modes, and technical risks
|
|
96
|
+
- Think through the optimal approach from multiple angles
|
|
97
|
+
Take your time to think deeply about the best solution before generating your plan.
|
|
98
|
+
</ultrathink>
|
|
100
99
|
|
|
101
|
-
WEB TESTING REQUIREMENTS:
|
|
102
|
-
- If the project includes ANY web interface (including dashboards, web apps, or APIs with UI):
|
|
103
|
-
- MUST include web testing tasks in the plan
|
|
104
|
-
- Use playwright MCP for browser automation and testing
|
|
105
|
-
- Create $WORKING_DIR/WEBTESTS.md to document web test scenarios
|
|
106
|
-
- Test both structure/functionality AND visual appearance with screenshots
|
|
107
|
-
- Include tests for: page rendering, user interactions, form submissions, navigation
|
|
108
|
-
- Web tests should cover happy paths and key error scenarios
|
|
109
100
|
"
|
|
110
101
|
|
|
111
|
-
#
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
echo ""
|
|
118
|
-
echo -e "\033[33m==================================================================\033[0m"
|
|
119
|
-
echo -e "\033[33m== RUNNING O3-PRO FOR DEEP STRATEGIC PLANNING\033[0m"
|
|
120
|
-
echo -e "\033[33m==================================================================\033[0m"
|
|
121
|
-
echo "⏳ This will take several minutes as o3-pro deeply analyzes the project..."
|
|
122
|
-
echo " o3-pro excels at strategic thinking and will create a comprehensive plan."
|
|
123
|
-
echo ""
|
|
124
|
-
|
|
125
|
-
# Prepare comprehensive context for o3-pro with file references
|
|
126
|
-
file_list=""
|
|
127
|
-
[ -f "$BRIEF_FILE" ] && file_list="$file_list\n- $BRIEF_FILE (project brief)"
|
|
128
|
-
[ -f "$WORKING_DIR/QUESTIONS.md" ] && file_list="$file_list\n- $WORKING_DIR/QUESTIONS.md (interview questions & answers)"
|
|
129
|
-
[ -f "$WORKING_DIR/REQUIREMENTS.md" ] && file_list="$file_list\n- $WORKING_DIR/REQUIREMENTS.md (consolidated requirements)"
|
|
130
|
-
[ -f "$WORKING_DIR/INTERVIEW-SESSION.json" ] && file_list="$file_list\n- $WORKING_DIR/INTERVIEW-SESSION.json (interview metadata)"
|
|
131
|
-
[ -f "$WORKING_DIR/CLAUDE-NOTES.md" ] && file_list="$file_list\n- $WORKING_DIR/CLAUDE-NOTES.md (existing technical notes)"
|
|
132
|
-
[ -f "$WORKING_DIR/IDEAS.md" ] && file_list="$file_list\n- $WORKING_DIR/IDEAS.md (ideas backlog)"
|
|
133
|
-
[ -f "$WORKING_DIR/README.md" ] && file_list="$file_list\n- $WORKING_DIR/README.md (project readme)"
|
|
134
|
-
|
|
135
|
-
o3_prompt="You are an elite software architect and strategic planner using o3-pro's advanced reasoning capabilities.
|
|
136
|
-
|
|
137
|
-
READ AND ANALYZE THESE PROJECT FILES:$file_list
|
|
138
|
-
|
|
139
|
-
TASK:
|
|
140
|
-
Using your deep strategic reasoning, create a comprehensive project architecture and implementation plan.
|
|
141
|
-
|
|
142
|
-
1. ARCHITECTURAL ANALYSIS ($WORKING_DIR/CLAUDE-NOTES.md):
|
|
143
|
-
- System architecture and key design decisions
|
|
144
|
-
- Technology stack justification
|
|
145
|
-
- Critical technical challenges and mitigation strategies
|
|
146
|
-
- Integration points and dependencies
|
|
147
|
-
- Performance and scalability considerations
|
|
148
|
-
- Security architecture
|
|
149
|
-
- Long-term maintainability strategy
|
|
150
|
-
|
|
151
|
-
2. IMPLEMENTATION PLAN ($WORKING_DIR/PLAN.md):
|
|
152
|
-
- Master plan limited to 100 lines maximum with high-level sections
|
|
153
|
-
- For complex projects, create detailed sub-plans in separate files ($WORKING_DIR/plan-section1.md, etc.)
|
|
154
|
-
- Phased development approach with clear milestones
|
|
155
|
-
- Task breakdown with dependencies (detailed in sub-plans if needed)
|
|
156
|
-
- Risk assessment for each phase
|
|
157
|
-
- Testing strategy integrated into each phase
|
|
158
|
-
- Infrastructure needs (proportional to project size)
|
|
159
|
-
- Performance benchmarks and acceptance criteria
|
|
160
|
-
|
|
161
|
-
Remember:
|
|
162
|
-
- Think strategically about the entire system lifecycle
|
|
163
|
-
- Consider edge cases and failure modes
|
|
164
|
-
- Plan for iterative development and feedback loops
|
|
165
|
-
- Keep infrastructure proportional to project complexity
|
|
166
|
-
- Prioritize robustness and maintainability
|
|
167
|
-
|
|
168
|
-
Take your time to think deeply about the optimal approach."
|
|
169
|
-
|
|
170
|
-
echo "Running codex o3-pro (this may take 3-5 minutes)..."
|
|
171
|
-
codex -m o3-pro --full-auto -q "$o3_prompt" | tee $LOGFILE-ba4
|
|
172
|
-
echo ""
|
|
173
|
-
echo "✅ o3-pro strategic planning complete!"
|
|
174
|
-
else
|
|
175
|
-
echo ""
|
|
176
|
-
if [ "$FAST_MODE" = true ]; then
|
|
177
|
-
echo -e "\033[33m⚡ Fast mode enabled - skipping o3-pro strategic analysis for quicker results.\033[0m"
|
|
178
|
-
echo "Use 'claudefsd-create-plan' without --fast for deep o3-pro planning."
|
|
179
|
-
echo "Fast mode: skipping o3-pro strategic analysis" > $LOGFILE-ba4
|
|
180
|
-
else
|
|
181
|
-
echo -e "\033[33mNote: Install 'codex' CLI to enable o3-pro strategic planning for enhanced results.\033[0m"
|
|
182
|
-
echo "Proceeding with standard planning using Claude Opus..."
|
|
183
|
-
echo "Codex not available, skipping o3-pro strategic analysis" > $LOGFILE-ba4
|
|
184
|
-
fi
|
|
185
|
-
fi
|
|
102
|
+
# Prepend ultrathink to the prompt
|
|
103
|
+
prompt2="$ultrathink_instruction$prompt2"
|
|
104
|
+
|
|
105
|
+
# Run planning with sonnet + ultrathink
|
|
106
|
+
echo "Running claude with sonnet model (ultrathink mode)..."
|
|
107
|
+
claude --model sonnet --dangerously-skip-permissions -p "$prompt2" | tee >(cat > $LOGFILE-ba3)
|
|
186
108
|
|
|
187
109
|
echo -e "\033[32m==================================================================\033[0m"
|
|
188
110
|
echo -e "\033[32m== PLAN CREATION COMPLETE\033[0m"
|
package/bin/claudefsd-dev
CHANGED
|
@@ -69,10 +69,7 @@ LOOP_COUNTER=0
|
|
|
69
69
|
|
|
70
70
|
# Failure detection variables
|
|
71
71
|
CONSECUTIVE_FAST_ITERATIONS=0
|
|
72
|
-
MIN_ITERATION_TIME=
|
|
73
|
-
|
|
74
|
-
# Unit test failure tracking
|
|
75
|
-
UNIT_TEST_FAILURE_INFO=""
|
|
72
|
+
MIN_ITERATION_TIME=300 # 5 minutes in seconds
|
|
76
73
|
|
|
77
74
|
while true; do
|
|
78
75
|
# Record iteration start time
|
|
@@ -81,21 +78,11 @@ while true; do
|
|
|
81
78
|
# Increment loop counter
|
|
82
79
|
LOOP_COUNTER=$((LOOP_COUNTER + 1))
|
|
83
80
|
|
|
84
|
-
# Unit test failure info will persist from previous iteration if tests failed
|
|
85
|
-
|
|
86
81
|
mkdir -p logs
|
|
87
82
|
# Use a temporary directory for tmp files
|
|
88
83
|
mkdir -p tmp
|
|
89
84
|
export TMPDIR=tmp/
|
|
90
|
-
|
|
91
|
-
# Generate log filename with working-dir token if set
|
|
92
|
-
if [ "$WORKING_DIR" != "docs" ]; then
|
|
93
|
-
# Extract a clean token from the working directory path
|
|
94
|
-
WORKING_DIR_TOKEN=$(echo "$WORKING_DIR" | sed 's/[^a-zA-Z0-9]/-/g' | sed 's/^-\+//;s/-\+$//')
|
|
95
|
-
LOGFILE="logs/claude-dev-${WORKING_DIR_TOKEN}-$(date +%Y%m%d_%H%M%S).txt"
|
|
96
|
-
else
|
|
97
|
-
LOGFILE="logs/claude-dev-$(date +%Y%m%d_%H%M%S).txt"
|
|
98
|
-
fi
|
|
85
|
+
LOGFILE="logs/claude-dev-$(date +%Y%m%d_%H%M%S).txt"
|
|
99
86
|
|
|
100
87
|
echo "Logging to ${LOGFILE} ..."
|
|
101
88
|
|
|
@@ -107,27 +94,27 @@ while true; do
|
|
|
107
94
|
if [ $((LOOP_COUNTER % 4)) -eq 0 ]; then
|
|
108
95
|
echo -e "\033[33m**** MEGATHINKING MODE ACTIVATED ****\033[0m"
|
|
109
96
|
echo -e "\033[33mThis is your 4th development cycle. Taking a step back for architectural planning.\033[0m"
|
|
110
|
-
MEGATHINKING_MODE="
|
|
111
|
-
|
|
97
|
+
MEGATHINKING_MODE="<ultrathink>
|
|
98
|
+
**** MEGATHINKING MODE ACTIVATED ****
|
|
99
|
+
This is your 4th development cycle. Before proceeding with the next task, engage in deep extended reasoning to:
|
|
100
|
+
- Take a step back and architecturally plan the next phase of development
|
|
101
|
+
- Consider the overall structure of the codebase
|
|
102
|
+
- Identify potential refactoring opportunities
|
|
103
|
+
- Evaluate design patterns and technical debt
|
|
104
|
+
- Think about how the current work connects to broader project goals
|
|
105
|
+
- Analyze edge cases and potential failure modes
|
|
106
|
+
Take your time to think deeply about the optimal approach before proceeding.
|
|
107
|
+
</ultrathink>
|
|
108
|
+
|
|
109
|
+
"
|
|
110
|
+
CLAUDE_MODEL="sonnet"
|
|
112
111
|
else
|
|
113
112
|
MEGATHINKING_MODE=""
|
|
114
113
|
CLAUDE_MODEL="sonnet"
|
|
115
114
|
fi
|
|
116
115
|
|
|
117
116
|
# Build the development prompt combining intelligent task selection with parallel execution
|
|
118
|
-
DEVELOPMENT_PROMPT="$MEGATHINKING_MODE
|
|
119
|
-
|
|
120
|
-
# Add unit test failure info if present
|
|
121
|
-
if [ -n "$UNIT_TEST_FAILURE_INFO" ]; then
|
|
122
|
-
DEVELOPMENT_PROMPT="$DEVELOPMENT_PROMPT
|
|
123
|
-
==== CRITICAL: UNIT TEST FAILURE FROM PREVIOUS ITERATION ====
|
|
124
|
-
$UNIT_TEST_FAILURE_INFO
|
|
125
|
-
==== END UNIT TEST FAILURE INFO ====
|
|
126
|
-
|
|
127
|
-
"
|
|
128
|
-
fi
|
|
129
|
-
|
|
130
|
-
DEVELOPMENT_PROMPT="$DEVELOPMENT_PROMPT
|
|
117
|
+
DEVELOPMENT_PROMPT="$MEGATHINKING_MODE
|
|
131
118
|
You are an elite AI developer working in an automated development environment. Your job is to IMPLEMENT tasks from the project plan, not just analyze them. You can either implement tasks directly yourself or coordinate parallel Task agents for independent work.
|
|
132
119
|
|
|
133
120
|
**PROJECT FILES TO READ AND ANALYZE:**"
|
|
@@ -301,59 +288,11 @@ Be thorough but concise in your verification."
|
|
|
301
288
|
|
|
302
289
|
# Check if verifier has confirmed all tasks are complete (only in output section)
|
|
303
290
|
if sed -n '/=== OUTPUT ===/,$p' $VERIFIER_LOGFILE | grep -q "^<VERIFIED_ALL_DONE>$"; then
|
|
304
|
-
echo -e "\033[
|
|
305
|
-
echo -e "\033[
|
|
306
|
-
echo -e "\033[
|
|
307
|
-
|
|
308
|
-
# Check if unit test script exists
|
|
309
|
-
if [ -f "$WORKING_DIR/unit-test" ]; then
|
|
310
|
-
echo -e "\033[36mFound $WORKING_DIR/unit-test - running unit tests...\033[0m"
|
|
311
|
-
# Generate unit test log filename with working-dir token if set
|
|
312
|
-
if [ "$WORKING_DIR" != "docs" ]; then
|
|
313
|
-
WORKING_DIR_TOKEN=$(echo "$WORKING_DIR" | sed 's/[^a-zA-Z0-9]/-/g' | sed 's/^-\+//;s/-\+$//')
|
|
314
|
-
UNIT_TEST_LOGFILE="logs/unit-test-${WORKING_DIR_TOKEN}-$(date +%Y%m%d_%H%M%S).txt"
|
|
315
|
-
else
|
|
316
|
-
UNIT_TEST_LOGFILE="logs/unit-test-$(date +%Y%m%d_%H%M%S).txt"
|
|
317
|
-
fi
|
|
318
|
-
|
|
319
|
-
# Run unit tests and capture exit code
|
|
320
|
-
if "$WORKING_DIR/unit-test" 2>&1 | tee $UNIT_TEST_LOGFILE; then
|
|
321
|
-
echo -e "\033[32m==================================================================\033[0m"
|
|
322
|
-
echo -e "\033[32m== UNIT TESTS PASSED!\033[0m"
|
|
323
|
-
echo -e "\033[32m== PROJECT COMPLETE - ALL TASKS VERIFIED AND TESTED!\033[0m"
|
|
324
|
-
echo -e "\033[32m==================================================================\033[0m"
|
|
325
|
-
# Clear any previous unit test failure info
|
|
326
|
-
UNIT_TEST_FAILURE_INFO=""
|
|
327
|
-
exit 0
|
|
328
|
-
else
|
|
329
|
-
echo -e "\033[31m==================================================================\033[0m"
|
|
330
|
-
echo -e "\033[31m== UNIT TESTS FAILED!\033[0m"
|
|
331
|
-
echo -e "\033[31m==================================================================\033[0m"
|
|
332
|
-
echo -e "\033[31mUnit test output saved to: $UNIT_TEST_LOGFILE\033[0m"
|
|
333
|
-
echo -e "\033[31mContinuing development loop to fix failing tests...\033[0m"
|
|
334
|
-
|
|
335
|
-
# Store unit test failure info for next iteration
|
|
336
|
-
UNIT_TEST_FAILURE_INFO="UNIT TEST FAILURE DETECTED!
|
|
337
|
-
The verifier thought all tasks were complete, but unit tests are failing.
|
|
338
|
-
Unit test output is available in: $UNIT_TEST_LOGFILE
|
|
339
|
-
You MUST fix these failing tests before the project can be considered complete."
|
|
340
|
-
fi
|
|
341
|
-
else
|
|
342
|
-
# No unit tests found, accept verifier's judgment
|
|
343
|
-
echo -e "\033[33mNo $WORKING_DIR/unit-test script found - accepting verifier's judgment\033[0m"
|
|
344
|
-
echo -e "\033[32m==================================================================\033[0m"
|
|
345
|
-
echo -e "\033[32m== PROJECT COMPLETE - ALL TASKS VERIFIED!\033[0m"
|
|
346
|
-
echo -e "\033[32m==================================================================\033[0m"
|
|
347
|
-
exit 0
|
|
348
|
-
fi
|
|
349
|
-
else
|
|
350
|
-
# Verifier doesn't think we're done, so clear any unit test failure info
|
|
351
|
-
# (we're back to working on regular tasks)
|
|
352
|
-
UNIT_TEST_FAILURE_INFO=""
|
|
291
|
+
echo -e "\033[32m==================================================================\033[0m"
|
|
292
|
+
echo -e "\033[32m== PROJECT COMPLETE - ALL TASKS VERIFIED!\033[0m"
|
|
293
|
+
echo -e "\033[32m==================================================================\033[0m"
|
|
294
|
+
exit 0
|
|
353
295
|
fi
|
|
354
|
-
|
|
355
|
-
# Show timestamp after verifier run
|
|
356
|
-
echo -e "\033[36mVerifier completed at: $(date)\033[0m"
|
|
357
296
|
|
|
358
297
|
# Calculate iteration duration and check for failure patterns
|
|
359
298
|
ITERATION_END_TIME=$(date +%s)
|
package/bin/claudefsd-interview
CHANGED
|
@@ -384,7 +384,7 @@ Create a comprehensive requirements document that:
|
|
|
384
384
|
Format the output as a clean, well-structured markdown document suitable for feeding into project planning.
|
|
385
385
|
"
|
|
386
386
|
|
|
387
|
-
claude --model
|
|
387
|
+
claude --model sonnet -p "$consolidation_prompt" > "$REQUIREMENTS_FILE"
|
|
388
388
|
|
|
389
389
|
echo -e "${GREEN}Requirements consolidated in $REQUIREMENTS_FILE${NC}"
|
|
390
390
|
|
package/package.json
CHANGED
package/bin/claudefsd-dev 2
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
#
|
|
3
|
-
# Main development dispatcher - now uses unified development mode by default
|
|
4
|
-
# Usage: claudefsd-dev [direct|iterative|legacy-direct|legacy-iterative]
|
|
5
|
-
#
|
|
6
|
-
# Modes:
|
|
7
|
-
# (default): Unified mode combining best of both approaches
|
|
8
|
-
# direct: Legacy single-context parallel execution (deprecated)
|
|
9
|
-
# iterative: Legacy multi-iteration loop development (deprecated)
|
|
10
|
-
# legacy-direct: Force legacy direct execution mode
|
|
11
|
-
# legacy-iterative: Force legacy iterative loop mode
|
|
12
|
-
#
|
|
13
|
-
# Examples:
|
|
14
|
-
# claudefsd-dev # Use unified development mode (recommended)
|
|
15
|
-
# claudefsd-dev legacy-direct # Force legacy direct execution mode
|
|
16
|
-
# claudefsd-dev legacy-iterative # Force legacy iterative loop mode
|
|
17
|
-
|
|
18
|
-
set -e
|
|
19
|
-
|
|
20
|
-
# Parse command line arguments
|
|
21
|
-
DEV_MODE="$1"
|
|
22
|
-
|
|
23
|
-
# Default to unified mode
|
|
24
|
-
if [ -z "$DEV_MODE" ]; then
|
|
25
|
-
DEV_MODE="unified"
|
|
26
|
-
fi
|
|
27
|
-
|
|
28
|
-
echo "Development mode: $DEV_MODE"
|
|
29
|
-
|
|
30
|
-
# Route to appropriate development script
|
|
31
|
-
case "$DEV_MODE" in
|
|
32
|
-
unified)
|
|
33
|
-
echo "Launching unified development mode (recommended)..."
|
|
34
|
-
exec "$(dirname "$0")/claudefsd-dev-unified"
|
|
35
|
-
;;
|
|
36
|
-
direct)
|
|
37
|
-
echo "WARNING: Legacy direct mode is deprecated. Consider using unified mode."
|
|
38
|
-
echo "Launching legacy direct execution mode..."
|
|
39
|
-
exec "$(dirname "$0")/claudefsd-dev-direct"
|
|
40
|
-
;;
|
|
41
|
-
iterative)
|
|
42
|
-
echo "WARNING: Legacy iterative mode is deprecated. Consider using unified mode."
|
|
43
|
-
echo "Launching legacy iterative development mode..."
|
|
44
|
-
exec "$(dirname "$0")/claudefsd-dev-iterative"
|
|
45
|
-
;;
|
|
46
|
-
legacy-direct)
|
|
47
|
-
echo "Launching legacy direct execution mode..."
|
|
48
|
-
exec "$(dirname "$0")/claudefsd-dev-direct"
|
|
49
|
-
;;
|
|
50
|
-
legacy-iterative)
|
|
51
|
-
echo "Launching legacy iterative development mode..."
|
|
52
|
-
exec "$(dirname "$0")/claudefsd-dev-iterative"
|
|
53
|
-
;;
|
|
54
|
-
small)
|
|
55
|
-
# Legacy support - map to unified (was direct)
|
|
56
|
-
echo "Legacy 'small' mode - redirecting to unified development..."
|
|
57
|
-
exec "$(dirname "$0")/claudefsd-dev-unified"
|
|
58
|
-
;;
|
|
59
|
-
large)
|
|
60
|
-
# Legacy support - map to unified (was iterative)
|
|
61
|
-
echo "Legacy 'large' mode - redirecting to unified development..."
|
|
62
|
-
exec "$(dirname "$0")/claudefsd-dev-unified"
|
|
63
|
-
;;
|
|
64
|
-
*)
|
|
65
|
-
echo "Unknown development mode: $DEV_MODE"
|
|
66
|
-
echo "Valid modes: unified (default), direct, iterative, legacy-direct, legacy-iterative"
|
|
67
|
-
exit 1
|
|
68
|
-
;;
|
|
69
|
-
esac
|