rk-skills 1.0.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.
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "rk-skills",
3
+ "description": "Marketplace for rk-skills: Richard Kuo's personal Claude Code skill collection.",
4
+ "owner": {
5
+ "name": "Richard Kuo"
6
+ },
7
+ "plugins": [
8
+ {
9
+ "name": "rk-skills",
10
+ "source": "./",
11
+ "description": "Richard Kuo's personal Claude Code skills: GitHub issue/PR/release workflow automation and Fable-driven planning."
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "rk-skills",
3
+ "displayName": "rk-skills",
4
+ "version": "1.0.0",
5
+ "description": "Richard Kuo's personal Claude Code skills: GitHub issue/PR/release workflow automation and Fable-driven planning.",
6
+ "author": {
7
+ "name": "Richard Kuo"
8
+ },
9
+ "repository": "https://github.com/richkuo/rk-skills",
10
+ "license": "MIT",
11
+ "keywords": ["skills", "workflow", "github-issues", "pull-requests", "release", "fable", "planning"]
12
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Richard Kuo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,61 @@
1
+ # rk-skills
2
+
3
+ Richard Kuo's personal [Claude Code](https://claude.com/claude-code) skills — the custom skills, global instructions, and slash command I use across every session.
4
+
5
+ The real files live in this repo. On my machine they're symlinked into `~/.claude`, so editing in either place is the same file and a `git commit` here captures the change. Third-party / marketplace-installed skills are deliberately excluded — they're reinstallable and not authored by me.
6
+
7
+ ## Skills
8
+
9
+ Most workflow skills come in two forms: a **base** skill that does one step, and a **`-loop`** variant that drives the whole thing autonomously through review to a merged PR.
10
+
11
+ - **Issues** — `new-issue`, `validate-issue`, `work-on-issue` (+ `-loop` variants): file a fully-specified, complexity-scored issue; verify its claims against the actual code; implement it end-to-end in an isolated worktree and open a PR.
12
+ - **PR review** — `fix-pr-review` (+ `-loop`): re-validate every review finding against the code, fix the ones that hold, push, and re-trigger review until approved.
13
+ - **Docs & release** — `sync-docs`, `sync-docs-release`, `create-release`: refresh `CLAUDE.md`/`README`/`SKILL.md` from recent commits, and cut versioned GitHub releases.
14
+ - **Fable-driven** — `fableplan`, `fable-validate`, `fable-new-issue` (+ `-loop` variants): delegate planning / validation / issue-drafting to a Fable 5 subagent, then build with your main-session model.
15
+
16
+ Also included:
17
+
18
+ - `CLAUDE.md` — my global instructions for all Claude Code sessions (linked to `~/.claude/CLAUDE.md`). Many skills above are tuned to the conventions defined here (attribution footers, complexity scores, the branch+PR workflow).
19
+ - `commands/commit.md` — the `/commit` slash command (linked to `~/.claude/commands/commit.md`).
20
+
21
+ ## Install (as a plugin)
22
+
23
+ This repo is a Claude Code plugin marketplace. In any Claude Code session:
24
+
25
+ ```
26
+ /plugin marketplace add richkuo/rk-skills
27
+ /plugin install rk-skills@rk-skills
28
+ ```
29
+
30
+ Claude Code auto-discovers everything under `skills/` (and the `/commit` command). `CLAUDE.md` is my personal global config and 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>`.
31
+
32
+ Prefer to install a single skill? Each is just a directory with a `SKILL.md`, so you can copy one in directly:
33
+
34
+ ```sh
35
+ mkdir -p ~/.claude/skills/work-on-issue && \
36
+ curl -fsSL https://raw.githubusercontent.com/richkuo/rk-skills/main/skills/work-on-issue/SKILL.md \
37
+ -o ~/.claude/skills/work-on-issue/SKILL.md
38
+ ```
39
+
40
+ ## Install (with npx)
41
+
42
+ Copy every skill into your personal `~/.claude/skills/` with one command — no marketplace, no clone:
43
+
44
+ ```sh
45
+ npx rk-skills
46
+ ```
47
+
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 above auto-updates. It installs the **skills only**; not `CLAUDE.md` (my personal global config) or the `/commit` command.
49
+
50
+ ## Restore on a new machine (my setup)
51
+
52
+ Clone this repo, then run `./install.sh`. It symlinks every tracked item into `~/.claude`, backing up any existing real file to `<name>.bak` first. It only ever replaces symlinks — it never deletes your data.
53
+
54
+ ```bash
55
+ git clone git@github.com:richkuo/rk-skills.git ~/Work/rk-skills
56
+ cd ~/Work/rk-skills && ./install.sh
57
+ ```
58
+
59
+ ## License
60
+
61
+ MIT — see [LICENSE](./LICENSE).
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env node
2
+ import { cpSync, existsSync, mkdirSync, readdirSync } from 'node:fs';
3
+ import { homedir } from 'node:os';
4
+ import { dirname, join, resolve } from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
6
+
7
+ const pkgRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
8
+ const skillsSrc = join(pkgRoot, 'skills');
9
+
10
+ if (!existsSync(skillsSrc)) {
11
+ console.error('rk-skills: could not find the skills/ directory in the package.');
12
+ process.exit(1);
13
+ }
14
+
15
+ // Each skill is a directory under skills/ that contains a SKILL.md.
16
+ const skills = readdirSync(skillsSrc, { withFileTypes: true })
17
+ .filter((entry) => entry.isDirectory())
18
+ .map((entry) => entry.name)
19
+ .filter((name) => existsSync(join(skillsSrc, name, 'SKILL.md')))
20
+ .sort();
21
+
22
+ if (skills.length === 0) {
23
+ console.error('rk-skills: no skills found to install.');
24
+ process.exit(1);
25
+ }
26
+
27
+ const project = process.argv.includes('--project');
28
+ const skillsDir = project
29
+ ? join(process.cwd(), '.claude', 'skills')
30
+ : join(homedir(), '.claude', 'skills');
31
+
32
+ mkdirSync(skillsDir, { recursive: true });
33
+ for (const name of skills) {
34
+ cpSync(join(skillsSrc, name), join(skillsDir, name), { recursive: true });
35
+ }
36
+
37
+ const scope = project ? 'this project' : 'your personal skills';
38
+ console.log(`rk-skills installed ${skills.length} skills into ${scope}:`);
39
+ console.log(` ${skillsDir}`);
40
+ console.log(` ${skills.join(', ')}`);
41
+ 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 ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "rk-skills",
3
+ "version": "1.0.0",
4
+ "description": "Installer for Richard Kuo's personal Claude Code skills — GitHub issue/PR/release workflow automation and Fable-driven planning.",
5
+ "type": "module",
6
+ "bin": {
7
+ "rk-skills": "bin/install.mjs"
8
+ },
9
+ "files": [
10
+ "bin",
11
+ "skills",
12
+ ".claude-plugin",
13
+ "README.md",
14
+ "LICENSE"
15
+ ],
16
+ "engines": {
17
+ "node": ">=18"
18
+ },
19
+ "keywords": [
20
+ "claude-code",
21
+ "claude",
22
+ "skills",
23
+ "plugin",
24
+ "workflow",
25
+ "github-issues",
26
+ "pull-requests",
27
+ "fable"
28
+ ],
29
+ "homepage": "https://github.com/richkuo/rk-skills#readme",
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "git+https://github.com/richkuo/rk-skills.git"
33
+ },
34
+ "author": "Richard Kuo",
35
+ "license": "MIT",
36
+ "publishConfig": {
37
+ "access": "public"
38
+ }
39
+ }
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: create-release
3
+ description: Use when 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
+ **This skill is a dispatch shim. Do not perform the work yourself.**
9
+
10
+ Immediately invoke the `create-release-runner` subagent via the Agent tool, which runs on Sonnet and contains the full create-release workflow.
11
+
12
+ ## Required invocation
13
+
14
+ Call the Agent tool with:
15
+
16
+ - `subagent_type`: `create-release-runner`
17
+ - `description`: `Cut and publish a release`
18
+ - `prompt`: Pass through the user's request verbatim, plus any context the user already provided in this session (target version or bump type, whether to bump an in-app version, release-notes specifics, etc.). The agent has its own copy of the workflow — do not paste workflow steps into the prompt. Include only the inputs it needs.
19
+ - `model`: Omit by default — the agent runs on Sonnet via its pinned frontmatter. **Override only if the user explicitly names a different LLM** when invoking the skill (e.g. "create a release with opus", "/create-release use haiku"). Map the request to the matching `model` value (`opus`, `sonnet`, or `haiku`) and pass it; the Agent tool's `model` parameter takes precedence over the agent's frontmatter. Do not infer an override from anything other than an explicit model name.
20
+
21
+ After the agent returns, relay its summary (and the release URL) to the user. Do not re-execute its work.
22
+
23
+ ## Why this exists
24
+
25
+ The full create-release workflow lives in `~/.claude/agents/create-release-runner.md` with `model: sonnet` pinned in frontmatter. Routing through the agent keeps release runs on Sonnet by default — but an explicit user LLM choice overrides it via the Agent tool's `model` parameter.
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: fable-new-issue
3
+ description: Use when the user wants a GitHub issue created by a Fable 5 subagent. Spins up a read-only subagent running on Fable 5 that executes the new-issue procedure (duplicate check, code grounding, approach design, complexity score) and returns a fully-composed issue draft, which the main agent spot-checks and files. Trigger on "/fable-new-issue", "fable new issue <description>", or "create this issue with fable".
4
+ ---
5
+
6
+ # fable-new-issue
7
+
8
+ Delegate issue drafting to a **Fable 5** subagent, then file it from the main agent. The subagent only researches and composes — it never files, edits files, or posts to GitHub; the main agent handles filing and all follow-on actions.
9
+
10
+ ## Input
11
+
12
+ Same as `new-issue`:
13
+ - A description of the bug/feature/task to file.
14
+ - **Nothing** — derive from the current conversation. Since the subagent can't see this conversation, the main agent first writes a faithful summary of the discussed bug/design/follow-up (with any file paths or symbols already named) to a scratchpad file and hands that path to the subagent as the source description.
15
+ - Optionally `owner/repo` or a repo path when the issue belongs elsewhere.
16
+
17
+ ## Steps
18
+
19
+ ### 1. Resolve the drafting procedure
20
+
21
+ Locate the `new-issue` SKILL.md the subagent must follow — prefer the project-local copy over the global one:
22
+
23
+ 1. `<repo>/.claude/skills/new-issue/SKILL.md` (if it exists)
24
+ 2. `~/.claude/skills/new-issue/SKILL.md`
25
+
26
+ Record the absolute path. If neither exists, stop and tell the user.
27
+
28
+ 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
+ ### 2. Dispatch the Fable 5 drafting subagent
31
+
32
+ Snapshot `git status --porcelain` before dispatching, then call the Agent tool with:
33
+
34
+ - `subagent_type`: `Plan` (read-only: no Edit/Write, keeps drafting side-effect-free)
35
+ - `model`: `fable` (the whole point — the draft must come from Fable 5)
36
+ - `run_in_background`: `false` — filing depends on the draft
37
+ - `description`: `Draft issue: <short topic>`
38
+ - `prompt`: hand it everything needed to draft independently:
39
+ - The user's description verbatim (or the scratchpad summary path), the working directory, and the target repo if not the current checkout.
40
+ - Instruct it to **read the SKILL.md at the recorded path and execute its steps 1 through 6 exactly** — repo/duplicate check, claim grounding with `file:line` citations traced against the correct baseline, approach design, complexity score, scope check, and full body composition per the step-6 template.
41
+ - It must STOP before filing: no `gh issue create`, no `gh issue edit`, no comments posted, no file edits — including via Bash (it lacks Edit/Write but still has Bash, so state this explicitly). Read-only `gh` calls (`gh issue list`, `gh pr list`, `gh repo view`, `gh label list`) are expected and allowed.
42
+ - Return as its final message: (a) any duplicate found (URL + why it matches) — in which case no draft; (b) otherwise the complete issue draft — exact title with `[C<score>]` prefix and the full body per the template — plus one line stating which baseline claims were traced against, and any unfiled follow-up candidates from the scope check.
43
+
44
+ If the call returns null or errors, retry once; if it fails again, report the failure to the user instead of drafting yourself.
45
+
46
+ When the result arrives:
47
+ - Diff `git status --porcelain` against the snapshot to confirm no file changes; if changed, tell the user and ask whether to revert before continuing.
48
+ - Save the draft verbatim to a scratchpad file immediately, so it survives context summarization.
49
+
50
+ ### 3. Duplicate gate
51
+
52
+ If the subagent reported a duplicate, stop and surface it — offer to update/comment on the existing issue instead. Nothing is filed.
53
+
54
+ ### 4. Spot-check the draft
55
+
56
+ Before filing, spot-check the draft's load-bearing `file:line` citations against the code and confirm the body meets the new-issue bar: complexity rationale as first line matching the title prefix, Problem/Goal/Approach/Acceptance criteria all concrete, no time/effort estimates, ELI18 title. Fix small inaccuracies yourself and note them (update the scratchpad copy); if the draft is structurally wrong (untraceable central claim, stale baseline, stub-like body), do NOT silently re-dispatch — tell the user what's off and let them decide.
57
+
58
+ ### 5. File it (main agent)
59
+
60
+ File per new-issue step 6: `gh issue create --title "[C<score>] <title>" --body-file <body-file>` (with `-R owner/repo` if cross-repo; labels only when the repo visibly uses them and the fit is unambiguous).
61
+
62
+ Footer: since the draft came from the Fable 5 subagent, use `Created with LLM: Fable 5 | high | Harness: Claude Code | fable-new-issue`. A repo CLAUDE.md footer format overrides.
63
+
64
+ ### 6. Report
65
+
66
+ Terse: issue URL, number, one-line summary, complexity score, any unfiled follow-ups from the subagent, and a note that small spot-check fixes were applied (if any). Offer "validate issue" / "work on issue" as next steps in one line.
67
+
68
+ ## Notes
69
+
70
+ - The drafting subagent runs on Fable 5 regardless of the main agent's model — `model: fable` forces it.
71
+ - One subagent, one draft: don't fan out or re-run for a second opinion unless the user asks.
72
+ - 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.
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: fable-new-issue-loop
3
+ description: Use when the user asks to have a Fable 5 subagent draft and file a GitHub issue, then autonomously drive it all the way to a reviewed PR in one shot — "fable-new-issue-loop", "fable create the issue and run it to completion". Runs fable-new-issue to create a fully-specified issue (drafted by a Fable 5 subagent), then hands the new issue number to validate-issue-loop (validate → update → work-on-issue-loop) — stopping instead when a duplicate is found or the discussion hasn't converged on one issue.
4
+ ---
5
+
6
+ # fable-new-issue-loop
7
+
8
+ Chain fable-new-issue → validate-issue-loop into one autonomous run: a Fable 5 subagent drafts the issue, the main agent files it, and the loop drives it to a reviewed PR without a human in between. Identical to new-issue-loop except the front of the chain is fable-new-issue.
9
+
10
+ **Do not skip filing a complete issue.** The downstream loop validates and implements *the issue text* — a thin or unverified draft propagates straight into the PR. Every step of fable-new-issue still runs (subagent drafting, duplicate gate, spot-check, filing); only the "offer next steps and wait" step is replaced by the handoff.
11
+
12
+ ## Input
13
+
14
+ Same as fable-new-issue: an optional description of what the issue should cover; with no input, derive it from the current conversation. Optionally `owner/repo` when the issue belongs elsewhere.
15
+
16
+ ## Steps
17
+
18
+ ### 1. Run fable-new-issue
19
+
20
+ Invoke the `fable-new-issue` skill (Skill tool, `skill: fable-new-issue`) with the user's description (or conversation-derived scope). Let it run its full process — Fable 5 subagent draft, duplicate gate, spot-check, filing. Capture the created issue number from its report.
21
+
22
+ ### 2. Stop gate — cases the loop can't safely continue
23
+
24
+ | Condition | Action |
25
+ |---|---|
26
+ | The subagent found an existing open issue/PR already covering it (no issue filed) | **STOP.** Report the duplicate and the offer to update/comment instead — whether to merge scopes is a human call. |
27
+ | The conversation held several distinct candidates | If one clearly converged, file it and **continue the chain with it**; the unfiled candidates go in the final report. If none clearly converged, **STOP** — report the candidates and ask which to file. Never bundle, never auto-file the extras. |
28
+ | The draft was structurally wrong and fable-new-issue paused for a human decision | **STOP.** Relay what's off — don't file or re-dispatch on your own. |
29
+ | The scope check named unfiled follow-ups | Continue with the **core issue only**; relay the unfiled follow-ups in the final report. |
30
+
31
+ Otherwise (one issue filed cleanly), continue.
32
+
33
+ ### 3. Hand off to validate-issue-loop
34
+
35
+ Invoke the `validate-issue-loop` skill (Skill tool, `skill: validate-issue-loop`) with the issue from step 1 passed explicitly — don't let it default to "latest open issue" and risk racing another just-filed issue. If filed to a repo other than the current checkout, pass the full `owner/repo#N` reference, not the bare number. Its own scope gate (too large / infeasible / already-addressed) still applies and may stop the run; that's the designed behavior, not a failure.
36
+
37
+ Validating an issue this chain just filed is not redundant: validate-issue re-traces the claims against the code independently, catching anything the Fable draft or the spot-check got wrong.
38
+
39
+ ### 4. Report
40
+
41
+ Relay validate-issue-loop's final summary (PR URL, review cycles, verdict), prefixed with one line covering the front of the chain: issue number/URL filed (drafted by Fable 5), complexity score, and any unfiled follow-ups from step 2.
42
+
43
+ **Cap the whole 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.
44
+
45
+ ## Red Flags — STOP
46
+
47
+ | Situation | Action |
48
+ |---|---|
49
+ | Tempted to skip the Fable subagent and draft/file the issue yourself to go faster | Never — the draft coming from Fable 5 is the point of this skill |
50
+ | fable-new-issue stopped on a duplicate or a structurally-wrong draft | Stop and report per step 2 — don't file anyway |
51
+ | Tempted to hand off without an explicit issue reference | Always pass the issue from step 1 — `owner/repo#N` if filed cross-repo — "latest issue" can race |
52
+ | validate-issue-loop's scope gate stops the run | Report its disposition faithfully — don't override and implement anyway |
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: fable-validate
3
+ description: Use when the user wants a GitHub issue validated by a Fable 5 subagent. Spins up a read-only subagent running on Fable 5 that executes the validate-issue procedure (claim tracing, architecture/consistency checks, complexity score), then relays the verdict back to the main agent, which presents it and takes any follow-on action (update issue, work on issue). Trigger on "/fable-validate", "fable validate <issue>", or "validate this with fable".
4
+ ---
5
+
6
+ # fable-validate
7
+
8
+ Delegate issue validation to a **Fable 5** subagent, then act on its verdict in the main agent. The subagent only validates — it never edits files or the issue; the main agent handles all follow-on actions.
9
+
10
+ ## Input
11
+
12
+ Same as `validate-issue`:
13
+ - Full URL: `https://github.com/<owner>/<repo>/issues/<N>`
14
+ - Short form: `#<N>` or bare `<N>` (current repo)
15
+ - `owner/repo#N`
16
+ - **Nothing** — default to the latest open issue in the current repo.
17
+
18
+ ## Steps
19
+
20
+ ### 1. Resolve the validation procedure and the issue
21
+
22
+ Locate the `validate-issue` SKILL.md the subagent must follow — prefer the project-local copy over the global one, since a repo may customize the procedure:
23
+
24
+ 1. `<repo>/.claude/skills/validate-issue/SKILL.md` (if it exists)
25
+ 2. `~/.claude/skills/validate-issue/SKILL.md`
26
+
27
+ Record the absolute path. If neither exists, stop and tell the user.
28
+
29
+ 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
+ ### 2. Dispatch the Fable 5 validation subagent
32
+
33
+ Do not validate the issue yourself first — the subagent owns the validation. Snapshot `git status --porcelain` before dispatching (the tree may already be dirty), then call the Agent tool with:
34
+
35
+ - `subagent_type`: `Plan` (read-only: no Edit/Write, keeps validation side-effect-free)
36
+ - `model`: `fable` (the whole point — the validation must come from Fable 5)
37
+ - `run_in_background`: `false` — everything downstream depends on the verdict
38
+ - `description`: `Validate issue #<N>` (or `Validate latest issue`)
39
+ - `prompt`: hand it everything needed to validate independently:
40
+ - The issue reference exactly as the user gave it (or "no issue referenced — resolve the latest open issue per the procedure"), plus the working directory.
41
+ - Instruct it to **read the SKILL.md at the recorded path and execute its steps 0 through 7 exactly** — baseline resolution, fetch with `--comments` + PR timeline check, claim extraction, depth-rule verification with `file:line` citations, 5a/5c/5b proposal checks, complexity score, scope disposition, and the step-7 verdict format.
42
+ - It must STOP at step 7: no step 7.5/8 actions, no `gh issue edit`, no comments posted, no file edits — including via Bash (it lacks Edit/Write but still has Bash, so state this explicitly).
43
+ - Return the complete step-7 verdict verbatim as its final message, plus one line stating which baseline (branch/commit) claims were traced against.
44
+
45
+ The subagent's final message comes back as the tool result; it is not shown to the user.
46
+
47
+ If the call returns null or errors (user skip, terminal API failure), retry once; if it fails again, report the failure to the user instead of validating yourself.
48
+
49
+ When the result arrives:
50
+ - Run `git status --porcelain` and diff against the pre-dispatch snapshot to confirm the subagent made no file changes. If it did, tell the user and ask whether to revert before continuing.
51
+ - Save the verdict verbatim to a scratchpad file immediately, so it survives context summarization and later steps can quote it exactly.
52
+
53
+ ### 3. Spot-check the verdict
54
+
55
+ Before presenting it, spot-check the verdict's load-bearing findings against the code: the `file:line` citations for any ❌/⚠️ claims resolve to real code saying what the verdict says, and the verdict doesn't contradict repo conventions (CLAUDE.md). Evidence outranks verdicts — a subagent citation that contradicts its own mark means the mark is wrong. Fix small inaccuracies yourself and note them (update the scratchpad copy); if the verdict is structurally wrong (e.g. traced a stale baseline, missed the central claim), do NOT silently re-dispatch — tell the user what's off and let them decide whether to re-run with Fable 5 or proceed.
56
+
57
+ ### 4. Relay the verdict to the user
58
+
59
+ Present the vetted verdict in the validate-issue step-7 format, noting it was produced by Fable 5 and which baseline it traced. Nothing is posted to GitHub at this stage — validation alone never writes to the issue.
60
+
61
+ ### 5. Follow-on actions (main agent)
62
+
63
+ Handle the user's reply per the validate-issue procedure — these are main-agent actions, never re-delegated:
64
+
65
+ - **"update issue"** → apply the suggested title/body edits per validate-issue step 8, including its claim-verification gate and final consistency pass. Footer: since the findings came from the Fable 5 subagent, use `Validated with LLM: Fable 5 | high | Harness: Claude Code | fable-validate` (stack under any existing footer lines per step 8; a repo CLAUDE.md footer format overrides).
66
+ - **"work on issue"** → hand off to the `work-on-issue` skill per validate-issue step 7.5, surfacing any step-6.5 scope disposition first.
67
+ - **"split issue" / "decompose"** → file the proposed parts per validate-issue step 6.5, each fully specified.
68
+
69
+ ## Notes
70
+
71
+ - The validation subagent runs on Fable 5 regardless of the main agent's model — `model: fable` on the Agent call forces it.
72
+ - One subagent, one verdict: don't fan out or re-run for a second opinion unless the user asks.
73
+ - 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.
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: fable-validate-loop
3
+ description: Use when the user asks to validate a GitHub issue with Fable 5 and then autonomously drive it to a reviewed PR in one shot — "fable-validate-loop", "fable validate and work on #N", "fully automate issue #N with fable". Runs fable-validate, auto-applies its update-issue edits when the verdict calls for it, has fableplan produce and post a Fable 5 implementation plan (skipped for issues below C50 with no safety flags), then hands off to work-on-issue-loop — stopping instead when validation flags the issue as too large, architecturally infeasible, or already addressed by an existing PR.
4
+ ---
5
+
6
+ # fable-validate-loop
7
+
8
+ Chain fable-validate → (conditional) update issue → fableplan → work-on-issue-loop into one autonomous run: Fable 5 validates the issue, the main agent fixes the issue description if needed, Fable 5 plans the implementation (plan posted to the issue), and work-on-issue-loop implements the plan and drives the PR through review to convergence. This is fable-validate's interactive handoff made unattended — the loop reads its own verdicts and proceeds, instead of waiting for the user to reply.
9
+
10
+ **Do not skip or reorder the chain.** Validation gates planning (a plan built on refuted claims is wrong), and the plan gates implementation (that's the point of routing through fableplan). The only sanctioned skip is the step-4 complexity gate (low-complexity issues bypass fableplan). Every other step of each skill still runs; only the "wait for the user's reply" moments are replaced by the decision rules below.
11
+
12
+ ## Input
13
+
14
+ Same defaults as fable-validate: issue URL, `#<N>` / `<N>` / `owner/repo#N`, or nothing (defaults to the latest open issue in the current repo).
15
+
16
+ ## Steps
17
+
18
+ ### 1. Run fable-validate
19
+
20
+ Invoke the `fable-validate` skill for the target issue (Skill tool, `skill: fable-validate`). Let it run fully — Fable 5 subagent validation, spot-check, verdict — producing the standard verdict block:
21
+
22
+ ```
23
+ **#<N>: Update issue description? <Yes|No>** · Complexity: <score>/100 — <driver> · Scope: <OK | too large — split/umbrella/narrow>
24
+ ```
25
+
26
+ Treat the verdict as structured output to parse yourself, not a prompt to wait on. Record the resolved issue number — every later step targets exactly this issue.
27
+
28
+ ### 2. Scope gate — stop if the issue is unsafe to auto-implement
29
+
30
+ Check the verdict's **Scope** field, **Architecture** section, and **Concerns** (for an already-addressing PR) before doing anything else:
31
+
32
+ | Condition | Action |
33
+ |---|---|
34
+ | `Scope: too large` (split / umbrella / narrow flagged) | **STOP.** Report the disposition and proposed parts. Implementing a multi-part issue as one PR reproduces the scope problem in the diff — splitting is a human call. |
35
+ | Architecture marked ❌ **Infeasible** | **STOP.** Report the infeasibility and the "Optimal direction" note; planning and implementing a design the validation rejected would ship the wrong fix. |
36
+ | A **merged** PR already implements the fix | **STOP.** Report the PR and the close/repurpose recommendation — nothing left to implement. |
37
+ | An **open** PR is already addressing the issue | **STOP.** Report the overlapping PR; supersede/join/wait is a human call. |
38
+
39
+ Otherwise (Scope: OK; architecture ✅/⚠️ or not applicable; no PR already addressing it), continue.
40
+
41
+ ### 3. Apply the update-issue edits, if called for
42
+
43
+ If the verdict says **Update issue description? Yes**, apply the suggested title/body edits now per fable-validate step 5 / validate-issue step 8 — claim-verification gate, final consistency pass, and the stacked attribution line (`Validated with LLM: Fable 5 | high | Harness: Claude Code | fable-validate-loop`) — from the current checkout (no worktree for issue edits).
44
+
45
+ If **No**, skip straight to step 4.
46
+
47
+ **Order matters:** the edits land before fableplan runs, so the Fable 5 planner fetches and plans against the corrected issue, not the flawed original.
48
+
49
+ ### 4. Run fableplan — planning phase only (skip below C50)
50
+
51
+ **Complexity gate:** if the verdict's validated complexity score is **below 50**, skip fableplan and go straight to step 5 — work-on-issue-loop plans adequately for low-complexity changes on its own. **Safety carve-out (overrides the gate):** if the validation flags money, data integrity, security, or an auto-protective mechanism anywhere in its findings, run fableplan regardless of score.
52
+
53
+ Otherwise, invoke the `fableplan` skill for the same issue number (Skill tool, `skill: fableplan`), and **scope it to its planning phase — steps 1 through 5 only**: fetch the issue, dispatch the Fable 5 Plan subagent, sanity-check the plan against the code, post the vetted plan as an issue comment, and relay it. **Do NOT execute fableplan's steps 6–7 (worktree + build)** — implementation belongs to work-on-issue-loop in step 5, which owns the implement → PR → review chain; building here would duplicate it outside that chain.
54
+
55
+ Give the planning subagent the validation verdict (the scratchpad copy from step 1) alongside the issue — the plan must respect what validation established (verified/refuted claims, the Optimal-direction note when architecture was ⚠️, 5b concerns).
56
+
57
+ Keep the vetted plan's scratchpad file — step 5 passes it through. If fableplan fails after its internal retry, stop and report; don't fall back to planning yourself or implementing unplanned.
58
+
59
+ ### 5. Hand off to work-on-issue-loop
60
+
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
+
63
+ It runs its full loop: work-on-issue implements in a worktree, opens the PR, triggers `@claude` review, and fix-pr-review cycles until convergence.
64
+
65
+ ### 6. Report
66
+
67
+ Relay work-on-issue-loop's final summary (PR URL, review cycles, final verdict), prefixed with one line covering the head of the chain: scope gate passed, issue updated or not, plan posted (comment URL) or skipped by the complexity gate.
68
+
69
+ **Cap the whole 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.
70
+
71
+ ## Red Flags — STOP
72
+
73
+ | Situation | Action |
74
+ |---|---|
75
+ | Tempted to skip validation or planning and jump to implementation | Never reorder — validate-then-plan-then-build is the point of this skill; the only sanctioned skip is the step-4 complexity gate (<C50, no safety flags) |
76
+ | `Scope: too large`, Architecture ❌ Infeasible, or a PR already addressing the issue | Stop and report per step 2 — the cases the loop can't safely auto-resolve |
77
+ | Tempted to wait for a literal user reply to fable-validate's or fableplan's prompt | Parse the output yourself and proceed per the step rules |
78
+ | Verdict says Update issue description? Yes | Apply the edits **before** fableplan runs, so the plan targets the corrected issue |
79
+ | fableplan about to enter its build steps (6–7) | Don't — stop it at step 5; work-on-issue-loop owns implementation |
80
+ | fableplan's sanity-check finds the plan structurally wrong | Stop and report — don't hand a broken plan to work-on-issue-loop, and don't silently re-plan |
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: fableplan
3
+ description: Use when the user wants a task planned by a Fable 5 planning subagent before building it. Spins up a Plan subagent running on Fable 5 to produce an implementation plan, relays the plan back to the main agent to build, and — if a GitHub issue is referenced — posts the plan as a comment on that issue. Trigger on "/fableplan", "fableplan this", or "plan this with fable".
4
+ ---
5
+
6
+ # fableplan
7
+
8
+ Delegate planning to a **Fable 5** Plan subagent, then build from its plan in the main agent. The main agent does the building — the subagent only plans.
9
+
10
+ ## Input
11
+
12
+ The user provides a task description, and optionally a GitHub issue:
13
+ - A task in prose ("fableplan adding X to Y").
14
+ - A GitHub issue reference — full URL, `#<N>`, bare `<N>`, or `owner/repo#N`. When present, the plan is also posted as an issue comment.
15
+ - If neither is obvious, ask the user what to plan before dispatching.
16
+
17
+ ## Steps
18
+
19
+ ### 1. Resolve the GitHub issue (only if one is referenced)
20
+
21
+ If the user named an issue, fetch it so the subagent plans against the real requirements, not a paraphrase:
22
+
23
+ ```
24
+ gh issue view <N> --json number,title,body,url
25
+ ```
26
+
27
+ For the `owner/repo#N` form (or a full URL to another repo), add `-R owner/repo` — a bare `gh issue view <N>` only resolves against the current repo.
28
+
29
+ If the command fails (wrong number, no auth, no repo), stop and tell the user — never proceed by planning against your paraphrase of an issue you couldn't fetch.
30
+
31
+ Record the issue number and URL — you'll need them in step 4. If no issue is referenced, skip this and step 4's posting.
32
+
33
+ ### 2. Dispatch the Fable 5 Plan subagent
34
+
35
+ Do not re-plan the task yourself first — the subagent owns the plan. Snapshot `git status --porcelain` before dispatching (the tree may already be dirty), then call the Agent tool with:
36
+
37
+ - `subagent_type`: `Plan`
38
+ - `model`: `fable` (this is the whole point of the skill — the plan must come from Fable 5)
39
+ - `run_in_background`: `false` — every later step depends on the plan, so wait for it synchronously instead of doing other work first
40
+ - `description`: `Plan <short task name>`
41
+ - `prompt`: Hand the subagent everything it needs to plan independently — the full task description, the issue title/body if one was fetched, the working directory, and any constraints the user stated. Tell it explicitly:
42
+ - Produce a concrete, ordered implementation plan (files to create/modify, the approach, build sequence, risks/edge cases, and how to verify).
43
+ - Plan the absolute-best solution the task calls for, evaluated as if cost, effort, time, token spend, and code volume were unlimited — they are not factors and must never narrow the option space. The only constraints that override "best" are correctness and safety.
44
+ - Return the plan as its final message in clean Markdown suitable to (a) act on directly and (b) post verbatim as a GitHub issue comment.
45
+ - It is planning only — it must NOT make code edits, including via Bash (no writing/modifying files, no commits). The subagent lacks Edit/Write, but still has Bash, so this must be stated explicitly.
46
+
47
+ The Plan subagent's final message is returned to you as the tool result; it is not shown to the user.
48
+
49
+ If the call returns null or errors (user skip, terminal API failure), retry once; if it fails again, report the failure to the user instead of planning yourself.
50
+
51
+ When the result arrives:
52
+ - Run `git status --porcelain` and compare against the pre-dispatch snapshot to confirm the subagent made no file changes despite the no-edit instruction. If it did, tell the user and ask whether to revert before continuing.
53
+ - Save the plan verbatim to a scratchpad file immediately, so it survives context summarization during a long build and step 4 can post it exactly as produced.
54
+
55
+ ### 3. Sanity-check the plan against the code
56
+
57
+ Before posting or presenting it, verify the plan's load-bearing claims against the actual codebase: the files it says to modify exist, the functions/symbols it references are real, and it doesn't contradict repo conventions (CLAUDE.md). Fix small inaccuracies yourself and note them; if the plan is structurally wrong (built on a file or mechanism that doesn't exist), do NOT automatically re-dispatch the Plan subagent — stop and tell the user what's failing, and let them decide whether to re-plan with Fable 5, adjust the task, or proceed anyway. If you fixed small inaccuracies, update the scratchpad file from step 2 so it reflects the corrected plan before step 4 posts it.
58
+
59
+ ### 4. Post the plan to the GitHub issue (only if one was resolved in step 1)
60
+
61
+ Now that the plan has passed the sanity-check, save it to the issue as a comment before building, so the vetted plan is preserved on the issue regardless of how the build goes. This comment is not updated after the build.
62
+
63
+ ```
64
+ gh issue comment <N> --body-file <tmpfile>
65
+ ```
66
+
67
+ Add `-R owner/repo` when the issue lives in another repo (as in step 1). Use the scratchpad file from step 2 (with any step-3 corrections) as the body-file base — it avoids shell-escaping problems with Markdown. Prefix the comment so its origin is clear with a heading line `## Implementation plan (Fable 5)` above the plan body, and end the body with the standard metadata footer:
68
+
69
+ ```
70
+ ---
71
+ Created with: Fable 5 | high | Claude Code | fableplan
72
+ ```
73
+
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.
75
+
76
+ ### 5. Relay the plan to the user
77
+
78
+ Present the vetted plan to the user (the main agent). This is the plan you will build from.
79
+
80
+ ### 6. Set up an isolated git worktree
81
+
82
+ Before making any code changes, move the build into its own git worktree so it never touches the user's current workspace. If the directory isn't a git repository, tell the user and ask how to proceed rather than building in place. Otherwise create a fresh branch and worktree for the task:
83
+
84
+ ```
85
+ git worktree add ../<repo>-fableplan-<short-task-name> -b fableplan/<short-task-name>
86
+ ```
87
+
88
+ Do all of step 7's building inside that worktree. When the build is done, follow the repo's usual conventions for merging or opening a PR from the branch, and remove the worktree once it's no longer needed (`git worktree remove <path>`).
89
+
90
+ ### 7. Build
91
+
92
+ In the worktree from step 6, the main agent builds the task per the plan. Confirm with the user first only if the plan reveals ambiguity or a decision the user must make; otherwise proceed.
93
+
94
+ ## Notes
95
+
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 user did not reference an issue, never invent one or post anywhere — just plan and build.