rk-skills 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +2 -2
- package/README.md +73 -27
- package/agents/create-release-runner.md +96 -0
- package/agents/sync-docs-runner.md +174 -0
- package/bin/install.mjs +22 -3
- package/package.json +3 -2
- package/skills/fable-new-issue/SKILL.md +3 -1
- package/skills/fable-validate/SKILL.md +3 -1
- package/skills/fable-validate-loop/SKILL.md +1 -1
- package/skills/fableplan/SKILL.md +2 -1
- package/skills/fix-pr-review-loop/SKILL.md +2 -0
- package/skills/validate-issue/SKILL.md +1 -1
- package/skills/validate-issue-fableplan-loop/SKILL.md +1 -1
- package/skills/work-on-issue/SKILL.md +7 -27
- package/skills/work-on-issue-loop/SKILL.md +16 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rk-skills",
|
|
3
|
-
"description": "Marketplace for rk-skills:
|
|
3
|
+
"description": "Marketplace for rk-skills: Claude Code workflow skills for GitHub issues, PR review loops, docs syncing, and releases.",
|
|
4
4
|
"owner": {
|
|
5
5
|
"name": "Richard Kuo"
|
|
6
6
|
},
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
{
|
|
9
9
|
"name": "rk-skills",
|
|
10
10
|
"source": "./",
|
|
11
|
-
"description": "
|
|
11
|
+
"description": "Claude Code workflow skills: GitHub issue/PR/release automation and Fable-driven planning."
|
|
12
12
|
}
|
|
13
13
|
]
|
|
14
14
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rk-skills",
|
|
3
3
|
"displayName": "rk-skills",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"description": "
|
|
4
|
+
"version": "1.1.0",
|
|
5
|
+
"description": "Claude Code workflow skills: GitHub issue/PR/release automation and Fable-driven planning.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Richard Kuo"
|
|
8
8
|
},
|
package/README.md
CHANGED
|
@@ -1,42 +1,78 @@
|
|
|
1
1
|
# rk-skills
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Workflow skills for [Claude Code](https://claude.com/claude-code) — automate GitHub issues, PR review loops, docs syncing, and releases.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
A "skill" is a reusable instruction file that teaches Claude Code how to do one job well (like filing a GitHub issue or cutting a release). You trigger one by name, and Claude follows its steps.
|
|
6
6
|
|
|
7
7
|
## Skills
|
|
8
8
|
|
|
9
|
-
Most workflow skills come in two forms: a **base** skill that does one step, and a **`-loop`** variant that
|
|
9
|
+
Most workflow skills come in two forms: a **base** skill that does one step and stops, and a **`-loop`** variant that keeps going on its own — through code review and re-review — until the pull request (PR) is approved.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
11
|
+
```mermaid
|
|
12
|
+
flowchart LR
|
|
13
|
+
A([validate-issue]) --> B([work-on-issue])
|
|
14
|
+
B --> C([PR + review])
|
|
15
|
+
C -- findings --> D([fix-pr-review])
|
|
16
|
+
D --> C
|
|
17
|
+
C -- LGTM --> E([issue complete])
|
|
18
|
+
```
|
|
15
19
|
|
|
16
|
-
|
|
20
|
+
Several skills mention a **complexity score** (`C0`–`C100`): a rough 0–100 rating of how hard an issue is to implement, put right in the issue title. "Fable" skills hand part of the work to a subagent running on the Fable 5 model — a second Claude instance that plans, validates, or drafts while your main session does the building.
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
- `commands/commit.md` — the `/commit` slash command (linked to `~/.claude/commands/commit.md`).
|
|
22
|
+
### Issue skills
|
|
20
23
|
|
|
21
|
-
|
|
24
|
+
| Skill | What it does |
|
|
25
|
+
|-------|--------------|
|
|
26
|
+
| `new-issue` | Turns a bug, idea, or conversation into a complete GitHub issue. Checks the claims against the actual code first, adds a complexity score, and never files a half-empty stub. |
|
|
27
|
+
| `new-issue-loop` | Runs `new-issue`, then automatically validates the new issue, implements it, and drives the PR through review — one command from idea to reviewed PR. Stops early if it finds a duplicate issue. |
|
|
28
|
+
| `validate-issue` | Fact-checks an existing issue: verifies every claim against the real code (with file and line references), and checks that the proposed approach is feasible and self-consistent. |
|
|
29
|
+
| `validate-issue-loop` | Runs `validate-issue`, applies any fixes the verdict calls for to the issue itself, then hands off to `work-on-issue-loop`. Stops instead if the issue is too large, infeasible, or already fixed elsewhere. |
|
|
30
|
+
| `work-on-issue` | Implements an issue end-to-end: builds the fix in an isolated git worktree (a separate working copy, so your main checkout stays untouched), verifies it, and opens a PR that closes the issue. |
|
|
31
|
+
| `work-on-issue-loop` | Runs `work-on-issue`, requests a code review, then keeps fixing whatever the review finds until the PR gets an approval ("LGTM" — looks good to me). |
|
|
22
32
|
|
|
23
|
-
|
|
33
|
+
### PR review skills
|
|
24
34
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
| Skill | What it does |
|
|
36
|
+
|-------|--------------|
|
|
37
|
+
| `fix-pr-review` | Reads all unaddressed feedback on a PR, re-checks each point against the actual code (never blindly applies a suggestion), fixes what holds up, pushes, replies point-by-point, and requests a fresh review. |
|
|
38
|
+
| `fix-pr-review-loop` | Repeats `fix-pr-review` after every new review until the PR is approved. After 5 review rounds it accepts the first approval even if minor, non-blocking notes remain. |
|
|
29
39
|
|
|
30
|
-
|
|
40
|
+
### Docs & release skills
|
|
31
41
|
|
|
32
|
-
|
|
42
|
+
| Skill | What it does |
|
|
43
|
+
|-------|--------------|
|
|
44
|
+
| `sync-docs` | Updates `CLAUDE.md`, `AGENTS.md`, `SKILL.md`, and `README.md` to match what recent commits actually changed. |
|
|
45
|
+
| `create-release` | Cuts a version tag and publishes a GitHub release with generated notes, bumping the package version first so publish workflows fire correctly. |
|
|
46
|
+
| `sync-docs-release` | The two above in sequence: sync docs, commit, then cut the release. |
|
|
47
|
+
|
|
48
|
+
### Fable-driven skills
|
|
49
|
+
|
|
50
|
+
| Skill | What it does |
|
|
51
|
+
|-------|--------------|
|
|
52
|
+
| `fableplan` | Has a Fable 5 subagent write an implementation plan before you build; posts the plan to the related issue if there is one. |
|
|
53
|
+
| `fable-new-issue` | Like `new-issue`, but a read-only Fable 5 subagent researches and drafts the issue; your main session spot-checks and files it. |
|
|
54
|
+
| `fable-new-issue-loop` | Runs `fable-new-issue`, then drives the new issue all the way to a reviewed PR automatically. |
|
|
55
|
+
| `fable-validate` | Like `validate-issue`, but the fact-checking runs on a Fable 5 subagent; your main session presents the verdict and acts on it. |
|
|
56
|
+
| `fable-validate-loop` | Runs `fable-validate`, applies issue fixes, gets a Fable plan (only for issues scored C50+ or touching safety-critical code), then drives to a reviewed PR. |
|
|
57
|
+
| `validate-issue-fableplan-loop` | The hybrid: validates on your session's own model, but still brings in Fable for planning when the issue is C50+ or safety-flagged, then drives to a reviewed PR. |
|
|
58
|
+
|
|
59
|
+
### Review bot prerequisite
|
|
60
|
+
|
|
61
|
+
The PR-review skills (`fix-pr-review`, all `-loop` variants) depend on an automated reviewer that responds to `@claude review` comments and answers in a specific format (an `LGTM` / `Needs Updates` verdict plus structured findings). This repo ships a ready-made GitHub Actions workflow for that: copy [`templates/claude-review.yml`](./templates/claude-review.yml) into your repo's `.github/workflows/`, add an `ANTHROPIC_API_KEY` secret, and the bot and skills speak the same format out of the box. Without a review bot, the loop skills detect its absence and stop instead of waiting for a review that never arrives.
|
|
62
|
+
|
|
63
|
+
Grab the workflow directly into a repo:
|
|
33
64
|
|
|
34
65
|
```sh
|
|
35
|
-
mkdir -p
|
|
36
|
-
curl -fsSL https://raw.githubusercontent.com/richkuo/rk-skills/main/
|
|
37
|
-
-o
|
|
66
|
+
mkdir -p .github/workflows && \
|
|
67
|
+
curl -fsSL https://raw.githubusercontent.com/richkuo/rk-skills/main/templates/claude-review.yml \
|
|
68
|
+
-o .github/workflows/claude.yml
|
|
38
69
|
```
|
|
39
70
|
|
|
71
|
+
Also included:
|
|
72
|
+
|
|
73
|
+
- `CLAUDE.md` — an example set of global instructions these skills are tuned for (attribution footers, complexity scores, the branch+PR workflow). Use it as a reference for your own `~/.claude/CLAUDE.md`.
|
|
74
|
+
- `commands/commit.md` — a `/commit` slash command for creating well-formed git commits.
|
|
75
|
+
|
|
40
76
|
## Install (with npx)
|
|
41
77
|
|
|
42
78
|
Copy every skill into your personal `~/.claude/skills/` with one command — no marketplace, no clone:
|
|
@@ -45,15 +81,25 @@ Copy every skill into your personal `~/.claude/skills/` with one command — no
|
|
|
45
81
|
npx rk-skills
|
|
46
82
|
```
|
|
47
83
|
|
|
48
|
-
Add `--project` to install into the current repo's `.claude/skills/` instead. This path is copy-based — re-run it to update — whereas the plugin
|
|
84
|
+
Add `--project` to install into the current repo's `.claude/skills/` instead. This path is copy-based — re-run it to update — whereas the plugin below auto-updates. It installs the **skills and their subagent files** (a few skills delegate their work to helper agents in `agents/`, which land in `~/.claude/agents/`); it does not install `CLAUDE.md` (the example global config) or the `/commit` command.
|
|
49
85
|
|
|
50
|
-
##
|
|
86
|
+
## Install (as a plugin)
|
|
51
87
|
|
|
52
|
-
|
|
88
|
+
This repo is a Claude Code plugin marketplace. In any Claude Code session:
|
|
53
89
|
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
|
|
90
|
+
```
|
|
91
|
+
/plugin marketplace add richkuo/rk-skills
|
|
92
|
+
/plugin install rk-skills@rk-skills
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Claude Code auto-discovers everything under `skills/` (and the `/commit` command). `CLAUDE.md` is **not** installed by the plugin — treat it as a reference. Restart Claude Code (or start a new session), then trigger any skill by name, e.g. `/fableplan <task>`.
|
|
96
|
+
|
|
97
|
+
Prefer to install a single skill? Each is just a directory with a `SKILL.md`, so you can copy one in directly:
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
mkdir -p ~/.claude/skills/work-on-issue && \
|
|
101
|
+
curl -fsSL https://raw.githubusercontent.com/richkuo/rk-skills/main/skills/work-on-issue/SKILL.md \
|
|
102
|
+
-o ~/.claude/skills/work-on-issue/SKILL.md
|
|
57
103
|
```
|
|
58
104
|
|
|
59
105
|
## License
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-release-runner
|
|
3
|
+
description: Runs the create-release workflow. Use whenever the user asks to create a release, cut a release, tag a version, publish release notes, or ship a new versioned GitHub release for the current repo.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# create-release
|
|
7
|
+
|
|
8
|
+
Cut an annotated semver tag and publish a GitHub release with auto-generated notes.
|
|
9
|
+
|
|
10
|
+
## Preconditions — verify ALL before doing anything
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
git status # must be clean — stop if dirty, surface the diff
|
|
14
|
+
git branch --show-current # must be on default branch (main/master)
|
|
15
|
+
git fetch origin && git status # must be up to date with origin
|
|
16
|
+
gh auth status # must succeed
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
If any check fails: **stop and tell the user**. Do not proceed.
|
|
20
|
+
|
|
21
|
+
## Steps
|
|
22
|
+
|
|
23
|
+
1. **Inspect actual tags** — never rely on memory or CHANGELOG:
|
|
24
|
+
```bash
|
|
25
|
+
git tag --sort=-v:refname | head -10
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
2. **Review commits since last tag:**
|
|
29
|
+
```bash
|
|
30
|
+
git log <last-tag>..HEAD --oneline
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
3. **Determine semver bump and state rationale** — breaking = major, new feature = minor, fixes/polish = patch. Proceed immediately. Only pause to ask the user if the bump type is genuinely ambiguous (e.g. unclear whether commits are breaking).
|
|
34
|
+
|
|
35
|
+
4. **Bump the repo's declared version — MANDATORY whenever a version field exists.** This is the package/manifest version, not just a "user-facing app" version: a library, CLI, or installer package (e.g. one with a `package.json` `"version"`) counts and **must** be bumped. Do not skip this because the repo "isn't an app." Grep the repo for version fields and update every match to `X.Y.Z` so the tag points at a commit carrying the correct version. Common locations (check all, update every match):
|
|
36
|
+
|
|
37
|
+
| File | Field |
|
|
38
|
+
|------|-------|
|
|
39
|
+
| `package.json` | `"version"` |
|
|
40
|
+
| `.claude-plugin/plugin.json` | `"version"` |
|
|
41
|
+
| `app.json` / `app.config.js` / `app.config.ts` | `expo.version` |
|
|
42
|
+
| `pubspec.yaml` | `version` |
|
|
43
|
+
| `Cargo.toml` | `[package] version` |
|
|
44
|
+
| `pyproject.toml` | `[project] version` or `[tool.poetry] version` |
|
|
45
|
+
| iOS `*.xcodeproj/project.pbxproj` | `MARKETING_VERSION` |
|
|
46
|
+
| Android `build.gradle` | `versionName` |
|
|
47
|
+
|
|
48
|
+
- Leave native build numbers (`buildNumber`, `versionCode`, `CURRENT_PROJECT_VERSION`) alone unless the user asks.
|
|
49
|
+
- If — and only if — no version field exists anywhere, skip silently and proceed to step 5.
|
|
50
|
+
- **Publish-on-release check (do this every time):** inspect `.github/workflows/` for a job that runs on `release: published` (e.g. `npm publish`). These jobs are almost always idempotency-guarded on the manifest version — if `package.json` still holds the previous version, the guard sees it already published and **silently skips**, so the release ships to GitHub but never reaches the registry. If such a workflow exists, bumping the manifest version in this step is what makes the publish actually fire; a mismatch between the tag and the manifest version is a bug.
|
|
51
|
+
- If a version field exists, edit it, then commit and push **before tagging**:
|
|
52
|
+
```bash
|
|
53
|
+
git commit -am "chore(release): bump version to X.Y.Z"
|
|
54
|
+
git push origin <default-branch>
|
|
55
|
+
```
|
|
56
|
+
- The tag must point at this bump commit — create the tag only after the commit and push succeed.
|
|
57
|
+
|
|
58
|
+
5. **Create annotated tag** (not lightweight):
|
|
59
|
+
```bash
|
|
60
|
+
git tag -a vX.Y.Z -m "vX.Y.Z"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
6. **Push tag:**
|
|
64
|
+
```bash
|
|
65
|
+
git push origin vX.Y.Z
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
7. **Create release with auto-generated notes:**
|
|
69
|
+
```bash
|
|
70
|
+
gh release create vX.Y.Z --generate-notes --title "vX.Y.Z"
|
|
71
|
+
```
|
|
72
|
+
Print the URL from `gh`'s output.
|
|
73
|
+
|
|
74
|
+
8. **Project-local hook:** if the repo has a `MEMORY.md` or `CHANGELOG.md` with a Releases section, append:
|
|
75
|
+
`**vX.Y.Z** — YYYY-MM-DD: <one-line summary>`
|
|
76
|
+
Skip silently if neither exists.
|
|
77
|
+
|
|
78
|
+
## Red Flags — STOP
|
|
79
|
+
|
|
80
|
+
| Situation | Action |
|
|
81
|
+
|-----------|--------|
|
|
82
|
+
| Tag already exists | Do NOT force-overwrite. Ask user. |
|
|
83
|
+
| `git status` dirty | Stop. Surface the diff. |
|
|
84
|
+
| Not on default branch | Stop. Ask user to confirm intent. |
|
|
85
|
+
| Breaking changes + patch bump proposed | Require major bump. |
|
|
86
|
+
| Manifest version (`package.json` etc.) still at previous version | Bump it (step 4) before tagging — a stale version silently no-ops any publish-on-release workflow. |
|
|
87
|
+
|
|
88
|
+
## Common Mistakes
|
|
89
|
+
|
|
90
|
+
- **Trusting memory for latest version** — always run `git tag`, tags and notes diverge.
|
|
91
|
+
- **Hand-writing release notes** — always use `--generate-notes`; GitHub builds them from merged PRs automatically.
|
|
92
|
+
- **Stalling for unnecessary confirmation** — if preconditions pass and bump type is clear, tag and release immediately.
|
|
93
|
+
- **Lightweight tag** — `git tag vX.Y.Z` without `-a` creates a lightweight tag; use `-a` always.
|
|
94
|
+
- **Letting `gh release create` implicitly create the tag** — create and push the tag explicitly first so it's traceable.
|
|
95
|
+
- **Tagging before the version bump commit** — if the repo has a declared version, bump and commit it first, then tag that commit. A tag pointing at a commit with the old version is wrong.
|
|
96
|
+
- **Treating a library/installer's `package.json` version as "not an app version" and skipping the bump** — any manifest `version` field must be bumped (step 4). Skipping it strands the release on GitHub and silently skips the npm publish, because the publish workflow keys off `package.json`'s version.
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sync-docs-runner
|
|
3
|
+
description: Runs the sync-docs workflow. Use whenever the user asks to sync, update, or refresh CLAUDE.md, AGENTS.md, SKILL.md, or README.md to reflect recent commits or PRs.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# sync-docs
|
|
7
|
+
|
|
8
|
+
Keep CLAUDE.md, AGENTS.md, SKILL.md, and README.md accurate after new commits land. Finds the last docs-sync point, classifies every commit since then, and writes targeted updates — no rewrite, no drift. Syncing is bidirectional: as well as adding what's new, **remove or correct anything the current codebase now contradicts** — stale paths, renamed symbols, removed fields, dead defaults. A doc that lies is worse than one that's merely incomplete.
|
|
9
|
+
|
|
10
|
+
Adapt to the repo you're in. The doc set below is the common shape, not a requirement — a repo may have only a README, or add its own docs. Edit the files that exist; never create a new top-level doc (AGENTS.md, CHANGELOG.md, SKILL.md) as part of a sync — if one seems warranted, surface it to the user instead.
|
|
11
|
+
|
|
12
|
+
Audience split:
|
|
13
|
+
- **CLAUDE.md** — agent-facing dense reference (architecture, symbol/file names, `file:line` cues). Describes **current behavior**; not a history log.
|
|
14
|
+
- **AGENTS.md** *(only if the repo already has one — check `ls AGENTS.md` first)* — the counterpart agent doc for other tools (e.g. Codex). Same body content (architecture, commands, conventions); only the intro line stays tool-specific. When present, mirror every CLAUDE.md body edit into it so the two stay in lockstep — see step 5.
|
|
15
|
+
- **SKILL.md** *(only if the repo has one)* — operator-facing imperative guide (config knobs, setup prompts, CLI flows).
|
|
16
|
+
- **README.md** — public/newcomer-facing (setup, supported features, headline config). Lowest churn — update only when public surface changes.
|
|
17
|
+
- **CHANGELOG.md** *(only if the repo already has one — check `ls CHANGELOG.md` first)* — per-issue/PR history, rationale, and migration archaeology. When present it is the home for the "why" and resolved-migration detail, so CLAUDE.md stays lean. Never create one as part of a sync.
|
|
18
|
+
|
|
19
|
+
## Preconditions
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
git log --oneline -5 # confirm you're on the right branch
|
|
23
|
+
git status # must be clean before editing docs
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Steps
|
|
27
|
+
|
|
28
|
+
### 1. Find the last sync baseline
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
git log --oneline | grep -m1 "docs:.*sync\|docs:.*CLAUDE\|docs:.*SKILL\|sync docs"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Note the SHA. If none found, ask the user for the last-known-good tag or SHA (or fall back to the initial commit for a first sync).
|
|
35
|
+
|
|
36
|
+
### 2. Get commits since last sync
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
git log <last-sync-sha>..HEAD --oneline
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Exclude pure CI / workflow / chore commits (`.github/`, `scripts/`, version bumps) unless they affect agent- or operator-facing behavior.
|
|
43
|
+
|
|
44
|
+
### 3. Classify each commit
|
|
45
|
+
|
|
46
|
+
| Category | Docs target | Action |
|
|
47
|
+
|----------|-------------|--------|
|
|
48
|
+
| New config field / flag / setting | CLAUDE.md config reference; SKILL.md settings table (if present); README.md **only if** it's a top-level/public-facing knob | Add field description + notes |
|
|
49
|
+
| Changed default behavior | CLAUDE.md patterns section; SKILL.md (if present); README.md **only if** a documented default/example now contradicts the code | Update description; note old vs new |
|
|
50
|
+
| New pluggable unit (plugin, command, integration, platform, strategy, theme, provider…) | CLAUDE.md structure + SKILL.md catalog (if present) + README.md feature list | Add entry to each doc that enumerates the set |
|
|
51
|
+
| Bug fix (behavior change) | CLAUDE.md patterns (if pattern-level) | Update the relevant bullet |
|
|
52
|
+
| New CLI command / flag | SKILL.md commands (if present); README.md Getting Started **only if** it's part of the setup/operator flow | Add usage |
|
|
53
|
+
| Setup / install flow change | README.md Getting Started + SKILL.md (if operator-facing) | Update the relevant block |
|
|
54
|
+
| Internal refactor / test | Skip (no docs change needed) | — |
|
|
55
|
+
| New release milestone | Project memory/notes file **if one exists** (see step 9) | Append version entry |
|
|
56
|
+
| Per-issue/PR history, rationale, or migration archaeology (*if CHANGELOG.md exists*) | CHANGELOG.md | Add a keyed entry there, not into CLAUDE.md; CLAUDE.md gets only the terse current-state invariant |
|
|
57
|
+
| Existing doc claim contradicted by current code (stale path, renamed symbol, removed field, changed default) | Whichever doc carries the claim | Correct or delete the stale statement |
|
|
58
|
+
|
|
59
|
+
### 4. Audit existing docs against the codebase and prune outdated content
|
|
60
|
+
|
|
61
|
+
Commit-driven updates catch what changed; they miss docs that silently went stale. Before writing new content, spot-check the existing docs against the actual code:
|
|
62
|
+
|
|
63
|
+
- For each doc section in the area of an in-scope commit, verify the surrounding claims still hold — file paths exist, symbol names match, defaults and version numbers are current, CLI flags still accept the documented args.
|
|
64
|
+
- Delete or correct any statement the codebase contradicts: removed fields, renamed symbols, dead file paths, stale defaults, deprecated flows, examples that no longer run.
|
|
65
|
+
- Removing wrong content is as important as adding new content — treat a prune as a first-class edit, not an afterthought.
|
|
66
|
+
- Stay scoped: audit the areas related to the in-scope commits, not the entire doc. If the docs look broadly drifted beyond that scope, flag it to the user rather than silently doing a full rewrite.
|
|
67
|
+
- When unsure whether something is outdated, grep the code to confirm before deleting — never remove a claim you haven't verified is wrong.
|
|
68
|
+
- **Cross-check "current/live/active/default" claims against the deciding variable, not the doc's own prior text.** Any doc that names which version/mode/config is currently in effect (a build script's target, a feature-flag default, an active-environment pointer) can go stale silently — the doc reads as self-consistent even after the underlying switch moved. Find the actual switch (grep for the assignment — `MAIN=`, `ACTIVE_*`, a default-branch config key, etc.) and confirm it still matches what the doc claims.
|
|
69
|
+
- **Diff enumerable generated listings against the filesystem.** When an in-scope commit touches a directory holding a versioned or pluggable set of items (plugins, commands, integrations, themes, providers), list the actual directory entries (`ls`, `find`) and compare against every place that's supposed to enumerate them (index/chooser pages, catalog tables, README lists). A missing or orphaned entry is a silent drift the commit diff alone won't surface, because the commit that broke it may be several syncs back.
|
|
70
|
+
- **Check promotion/demotion parity.** If the codebase has a "promote item to active, retire the previous one" pattern (a new default version, a new production config, a newly-active integration), verify that state encoding "this is the active one" — self-referencing URLs, indexing/discoverability directives, feature flags, config defaults — was flipped on BOTH the newly-promoted item and the newly-demoted item. A promotion is a two-sided edit; half-applied swaps (new item correct, old item still claiming to be active) are a common source of live bugs, not just doc drift, and won't show up in a diff of the promoting commit alone. If you find this pattern is real but undocumented as an explicit invariant, add a short rule for it to the project's own docs (e.g. CLAUDE.md patterns) so future promotions don't repeat the same half-applied swap.
|
|
71
|
+
|
|
72
|
+
### 5. Edit CLAUDE.md
|
|
73
|
+
|
|
74
|
+
- Stay surgical: edit only the sections that changed.
|
|
75
|
+
- Add new fields to the appropriate config or patterns section.
|
|
76
|
+
- Keep bullets concise — CLAUDE.md is dense reference, not narrative.
|
|
77
|
+
- Update any config/schema version constant the project maintains if a migration bumped it.
|
|
78
|
+
- If a new opt-in field was added and the repo has a SKILL.md, add it to the relevant operator table there (see step 6).
|
|
79
|
+
- **Mirror into AGENTS.md if it exists.** Run `ls AGENTS.md`; if present, apply every body edit you just made to CLAUDE.md to AGENTS.md verbatim (architecture, commands, conventions, schema — same content). The only thing that differs is the intro/header line, which stays tool-specific — do not overwrite it with CLAUDE.md's Claude-facing line. Also audit AGENTS.md for the same staleness patterns as step 4: it drifts silently because commit-driven edits target CLAUDE.md by name. If AGENTS.md doesn't exist, skip it — never create one during a sync.
|
|
80
|
+
|
|
81
|
+
### 6. Edit SKILL.md (only if the repo has one)
|
|
82
|
+
|
|
83
|
+
Keep SKILL.md operator-facing and imperative; avoid code internals. Common targets, depending on what the repo's SKILL.md documents:
|
|
84
|
+
- **Settings / configuration table** — add new global or per-unit keys.
|
|
85
|
+
- **Post-update / upgrade reference** — add the change as a default, opt-in, or auto-migration row so operators get prompted on upgrade.
|
|
86
|
+
- **Commands / reconfiguration section** — if a CLI surface or reload scope changed.
|
|
87
|
+
- **Operator safety controls** — if guard/circuit-breaker/limit behavior changed.
|
|
88
|
+
|
|
89
|
+
### 7. Edit README.md (only if public surface changed)
|
|
90
|
+
|
|
91
|
+
README is the entry point for newcomers and the public face of the project. Default to **no edit** — only touch when one of these is true:
|
|
92
|
+
|
|
93
|
+
- **New supported feature/platform/integration** → add to the relevant feature or catalog section.
|
|
94
|
+
- **New public-facing unit** (plugin, command, provider, theme) → add to the list that enumerates them, one line each, matching the existing format.
|
|
95
|
+
- **New top-level CLI subcommand** that users run by hand → add to the appropriate Getting Started block or a dedicated section.
|
|
96
|
+
- **Setup / install / build flow change** → update the relevant setup block.
|
|
97
|
+
- **Public-facing config knob change** that contradicts a documented example → update the affected config sub-block only.
|
|
98
|
+
|
|
99
|
+
Skip README for: bug fixes, internal refactors, parameter tweaks, symbol renames, schema migrations (those go in SKILL.md if present), and cosmetic changes.
|
|
100
|
+
|
|
101
|
+
When editing:
|
|
102
|
+
- Keep the tone tutorial-clean — no `file:line` cues, no code internals, no PR numbers in body text (PR numbers only in changelog-style sections that already use them).
|
|
103
|
+
- Don't grow lists into prose — each item gets one line / one bullet matching the existing format.
|
|
104
|
+
- If a section already has version/PR references, follow the same convention; otherwise omit them.
|
|
105
|
+
|
|
106
|
+
### 8. Check CLAUDE.md size and condense if oversized
|
|
107
|
+
|
|
108
|
+
Claude Code warns when CLAUDE.md exceeds 40k chars ("Large CLAUDE.md will impact performance"). Run after step 5:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
wc -c CLAUDE.md
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
If the byte count exceeds **40000**, condense in-place before finishing the sync. Target: bring the file back under 38000 chars (leaves headroom for the next sync). Do NOT split into multiple files — agents only auto-load the root CLAUDE.md.
|
|
115
|
+
|
|
116
|
+
**If a CHANGELOG.md exists, relocate rather than delete.** Before dropping completed-migration prose, resolved-incident narrative, or per-issue "why" detail (passes 2 and 5 below), move it into CHANGELOG.md keyed by issue/PR instead of discarding it — the history stays available without loading into agent context every turn. Only outright-delete history when the repo has no CHANGELOG.md to receive it. Never create a CHANGELOG.md solely to offload bytes during a sync; if CLAUDE.md is oversized and no CHANGELOG.md exists, surface that to the user as an option rather than introducing the file unilaterally.
|
|
117
|
+
|
|
118
|
+
**Condensation rules — preserve agent-critical signal, drop narrative:**
|
|
119
|
+
|
|
120
|
+
| Keep | Trim / drop |
|
|
121
|
+
|------|-------------|
|
|
122
|
+
| Symbol / file names and `file:line` cues | Prose explaining *why* a pattern exists when the rule alone is actionable |
|
|
123
|
+
| Field-name lists, enum values, default values, version numbers (thresholds, timeouts, schema versions) | Historical migration notes once the migration has shipped and stabilized (>2 versions old) |
|
|
124
|
+
| Non-obvious gotchas, race conditions, lock order, ordering constraints | Restated information that's already in another bullet |
|
|
125
|
+
| Active "new X requires Y" instructions | Examples that duplicate a rule already stated tersely |
|
|
126
|
+
| Currently-live behavior | Deprecated behavior, legacy field aliases that no caller uses |
|
|
127
|
+
|
|
128
|
+
**Mechanical passes — apply in order, stop when under target:**
|
|
129
|
+
|
|
130
|
+
1. **Collapse duplicated phrasing** — same fact stated twice in different bullets → merge into one bullet.
|
|
131
|
+
2. **Drop completed-migration prose** — if a migration is ≥2 versions behind the current schema/config version AND the legacy field is no longer read, delete the migration narrative; keep the field rename only if code still references the old name.
|
|
132
|
+
3. **Compress example-laden bullets** — `e.g.` lists with 3+ items → keep the first 1–2 + `…` if the pattern is obvious.
|
|
133
|
+
4. **Inline single-line sub-bullets** — `- foo:\n - bar` where bar is one short clause → `- foo: bar`.
|
|
134
|
+
5. **Remove resolved-incident narrative** — "fixed because X happened in prod" becomes "X — see <symbol>" or is dropped if the rule stands on its own.
|
|
135
|
+
6. **Shorten reference-table cells** — multi-clause descriptions → one clause + symbol name; agents resolve details from code.
|
|
136
|
+
|
|
137
|
+
**Forbidden — never trim these even if oversized:**
|
|
138
|
+
- The `## Environment`, `## Setup`, `## Build & Deploy`, `## Testing` blocks (operator-load-bearing).
|
|
139
|
+
- Lookup tables — lists of IDs, type names, prefixes, file paths (losing one row corrupts dispatch).
|
|
140
|
+
- Concurrency-hazard rules (state-locking, lock-order, skip-reason/live-exec guards).
|
|
141
|
+
- Any PR/commit footer or format convention the repo's own CLAUDE.md defines.
|
|
142
|
+
|
|
143
|
+
After condensing, re-run `wc -c CLAUDE.md` and report old → new byte counts. If still over 40k after all six passes, surface to the user with a list of the largest sections and ask which to cut further — don't unilaterally remove load-bearing content.
|
|
144
|
+
|
|
145
|
+
### 9. Update the project memory/notes file if one exists
|
|
146
|
+
|
|
147
|
+
Some repos keep a running notes or memory file (e.g. `MEMORY.md`, `NOTES.md`, `docs/CHANGELOG`-style log) with a Releases section. If one exists **and** the in-scope commits include a version tag or release PR, append:
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
- **vX.Y.Z** — YYYY-MM-DD: <one-line summary> (PRs #N, #M)
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Only append if such a file already exists — never create one during a sync.
|
|
154
|
+
|
|
155
|
+
## Red Flags — STOP
|
|
156
|
+
|
|
157
|
+
| Situation | Action |
|
|
158
|
+
|-----------|--------|
|
|
159
|
+
| `git status` is dirty before you start | Stash or commit pending work first |
|
|
160
|
+
| Commit touches multiple unrelated areas | Split classification carefully; don't conflate |
|
|
161
|
+
| A field was *removed* | Delete the row/bullet — don't leave stale docs |
|
|
162
|
+
| Behavior reversal (bug was fixed back to original) | Note the revert explicitly, don't just silently restore |
|
|
163
|
+
| A sync seems to warrant a brand-new top-level doc (AGENTS.md, CHANGELOG.md, SKILL.md) | Surface it to the user — never create one as part of a sync |
|
|
164
|
+
|
|
165
|
+
## Common Mistakes
|
|
166
|
+
|
|
167
|
+
- **Over-documenting internals** — CLAUDE.md is for agent-relevant patterns; SKILL.md is for operators. Symbol/field names belong in CLAUDE.md, not SKILL.md operator tables.
|
|
168
|
+
- **Under-documenting opt-in fields** — when the repo has a SKILL.md, every new opt-in field needs a row in its settings table and its upgrade reference so operators get prompted on upgrade.
|
|
169
|
+
- **Copying PR descriptions verbatim** — translate to concise imperative phrases the reader can act on.
|
|
170
|
+
- **Bundling multiple unrelated changes into one bullet** — one bullet per behavioral change.
|
|
171
|
+
- **Treating README like CLAUDE.md** — don't dump code internals, symbol names, or PR-by-PR changelog entries into README. If a change doesn't affect what a newcomer needs to install/run/configure, it doesn't belong there.
|
|
172
|
+
- **Forgetting README on new public units** — new features/plugins/integrations are the highest-signal README updates and the easiest to miss because CLAUDE.md and SKILL.md updates feel "complete." Always check the enumerated lists.
|
|
173
|
+
- **Trusting a doc's own history instead of re-deriving current state from code** — a "currently active" claim is only correct as of when it was written. Always re-check it against the actual deciding switch (config default, build-script variable, feature flag) rather than assuming a prior sync got it right.
|
|
174
|
+
- **Creating a new top-level doc during a sync** — AGENTS.md, CHANGELOG.md, and SKILL.md are only edited when they already exist; introducing one is a user decision, not a sync side effect.
|
package/bin/install.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
6
6
|
|
|
7
7
|
const pkgRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
8
8
|
const skillsSrc = join(pkgRoot, 'skills');
|
|
9
|
+
const agentsSrc = join(pkgRoot, 'agents');
|
|
9
10
|
|
|
10
11
|
if (!existsSync(skillsSrc)) {
|
|
11
12
|
console.error('rk-skills: could not find the skills/ directory in the package.');
|
|
@@ -25,17 +26,35 @@ if (skills.length === 0) {
|
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
const project = process.argv.includes('--project');
|
|
28
|
-
const
|
|
29
|
-
? join(process.cwd(), '.claude'
|
|
30
|
-
: join(homedir(), '.claude'
|
|
29
|
+
const claudeDir = project
|
|
30
|
+
? join(process.cwd(), '.claude')
|
|
31
|
+
: join(homedir(), '.claude');
|
|
32
|
+
const skillsDir = join(claudeDir, 'skills');
|
|
33
|
+
const agentsDir = join(claudeDir, 'agents');
|
|
31
34
|
|
|
32
35
|
mkdirSync(skillsDir, { recursive: true });
|
|
33
36
|
for (const name of skills) {
|
|
34
37
|
cpSync(join(skillsSrc, name), join(skillsDir, name), { recursive: true });
|
|
35
38
|
}
|
|
36
39
|
|
|
40
|
+
// Some skills are dispatch shims that invoke subagents; install their agent files too.
|
|
41
|
+
const agents = existsSync(agentsSrc)
|
|
42
|
+
? readdirSync(agentsSrc).filter((name) => name.endsWith('.md')).sort()
|
|
43
|
+
: [];
|
|
44
|
+
if (agents.length > 0) {
|
|
45
|
+
mkdirSync(agentsDir, { recursive: true });
|
|
46
|
+
for (const name of agents) {
|
|
47
|
+
cpSync(join(agentsSrc, name), join(agentsDir, name));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
37
51
|
const scope = project ? 'this project' : 'your personal skills';
|
|
38
52
|
console.log(`rk-skills installed ${skills.length} skills into ${scope}:`);
|
|
39
53
|
console.log(` ${skillsDir}`);
|
|
40
54
|
console.log(` ${skills.join(', ')}`);
|
|
55
|
+
if (agents.length > 0) {
|
|
56
|
+
console.log(`\nAlso installed ${agents.length} subagents into:`);
|
|
57
|
+
console.log(` ${agentsDir}`);
|
|
58
|
+
console.log(` ${agents.map((n) => n.replace(/\.md$/, '')).join(', ')}`);
|
|
59
|
+
}
|
|
41
60
|
console.log('\nRestart Claude Code (or start a new session), then invoke any skill by name, e.g.\n /fableplan <task to plan>');
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rk-skills",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Installer for
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Installer for Claude Code workflow skills — GitHub issue/PR/release automation and Fable-driven planning.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"rk-skills": "bin/install.mjs"
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"bin",
|
|
11
11
|
"skills",
|
|
12
|
+
"agents",
|
|
12
13
|
".claude-plugin",
|
|
13
14
|
"README.md",
|
|
14
15
|
"LICENSE"
|
|
@@ -22,8 +22,9 @@ Locate the `new-issue` SKILL.md the subagent must follow — prefer the project-
|
|
|
22
22
|
|
|
23
23
|
1. `<repo>/.claude/skills/new-issue/SKILL.md` (if it exists)
|
|
24
24
|
2. `~/.claude/skills/new-issue/SKILL.md`
|
|
25
|
+
3. Any other install location — search by name, e.g. `ls ~/.claude/plugins/*/skills/new-issue/SKILL.md` (plugin-marketplace installs live under a plugin directory, not `~/.claude/skills/`).
|
|
25
26
|
|
|
26
|
-
Record the absolute path. If
|
|
27
|
+
Record the absolute path. If none of these resolves, stop and tell the user.
|
|
27
28
|
|
|
28
29
|
If the input is conversation-derived, write the scratchpad summary now (see Input). Do NOT pre-research or pre-draft the issue yourself — the subagent owns steps 1–6 of the procedure up to (but not including) the `gh issue create` call.
|
|
29
30
|
|
|
@@ -68,5 +69,6 @@ Terse: issue URL, number, one-line summary, complexity score, any unfiled follow
|
|
|
68
69
|
## Notes
|
|
69
70
|
|
|
70
71
|
- The drafting subagent runs on Fable 5 regardless of the main agent's model — `model: fable` forces it.
|
|
72
|
+
- **If the `fable` model is unavailable in this harness** (the Agent call errors on the model id), fall back to the most capable model available and proceed — the isolation pattern (read-only subagent drafts, main agent files) is what matters. Name the model that actually ran in the footer and report, never "Fable 5".
|
|
71
73
|
- One subagent, one draft: don't fan out or re-run for a second opinion unless the user asks.
|
|
72
74
|
- Never file a placeholder or thin body — if the subagent's draft isn't complete, it doesn't get filed; that rule outranks finishing the run.
|
|
@@ -23,8 +23,9 @@ Locate the `validate-issue` SKILL.md the subagent must follow — prefer the pro
|
|
|
23
23
|
|
|
24
24
|
1. `<repo>/.claude/skills/validate-issue/SKILL.md` (if it exists)
|
|
25
25
|
2. `~/.claude/skills/validate-issue/SKILL.md`
|
|
26
|
+
3. Any other install location — search by name, e.g. `ls ~/.claude/plugins/*/skills/validate-issue/SKILL.md` (plugin-marketplace installs live under a plugin directory, not `~/.claude/skills/`).
|
|
26
27
|
|
|
27
|
-
Record the absolute path. If
|
|
28
|
+
Record the absolute path. If none of these resolves, stop and tell the user.
|
|
28
29
|
|
|
29
30
|
If the user referenced an issue, note the number/repo but do NOT fetch or pre-validate it yourself — the subagent owns steps 0–7 of the procedure, including fetching. If no issue was referenced, the subagent resolves the latest open issue itself per the procedure.
|
|
30
31
|
|
|
@@ -69,5 +70,6 @@ Handle the user's reply per the validate-issue procedure — these are main-agen
|
|
|
69
70
|
## Notes
|
|
70
71
|
|
|
71
72
|
- The validation subagent runs on Fable 5 regardless of the main agent's model — `model: fable` on the Agent call forces it.
|
|
73
|
+
- **If the `fable` model is unavailable in this harness** (the Agent call errors on the model id), fall back to the most capable model available and proceed — the isolation pattern (read-only subagent validates, main agent acts) is what matters. Name the model that actually ran in the footer and report, never "Fable 5".
|
|
72
74
|
- One subagent, one verdict: don't fan out or re-run for a second opinion unless the user asks.
|
|
73
75
|
- If the user's reference turns out not to be fetchable (wrong number, no auth), the subagent will report that per the procedure — relay it; never validate against a paraphrase.
|
|
@@ -60,7 +60,7 @@ Keep the vetted plan's scratchpad file — step 5 passes it through. If fablepla
|
|
|
60
60
|
|
|
61
61
|
Invoke the `work-on-issue-loop` skill for the same issue number (Skill tool, `skill: work-on-issue-loop`). Pass the issue number through explicitly — don't let it re-resolve "latest issue" — and instruct it that the implementation must follow the Fable 5 plan: point it at the plan's scratchpad file and the posted issue comment (`## Implementation plan (Fable 5)`), and tell it deviations from the plan are allowed only when the code contradicts the plan, and must be named in the PR body. (If step 4 was skipped by the complexity gate, there is no plan — hand off the issue alone and note the skip.)
|
|
62
62
|
|
|
63
|
-
It runs its full loop: work-on-issue implements in a worktree
|
|
63
|
+
It runs its full loop: work-on-issue implements in a worktree and opens the PR, the loop triggers `@claude` review, and fix-pr-review cycles until convergence.
|
|
64
64
|
|
|
65
65
|
### 6. Report
|
|
66
66
|
|
|
@@ -68,7 +68,7 @@ Add `-R owner/repo` when the issue lives in another repo (as in step 1). Use the
|
|
|
68
68
|
|
|
69
69
|
```
|
|
70
70
|
---
|
|
71
|
-
Created with: Fable 5 | high | Claude Code | fableplan
|
|
71
|
+
Created with LLM: Fable 5 | high | Harness: Claude Code | fableplan
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
After posting, give the user the comment URL `gh` returns. Follow the repo's CLAUDE.md conventions for comment formatting if any apply (e.g. avoid `#N` auto-links in list items). If no issue is referenced, skip this step.
|
|
@@ -94,4 +94,5 @@ In the worktree from step 6, the main agent builds the task per the plan. Confir
|
|
|
94
94
|
## Notes
|
|
95
95
|
|
|
96
96
|
- The Plan subagent runs on Fable 5 regardless of the main agent's model — `model: fable` on the Agent call forces it.
|
|
97
|
+
- **If the `fable` model is unavailable in this harness** (the Agent call errors on the model id), fall back to the most capable model available and proceed — the isolation pattern (Plan subagent plans, main agent builds) is what matters. Name the model that actually ran in the footer and report, never "Fable 5".
|
|
97
98
|
- If the user did not reference an issue, never invent one or post anywhere — just plan and build.
|
|
@@ -29,6 +29,8 @@ gh pr view <N|--> --json number,headRefName,headRepositoryOwner,baseRefName,url,
|
|
|
29
29
|
```
|
|
30
30
|
Record the trigger timestamp, set `review_count = 1`, and go to step 2 to wait for it.
|
|
31
31
|
|
|
32
|
+
**Preflight — confirm a review bot exists before waiting on one.** This loop assumes an automated reviewer that answers `@claude review` comments. Before entering the wait, check the repo for one: `gh api repos/{owner}/{repo}/contents/.github/workflows --jq '.[].name'` and look for a workflow that responds to `@claude` (e.g. `claude.yml`), or confirm the Claude GitHub App is installed. If you find none, don't sink 30 minutes into a review that will never come — tell the user no review bot is configured and point them at `templates/claude-review.yml` in this repo (copy it to `.github/workflows/`, add an `ANTHROPIC_API_KEY` secret). Proceed into the wait only if a reviewer is present or the user confirms one is configured elsewhere.
|
|
33
|
+
|
|
32
34
|
### 2. Wait for the review to land
|
|
33
35
|
|
|
34
36
|
Poll the PR for a new review or issue comment posted **after** the last trigger timestamp — reviews can land as a formal PR review or as an issue comment (the `@claude` bot usually posts as an issue comment; see fix-pr-review step 1 for the `gh` calls to check — it also fetches inline diff threads, which matter when a human reviewer weighs in). An until-loop is the right shape here — you want to be notified once the condition is true, not to busy-poll inline:
|
|
@@ -280,7 +280,7 @@ Scope: (omit unless the issue is too large per step 6.5)
|
|
|
280
280
|
|
|
281
281
|
### 7.5. When the user replies "work on issue" — hand off to the work-on-issue skill
|
|
282
282
|
|
|
283
|
-
When the user opts to **work on** the issue (not merely validate or update it), **invoke the `work-on-issue` skill** — that is the default follow-on. It owns the full implementation flow: create and switch into a fresh isolated worktree off the latest default branch, implement the fix to the codebase's conventions, verify, commit and push, open a PR that `Closes #<N
|
|
283
|
+
When the user opts to **work on** the issue (not merely validate or update it), **invoke the `work-on-issue` skill** — that is the default follow-on. It owns the full implementation flow: create and switch into a fresh isolated worktree off the latest default branch, implement the fix to the codebase's conventions, verify, commit and push, and open a PR that `Closes #<N>` (it ends with the open PR — requesting review is the caller's job).
|
|
284
284
|
|
|
285
285
|
Pass the issue number through; the skill is idempotent about the worktree (reuses an existing one for this issue). Don't start editing code or creating a worktree here yourself — delegate so the implement → PR → review chain stays consistent.
|
|
286
286
|
|
|
@@ -62,7 +62,7 @@ Keep the vetted plan's scratchpad file — step 5 passes it through. If fablepla
|
|
|
62
62
|
|
|
63
63
|
Invoke the `work-on-issue-loop` skill for the same issue number (Skill tool, `skill: work-on-issue-loop`). Pass the issue number through explicitly — don't let it re-resolve "latest issue" — and instruct it that the implementation must follow the Fable 5 plan: point it at the plan's scratchpad file and the posted issue comment (`## Implementation plan (Fable 5)`), and tell it deviations from the plan are allowed only when the code contradicts the plan, and must be named in the PR body. (If step 4 was skipped by the complexity gate, there is no plan — hand off the issue alone and note the skip.)
|
|
64
64
|
|
|
65
|
-
It runs its full loop: work-on-issue implements in a worktree
|
|
65
|
+
It runs its full loop: work-on-issue implements in a worktree and opens the PR, the loop triggers `@claude` review, and fix-pr-review cycles until convergence.
|
|
66
66
|
|
|
67
67
|
### 6. Report
|
|
68
68
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: work-on-issue
|
|
3
|
-
description: Use when the user says "work on issue", "work on this issue", "implement issue", "/work-on-issue", or otherwise asks to implement a GitHub issue end-to-end (not merely validate it). Takes a GitHub issue URL or number (defaults to the just-validated issue). Implements the fix in an isolated worktree, verifies it, commits and pushes, opens a PR that closes the issue
|
|
3
|
+
description: Use when the user says "work on issue", "work on this issue", "implement issue", "/work-on-issue", or otherwise asks to implement a GitHub issue end-to-end (not merely validate it). Takes a GitHub issue URL or number (defaults to the just-validated issue). Implements the fix in an isolated worktree, verifies it, commits and pushes, and opens a PR that closes the issue. This is the default follow-on when validate-issue offers "work on issue".
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# work-on-issue
|
|
7
7
|
|
|
8
|
-
Take a GitHub issue from "validated" to "PR
|
|
8
|
+
Take a GitHub issue from "validated" to "PR open", autonomously and end-to-end: isolate the work in a fresh worktree, implement the fix to the codebase's conventions, verify it really works, commit and push, then open a pull request that closes the issue. The skill ends with the open PR — requesting review is the caller's job (work-on-issue-loop does it; standalone, the user decides). Don't stop to ask the user between steps — do the work and report at the end.
|
|
9
9
|
|
|
10
10
|
**This is the natural follow-on to validate-issue.** When validate-issue ends with `→ Reply "work on issue"`, the user replying "work on issue" lands here. The skill is also valid standalone — invoke it when the user asks to implement an issue without a prior validation pass.
|
|
11
11
|
|
|
@@ -118,29 +118,11 @@ gh pr create --base "$(gh repo view --json defaultBranchRef -q .defaultBranchRef
|
|
|
118
118
|
|
|
119
119
|
Capture the PR number/URL from the command output.
|
|
120
120
|
|
|
121
|
-
### 7.
|
|
121
|
+
### 7. Report to the user
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
The skill ends here — do **not** trigger an `@claude` review or wait on CI; requesting review belongs to the caller (work-on-issue-loop posts the trigger itself; standalone, the user decides whether and when to request one).
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
gh pr checks <PR-number>
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
- **Failing** → fix the failure, push, and re-check before triggering. **Bound the loop:** if CI is still red after two or three fix-push-recheck rounds, stop and report the PR's true state (open, CI red, what was tried) — an honestly-reported red PR beats an endless loop or a false success.
|
|
130
|
-
- **Pending** → don't block the flow waiting; trigger the review and state the pending CI status in the final report.
|
|
131
|
-
- **Empty output is not "no checks".** Immediately after the PR opens, CI may not have registered its runs yet. If the repo defines workflows (`ls .github/workflows/`), wait briefly and re-run `gh pr checks` before classifying; conclude "none configured" only when the repo has no CI workflows at all — then proceed and note it in the report.
|
|
132
|
-
|
|
133
|
-
Then post a **separate, one-line** comment so the bot triggers cleanly on its own:
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
gh pr comment <PR-number> --body "@claude review"
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
(If the repo uses a different review trigger phrase, match it — check recent PR comments.) A trigger mention is not authored content — no footer.
|
|
140
|
-
|
|
141
|
-
### 8. Report to the user
|
|
142
|
-
|
|
143
|
-
Terse summary: the worktree/branch, what you implemented (one or two lines), the verification result, the CI-checks status (passing / pending / none — or red-after-bounded-attempts when step 7's exit fired), the commit SHA, the PR URL, that it closes #<N>, and that an `@claude` review was requested. The work is done and under review — not waiting on the user.
|
|
125
|
+
Terse summary: the worktree/branch, what you implemented (one or two lines), the verification result, the commit SHA, the PR URL, and that it closes #<N>. The work is done and the PR is open — not waiting on the user.
|
|
144
126
|
|
|
145
127
|
**Follow-on work named in the deliverables must not silently drop.** If the PR body, commit message, or any doc the diff adds names follow-on work ("own issue", "future work", "not yet wired"), state it in the report as **unfiled** — under work-on-issue-loop, its step 4.5 files these once review converges; standalone, tell the user the issues still need filing.
|
|
146
128
|
|
|
@@ -164,7 +146,5 @@ Terse summary: the worktree/branch, what you implemented (one or two lines), the
|
|
|
164
146
|
| Tests/build/lint fail locally | Fix or surface it — never commit, push, or claim success on a failing tree |
|
|
165
147
|
| `git status` shows files unrelated to the change | Don't `git add -A` — stage the intended files by name |
|
|
166
148
|
| Writing the PR body | Include `Closes #<N>` (without it the merge doesn't resolve the issue) and end with the repo's footer convention — **Created** verb, no `Co-authored-by` |
|
|
167
|
-
|
|
|
168
|
-
|
|
|
169
|
-
| Bundling `@claude review` into the PR body or first comment | Keep it a separate one-line comment so the bot fires reliably |
|
|
170
|
-
| Tempted to pause and ask the user mid-flow | Don't — implement, verify, commit, push, open the PR, request review, then report |
|
|
149
|
+
| Tempted to trigger an `@claude` review or wait on CI after opening the PR | Don't — the skill ends with the open PR; review requests are the caller's job |
|
|
150
|
+
| Tempted to pause and ask the user mid-flow | Don't — implement, verify, commit, push, open the PR, then report |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: work-on-issue-loop
|
|
3
|
-
description: Use when the user asks to implement a GitHub issue and drive it through review to completion autonomously — "work on issue and loop until approved", "work-on-issue-loop", or as the automatic follow-on from validate-issue-loop. Runs work-on-issue to implement and open the PR
|
|
3
|
+
description: Use when the user asks to implement a GitHub issue and drive it through review to completion autonomously — "work on issue and loop until approved", "work-on-issue-loop", or as the automatic follow-on from validate-issue-loop. Runs work-on-issue to implement and open the PR, triggers the first @claude review itself, then waits for each review to land and calls fix-pr-review to resolve it. Stops on a bare LGTM with nothing left to fix; once past 5 review cycles it stops at the first LGTM it sees even if non-blocking findings remain, rather than continuing to chase them.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# work-on-issue-loop
|
|
@@ -14,15 +14,22 @@ Drive an issue from "validated" to "PR reviewed to convergence" without stopping
|
|
|
14
14
|
|
|
15
15
|
## Steps
|
|
16
16
|
|
|
17
|
-
### 1. Implement and
|
|
17
|
+
### 1. Implement, open the PR, and trigger the first review
|
|
18
18
|
|
|
19
|
-
Invoke the `work-on-issue` skill for the issue (Skill tool, `skill: work-on-issue`). It implements the fix in an isolated worktree, verifies it, commits, pushes, opens the PR (`Closes #<N>`)
|
|
19
|
+
Invoke the `work-on-issue` skill for the issue (Skill tool, `skill: work-on-issue`). It implements the fix in an isolated worktree, verifies it, commits, pushes, and opens the PR (`Closes #<N>`) — it does **not** request review; that's this loop's job.
|
|
20
20
|
|
|
21
|
-
**Gate on its outcome before
|
|
21
|
+
**Gate on its outcome before continuing — work-on-issue can legitimately stop early:**
|
|
22
22
|
|
|
23
23
|
- **Stopped with no PR** (issue already closed, an existing PR already addresses it, wrong repo checked out) → there is nothing to drive; stop and relay its report.
|
|
24
|
-
- **PR opened
|
|
25
|
-
|
|
24
|
+
- **PR opened** → capture the PR number/URL and the branch, then trigger the first review yourself. Don't wait on CI or poll `gh pr checks` — CI runs in parallel and the reviewer surfaces check failures itself. Post a **separate, one-line** comment so the bot fires cleanly (match the repo's trigger phrase if it differs — check recent PR comments; a trigger mention is not authored content — no footer):
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
gh pr comment <PR-number> --body "@claude review"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Preflight — confirm a review bot exists before waiting on one.** This loop assumes an automated reviewer that answers `@claude review` comments. Before entering the wait, check the repo for one: `gh api repos/{owner}/{repo}/contents/.github/workflows --jq '.[].name'` and look for a workflow that responds to `@claude` (e.g. `claude.yml`), or confirm the Claude GitHub App is installed. If you find none, don't sink 30 minutes into a review that will never come — tell the user the PR is pushed but no review bot is configured, and point them at `templates/claude-review.yml` in this repo (copy it to `.github/workflows/`, add an `ANTHROPIC_API_KEY` secret). Proceed into the wait only if a reviewer is present or the user confirms one is configured elsewhere.
|
|
31
|
+
|
|
32
|
+
Record the timestamp of the trigger comment and set `review_count = 1` — that review is #1 in flight.
|
|
26
33
|
|
|
27
34
|
### 2. Wait for the review to land
|
|
28
35
|
|
|
@@ -57,7 +64,7 @@ Evaluate in this order:
|
|
|
57
64
|
|
|
58
65
|
Invoke the `fix-pr-review` skill for the PR (Skill tool, `skill: fix-pr-review`). It re-validates every finding against the code, fixes what's real, implements the judgment calls and optional improvements to the best-solution standard, commits, pushes, posts the disposition comment, and triggers a fresh `@claude` review itself (routed to Sonnet when it addressed only non-blocking items, otherwise to the repo default, per fix-pr-review step 7).
|
|
59
66
|
|
|
60
|
-
fix-pr-review also
|
|
67
|
+
fix-pr-review also picks its own working model dynamically (its step 3.5): it always validates the findings inline on the session model, then tiers implementation by the complexity of the most complex surviving fix — open judgment calls and safety-class findings stay inline, any non-trivial fix routes the set to an Opus subagent, and all-mechanical work goes to a Sonnet subagent. It decides from the validated findings itself, so don't override its choice — just record which model each cycle reported running on, for the step 5 report.
|
|
61
68
|
|
|
62
69
|
Increment `review_count`, record the new trigger timestamp from that comment, and go back to step 2.
|
|
63
70
|
|
|
@@ -82,11 +89,10 @@ Stop the loop and report the terminal state — don't claim blanket success:
|
|
|
82
89
|
| `review_count > 5` and an `LGTM` (with non-blocking items remaining) ended the loop | **Done, with leftovers.** PR is approved; note the remaining optional/follow-up items that were left unaddressed once the loop passed 5 cycles. |
|
|
83
90
|
| Bot never responded within the wait window | **Escalate.** Report that the PR is implemented and pushed but review never landed; the user should check the `@claude` GitHub Action / bot status. |
|
|
84
91
|
| work-on-issue stopped with no PR (closed issue / existing PR / wrong repo) | **Nothing to drive.** Relay its report; zero review cycles ran. |
|
|
85
|
-
| work-on-issue opened the PR but its red-CI exit fired (review never triggered) | **Escalate.** Report the PR URL and the red CI state; the user decides whether to keep pushing on CI. |
|
|
86
92
|
|
|
87
93
|
There is no "stuck on `Needs Updates` past the cap" case to report — per step 3, `Needs Updates` never stops the loop by cycle count alone; it keeps calling fix-pr-review until an LGTM appears (or the bot stops responding, the row above).
|
|
88
94
|
|
|
89
|
-
In every case, give: PR URL, number of review cycles run, final verdict, which model each fix cycle ran on (per fix-pr-review's
|
|
95
|
+
In every case, give: PR URL, number of review cycles run, final verdict, which model each fix cycle ran on (per fix-pr-review's findings-based selection), any follow-on issues filed in step 4.5 (URLs) or deliberately left unfiled, and (if escalating) exactly what's left.
|
|
90
96
|
|
|
91
97
|
**Cap the report at 55 words, ELI18** — plain language, no jargon, as if explaining the outcome to a smart 18-year-old with no context on this codebase or its internals.
|
|
92
98
|
|
|
@@ -100,7 +106,7 @@ In every case, give: PR URL, number of review cycles run, final verdict, which m
|
|
|
100
106
|
| Review bot hasn't responded after ~30 minutes | Stop waiting; report that review didn't land rather than polling forever |
|
|
101
107
|
| Tempted to treat "LGTM with Recommended Optional items" as terminal at `review_count <= 5` | It isn't — below the cap, LGTM-with-findings still goes through fix-pr-review; only past the cap does the first LGTM end it regardless of findings |
|
|
102
108
|
| PR gets closed or merged mid-loop (e.g. by the user) | Stop immediately; don't keep pushing fixes to a closed/merged PR |
|
|
103
|
-
| work-on-issue
|
|
109
|
+
| work-on-issue stopped with no PR | Don't trigger a review or enter the wait loop — gate on its outcome in step 1 and report per step 5 |
|
|
104
110
|
| About to report "Done" while the PR/README names follow-on work with no issue filed | Stop — run step 4.5 first; a named follow-on with no issue and no "deliberately unfiled" note in the report is a silent drop |
|
|
105
111
|
|
|
106
112
|
## Common Mistakes
|