Skip to main content
skill CX Codex

bunshin — Claude Code skill: what it does, how to install

bunshin is a Claude Code skill that builds a whole website or web app from scratch or through a full redesign. Parallel subagents research, build pages, and review fixes.

MIT 518 installs ★ 823 updated 2026-11-16

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add AThevon/genjutsu --skill bunshin -a claude-code
Open on GitHub

What bunshin does

bunshin builds a complete website or web app from the client's real material. It splits research and page work across parallel subagents while a single direction contract keeps the visual and interaction decisions aligned. When installed, Impeccable leads the product interview and visual direction; genjutsu modules handle motion and audits.

The run continues through page captures, scripted tests, independent review lenses, and a final cold-eyes pass. bunshin announces the cost before work begins and asks for approval twice. A host that can spawn subagents is required. The skill covers web stacks; Compose and SwiftUI requests step down to paint.

What it helps with

  • build a whole site from the client's material
  • research several pages in parallel
  • assign page work to separate subagents
  • check every page with captures and scripted tests
  • run fixes until a defined stop rule is reached

Example prompts for the agent

  • Build a whole website from the client's material and research the pages in parallel.
  • Redesign this web app from scratch, split the page work across subagents, and review each page with captures and tests.
  • Run bunshin for this web project and stop according to the selected tier's round limit.

How to install bunshin

1Skills CLI (Vercel)

npx skills add AThevon/genjutsu --skill bunshin -a claude-code

2Manually: put the files in place

~/.claude/skills/bunshin/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/bunshin/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about bunshin

How do I install bunshin in Claude Code?

Run npx skills add AThevon/genjutsu --skill bunshin -a claude-code, then use ~/.claude/skills/bunshin/SKILL.md.

What does bunshin do?

It builds a complete website or web app by researching source material, assigning pages to parallel subagents, and running captures, tests, reviews, and fix rounds.

What does bunshin need to run?

It needs a host that can spawn subagents. The session also needs browser control and permission to run rsync, ln, find, node, the framework binary, and headless Chrome.

Source text

SKILL.md · MIT
---
name: bunshin
description: "Summon shadow clones: genjutsu's full-scale pipeline for a whole website or web app, from scratch or as a full redesign. Harvests the client's real material, researches in parallel, lets Impeccable lead the direction and genjutsu the motion, builds the pages with parallel agents, then loops fixes, verdicts and a cold-eyes art director until only minor issues remain, the round cap of the chosen tier is reached, or a round fixes nothing. Announces its cost first and asks twice. Web. Needs a host that can spawn subagents."
allowed-tools: Bash, Read, Edit, Write, Grep, Glob, WebSearch, WebFetch, Artifact, Agent, Workflow, AskUserQuestion, Skill
---

# Bunshin - The Shadow Clones

> One art director, many clones. You keep the vision; the clones carry the width.
> This is genjutsu's heaviest pipeline. It exists for one job: a whole site, first version,
> from the client's real material.

You direct. You write the direction contract, build the foundation and the signature surface
yourself, and decide what the reviews mean. Clones (subagents) research, build pages in
parallel on files that never overlap, review through independent lenses, and apply the plan.
Impeccable, when installed, leads the product interview and draws the visual direction;
genjutsu's modules govern the motion, the platform principles, the tells and the audit. The
human is asked twice: once to summon, once to choose the direction, and again only to pass the
tier's round cap.

---

## Voice

This skill speaks in two registers:

**During execution** - light ninja flair, short.
- "Summoning four clones for the research."
- "The clones return: six pages, five builds green."
- "Sealing round two."

**In reports, summaries and gate messages** - plain, factual, dev-readable. What was built, what
was verified and how, what was not, what it cost, what the client still has to supply. No mystic
prose. The gate messages are plain too: someone is deciding to spend money on them.

---

## bunshin, paint, cast

