agent-patterns-plugin
Configuration toolkit for Claude Code that audits agents, assimilates project configs, and manages MCP servers.
- CCM score
- 63 of 100
- version
- 2.59.1
- GitHub stars
- 60
Own this plugin? Claim it
What it does
- Adds
/meta:assimilate,/meta:audit,/meta:promote, and/meta:context-dietcommands for moving and auditing agent and rule configurations - Covers agent teams, custom agent definitions, MCP server authoring, and MCP code execution patterns for multi-tool workflows
- Enforces scope-by-scope promotion with per-candidate confirmation, touching only approved files and never auto-committing
- Designed for teams tuning long-running Claude Code setups that need to keep always-loaded context lean
Agent configuration utilities - project assimilation, config auditing, teammate definitions, MCP management, MCP code execution patterns
Add marketplace
/plugin marketplace add laurigates/claude-pluginsRun it inside Claude Code once, then install the plugin below.
Install
/plugin install agent-patterns-plugin@laurigates-claude-pluginsRun it inside Claude Code after adding the marketplace.
Files
Discovered from sourceAdversarial Review
A normal review asks "is this right?" and confirms intent. Adversarial review asks "how could this be wrong?" and hunts for the fault the first pass rationalised away. It is a second pass for residual risk on high-stakes work — not a replacement for the first pass, and not for low-stakes or reversible changes where it only manufactures busywork. Red-teaming is the same posture aimed at a proposal rather than a finished change: actively try to break the proposed approach before you commit to an architecture or design.
This is a thin posture, not a new checklist. It layers four moves —
isolation, inverted objective, a triage gate, and a bounded loop — on top of
the domain checklists that already live in code-review, security-audit,
verify-before-plan, and cold-read-gate. It dispatches an isolated
reviewer with the matching lens and then triages what comes back, because
an agent told to find faults will invent them.
When to Use This Skill
| Use this skill when... | Use something else instead when... |
|---|---|
| Stakes are high and a normal review already passed, but residual risk remains | First-pass review of a diff/PR → code-quality-plugin:code-review |
| Red-teaming an architecture decision, ADR, or migration plan before commit | Verifying plan facts (counts, paths, build state) → agent-patterns-plugin:verify-before-plan |
| Stress-testing a design's failure modes and invariants | Pure security audit → agents-plugin security-audit / /security-review |
Probing whether outward text survives a reader → wrap cold-read-gate | Legibility of outward text on its own → agent-patterns-plugin:cold-read-gate |
| The change is hard to reverse and a missed fault is expensive | The change is low-stakes, reversible, or throwaway — skip; it wastes tokens |
The Four Moves
| Move | What it means | Borrowed from |
|---|---|---|
| Isolation | The reviewer gets the artifact with no author context — bias can't leak in | cold-read-gate |
| Inverted objective | Brief says "enumerate failure modes," never "confirm it works" | this skill |
| Triage gate | Separate genuine faults from manufactured objections before acting | cold-read-gate Step 3 |
| Bounded loop | One revise round; a third means a structural problem the gate can't fix | cold-read-gate Step 4 |
Model choice is the inverse of cold-read-gate. That skill uses haiku on purpose — the weak reader is the measurement instrument for legibility. Adversarial review wants opus: finding subtle faults is a reasoning task, not a low-context-reader simulation.
Parameters
Parse $ARGUMENTS:
- Target (first positional) — what to attack: a path, a PR ref
(
#123or URL), a file, or a free-text description of a plan/decision. If absent, default to the current diff (git diff+ staged) and say so. - Focus directive (optional, free text after the target, e.g.
focus on the failure path, ignore style) — biases the lens. It steers, never overrides: it must not cancel a live user boundary stated earlier in the session (theauto-mode.mdconversation-boundary hazard).
Execution
Execute this adversarial review:
Step 1: Precondition gate
Confirm both hold before spending tokens:
- Stakes are high — the change is hard to reverse, or a missed fault is expensive. If not, stop and recommend a normal review instead.
- A first pass exists — a normal review/lint/test pass already ran.
If not, run that first (
code-review) — adversarial review is a second pass, and leading with it skips cheap, high-yield findings.
If either fails, say so and redirect rather than proceeding.
Step 2: Name the target and pick the lens
State in one line what is under review, then select the lens. The lens supplies the domain attack vocabulary — delegate to the owning skill's checklist rather than restating it:
| Target type | Lens / attack vocabulary | Delegate the checklist to |
|---|---|---|
| Code, diff, PR | Logic errors, edge cases, race conditions, error-swallowing | code-quality-plugin:code-review, code-review-checklist |
| Security surface | Injection, authz gaps, secret exposure, trust boundaries | agents-plugin security-audit, /security-review |
| Architecture / ADR | Coupling, failure domains, blast radius, reversibility | blueprint adr-validate, adr-relationships |
| Plan / wave premise | Premise truth, stale facts, name≠behaviour | agent-patterns-plugin:verify-before-plan |
| Outward text / docs | Legibility under zero context | agent-patterns-plugin:cold-read-gate |
| Research claims | Unverified or single-sourced claims | .claude/skills/deep-research |
Step 3: Dispatch the isolated reviewer
One Agent per lens on model: opus — adversarial review is judgement-tier
work (.claude/rules/agent-development.md § "Model Selection for Agents"), so
not a place for sonnet or haiku — and model: fable is sanctioned too: it
is exactly the hardest delegated reasoning, so the reviewer must not be weaker
than the author it is attacking.
Dispatch lenses in parallel only when there are several and the session is not
on a 1M-context model (every Fable 5.1 session, or Opus with the [1m]
suffix) — the parallel-subagent rate-limit caveat in skill-fork-context.md.
Template:
subagent_type: general-purpose
model: opus # judgement tier; fable also sanctioned — see agent-development.md
prompt: |
You are an adversarial reviewer. Your ONLY objective is to find ways this
is WRONG, fragile, or unsafe — do not confirm that it works, do not
praise it. Assume a fault exists and locate it.
Read ONLY the target (no scope beyond it):
<target path / diff / pasted plan>
Attack along this lens: <lens from Step 2, with its checklist>.
<focus directive, if any>
Produce:
1. FAULTS — each as: SEVERITY=critical|high|medium EVIDENCE=<file:line or
quoted claim> FAILURE=<the concrete way it breaks>.
2. ASSUMPTIONS-ATTACKED — load-bearing assumptions you tried to falsify,
and whether each held.
3. VERDICT: exactly one of `sound` | `flawed`.
Cite evidence for every fault. Your final message is the deliverable.
Step 4: Triage — genuine fault vs manufactured objection
The reviewer was told to find faults, so some "faults" are noise. Triage before acting (this is the load-bearing step — skipping it is how adversarial review sends you down the wrong path):
| Genuine fault — act on it | Manufactured objection — drop it |
|---|---|
| A concrete input/state that breaks the code, with evidence | A defense against an input the contract makes impossible |
| A failure mode with real blast radius | A hypothetical with no realistic trigger |
| A violated invariant or unhandled error path | Style/preference dressed up as a fault |
| A premise that is actually false | Re-litigating a trade-off already decided with rationale |
| A missing edge case the spec implies | Scope the change didn't touch and isn't responsible for |
Step 5: Report and bound the loop
Emit a prioritised report: target, verdict, surviving genuine faults
(severity-ordered, with evidence and a suggested fix), and explicitly note
the objections you dropped in triage and why. Apply or hand off the genuine
fixes. Re-dispatch a fresh reviewer only if the verdict was flawed;
do not loop more than twice — a third round means a structural problem the
review can't resolve.
Workflow harness (template)
workflows/find-verify.workflow.js (an existing change) and
workflows/design-review.workflow.js (a spec drafted from recon) ship beside this
skill. Each is a TEMPLATE to adapt, not a script to run verbatim. Read it, then
rewrite it for the work in front of you. Step 1's gate stays in prose here; no gate
agent goes inside a harness.
Adapt freely: lens prompts and their skills, context, decided, measured,
verifyCap (≤ 6), controlSample (≤ 2), the verifier run hint and isolation, the
spec sections. A find-verify lens may be an external model (finder: { pal: '<model>' }).
Agent budget: 3 + 1 x — the counted 3 are the lens agents (lenses.slice(0, 3) in both files); find-verify adds one verifier per ranked finding up to verifyCap plus the control sample (≤ 11 in all), design-review adds the drafter and the reviser (5).
Preserve across any adaptation: a caller-chosen lens list of 2–3, never
truncated; the Rank barrier and refute-by-default verdict; nothing dropped past the
cap, behind a dead verifier, or folded into a duplicate; a resolution row per design
issue; read-only agents; a status that is never clean over a coverage gap. The
full list is in REFERENCE.md.
Never Workflow({resumeFromRunId}) to retry a few failed worktree agents — a resume
re-runs agents that already succeeded and opens duplicate PRs (#1868). Re-dispatch the
failed units fresh and sequentially after checking
gh pr list --head <branch> --state all --json number,state.
Push, PR creation, and GitHub mutations happen only in the single sequential finalise stage, never inside a fanned-out agent. These templates have no such stage.
Skip the harness when: there is one lens on one target — dispatch one reviewer (Step 3) and triage inline. The Execution steps remain the authoritative description of what each stage must produce; the harness only fixes how the work is split.
Anti-patterns
| Mistake | Correct approach |
|---|---|
| Running it as a first pass | It's a second pass — a normal review runs first (Step 1) |
| Using it on low-stakes / reversible work | Skip it; the precondition gate exists to say no |
| Acting on every objection the reviewer raises | Triage first (Step 4); the inverted objective guarantees noise |
| Using a weak model "to be tougher" | Opus — subtle faults are a reasoning task (inverse of cold-read-gate) |
| Restating each lens's checklist inline | Delegate to the owning skill; this is a posture, not a checklist |
| Looping until the reviewer goes silent | One revise round; persistent faults = structural problem |
Related
- REFERENCE.md — audit sweeps: find, verify adversarially, then resolve settled facts before editing; apply an undecided finding only where the facts make it policy-neutral, never "TBD" or a plausible owner
cold-read-gate— the isolation + triage + bounded-loop pattern this skill generalises (legibility lens; uses haiku)verify-before-plan— adversarial review of premises; the plan/wave lens delegates hereexecution-grounded-review— the sibling verifier for running behaviour against acceptance criteria (this skill attacks a design; that one grounds each criterion in execution evidence)code-quality-plugin:code-review— the first-pass review this layers on top ofagents-pluginsecurity-audit //security-review— the security lens.claude/rules/skill-fork-context.md— the[1m]parallel-dispatch caveat.claude/rules/loop-integrity.md— looping skills delegate their stop-condition judgement to an isolated reviewer like this one (Pillar 1)
Readme
Agent Patterns Plugin
Agent configuration utilities for Claude Code — project assimilation, config auditing, teammate definitions, MCP management, and hooks configuration.
Overview
This plugin provides utilities for configuring and managing Claude Code agents, MCP servers, and hooks. Orchestration features previously in this plugin have been replaced by Claude Code's native agent teams feature.
Features
Hooks
pre-compact-primer.sh
PreCompact hook that preserves context during long single-session work. Fires before context compaction to inject a continuation primer with current state, active files, and remaining tasks.
Skills
/meta:assimilate
Analyze and assimilate project-specific Claude configurations into user-scoped configs.
Usage:
/meta:assimilate <project-path>
Features:
- Examines project
.claude/directories - Identifies reusable patterns
- Suggests generalizations for user-scoped usage
/meta:audit
Audit Claude agent and teammate configurations for completeness, security, and best practices.
Usage:
/meta:audit [--verbose]
Features:
- Validates frontmatter fields
- Analyzes tool assignments for security
- Checks privilege levels
- Generates comprehensive audit reports
/meta:promote
Evaluate whether rules, skills, commands, or agents at one .claude/ scope should be promoted to a higher scope (parent or user-global), and execute approved promotions safely.
Usage:
/meta:promote [scope-path]
Features:
- Walks target / sources / upstream layers to find overlap candidates
- Per-candidate checklist for owner-specific signals vs generic kernel
- Four-action menu: promote as-is, extract kernel, keep scoped, no action
- Per-candidate
AskUserQuestionconfirmation — no bundled approvals - Read-broad / write-narrow: only approved files are touched, no auto-commit
/meta:context-diet
Audit always-loaded context (CLAUDE.md and .claude/rules/) for material that should become an on-demand skill, and migrate approved candidates one at a time.
Usage:
/meta:context-diet [scope-path]
Features:
- Inventories the every-turn surface and estimates each unit's token cost
- Classifies each rule/section: keep invariant, lean, path-scope, promote-to-skill, consolidate, drop
- Drafts an auto-triggering description before promoting (the gate that prevents lossy moves)
- Per-candidate
AskUserQuestionconfirmation, largest-impact first — no bundled approvals - Inverse of
session-distill(creates rules), orthogonal tometa-promote(moves between scopes)
meta-local-notes
Audit a machine-local notes file (CLAUDE.local.md) — verify every claim against the live environment, correct drifted facts, and delete findings that duplicate versioned docs.
When to use:
- Local notes have grown stale, bloated, or contradict the ADRs/roadmap
- Before appending a session finding to a machine-local file
Features:
- The keep test: environment facts (host, paths, toolkit versions, local gotchas) stay; project findings (measurements, root causes, blocker status) move to the versioned docs
- Live-probe checklist per claim shape — including the perf-commit check that catches a still-plausible claim the project already fixed
- holds / drifted / superseded / gone verdicts, with correct-don't-delete for drifted environment facts
- Reports the verdict table, supplying the review a git-ignored file never gets
- Complements
meta-context-diet: that skill audits a file's load cost, this one audits its truth
custom-agent-definitions
Define and configure custom agents and teammate templates with tool restrictions and worktree isolation.
When to use:
- Creating custom agent or teammate definitions
- Choosing between a named agent (fresh context) and the runtime
forksubagent type (inherits the conversation) - Restricting agent capabilities with
disallowedTools - Setting up specialized teammates for team workflows
mcp-management
Intelligent MCP server installation and management.
When to use:
- Configuring MCP servers for a project
- Analyzing project context for MCP recommendations
- Setting up environment variables for MCP servers
Features:
- Project context analysis
- Intelligent server suggestions
- Project-scoped
.mcp.jsonmanagement - Environment variable validation
mcp-code-execution
Design and scaffold the MCP code execution pattern for agent systems.
When to use:
- Building agents that interact with many MCP tools (50+)
- Intermediate data is too large for model context
- Workflows need loops, conditionals, or retries across tool calls
- PII must stay out of the model context
- Tasks benefit from state persistence across agent runs
Features:
- Decision framework: code execution vs direct tool calls
- Typed wrapper scaffolding for MCP servers
- Key patterns: progressive discovery, data filtering, PII tokenization, skill accumulation
- Security checklist for sandboxed execution environments
mcp-server-authoring
Producer-side patterns for building a Python MCP server with FastMCP — an ordered, reasoned build path (scaffold → tools → resources → tests → release) for any server you own.
When to use:
- Building or scaffolding a new MCP server
- Adding a tool, resource, or prompt to an existing server
- Wiring a server's tests (TDD), lint, and release-please
- Choosing transport (stdio vs HTTP) for a server you own
Features:
- FastMCP server skeleton (SDK-bundled and standalone
fastmcp) - Tool / resource / prompt decorators with type-hint-driven schemas
- Toolchain wiring (uv, ruff, pytest, release-please) with the reasoning at each step
- TDD pattern testing the underlying function, not the decorator
agent-teams
Configure and orchestrate Claude Code agent teams (implicit team, SendMessage, shared task list workflows).
When to use:
- Setting up multi-agent parallel workflows
- Coordinating lead/teammate architectures
- Managing task assignment and inter-agent communication
- Implementing graceful team shutdown procedures
parallel-agent-dispatch
Dispatch contract for any workflow that spawns more than one agent in parallel — applies to both native agent teams and plain parallel Agent tool fan-out.
When to use:
- Before spawning any parallel agents (worktree preflight)
- Authoring agent prompts that need file/read/output budgets
- Defining the mandatory Return Contract every parallel agent must emit on exit
- Recovering from silent agent exits or worktree collisions
- Mapping the Return Contract onto workflow primitives (a JSON Schema on the
agent()call;parallel()as the barrier) before reaching for a harness
multi-model-delegation
Protocol for consulting other models (kimi, glm, gemini, gpt via the PAL MCP gateway) on design and judgment work — the complement of parallel-agent-dispatch, which delegates work to Claude subagents.
When to use:
- Brainstorming an open design decision with foreign models (PAL
chat/consensus) - Reconciling two models' conflicting design proposals
- Deciding whether a multi-model consult is worth the tokens
Features:
- The disagreement-is-the-signal protocol: identical briefs, independent round one, diff for the split
- Adjudicate splits against the codebase (which usually already decided), never model confidence
- Graft-never-adopt-wholesale synthesis guidance
- PAL mechanics that bite:
listmodelsfirst, the kimitemperature400, per-modelabsolute_file_pathsbudgets, thePAL_WORKSPACE_ROOTrestriction, andmodel_usedscrambling under concurrency - The curated excerpt bundle: one §-numbered verbatim-excerpt file, sized under the smallest model's budget, attached unchanged to every model
verify-before-plan
Verify orchestrator premises (file counts, build state, artefact presence) before dispatching parallel subagents. Sits before parallel-agent-dispatch in the dispatch sequence — bad premises propagate to every brief in the wave.
When to use:
- Planning a wave whose agent briefs cite a number, path, or "does X" claim not checked this session
- Inheriting a premise from a prior agent's return contract or an earlier session
- Patching from a user's symptom report ("the bug is X") before reading the failing repro
- Allocating from a shared counter (ADR / WO / migration sequence) that other agents may have bumped
Features:
- Verifier return-contract: Premise / Evidence / Verdict / Implicit assumptions
- Cheapest-verifier table mapping premise shape to the right tool (
Glob,Grep, read-only agent) - Anti-patterns catalog: name-equals-behaviour, stale-counter, symptom-not-cause
workflows/recon-map.workflow.jstemplate: read-only mappers over a caller-supplied unit list (deterministic lists preferred, cap 10), then an optional critic, up to 3 gap-fillers, a verifier and a synthesizer; every claim cites file:line or command output
tool-result-traps
Tool results that mean something other than they look — an empty result, a green exit, and a well-formed line of output are each claims about mechanics, not content. Complements verify-before-plan: that one verifies a premise before a wave, this one distrusts the tool output a verdict is built on.
When to use:
- A zero-match or empty result is about to be reported as "clean", "complete", or "none found"
- Deduping before filing an issue, or concluding nobody reported something
- Declaring a bulk rename, migration, or sweep finished
- A verification loop's input set is built from a relative path in a long-running session
- An
rg/git grepresult contradicts something read directly - Concluding a skill, command, recipe, or binary "does not exist"
- A
-g/--globfilter is narrowing the search and the name you want is a directory - A
pgrep -fliveness check or watcher loop disagrees with the job's own log, or never exits
Features:
- The silent-rewrite and never-compiled-pattern cases:
rg -ras--replace,git grep -Edropping\b - Why
-g '*name*'cannot match a directory — a no-slash glob tests the basename, and it returns plausible sibling files rather than zero - One search tier is not the search universe: user-global, plugin, and project (
<repo>/.claude/) resolve independently - A rejected flag reading as "no results" — and its worse variants on a write, and on an accepted flag that takes a stdin marker literally
- The persistent-cwd pair: the shell wedge
cdcannot undo, and the vacuous path-scoped verification that shares its cause Workflowargsarriving JSON-encoded, so agents run againstundefinedpgrep -fmatching its own shell wrapper, so a watcher never exits and a finished job reads as running; match the executable, hold the PID, or watch the artifact- Control-testing every negative that gates an action — with a control that exercises the part of the pattern that can fail; parallel-batch rule for siblings that can exit non-zero
harness-tool-errors
Claude Code harness tool errors that the loud hooks do not catch: Read on a missing path, a directory, or a file over the token limit; Edit/Write before a Read or after a formatter rewrote the file; Bash permission denials, which are terminal.
When to use:
- A
Read,Edit,Write, or Bash call returned an error rather than a result - About to rewrite a whole file (or round-trip JSON) to change one span
Features:
- Glob-before-Read,
EISDIR, and Grep-then-page for files over 25,000 tokens - The re-Read triggers table (pre-commit, formatter, commit hooks, coworker, background Bash)
- Surgical
EditoverWrite, including thejson.load→json.dumpsreformatting trap - Permission denials are final: switch tools or hand the command over with
! <cmd>
probe-input-integrity
Never fabricate an identifier you are about to test against: take it from the system, run a known-good control, extract the code under test instead of retyping it, and make sure a PATH stub is actually the one that runs.
When to use:
- Probing an endpoint, URL, record id, path, or ticket number
- Building a harness around code that is awkward to run directly
- A sweep's own target set is empty, so a green result asserts nothing
Features:
- List-before-get, and a known-good control to separate "denied" from "not found" from "wrong shape"
sed -nextraction of the shipped text, and borrowing a control set when yours is emptychmod +x+command -v+ an unmistakable sentinel for stubbed CLIs
local-run-handoff
Hand a probe, test or bug repro to the user's own machine as a one-command bundle (just run <slug>), and read the verdict back from results/summary.txt instead of asking for pasted output.
When to use:
- A check needs the user's workstation, OS, signed-in account, marketplace install or hardware
- A repro must be confirmed on a real install, or carried to another machine or upstream
Features:
scripts/new-probe.shscaffolds a dated bundle with a control arm, verdict codes and.handoff.json- A fixed verdict contract: one
STATUS=line, exit0decided /1ERROR /2INCONCLUSIVE /3SKIP - Return channels behind a secret scan: PR comment,
SendMessageto a local session, opt-in--clip just listandjust archive(decided probes older than 14 days),REQUIRES_OSguard for Mac vs Linux
adversarial-review
Adversarial second-pass review that tries to break code, designs, plans, or ADRs — a thin posture (isolation, inverted objective, triage gate, bounded loop) layered on top of the existing domain review skills.
When to use:
- Stakes are high and a normal review already ran, but residual risk remains
- Red-teaming an architecture decision, ADR, or migration plan before commit
- Stress-testing a design's failure modes and invariants
Features:
- Precondition gate — refuses low-stakes/first-pass use (the common waste case)
- Lens table delegating domain checklists to
code-review, security-audit,verify-before-plan,cold-read-gate - Isolated opus reviewer with an inverted "find the fault" objective
- Triage gate separating genuine faults from manufactured objections before acting
- Workflow templates:
find-verify(2–3 lens finders, cross-lens dedup and severity rank, capped refute-by-default verifiers, re-runnableunverifiedclaims) anddesign-review(draft, 2–3 lens reviewers, evidence-backed revise)
execution-grounded-review
Verify an implementation meets its acceptance criteria by running the suite first, then tracing each criterion to execution evidence — the execution-grounded sibling of adversarial-review. The report lists narrative-changing limitations (unverified criteria, skipped steps, stale evidence) before the verdict, and states none explicitly when there are none. A red suite fails the verdict only on failures that are new against the merge-base.
When to use:
- Verifying an implementation meets explicit acceptance criteria, proven by running it
- Gating a loop/phase
doneon an independent check of behaviour - Confirming a fix actually fixes the reported failure (not just compiles)
- Closing the loop on "is every requirement actually covered by a test?"
Features:
- Execute-first: runs suite + typecheck + lint before any verdict
LEDGERschema binding the verifier's output: one row per criterion,verdictenum (PASS/FAIL/PARTIAL/UNVERIFIED) grounded in execution evidence- Required
sequenceMatchesProductionenum on every row — makes "I did not check the production call sequence" unrepresentable - Search-shaped failure attribution on long traces — locate with
grep -n, read narrow windows, report a checkableevidenceSpan, within a stated bound of 3 rounds / 5 windows - Intent-starved isolated opus verifier — grades behaviour, not the author's rationale
- Over-correction triage guarding both "pass broken code" and "fail correct code"
plugin-settings
Configure per-project plugin settings using .claude/plugin-name.local.md files.
When to use:
- Building plugins that need user-configurable behavior
- Storing agent state between sessions
- Controlling hook activation per-project without editing
hooks.json
Features:
- YAML frontmatter for structured settings
- Markdown body for prompts and additional context
- Standard
extract_fieldparsing pattern - Toggle-based hook activation, agent state management
expose-tunable-knob
Expose a live-adjustable control instead of guessing a magic constant for a parameter the agent cannot itself perceive (visual, audio, UX output).
When to use:
- Tuning a value judged by a sense the agent lacks — color, size, position, timing, gain
- The user has already pushed back once on a guessed default ("that's better, but...")
- The runtime already has (or can cheaply gain) a live control surface — a UI slider, hot-reloadable config, a
--watchflag
Features:
- Four-step pattern: parameterize the mechanism, pick a reasoned starting default, expose a live control at the human's layer, stop guessing past that point
- Anti-pattern catalog: silent precision theater, unreachable knobs, knob sprawl
- Worked example from a live face-swap app's mouth-mask tuning
agent-cli-worktree-safety
Data-loss invariants for a CLI that runs an agent SDK inside a git worktree and force-removes it afterwards.
When to use:
- Building or reviewing a CLI that creates a worktree, runs an agent in it, then cleans up
- An agent run wrote files but reported "No changes were made" — the diagnostic tell for the whole class
- Deciding whether a "has changes" check is safe to gate a destructive cleanup on
Features:
- Four invariants: dirty-tree detection (
--porcelain, notgit diff), safety-net commit, pre-validation incl. unborn HEAD, collision refusal - Why an interactive tool call fails silently in SDK subprocess mode, and the two-phase pattern that replaces it
- Six-row required-test table and a new-CLI checklist
Migration from Orchestration Patterns
The following skills have been removed in favor of native agent teams:
| Removed Skill | Native Replacement |
|---|---|
delegate | Native delegate mode |
delegation-first | Native delegate mode |
agent-coordination-patterns | Shared task list + messaging |
agent-file-coordination | Native file-locking |
agent-handoff-markers | Native inter-agent messaging |
workflow-primer | Per-teammate context windows |
multi-agent-workflows | Agent teams configuration |
agentic-patterns-source | Agent teams docs |
command-context-patterns | Agent teams context handling |
check-negative-examples | Plan approval gates |
wip-todo | Shared task list |
orchestrator-enforcement hook | Native delegate mode |
See ADR-0015 for the decision rationale.
Installation
Via Plugin System
- Clone or copy this plugin to your Claude plugins directory:
cp -r agent-patterns-plugin ~/.claude/plugins/
- The plugin will be automatically loaded by Claude Code.
License
MIT License - See LICENSE file for details.
Details
- Marketplace
- laurigates/claude-plugins
- Source
- agent-patterns-plugin
- Author
- Lauri Gates
- Category
- Ai
- License
- MIT
- Keywords
- agents, configuration, assimilation, audit, mcp, teammate-definitions
- Listed since
- Apr 7, 2026
Questions
What does the agent-patterns-plugin add to Claude Code?
agent-patterns-plugin adds the /meta:assimilate, /meta:audit, /meta:promote and /meta:context-diet commands for agent configuration. It also ships a PreCompact hook, pre-compact-primer.sh, that preserves context during long single-session work.
How do I install agent-patterns-plugin?
Run /plugin marketplace add laurigates/claude-plugins, then run /plugin install agent-patterns-plugin@laurigates-claude-plugins inside Claude Code. After that, agent-patterns-plugin gives you its skills for auditing agents, managing MCP servers and defining custom agents.
Which category does agent-patterns-plugin belong to and what leads it?
agent-patterns-plugin is in the Skill & Plugin Building category, where example-skills, prompts.chat, plugin-dev, ruflo-plugin-creator and mcp-builder are the other top plugins. agent-patterns-plugin focuses on auditing agent configurations and managing MCP servers for Claude Code projects.
Does agent-patterns-plugin help with MCP servers?
Yes, agent-patterns-plugin includes an mcp-management skill for installing and managing MCP servers, which handles project-scoped .mcp.json files and environment variable validation. It also includes mcp-code-execution and mcp-server-authoring skills for building agents and Python MCP servers.
More from laurigates/claude-plugins
All 52- agents-pluginv1.16.3
- api-pluginv2.0.1
- bevy-pluginv1.4.2
- bios-pluginv1.2.0
- blog-pluginv1.3.4
- blueprint-pluginv3.52.2
- cloud-pluginv1.1.1
- code-quality-pluginv1.30.4
- codebase-attributes-pluginv1.3.4
- comfyui-pluginv1.15.10
- communication-pluginv1.2.7
- component-patterns-pluginv1.5.4
- configure-pluginv1.45.0
- container-pluginv2.12.0
- css-pluginv1.2.4
- documentation-pluginv1.16.2
- evaluate-pluginv1.22.1
- feedback-pluginv1.18.0
- finops-pluginv1.4.7
- foundryvtt-pluginv1.6.4
- git-pluginv2.77.3
- github-actions-pluginv1.13.10
- health-pluginv1.24.11
- home-assistant-pluginv1.4.1
Similar to agent-patterns-plugin
More Skill & Plugin Buildingagents-pluginPluginlaurigates/claude-plugins60 starsTask-focused agents with teammate and subagent role guidance for test, review, debug, docs, CI, security, refactoring, research, and performance
Claude FlowMCP serverruvnet82.6K starsAI orchestration server for Claude Code: swarm, agent, memory, and config tools over MCP.
agents-ai-agentsPlugindavepoon/buildwithclaude3.8K starsAgents for multi-agent orchestration, MCP tooling, and agentic workflows
mcp-create-declarative-agentSkillgithub/awesome-copilot8.7K installsScaffolds a Microsoft 365 Copilot declarative agent wired to an MCP server with OAuth or SSO auth.
agent-alchemy-plugin-toolsPluginsequenzia/agent-alchemy46 starsAgent Alchemy Plugin Tools — plugin lifecycle tools for AI agents
anthropic-plugin-devPluginfcakyon/claude-codex-settings1.2K starsPlugin development toolkit for hooks, MCP servers, commands, and skills.