feat: add install.sh for one-line agent-skills install#56
Conversation
|
Warning Review limit reached
Next review available in: 55 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. 📝 WalkthroughWalkthroughAdds ChangesSkill pack installation
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Operator
participant install.sh
participant GitHub
participant SkillsDirectory
Operator->>install.sh: run with optional destination
install.sh->>GitHub: download branch archive
GitHub-->>install.sh: return skill packs
install.sh->>SkillsDirectory: copy validated packs
SkillsDirectory-->>install.sh: complete installation
install.sh-->>Operator: print installed count and catalog link
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
install.sh (1)
51-51: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winConsider downloading to a file before extracting to avoid pipeline error masking.
In POSIX
sh,set -eonly checks the exit status of the last command in a pipeline. Iffetch(curl/wget) fails,tartypically also fails andset -ecatches it, but downloading to a temporary file first makes the failure path explicit and avoids relying on tar's behavior with empty/truncated input.♻️ Proposed refactor
-fetch "https://codeload.github.com/${REPO}/tar.gz/refs/heads/${BRANCH}" | tar -xz -C "$TMP" +fetch "https://codeload.github.com/${REPO}/tar.gz/refs/heads/${BRANCH}" > "$TMP/repo.tar.gz" +tar -xz -C "$TMP" < "$TMP/repo.tar.gz"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@install.sh` at line 51, Update the install flow around fetch to download the archive into a temporary file under $TMP first, then extract that file with tar. Ensure fetch failure stops execution explicitly before extraction, and preserve the existing extraction destination and archive contents.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@install.sh`:
- Line 64: Update the rm command in the skills cleanup flow to require a
non-empty SKILLS_DIR before expansion, using the shell’s explicit parameter
guard so an empty value aborts instead of targeting a root-level path. Preserve
the existing name-based removal behavior when SKILLS_DIR is set.
---
Nitpick comments:
In `@install.sh`:
- Line 51: Update the install flow around fetch to download the archive into a
temporary file under $TMP first, then extract that file with tar. Ensure fetch
failure stops execution explicitly before extraction, and preserve the existing
extraction destination and archive contents.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| for dir in "$SRC"/*/; do | ||
| [ -f "${dir}SKILL.md" ] || continue | ||
| name="$(basename "$dir")" | ||
| rm -rf "${SKILLS_DIR}/${name}" |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Guard against empty SKILLS_DIR in rm -rf to prevent accidental root deletion.
If SKILLS_DIR is set to an empty string (e.g., --dir= or SKILLS_DIR=""), this line expands to rm -rf "/${name}", deleting a top-level directory. While mkdir -p "" on line 59 would likely fail and exit first under set -eu, adding an explicit :? guard is a low-cost safety net.
🛡️ Proposed fix
- rm -rf "${SKILLS_DIR}/${name}"
+ rm -rf "${SKILLS_DIR:?}/${name}"📝 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.
| rm -rf "${SKILLS_DIR}/${name}" | |
| rm -rf "${SKILLS_DIR:?}/${name}" |
🧰 Tools
🪛 Shellcheck (0.11.0)
[warning] 64-64: Use "${var:?}" to ensure this never expands to / .
(SC2115)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@install.sh` at line 64, Update the rm command in the skills cleanup flow to
require a non-empty SKILLS_DIR before expansion, using the shell’s explicit
parameter guard so an empty value aborts instead of targeting a root-level path.
Preserve the existing name-based removal behavior when SKILLS_DIR is set.
Source: Linters/SAST tools
curl -fsSL https://raw.githubusercontent.com/api7/a6/main/install.sh | sh Downloads the repo tarball (no git required) and copies each skills/<name> pack into ~/.claude/skills (override with --dir / SKILLS_DIR). POSIX sh, idempotent. Tested: installs all 40 skills.
5b95e94 to
aaa4808
Compare
Independent audit — resolvedA fresh review agent audited this script. No HIGH findings. Verified: correct repo/branch (no a6/a7 mixup),
Re-tested after the change: |
|
Addressed in follow-up #57: |
What
Adds
install.shso the AI agent skills can be installed with a single command:curl -fsSL https://raw.githubusercontent.com/api7/a6/main/install.sh | shThis is the one-line install referenced from the AI Agent Skills catalog; until now the docs showed a manual
git clone+cp.Behavior
gitrequired —curl/wget+tar) and copies eachskills/<name>/pack into the target directory.~/.claude/skills(Claude Code personal skills). Override with--dir <path>orSKILLS_DIR=...(e.g..cursor/rulesfor Cursor, an OpenCode skills dir, etc.).sh, cleans up its temp dir on exit.Tested
Ran end-to-end against this repo: 40 skills installed, all with
SKILL.md.sh -nsyntax check passes.Follow-up
Once merged, the docs install snippet can be switched from
git cloneto this one-liner.🤖 Generated with Claude Code
Summary by CodeRabbit