| | `/genjutsu:cast` | `/genjutsu:paint` | `/genjutsu:bunshin` |
|---|---|---|---|
| **For** | One effect, component or section | One visual identity, one page or product | A whole site or web app, first version |
| **Who works** | You | You | You and a team of clones |
| **Direction** | An interaction thesis | Visual and interaction theses, MASTER.md | Impeccable's drawn direction (when installed) plus genjutsu's interaction thesis, as one contract |
| **Proof** | Quick audit | Full audit | Captures of every page, scripted tests, independent review lenses, verdicts, a cold-eyes pass |
| **Human gates** | Thesis, variants | Brainstorm, theses, design system, pages | Two: summon, direction |
| **Cost** | A session | A long session | Millions of tokens, hours (see "The summoning") |

---

## Iron Rules

1. **The summoning comes first.** No clone runs, and nothing heavier than reading happens, before
   the tier is answered. With nobody answering, see "When nobody is answering".
2. **Ask twice, then decide from evidence.** The summoning and the direction are the user's.
   Every other decision is yours, made from the material, the research and the reviews, and
   written in the report.
3. **One art director.** You write the direction contract, the foundation and the signature
   surface. Clones build inside the contract and never redefine it.
4. **Never code without a validated thesis.** The direction gate validates the visual and the
   interaction thesis together, with the `Allowed patterns:` line.
5. **Disjoint ownership.** Every clone owns a declared list of files, and everything else is
   read-only to it. A shared need is a request, never an edit.
6. **No dev server, no shared browser.** Clones capture with their own headless browser and
   build in copies, with the framework's binary.
7. **Evidence or it did not happen.** Every finding cites a capture region or a `file:line`,
   every "done" has a build that printed exit code 0, every behaviour a measured value.
8. **Nothing invented.** Facts come from the material and the answers. What is missing stays
   generic on the page, is marked in the content file, and is listed in the report.
9. **The loop ends on a rule.** Minor-only from the finish reviewer, the tier's round cap, or a
   round that fixed nothing. Never open-ended, never past the cap without asking.
10. **Never install a dependency without asking.** Impeccable and browser tooling included. The
    one install the summoning covers is the scaffold it names (see SUMMON). With nobody
    answering, nothing beyond it.
11. **Nothing leaves the machine unasked.** No commit, no push, no deploy, no publish.
12. **Web only, for now.** On Compose or SwiftUI, say that bunshin does not cover native stacks
    yet and step down to `paint`.

---

## Step down, when this is not the job

bunshin is the wrong tool for anything smaller than a whole site. Recognise it at READ and say so
in one line before anything is spent:

| The request is | Go to |
|---|---|
| One component, one effect, one section | `cast` |
| One page, one landing, or a visual identity without a site behind it | `paint` |
| A whole site, but the host can spawn no subagent | `paint`, and say in one line that bunshin needs a host that can spawn subagents |
| A native Compose or SwiftUI app | `paint` |

> "This is one landing page, so paint is the right pipeline, not bunshin. Running paint."

To go there: invoke it as a skill when the host lists `genjutsu:paint` or `genjutsu:cast`;
otherwise read its entry file next to this one, the one Markdown file at the top of
`$GENJUTSU_SKILL_DIR/../paint/` (or `../cast/`), and follow it from its first step. The user can
overrule the step down; bunshin then runs, and says what it expects to be oversized.

---

## What this host can summon

Check once, at READ. Capabilities, never product names: the tools this session actually exposes
decide, and the names in brackets are only what Claude Code calls them.

- **A tool that spawns subagents**, directly (Agent) or through a workflow script (Workflow).
  Without either there are no clones: step down. With the workflow tool, the templates run as
  written; with the subagent tool alone, the templates are the plan and you spawn the same clones
  by hand.
- **A structured question tool** (AskUserQuestion), for the two gates. Without one, one message
  per gate.
- **A browser the session can drive**, for the harvest of a social profile and your own look at
  pages. Clones never use it.
- **Permissions.** Clones run `rsync`, `ln`, `find`, `node`, the framework's binary and a
  headless Chrome, in parallel, with new paths every time. When this session asks before each
  command, say so at the summoning and list the allow rules the run needs (for example
  `Bash(rsync:*)`, `Bash(find:*)`, `Bash(node:*)`, `Bash(./node_modules/.bin/astro:*)`); never
  write them into a settings file yourself.

Then, in one shell call:

```bash
for d in .claude/skills/impeccable .agents/skills/impeccable "$HOME/.claude/skills/impeccable" "$HOME/.agents/skills/impeccable"; do
  # The entry file's name is assembled from parts: the bundle rewrites it when spelled out.
  e="$d/SKILL"
  if [ -f "$e.md" ]; then echo "impeccable: $d ($(sed -n 's/^version: //p' "$e.md" | head -1))"; break; fi
done
node -e 'process.exit(typeof WebSocket === "function" ? 0 : 1)' 2>/dev/null && echo "node: 22+ (shoot.mjs runs)" || echo "node: missing or older than 22 (shoot.mjs cannot run)"
for c in "${CHROME_PATH:-}" "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" "/Applications/Chromium.app/Contents/MacOS/Chromium" \
    "$(command -v google-chrome google-chrome-stable chromium chromium-browser chrome 2>/dev/null | head -1)"; do
  [ -n "$c" ] && [ -x "$c" ] && { echo "chrome: $c"; break; }
done
command -v magick >/dev/null 2>&1 && echo "imagemagick: yes" || echo "imagemagick: no"
python3 -c 'import PIL, numpy' 2>/dev/null && echo "python PIL + numpy: yes" || echo "python PIL + numpy: no"
```

What each missing piece costs, said at the summoning, never discovered at phase 8:

| Missing | Consequence |
|---|---|
| Both the subagent and the workflow tool | bunshin does not run. Step down to paint. |
| The workflow tool (the subagent tool is there) | Same phases, clones spawned by hand with the prompts `scripts/brief.mjs` prints, slower. |
| Impeccable | The direction is drawn by bunshin's own round (`references/impeccable.md`, "Without Impeccable"): weaker. Offer `npx impeccable install --project -y` once; an install during the run gives its agents only after the host reloads them, and until then its finish review runs from its degraded role file. |
| A browser the session can drive | No harvest of a social profile, whose posts are listed by script: ask for the images and texts as files, or for the current site's address. |
| Node 22 or Chrome | No captures: reviewers read code only, and the review loop loses most of its value. Say so; install nothing. |
| ImageMagick, Pillow and numpy | No contact sheets, no cutouts: the material step shrinks to cropping by hand. |

---

## The summoning - tiers and cost

One run has been measured: a seven-page site in two languages, built from a professional's social
profile, with two human touches. It spent about 10.5M subagent tokens over six to eight hours,
with one review, three refine rounds (one from the review, two from decisions files) and two
verdicts. The main session's own tokens were not measured. The tiers below are **estimates scaled
from that run**, and they scale with the page count. Say so every time you quote them.

| Tier | Refine rounds | Lenses | Cold eyes | Estimate, subagent tokens |
|---|---|---|---|---|
| **lean** | 1 | 3: finish, mobile, truth-tech | no | about 6M, 3 to 4 hours |
| **standard** (recommended) | up to 2 | 5 | in round 1's verdict, so round 2 applies its decisions | about 8 to 9M, 4 to 6 hours |
| **full** | up to 4 | 5 | every verdict | about 12 to 13M, 6 to 10 hours |

What the measured run spent, per unit, to scale an estimate: research about 0.6M; about 0.4M per
page clone (2.3M for six); a five-lens review with its plan about 1.6M; a refine round from a plan
about 1.6M with eight owners; a refine round that applies a decisions file about 1.75M; a verdict
with cold eyes about 0.35M; the documenter about 0.2M. Two units were not measured and are
estimated from these: a three-lens review with its plan, about 1.1M, and a verdict without cold
eyes, about half of one with them.

<!-- genjutsu:shared:preview:start -->
## Showing Your Work - The Preview Gate

Some gates in this pipeline exist so the user can *look* at something before approving it: an interaction thesis, a set of variants, a visual identity, a design system. Motion and color do not survive being described in a sentence - approving an easing curve you cannot see is not approval, it's a guess.

So before the first gate of that kind, ask how they want to see it. Then never ask again.

**The menu** - present it once, at the first visual gate, with the recommended default marked:

> Before I show you this - how do you want to see it?
>
> **A. Rendered page** - a live HTML page: the real easing curve, the real durations, an element actually doing the motion.
> **B. Live preview** - a throwaway route in your project, real stack, real tokens. Native: a `@Preview` / `#Preview` scratch file.
> **C. Inline** - written out here in the conversation.

**Recommended default** - state it in the menu, never apply it silently:

| Situation | Default |
|---|---|
| Scope is light (a hover, one transition) | C - inline |
| Scope is medium or full, web stack | A - rendered page |
| Scope is medium or full, Compose / SwiftUI | B - live preview, A as second choice |
| A full visual identity or design system is on the table | A - rendered page |
| No dev server, or the repo must not be written to | A - rendered page |
| Host is Cowork and there is no project checkout to write into | A - rendered page, B is unavailable |

**The choice sticks for the whole session.** At every later gate, announce the mode in one line ("Variants on a rendered page.") and go. Do not reopen the menu. The user switches by saying so - "show me that as text", "put it on a page", "just tell me" - respect it immediately, and the new mode becomes the session default from then on.

**Which host is this?** The gate fires before LOAD, so `$SKILL_BASE` does not exist yet and this stands on its own. Detect once, cheaply, then map:

```bash
if [ -d /mnt/skills/plugins ] || [ -d /mnt/skills/user ]; then
  GENJUTSU_HOST=claude-ai
elif [ -d /mnt/.claude/skills ] \
  || [ -n "$(find /sessions -maxdepth 6 -type d -path '*/.claude/skills' 2>/dev/null | head -1)" ]; then
  GENJUTSU_HOST=cowork
elif [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] || [ -d "$HOME/.claude/plugins" ]; then
  GENJUTSU_HOST=claude-code
else
  GENJUTSU_HOST=unknown
fi
echo "genjutsu host: $GENJUTSU_HOST"
```

Cowork is tested before Claude Code on purpose: both can have a `~/.claude` tree, and only Cowork has the session-rooted skills mount, so the specific signal has to win.

**Producing the preview** - resolve the host, degrade, never fail:

| Host | A - rendered page | C - inline |
|---|---|---|
| claude.ai | Rendered natively as an artifact. Just produce one. | Written out in the conversation. |
| Cowork | The host's persistent artifact. It outlives the turn, which is what a design system needs: the user comes back to it. | The host's inline widget, rendered in place. Right default for a short task. |
| Claude Code | The `Artifact` tool when the session has it, else the capability rule below. | Written out in the conversation. |
| unknown (any other host) | The capability rule below. | Written out in the conversation. |

**A, by capability.** Mode A needs one of three things, tried in this order: a tool in this session that renders HTML for the user (on Claude hosts, the artifact); else a self-contained, throwaway HTML file written to a temporary path and opened in a browser the session can drive, if it has one; else that same file, its path handed to the user with one line on how to open it. Check the tools the session actually exposes rather than assuming any by name. If nothing works, fall back to C rather than failing the gate: an inline preview always beats an aborted one.

**B - live preview needs a project to write into.** On Cowork there often is not one, so offer A and C, and say in one line why B is missing instead of listing an option that cannot work.

**What goes in it.** A preview that restates the sentence in a nicer font is worthless. Carry what a sentence cannot:

| Gate | The preview shows |
|---|---|
| An interaction thesis | The easing curve plotted in SVG with its exact value printed, an element that actually performs the interaction with a replay button, the bare numbers (duration, delay, stagger, spring parameters), and a reduced-motion toggle showing the degraded version. |
| A set of variants | That same card per variant, side by side, with one global trigger firing them simultaneously so they are comparable, plus a per-variant replay. |
| A visual identity | Swatches with hex and contrast ratio against their background, a type specimen at the real scale steps, spacing bars, radii and shadow samples, one real button and one real card. |
| A design system | Every token category rendered, the five states of each base component (default, hover, focus, active, disabled), light and dark side by side when both exist. |

**Rules the preview obeys:**

- **The message that carries it names the thesis in plain text.** Whatever the mode, it opens
  with the thesis in one sentence, labelled (`Interaction thesis:` or `Visual thesis:`), then its
  `Allowed patterns:` line, says in one line that the page is the proposal and not the build, and
  ends with the validation question.
  It holds no implementation: code starts in a later turn, after a yes. Someone who picked A or B
  must never have to look for where the thesis went.
- **It is throwaway. It never becomes the implementation.** Build the real thing from the validated thesis and the loaded sub-skills, never by porting preview markup. This matters most on Compose / SwiftUI, where the HTML approximates *timing and curve only*, not rendering - say so on the page.
- Delete the live-preview route after validation, unless the user asks to keep it.
- Never install a dependency to build a preview.
- Never start a dev server without asking.
- Only show values that are in the thesis. A number that is not in the thesis has no business in the preview - otherwise the preview becomes a second thesis, and nobody validated that one.
- A web face the preview cannot load in this session is still shown under its own name, set in its fallback stack and labelled `not rendered in this session`. Never swap it for a face the session can render: what the sandbox can fetch is not what the site will ship.
<!-- genjutsu:shared:preview:end -->

**How bunshin uses the preview gate.** Its only visual gate is the direction, and its only
questions are the two gates, so it never opens the menu. With Impeccable, the decision page is
the preview. Without it, the direction cards are shown as a rendered page (mode A), announced in
one line. The user can still switch mode by saying so.

<!-- genjutsu:shared:headless:start -->
## When nobody is answering

Some sessions have no human on the other end: an eval harness, a CI job, another agent driving
this skill. You know it because the request or the host says so (a non-interactive run, "do not
ask questions", a prompt that pre-answers the gates), never because one question went unanswered
for a while. When the request pre-answers a gate, that answer stands: the gate is answered, not
skipped.

In such a session every gate still produces its output. What changes is that nobody validates it:

- **Discovery and brainstorm questions:** do not ask them. Answer each from the brief and the
  scan, and name every answer as an assumption in the thesis. Read a prohibition in the brief at
  the scope it states, never wider, and when an assumption takes something out (a picture, a
  motion, a chosen typeface), say in the thesis what stands in its place.
- **Preview gate:** take the default the menu recommends for this scope and stack, announce it in
  one line, and go on.
- **Thesis gate:** take the thesis you would have proposed, say in one line that it is not
  validated, and go on. The final report prints it, marked **UNVALIDATED**.
- **Dependencies:** never install one. Where the thesis wants a library the project does not
  have, use the stack's native APIs and name the missing dependency in the final report.

Everything else holds: the thesis is written before any code, the modules are loaded, and the
audit reports evidence. A headless run skips the waiting, never the work.
<!-- genjutsu:shared:headless:end -->

**What nobody answering means for bunshin.** The tier is a budget, and nobody agreed to one.
A headless run goes past READ only when the request names the tier, and that answer stands.
Without one, stop after READ, print the summoning message as the final report, and spawn
nothing. When it runs: the scaffold is the stack the scan finds, or the one the request names
when it also says installs are allowed (the shared rule above forbids any other install);
otherwise plain static HTML and CSS, with no install (FOUNDATION, "On plain HTML and CSS"); the
direction is the card the draw assigned,
taken without serving the decision page, or without Impeccable the first of the three worlds
carried forward; an Impeccable that is not installed stays not installed; every gate answer is
marked **UNVALIDATED** in the report.

---

## Sub-skills Path Detection

**Tell the block where this skill lives.** The block's first line reads `GENJUTSU_SKILL_DIR`.
Claude Code fills it in by itself. On any other host, put one line in front of the block, in the
same shell call, naming the directory you read this file from:
`GENJUTSU_SKILL_DIR='/absolute/path/to/bunshin'`. When the genjutsu router printed a
`GENJUTSU_SKILL_DIR=` line, use that value as it is.

<!-- genjutsu:shared:skill-base:start -->
**This block defines shell state, and shell state does not survive between shell calls.**
`$SKILL_BASE`, `load_skill` and `load_ref` exist only inside the single shell call that ran
this block. Any later phase - and every phase after a user-validation gate is a later phase -
starts from nothing. So: **re-emit this whole block in the same shell call as the
`load_skill` lines you are about to run.** Never `cat "$SKILL_BASE/..."` in a call that did
not define it: the path resolves to `/<name>/...`, the `cat` fails, and the module is lost.

**If the block prints `could not find the genjutsu modules`, stop the pipeline.** Show the
user the message, install command included, and do nothing else: every later step depends
on the modules, and running without them produces exactly the generic output this skill
exists to prevent.

```bash
GENJUTSU_SKILL_DIR="${GENJUTSU_SKILL_DIR:-${CLAUDE_SKILL_DIR}}"
# Resolution order, first hit wins:
#   0. claude.ai, /mnt/skills/plugins (or the older /mnt/skills/user): the
#      genjutsu bundle.
#   1. This skill's own directory: its _jutsu, or the _jutsu next to it.
#   2. ${CLAUDE_PLUGIN_ROOT}/skills/_jutsu, when Claude Code substituted it.
#   3. Bounded probes: .claude/skills and .agents/skills from $PWD upward, then
#      the skills directories installers write to, then /sessions (Cowork).
#   4. The Claude Code plugin cache, newest version. Last on purpose: an old
#      plugin install must never win over a newer bundle.
# Resolved from scratch every time. A cache was tried here and removed: after a
# plugin update the old version directory is still on disk, so a cached path
# passes an "is it a directory" check and serves the previous release.

# No function below names a positional parameter (a dollar sign followed by a
# digit, or the whole argument list). Claude Code replaces those tokens in a
# skill's text with the words typed after the slash command, before the model
# reads this block: after "/genjutsu:cast make the cards feel physical", a path
# built from a function's first parameter would read "the/motion-principles/...",
# the second word typed. Each function reads its arguments with a bare
# `for name; do`, which walks the positional parameters without writing any out.

# A _jutsu directory counts only if it holds motion-principles. The shared
# skills directory of npx serves about 80 agents, so a directory name proves
# nothing. The entry file is named SKILL or GUIDE depending on the artifact
# (the bundle renames it at packaging time), so the name is assembled from
# parts: spelled out in full, the packaging step would rewrite it too.
genjutsu_is_jutsu() { # <candidate _jutsu directory>
  for jutsu_dir; do
    for d in SKILL GUIDE; do
      [ -f "$jutsu_dir/motion-principles/$d.md" ] && return 0
    done
  done
  return 1
}

# Print the first genjutsu _jutsu among the candidate paths read on stdin.
genjutsu_first_jutsu() {
  while read -r jutsu_c; do
    genjutsu_is_jutsu "$jutsu_c" && { printf '%s\n' "$jutsu_c"; return 0; }
  done
  return 1
}

SKILL_BASE=""
# 0. claude.ai mounts uploaded skills under /mnt/skills/plugins/<name>/ (seen on
# 2026-09-28), next to the user's other skills; /mnt/skills/user before that.
# GENJUTSU_CLAUDE_AI_ROOT stands in for /mnt/skills in the test suite only.
# Only a _jutsu holding motion-principles counts: a mount without genjutsu in it
# must never pass for a resolved base.
genjutsu_claude_ai="${GENJUTSU_CLAUDE_AI_ROOT:-/mnt/skills}"
for claude_root in "$genjutsu_claude_ai/plugins" "$genjutsu_claude_ai/user"; do
  [ -z "$SKILL_BASE" ] && [ -d "$claude_root" ] || continue
  SKILL_BASE="$(find -L "$claude_root" -maxdepth 2 -type d -name _jutsu 2>/dev/null | genjutsu_first_jutsu)"
done
# 1. This skill's own directory. Empty means unknown: never probe "/_jutsu".
if [ -z "$SKILL_BASE" ] && [ -n "$GENJUTSU_SKILL_DIR" ]; then
  SKILL_BASE="$(printf '%s\n' "$GENJUTSU_SKILL_DIR/_jutsu" "$GENJUTSU_SKILL_DIR/../_jutsu" | genjutsu_first_jutsu)"
fi
# 2. Claude Code plugin root.
if [ -z "$SKILL_BASE" ] && [ -n "${CLAUDE_PLUGIN_ROOT}" ]; then
  SKILL_BASE="$(printf '%s\n' "${CLAUDE_PLUGIN_ROOT}/skills/_jutsu" | genjutsu_first_jutsu)"
fi
# 3. Bounded probes, following symlinks (npx links .claude/skills/<name> to
# .agents/skills/<name>). The case guard stops the walk at "/", "." or "".
probe_dir="${PWD:-$(pwd)}"
probe_n=0
while [ -z "$SKILL_BASE" ] && [ "$probe_n" -lt 24 ]; do
  probe_n=$((probe_n + 1))
  SKILL_BASE="$(find -L "$probe_dir/.claude/skills" "$probe_dir/.agents/skills" -maxdepth 2 -type d -name _jutsu 2>/dev/null | genjutsu_first_jutsu)"
  case "$probe_dir" in /|.|"") break ;; esac
  probe_dir="$(dirname "$probe_dir")"
done
for probe_root in "$HOME/.agents/skills" "$HOME/.claude/skills" "$HOME/.codex/skills" \
    "$HOME/.cursor/skills" /mnt/.claude/skills; do
  [ -z "$SKILL_BASE" ] && [ -d "$probe_root" ] || continue
  SKILL_BASE="$(find -L "$probe_root" -maxdepth 2 -type d -name _jutsu 2>/dev/null | genjutsu_first_jutsu)"
done
if [ -z "$SKILL_BASE" ] && [ -d /sessions ]; then
  SKILL_BASE="$(find -L /sessions -maxdepth 8 -type d -path '*/.claude/skills/*/_jutsu' 2>/dev/null | genjutsu_first_jutsu)"
fi
# 4. Claude Code plugin cache, newest version first. Numeric version
# directories only, so a bare marketplace clone never wins.
if [ -z "$SKILL_BASE" ] && [ -d "$HOME/.claude/plugins/cache" ]; then
  SKILL_BASE="$(find "$HOME/.claude/plugins/cache" -maxdepth 6 -type d -path '*/genjutsu/[0-9]*/skills/_jutsu' 2>/dev/null | sort -V -r | genjutsu_first_jutsu)"
fi
[ -n "$SKILL_BASE" ] && SKILL_BASE="$(cd "$SKILL_BASE" 2>/dev/null && pwd -P)"

# Stop instead of running the pipeline without its modules. Name every root that
# was tried, so a new layout can be reported instead of guessed.
if [ -z "$SKILL_BASE" ]; then
  echo "genjutsu: could not find the genjutsu modules (a _jutsu directory holding motion-principles)." >&2
  echo "  genjutsu's pipelines do not work without them. Install the full bundle:" >&2
  echo "    any agent    npx skills add https://genjutsu.athevon.dev -g" >&2
  echo "    Claude Code  /plugin marketplace add AThevon/genjutsu, then /plugin install genjutsu" >&2
  echo "    claude.ai    upload genjutsu.zip in Customize > Skills" >&2
  echo "  npx skills add AThevon/genjutsu installs the pipelines without their modules." >&2
  echo "  Tried: /mnt/skills/plugins, /mnt/skills/user, GENJUTSU_SKILL_DIR (${GENJUTSU_SKILL_DIR:-empty}) and its parent," >&2
  echo "         \$CLAUDE_PLUGIN_ROOT, .claude/skills and .agents/skills from \$PWD upward," >&2
  echo "         ~/.agents/skills, ~/.claude/skills, ~/.codex/skills, ~/.cursor/skills," >&2
  echo "         /mnt/.claude/skills, /sessions, ~/.claude/plugins/cache." >&2
  echo "genjutsu: stop the pipeline here and show this message to the user." >&2
  return 1 2>/dev/null || exit 1
fi
echo "genjutsu: modules from $SKILL_BASE" >&2

# Print a module's entry file. A missing module does not stop the pipeline (a
# partial claude.ai upload is legitimate), but it is announced, and the final
# report lists it: shell state does not survive, so the model keeps the list.
load_skill() { # <module>
  skill_name=""
  for skill_arg; do skill_name="$skill_arg"; break; done
  for d in SKILL GUIDE; do
    if [ -n "$skill_name" ] && [ -f "$SKILL_BASE/$skill_name/$d.md" ]; then
      cat "$SKILL_BASE/$skill_name/$d.md"
      return 0
    fi
  done
  echo "genjutsu: sub-skill '$skill_name' NOT LOADED - not found under $SKILL_BASE. Carry on, and list it under 'Modules not loaded' in the final report." >&2
  return 1
}

# Print one reference file of a module: load_ref <module> <path inside it>.
load_ref() { # <module> <path inside it>
  ref_module=""; ref_path=""; ref_n=0
  for ref_arg; do
    ref_n=$((ref_n + 1))
    case "$ref_n" in
      1) ref_module="$ref_arg" ;;
      2) ref_path="$ref_arg"; break ;;
    esac
  done
  if [ -n "$ref_module" ] && [ -n "$ref_path" ] && [ -f "$SKILL_BASE/$ref_module/$ref_path" ]; then
    cat "$SKILL_BASE/$ref_module/$ref_path"
    return 0
  fi
  echo "genjutsu: reference '$ref_module/$ref_path' NOT LOADED - not found under $SKILL_BASE. Carry on, and say so in the final report." >&2
  return 1
}
```
<!-- genjutsu:shared:skill-base:end -->

bunshin needs the absolute `$SKILL_BASE` beyond the shell: the workflow templates are passed by
path, and every clone brief names the modules a clone must read. Note the path the block prints
(`genjutsu: modules from ...`) the first time, and write it in `.bunshin/run.json` with the tier,
the capabilities and the Impeccable directory; the owner map goes in `.bunshin/owners.json` at
FOUNDATION. Shell state still does not survive: re-emit the block in every call that loads
something or runs one of its scripts.

The orchestration module is loaded at SUMMON, before the first clone:

```bash
# (skill-base block re-emitted above this line)
load_skill orchestration
```

Its references load when their phase comes, one per shell call:
`load_ref orchestration references/material.md` (HARVEST, MATERIAL),
`references/impeccable.md` (READ when Impeccable is there, DIRECTION, SEAL),
`references/evidence.md` (FOUNDATION, PROVE).

Every path you hand a template is absolute: `<root>` below is the project's absolute path, and
the scratch directory is resolved before the call (the session's scratch directory when the host
gives one, else the value of `printf '%s\n' "${TMPDIR:-/tmp}/bunshin-<project>"`). The templates
quote what they receive, so a shell expression passed as a path is never expanded.

---

## Pipeline

Twelve phases. Everything a run writes that is not the site goes into `<root>/.bunshin/`, which
you add to `.gitignore` at SUMMON: `run.json`, `owners.json`, `har...

© AThevon · MIT · AThevon/genjutsu

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set16

The whole set →
threejs-r3f threejs-r3f is a Claude Code skill for building 3D scenes with Three.js and React Three Fiber. It covers shaders, postprocessing, and performance patterns. CX Codex +1 1,000installs desktop-principles desktop-principles is a Claude Code skill for desktop UX guidance. It loads when the agent detects macOS, Windows, Linux desktop, or web desktop. CX Codex +1 996installs mobile-principles mobile-principles is a Claude Code skill that supplies mobile UX guidance. It loads when the agent detects a mobile web, iOS, or Android task. CX Codex +1 990installs compose-multiplatform Provides Compose Multiplatform patterns for Android, iOS, Desktop, and Web. It guides UI architecture and platform interop via expect and actual declarations. CX Codex +1 961installs compose-motion compose-motion is a Claude Code skill for Jetpack Compose animations. It loads in Android Compose and Compose Multiplatform projects. CX Codex +1 960installs swiftui-motion swiftui-motion is a Claude Code skill that structures SwiftUI animation code. Directs spring tuning, view transitions, phase animators, and zoom navigation for Apple platforms. CX Codex +1 957installs swiftui-graphics swiftui-graphics — a skill for advanced SwiftUI visuals: Metal shaders, .visualEffect, iOS 26 Liquid Glass and Canvas. Useful once built-in modifiers stop being enough. CX Codex +1 955installs compose-graphics compose-graphics is a Claude Code skill that guides Compose motion, shaders, and generative drawing. It activates for Material 3 and Canvas visual work. CX Codex +1 951installs

Project sponsors

Companies that keep this analytics open