Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions scripts/small_repos/run_claude.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [ $# -ne 1 ]; then
fi

directory="$1"
MODEL="codex-mini-latest"
ANTHROPIC_MODEL="claude-3-7-sonnet-20250219"

if [ ! -d "$directory" ]; then
echo "Error: Directory '$directory' does not exist"
Expand Down Expand Up @@ -39,8 +39,9 @@ echo "Following the instructions in $base_dir/REFACTOR_INSTRUCTIONS.md..."

echo "Running claude planner"
# Claude plan
claude --dangerously-skip-permissions -p \
"Follow the instructions in ../../../prompts/REFACTOR_INSTRUCTIONS.md. Only write PLAN.md. Give the file structure. Do not implement any code. Do not give example usage code."
claude --dangerously-skip-permissions -p <<EOF
Read the instructions in ../../../prompts/REFACTOR_INSTRUCTIONS.md. Follow the implementation plan and file structure proposed in PLAN.md. IMPORTANT: Create, modify, and reference files ONLY in this current working subdirectory ($new_directory/unified) and nowhere else. Do NOT import from any other subdirectories in $new_directory except for what is here in unified/. Implement ALL code and update ALL test file imports until this whole subfolder is a functional standalone repository. Do not stop to ask for confirmation; keep going until the final implementation passes all tests using pytest tests/.
EOF

# Setup testing environment
uv venv
Expand All @@ -49,8 +50,9 @@ uv pip install -e .

echo "Running claude impl"
# Claude implement
claude --dangerously-skip-permissions -p \
"Read the instructions in ../../../prompts/REFACTOR_INSTRUCTIONS.md. Follow the implementation plan and file structure proposed in PLAN.md. IMPORTANT: Create, modify, and reference files ONLY in this current working subdirectory ($new_directory/unified) and nowhere else. Do NOT import from any other subdirectories in $new_directory except for what is here in unified/. Implement ALL code and update ALL test file imports until this whole subfolder is a functional standalone repository. Do not stop to ask for confirmation; keep going until the final implementation passes all tests using pytest tests/."
claude --dangerously-skip-permissions -p <<EOF
Read the instructions in ../../../prompts/REFACTOR_INSTRUCTIONS.md. Follow the implementation plan and file structure proposed in PLAN.md. IMPORTANT: Create, modify, and reference files ONLY in this current working subdirectory ($new_directory/unified) and nowhere else. Do NOT import from any other subdirectories in $new_directory except for what is here in unified/. Implement ALL code and update ALL test file imports until this whole subfolder is a functional standalone repository. Do not stop to ask for confirmation; keep going until the final implementation passes all tests using pytest tests/.
EOF

popd >/dev/null
# Now that it's been refactored, remove all original persona subdirs
Expand All @@ -70,8 +72,9 @@ pytest tests/ --json-report --json-report-file=report.json --continue-on-collect

echo "Running final-check claude impl"
# claude implement
claude --dangerously-skip-permissions -p \
"Read the pytest results in test_output.txt. If they indicate pytest failures, fix them. Stick to the implementation plan and file structure proposed in PLAN.md. IMPORTANT: Create and modify files ONLY in this current working subdirectory ($new_directory/unified) and nowhere else. Implement ALL code and update ALL test file imports until this whole subfolder is a functional standalone repository. Do not stop to ask for confirmation; keep going until the final implementation passes all tests using pytest tests/. If there are no errors, exit."
claude --dangerously-skip-permissions -p <<EOF
Read the pytest results in test_output.txt. If they indicate pytest failures, fix them. Stick to the implementation plan and file structure proposed in PLAN.md. IMPORTANT: Create and modify files ONLY in this current working subdirectory ($new_directory/unified) and nowhere else. Implement ALL code and update ALL test file imports until this whole subfolder is a functional standalone repository. Do not stop to ask for confirmation; keep going until the final implementation passes all tests using pytest tests/. If there are no errors, exit.
EOF

pytest tests/ --json-report --json-report-file=report.json --continue-on-collection-errors > test_output.txt 2>&1
deactivate
Expand Down
9 changes: 3 additions & 6 deletions scripts/small_repos/run_codex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ echo "Following the instructions in $base_dir/prompts/REFACTOR_INSTRUCTIONS.md..

echo "Running codex planner"
# Codex plan
codex --approval-mode full-auto -q \
"Follow the instructions in ../../../prompts/REFACTOR_INSTRUCTIONS.md. Only write PLAN.md. Give the file structure. Do not implement any code. Do not give example usage code."
codex --approval-mode full-auto -q "Follow the instructions in ../../../prompts/REFACTOR_INSTRUCTIONS.md. Only write PLAN.md. Give the file structure. Do not implement any code. Do not give example usage code."

# Setup testing environment
uv venv
Expand All @@ -51,8 +50,7 @@ uv pip install -e .

echo "Running codex impl"
# Codex implement
codex --approval-mode full-auto -q \
"Read the instructions in ../../../prompts/REFACTOR_INSTRUCTIONS.md. Follow the implementation plan and file structure proposed in PLAN.md. IMPORTANT: Create, modify, and reference files ONLY in this current working subdirectory ($new_directory/unified) and nowhere else. Do NOT import from any other subdirectories in $new_directory except for what is here in unified/. Implement ALL code and update ALL test file imports until this whole subfolder is a functional standalone repository. Do not stop to ask for confirmation; keep going until the final implementation passes all tests using pytest tests/."
codex --approval-mode full-auto -q "Read the instructions in ../../../prompts/REFACTOR_INSTRUCTIONS.md. Follow the implementation plan and file structure proposed in PLAN.md. IMPORTANT: Create, modify, and reference files ONLY in this current working subdirectory ($new_directory/unified) and nowhere else. Do NOT import from any other subdirectories in $new_directory except for what is here in unified/. Implement ALL code and update ALL test file imports until this whole subfolder is a functional standalone repository. Do not stop to ask for confirmation; keep going until the final implementation passes all tests using pytest tests/."

popd >/dev/null
# Now that it's been refactored, remove all original persona subdirs
Expand All @@ -71,8 +69,7 @@ pytest tests/ --json-report --json-report-file=report.json --continue-on-collect

echo "Running final-check codex impl"
# Codex implement
codex --approval-mode full-auto -q \
"Read the pytest results in test_output.txt. If they indicate pytest failures, fix them. Stick to the implementation plan and file structure proposed in PLAN.md. IMPORTANT: Create and modify files ONLY in this current working subdirectory ($new_directory/unified) and nowhere else. Implement ALL code and update ALL test file imports until this whole subfolder is a functional standalone repository. Do not stop to ask for confirmation; keep going until the final implementation passes all tests using pytest tests/. If there are no errors, exit."
codex --approval-mode full-auto -q "Read the pytest results in test_output.txt. If they indicate pytest failures, fix them. Stick to the implementation plan and file structure proposed in PLAN.md. IMPORTANT: Create and modify files ONLY in this current working subdirectory ($new_directory/unified) and nowhere else. Implement ALL code and update ALL test file imports until this whole subfolder is a functional standalone repository. Do not stop to ask for confirmation; keep going until the final implementation passes all tests using pytest tests/. If there are no errors, exit."

pytest tests/ --json-report --json-report-file=report.json --continue-on-collection-errors > test_output.txt 2>&1
deactivate
Expand Down