feat(claude): improve ai workflow
This commit is contained in:
parent
e84a22dbcb
commit
902f0f3ad6
11 changed files with 196 additions and 33 deletions
|
|
@ -1,4 +1,4 @@
|
|||
# /commit
|
||||
# /gc
|
||||
|
||||
Create a conventional commit from staged or unstaged changes.
|
||||
|
||||
|
|
@ -26,7 +26,10 @@ Create a conventional commit from staged or unstaged changes.
|
|||
- Scope is optional, lowercase.
|
||||
- Non-trivial changes require a body with `Problem:` / `Solution:` sections,
|
||||
wrapped at 72 chars, separated from header by a blank line.
|
||||
- Keep the body tight: 2-3 sentences per section, max.
|
||||
- Trivial one-liners: header alone is fine.
|
||||
- Use backticks around code identifiers, function names, and file paths
|
||||
(e.g. `setup()`, `lua/pending/store.lua`).
|
||||
- Match the style of the recent commits from step 1.
|
||||
|
||||
4. Present the full message and ask for approval.
|
||||
51
config/claude/skills/guide/SKILL.md
Normal file
51
config/claude/skills/guide/SKILL.md
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
# /guide
|
||||
|
||||
Interactive step-by-step guide for nvim plugin development tasks.
|
||||
|
||||
## Instructions
|
||||
|
||||
1. Ask the user what they want to accomplish. Gather enough context to build a
|
||||
step-by-step plan (the plugin name, the goal, any constraints).
|
||||
|
||||
2. Determine the plugin name from the current repo (basename of the working
|
||||
directory) and today's date. Run exactly one Bash command:
|
||||
|
||||
```
|
||||
basename "$(git rev-parse --show-toplevel)" && date +%Y-%m-%d
|
||||
```
|
||||
|
||||
3. Build a numbered step-by-step plan as a markdown file. Run exactly one Bash
|
||||
command:
|
||||
|
||||
```
|
||||
mkdir -p /tmp/<plugin>-<date> && cat > /tmp/<plugin>-<date>/guide.md <<'EOF'
|
||||
# <Goal>
|
||||
|
||||
Plugin: <plugin>
|
||||
Date: <date>
|
||||
Branch: <branch name to create>
|
||||
|
||||
## Steps
|
||||
|
||||
1. <step>
|
||||
2. <step>
|
||||
...
|
||||
|
||||
## Current
|
||||
|
||||
Step 1: <description>
|
||||
EOF
|
||||
```
|
||||
|
||||
4. Present step 1 to the user. Execute it. Show the result. Ask for
|
||||
confirmation before moving to the next step.
|
||||
|
||||
5. After the user confirms, update the `## Current` section in the guide to
|
||||
reflect the next step, then execute it. Repeat until all steps are done.
|
||||
|
||||
6. When all steps are complete, update the guide with a `## Done` section and
|
||||
print the path to the guide file.
|
||||
|
||||
Keep each step small and self-contained. Prefer one logical change per step.
|
||||
If a step reveals unexpected complexity, break it into sub-steps and update
|
||||
the guide before proceeding.
|
||||
|
|
@ -21,28 +21,35 @@ Create a pull request from the current branch.
|
|||
```
|
||||
## Problem
|
||||
|
||||
<why this change is needed>
|
||||
<1-2 sentences>
|
||||
|
||||
## Solution
|
||||
|
||||
<what the change does>
|
||||
<1-2 sentences>
|
||||
```
|
||||
|
||||
- Write in plain prose. No bullet walls, no AI markdown soup.
|
||||
- Write concise prose. No bullet walls, no verbose explanations.
|
||||
- Use backticks around code identifiers, function names, and file paths.
|
||||
|
||||
3. Present the title and body. Ask for approval.
|
||||
|
||||
4. After approval, run exactly one Bash command (push + create chained):
|
||||
4. After approval, if `scripts/ci.sh` exists, run it:
|
||||
```
|
||||
git push -u origin <branch> && gh pr create --title "<title>" --body "$(cat <<'EOF'
|
||||
bash scripts/ci.sh
|
||||
```
|
||||
If it fails, show the output and stop. Do NOT create the PR.
|
||||
|
||||
5. Run exactly one Bash command:
|
||||
```
|
||||
gh pr create --title "<title>" --body "$(cat <<'EOF'
|
||||
<body here>
|
||||
EOF
|
||||
)"
|
||||
```
|
||||
Print the PR URL from the output.
|
||||
|
||||
Total: 2 Bash calls (gather + push/create). Do not run any other commands. Do
|
||||
not read files, explore code, or run additional git commands beyond what is
|
||||
listed above.
|
||||
Total: 2 Bash calls (gather + create), or 3 if CI ran. Do not run any other
|
||||
commands. Do not read files, explore code, or run additional git commands beyond
|
||||
what is listed above.
|
||||
|
||||
Never force-push, even with lease. Never target main/master as the head branch.
|
||||
|
|
|
|||
48
config/claude/skills/qpr/SKILL.md
Normal file
48
config/claude/skills/qpr/SKILL.md
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
# /qpr
|
||||
|
||||
Create a pull request immediately, no approval step.
|
||||
|
||||
## Instructions
|
||||
|
||||
1. Run exactly this one Bash command:
|
||||
|
||||
```
|
||||
echo "---BRANCH---" && git branch --show-current && echo "---LOG---" && git log --oneline main..HEAD && echo "---STAT---" && git diff main...HEAD --stat && echo "---TEMPLATE---" && cat .github/pull_request_template.md 2>/dev/null || true
|
||||
```
|
||||
|
||||
If the branch is `main` or `master`, tell the user and stop.
|
||||
|
||||
2. If `scripts/ci.sh` exists, run it:
|
||||
```
|
||||
bash scripts/ci.sh
|
||||
```
|
||||
If it fails, show the output and stop.
|
||||
|
||||
3. Draft the PR (do NOT present for approval — create it immediately):
|
||||
- **Title**: `type(scope): imperative summary`, max 72 chars.
|
||||
- **Body**: if a PR template was found, fill it in. Otherwise:
|
||||
|
||||
```
|
||||
## Problem
|
||||
|
||||
<1-2 sentences>
|
||||
|
||||
## Solution
|
||||
|
||||
<1-2 sentences>
|
||||
```
|
||||
|
||||
- Use backticks around code identifiers, function names, and file paths.
|
||||
|
||||
Run exactly one Bash command:
|
||||
```
|
||||
gh pr create --title "<title>" --body "$(cat <<'EOF'
|
||||
<body here>
|
||||
EOF
|
||||
)"
|
||||
```
|
||||
Print the PR URL from the output.
|
||||
|
||||
Total: 2-3 Bash calls. Do not run any other commands.
|
||||
|
||||
Never force-push. Never target main/master as the head branch.
|
||||
Loading…
Add table
Add a link
Reference in a new issue