Skip to content

Commit 6c7a5cc

Browse files
committed
- claude: remove max-turns, add allowedTools
1 parent 9593bc0 commit 6c7a5cc

2 files changed

Lines changed: 25 additions & 20 deletions

File tree

template/_claude_finalize.rb

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,17 @@
2020
2121
And `dip.yml` in the project root for the Dip CLI.
2222
23-
## TODOs to complete
23+
## TODOs
2424
2525
#{todos_text}
2626
2727
## Your tasks
2828
29-
1. **Review the generated configuration** - Check the files in `#{DOCKER_DEV_ROOT}/` and `dip.yml` to ensure they match the project's needs
30-
2. **Complete the TODOs** - Help me address each item listed above
31-
3. **Suggest improvements** - Based on this project's structure, suggest any additional Docker configuration that might be helpful
32-
4. **Document the setup** - Create or update documentation appropriate for this project:
33-
- If CLAUDE.md or AGENTS.md exists, add Docker-related instructions there
34-
- If there's a docs/ folder, consider adding a Docker setup guide
35-
- Otherwise, ensure #{DOCKER_DEV_ROOT}/README.md is comprehensive
29+
1. **Polish the generated configuration** — review the files in `#{DOCKER_DEV_ROOT}/` and `dip.yml` against the project's actual structure (check database.yml, Gemfile, etc.) and fix any issues directly.
30+
2. **Complete the mandatory TODOs** listed above (e.g., add DATABASE_URL to database.yml). Apply fixes directly without asking. Do not ask questions.
31+
3. **Create a `TODO.md` file** in `#{DOCKER_DEV_ROOT}/` listing optional next steps the user may want to configure later (system tests, Vite, CI, etc.).
3632
37-
IMPORTANT: Provide the user with a TODO list of changes before applying them. Explain every change and why it's needed (based on the materials provided, use links if necessary). Allow the user to pick only ones to implement right now and postpone others (ask if needed to document somewhere).
38-
39-
Exit the session after done with configuring the Docker setup (so the installer can get control back).
33+
Exit the session when done (so the installer can get control back). Do not provide lengthy explanations.
4034
4135
## References
4236
@@ -47,15 +41,21 @@
4741
PROMPT
4842

4943
say_status :info, "Handing over to Claude to review your Docker setup...\n"
44+
say ""
45+
46+
claude_cmd = ["claude", "--allowedTools", "Read,Edit,Write,Glob,Grep,Bash(git:*)", "-p", prompt]
5047

51-
# Use fork + exec to hand over control to Claude for interactive session
52-
# while allowing the parent process to complete
53-
pid = fork do
54-
exec(
55-
"claude",
56-
prompt
57-
)
48+
output = if defined?(Gum) && ENV["RBYTES_DISABLE_GUM"] != "1"
49+
Gum.spin("Claude is thinking...") do
50+
IO.popen(claude_cmd, &:read)
51+
end
52+
else
53+
IO.popen(claude_cmd, &:read)
5854
end
59-
Process.wait(pid)
55+
56+
say "Here is what Claude said", :blue
57+
print_wrapped output
58+
say "\n"
59+
say ""
6060
end
6161
end

test/template/claude_finalize_test.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,20 @@ def test_runs_claude_with_correct_arguments
3838

3939
# Check prompt content includes todos
4040
assert_includes args, "Ruby on Whales"
41-
assert_includes args, "TODOs to complete"
4241
assert_includes args, "Important things to take care of"
4342
assert_includes args, "ENV[\"RAILS_ENV\"] = \"test\""
4443
assert_includes args, "DATABASE_URL"
4544

45+
# Check prompt includes TODO.md instruction
46+
assert_includes args, "TODO.md"
47+
4648
# Check prompt includes references
4749
assert_includes args, "evilmartians.com/chronicles/ruby-on-whales-docker-for-ruby-rails-development"
4850
assert_includes args, "system-of-a-test"
4951
assert_includes args, "vite-lizing-rails"
52+
53+
# Check --allowedTools flag is passed
54+
assert_includes args, "--allowedTools"
5055
end
5156

5257
def test_skips_when_user_declines

0 commit comments

Comments
 (0)