mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
feat(skills): add dynamic !command injection to Claude Code skills
Add `!command` blocks to pr-address, pr-review, and worktree skills so Claude Code injects runtime context (current branch, PR info, CI status, existing worktrees) directly into the prompt at invocation time. This eliminates redundant tool calls for context gathering — the model sees the output inline before it starts working. Skills updated: - pr-address: branch, PR number/URL, CI check count - pr-review: branch, PR number/URL - worktree: existing worktree list Commands use fallback patterns (`2>/dev/null || echo ...`) so skills degrade gracefully if a command fails (e.g. detached HEAD, no PR).
This commit is contained in:
@@ -10,6 +10,14 @@ metadata:
|
||||
|
||||
# PR Address
|
||||
|
||||
## Current State
|
||||
|
||||
- **Branch:** `!git branch --show-current`
|
||||
- **PR:** `!gh pr list --head $(git branch --show-current) --repo Significant-Gravitas/AutoGPT --json number,url,title -q '.[0] | "\(.number) \(.url) \(.title)"' 2>/dev/null || echo "no PR found for current branch"`
|
||||
- **CI:** `!gh pr checks $(gh pr list --head $(git branch --show-current) --repo Significant-Gravitas/AutoGPT -q '.[0].number' 2>/dev/null) --repo Significant-Gravitas/AutoGPT --json bucket,name -q '[.[] | select(.bucket != "pass" and .bucket != "skipping")] | length | tostring + " failing/pending checks"' 2>/dev/null || echo "unknown"`
|
||||
|
||||
Use the context above to skip the "Find the PR" step if a PR number is already shown.
|
||||
|
||||
## Find the PR
|
||||
|
||||
```bash
|
||||
|
||||
@@ -10,6 +10,13 @@ metadata:
|
||||
|
||||
# PR Review
|
||||
|
||||
## Current State
|
||||
|
||||
- **Branch:** `!git branch --show-current`
|
||||
- **PR:** `!gh pr list --head $(git branch --show-current) --repo Significant-Gravitas/AutoGPT --json number,url,title -q '.[0] | "\(.number) \(.url) \(.title)"' 2>/dev/null || echo "no PR found for current branch"`
|
||||
|
||||
Use the context above to skip the "Find the PR" step if a PR number is already shown.
|
||||
|
||||
## Find the PR
|
||||
|
||||
```bash
|
||||
|
||||
@@ -10,6 +10,13 @@ metadata:
|
||||
|
||||
# Worktree Setup
|
||||
|
||||
## Current State
|
||||
|
||||
- **Existing worktrees:**
|
||||
`!git worktree list 2>/dev/null || echo "not in a git repo"`
|
||||
|
||||
Use the list above to pick the next available `AutoGPT<N>` name and avoid conflicts.
|
||||
|
||||
## Create the worktree
|
||||
|
||||
Derive paths from the git toplevel. If a name is provided as argument, use it. Otherwise, check `git worktree list` and pick the next `AutoGPT<N>`.
|
||||
|
||||
Reference in New Issue
Block a user