feat(skill): show GitHub star prompt on first successful generation#778
feat(skill): show GitHub star prompt on first successful generation#778
Conversation
Display a one-time friendly reminder to star the ACE-Step GitHub repo after the user's first successful music generation via the CLI skill. The prompt is shown only once, tracked by a local marker file. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a one-time GitHub star prompt to ACE-Step by creating a marker file and a Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.claude/skills/acestep/scripts/acestep.sh:
- Line 715: The one-time prompt function show_star_prompt is only called in
synchronous completion flows (via wait_for_job()), so async native jobs started
with "generate --no-wait" never see it; update the async success path in
cmd_status() (the branch that currently saves/downloads the finished result
around the success handling at lines ~431-433) to invoke show_star_prompt after
the result is persisted, or refactor both sync and async completion paths to
call a shared success handler that calls show_star_prompt; ensure the change
covers both invocation sites noted (around Line 715 and Line 760) so the prompt
is shown for both sync and --no-wait completions.
- Around line 30-43: The script persists runtime state into the repository via
STAR_MARKER_FILE and unguarded touch inside show_star_prompt, which can fail
under read-only/shared installs and abort due to set -e; change STAR_MARKER_FILE
to a user-writable state location (e.g. use XDG_STATE_HOME or fallback to
$HOME/.local/state and a subdir for this script) and update show_star_prompt to
create the directory if needed and perform the touch in a non-fatal way (ensure
failures are ignored so the script continues under set -e). Reference
STAR_MARKER_FILE and the show_star_prompt function when making the change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5405728a-d692-4286-99c3-21a4195230f3
📒 Files selected for processing (2)
.claude/skills/acestep/scripts/acestep.sh.gitignore
| STAR_MARKER_FILE="${SCRIPT_DIR}/.first_gen_done" | ||
|
|
||
| # Colors | ||
| RED='\033[0;31m' | ||
| GREEN='\033[0;32m' | ||
| YELLOW='\033[1;33m' | ||
| CYAN='\033[0;36m' | ||
| NC='\033[0m' | ||
| BOLD='\033[1m' | ||
|
|
||
| # Show GitHub star prompt on first successful generation | ||
| show_star_prompt() { | ||
| if [ ! -f "$STAR_MARKER_FILE" ]; then | ||
| touch "$STAR_MARKER_FILE" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify the code at the specified lines and check set -e status
FILE=".claude/skills/acestep/scripts/acestep.sh"
# Check if file exists
if [ ! -f "$FILE" ]; then
echo "File not found: $FILE"
exit 1
fi
# Show lines 1-60 to see context including set -e and the marker file
echo "=== Code from lines 1-60 ==="
head -60 "$FILE" | cat -n
echo ""
echo "=== Checking for set -e ==="
grep -n "set -e" "$FILE" | head -5
echo ""
echo "=== Show star prompt function ==="
sed -n '30,50p' "$FILE" | cat -nRepository: ace-step/ACE-Step-1.5
Length of output: 3433
Don't persist runtime state inside the checked-out scripts directory.
Line 30 places the marker file at .claude/skills/acestep/scripts/.first_gen_done, and Line 43 writes it unguarded. In read-only or shared installs, the first successful generation fails after saving files because set -e (Line 19) treats the touch failure as fatal. Move the marker to a user-writable state directory and make marker-write failures non-fatal.
Proposed fix
-STAR_MARKER_FILE="${SCRIPT_DIR}/.first_gen_done"
+STAR_STATE_DIR="${XDG_STATE_HOME:-$HOME/.local/state}/acestep"
+STAR_MARKER_FILE="${STAR_STATE_DIR}/first_gen_done"
@@
show_star_prompt() {
+ mkdir -p "$STAR_STATE_DIR" 2>/dev/null || return 0
if [ ! -f "$STAR_MARKER_FILE" ]; then
- touch "$STAR_MARKER_FILE"
+ touch "$STAR_MARKER_FILE" 2>/dev/null || return 0
echo ""
echo -e "${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo -e "${BOLD} ACE-Step is free and open-source.${NC}"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| STAR_MARKER_FILE="${SCRIPT_DIR}/.first_gen_done" | |
| # Colors | |
| RED='\033[0;31m' | |
| GREEN='\033[0;32m' | |
| YELLOW='\033[1;33m' | |
| CYAN='\033[0;36m' | |
| NC='\033[0m' | |
| BOLD='\033[1m' | |
| # Show GitHub star prompt on first successful generation | |
| show_star_prompt() { | |
| if [ ! -f "$STAR_MARKER_FILE" ]; then | |
| touch "$STAR_MARKER_FILE" | |
| STAR_STATE_DIR="${XDG_STATE_HOME:-$HOME/.local/state}/acestep" | |
| STAR_MARKER_FILE="${STAR_STATE_DIR}/first_gen_done" | |
| # Colors | |
| RED='\033[0;31m' | |
| GREEN='\033[0;32m' | |
| YELLOW='\033[1;33m' | |
| CYAN='\033[0;36m' | |
| NC='\033[0m' | |
| BOLD='\033[1m' | |
| # Show GitHub star prompt on first successful generation | |
| show_star_prompt() { | |
| mkdir -p "$STAR_STATE_DIR" 2>/dev/null || return 0 | |
| if [ ! -f "$STAR_MARKER_FILE" ]; then | |
| touch "$STAR_MARKER_FILE" 2>/dev/null || return 0 |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.claude/skills/acestep/scripts/acestep.sh around lines 30 - 43, The script
persists runtime state into the repository via STAR_MARKER_FILE and unguarded
touch inside show_star_prompt, which can fail under read-only/shared installs
and abort due to set -e; change STAR_MARKER_FILE to a user-writable state
location (e.g. use XDG_STATE_HOME or fallback to $HOME/.local/state and a subdir
for this script) and update show_star_prompt to create the directory if needed
and perform the touch in a non-fatal way (ensure failures are ignored so the
script continues under set -e). Reference STAR_MARKER_FILE and the
show_star_prompt function when making the change.
|
|
||
| echo "" | ||
| echo -e "${GREEN}Done! Files saved to: $OUTPUT_DIR${NC}" | ||
| show_star_prompt |
There was a problem hiding this comment.
--no-wait native jobs never hit this prompt.
Line 715 and Line 760 only cover synchronous completion paths. generate --no-wait bypasses wait_for_job(), and the cmd_status() success path around Line 431-Line 433 saves/downloads the finished result without calling show_star_prompt(), so async native users never see the one-time prompt.
Minimal fix
@@
# Save and download
save_result "$job_id" "$response"
download_audios "$api_url" "$job_id" "$result_file"
+ show_star_prompt
rm -f "$result_file"Also applies to: 760-760
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.claude/skills/acestep/scripts/acestep.sh at line 715, The one-time prompt
function show_star_prompt is only called in synchronous completion flows (via
wait_for_job()), so async native jobs started with "generate --no-wait" never
see it; update the async success path in cmd_status() (the branch that currently
saves/downloads the finished result around the success handling at lines
~431-433) to invoke show_star_prompt after the result is persisted, or refactor
both sync and async completion paths to call a shared success handler that calls
show_star_prompt; ensure the change covers both invocation sites noted (around
Line 715 and Line 760) so the prompt is shown for both sync and --no-wait
completions.
Summary
.first_gen_done) to ensure the prompt only appears oncesend_completion_request) and native polling mode (wait_for_job).gitignoreto avoid committing local statePreview
After first successful generation, the user will see:
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit