setup-code-skills
Install Code's repo-level machinery and configure model routing for skills-only consumers. Use for /setup-code-skills or setting Code up in a repository.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 1
- Forks
- 1
01 前言 Front Matter
- name
- setup-code-skills
- description
- Install Code's repo-level machinery and configure model routing for skills-only consumers. Use for /setup-code-skills or setting Code up in a repository.
- menu-description
- install machinery and configure model routing
02 资源文件 21
- 资产文件assets/agents/comment-sicko.md2.2 KB
- 资产文件assets/agents/effort-high.md467 B
- 资产文件assets/agents/effort-low.md462 B
- 资产文件assets/agents/effort-max.md462 B
- 资产文件assets/agents/effort-medium.md477 B
- 资产文件assets/agents/effort-xhigh.md472 B
- 资产文件assets/agents/patina-agent-high.md475 B
- 资产文件assets/agents/patina-agent-low.md471 B
- 资产文件assets/agents/patina-agent-max.md471 B
- 资产文件assets/agents/patina-agent-medium.md483 B
- 资产文件assets/agents/patina-agent-xhigh.md479 B
- 资产文件assets/agents/patina-agent.md687 B
- 资产文件assets/agents/patina-reader-high.md786 B
- 资产文件assets/agents/patina-reader-low.md782 B
- 资产文件assets/agents/patina-reader-max.md782 B
- 资产文件assets/agents/patina-reader-medium.md794 B
- 资产文件assets/agents/patina-reader-xhigh.md790 B
- 资产文件assets/agents/patina-reader.md869 B
- 资产文件assets/hooks/session-start-context.md1.1 KB
- 脚本assets/hooks/session-start.sh2.0 KB
- 脚本scripts/install-machinery.sh6.9 KB
03 SKILL.md 正文
Set Up Code Skills
Code ships as a full plugin (hook, subagents) and also as a vendored skill catalog. Vendoring carries the skills but not the hook or the agents, so a skills-only consumer loses the default-on entry point and the Claude-native targets that provider dispatch names. This skill installs that machinery into the target repo and, on Codex, the repo-scoped Codex config.
The machinery install is non-interactive and idempotent.
Install repo-level machinery
scripts/install-machinery.sh (in this skill's base directory) owns the
idempotency and no-clobber contract. Run it rather than editing the target files
by hand. It copies managed hook and agent files on every run, upserts one
Code SessionStart entry while preserving unrelated hooks, and removes
the legacy mandate blocks. Re-running refreshes managed files without
duplicating configuration.
The installer first checks that the sibling setup-pstack skill and the
patina-mode Codex tool reference are present. If any required file is
missing, the install fails and tells the reader to install the full Code
skill catalog.
What it materializes from assets/:
- The Code hook and its context (from
assets/hooks/), plus thesetup-pstacksheet decoder the hook runs, into the repo's.claude/hooks/. The context names skills by their bare names. - The Code agents (from
assets/agents/) into the repo's.claude/agents/, sosubagent_type: "patina-agent"resolves, the effort agentspatina-agent-<level>andeffort-<level>resolve, the review agentspatina-readerandpatina-reader-<level>resolve, and no-comments can reachcomment-sicko.patina-readerandcomment-sickosetomitClaudeMd, so they start without the user, project, and local CLAUDE.md files and keep only managed policy. An installation puts the machine-specific safety rules these agents need in a managed policy file. Examples are which GitHub identity or config directory to use and a ban on pushing with the plaingitcommand. The agents keep their bare names, so the same names resolve when Code is also installed as a plugin. Model choice per role comes from thesetup-pstacksheet at runtime, not from an agent definition. - One
SessionStartentry matchingstartup|resume|clear|compactin.claude/settings.json; existing hooks remain in place.
Run it from the target repo:
bash "<this-skill>/scripts/install-machinery.sh"
The script defaults --repo to the current Git toplevel and the instructions
file to <repo>/CLAUDE.md. Pass --repo <dir> or --instructions <file> to
choose the legacy instructions file whose managed block should be removed.
Codex
The Code plugin's Codex SessionStart hook, registered in
.codex-plugin/plugin.json, delivers the mandate on Codex. Codex asks the user
to trust plugin hooks through /hooks before it runs them. This installer
writes no mandate block to AGENTS.md, so Codex never receives the mandate
twice. A skills-only Codex install carries no plugin hook, so there the user
requests patina-mode explicitly. Codex has no subagent registry, so delegates
route through the spawn-prompt convention in the patina-mode
references/codex-tools.md (dispatch a spawn_agent told to read the
patina-mode skill, or agents/comment-sicko.md, first). Subagent dispatch
also needs the multi_agent feature. Add --codex to enable it:
bash "<this-skill>/scripts/install-machinery.sh" --codex
That enables multi_agent under [features] in <repo>/.codex/config.toml,
idempotently. Writing the repo-scoped config rather than the user's global
~/.codex/config.toml keeps the machinery committed and shared across
contributors. Codex honors a repo-scoped .codex/config.toml only for a project
the user has marked trusted, so the flag takes effect after Codex's one-time
trust prompt. Override the path with --codex-config <file>.
Every run, with or without --codex, removes the managed mandate block that an
earlier install wrote to CLAUDE.md or AGENTS.md, and leaves all other
content in those files untouched. --codex-agents <file> names a different
AGENTS.md to clean. A block without its closing marker stays in place.
Skills load natively by name on Codex. The /command stubs under
.codex-plugin/prompts/* come from the pstack-claude base; the installer does
not write or edit them.
Configure model routing
After the installer succeeds, read its final next skill: line. Load the skill
at that path and run it. Let setup-pstack own its model choices, probes,
confirmation, and writes.
Confirm
Tell the user what the machinery install wrote: the session hook, the
Code agents, any legacy mandate block it removed, and on Codex the
multi_agent flag. Relay setup-pstack's
final report. Report setup-code-skills complete only when setup-pstack
succeeds. Otherwise, report it incomplete and include the reason
setup-pstack reported when it stopped.
04 同仓库更多 Skills
code-review
Review the changes since a fixed point (commit, branch, tag, or merge-base) along five axes: Standards (does the code follow this repo's documented coding standards?), Spec (does the code match what the originating issue/spec asked for?), Evidence (does each claim in the pull request have evidence that shows it?), Bugs (does the changed code have logic errors, unhandled states, races, or regressions?), and Security (does the change open injection, auth, secret, input, or CI workflow holes?). Runs the reviews in parallel sub-agents, tags every finding Important, Nit, or Pre-existing, and reports them side by side with what blocks merge. Given an earlier reviewed head and its findings, it reviews only the newer commits, rechecks the earlier findings, and never repeats one. Use when the user wants to review a branch, a PR, work-in-progress changes, or asks to "review since X".
writing-for-pstack
Write or tighten an operator prompt for a patina-mode run. Use when the operator asks to write, revise, or review a prompt that will be passed to patina-mode.
writing-for-agents
Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.
wizard
Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.
wayfinder
Plan a huge chunk of work (more than one agent session can hold) as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.
wait-what
Stop. That last message did not land: re-pitch it.