Agent skill · software engineering · yonatangross
chain-patterns
Multi-phase pipeline patterns: MCP detection, handoff files, checkpoint-resume, worktree agents, cron monitoring. Use when building or debugging a pipeline skill.
Why this skill is useful
Adds executable scripts for multi-phase pipeline management that enhance the AI's ability to build and debug complex workflows.
What it needs
Requires claude installed locally. About 11k tokens when loaded. Last updated 2026-08-06. 215 stars on the source repository.
What this skill does
Chain Patterns Overview Foundation patterns for CC 2.1.71 pipeline skills. This skill is loaded via the skills: frontmatter field — it provides patterns that parent skills follow. Pattern 1: MCP Detection (ToolSearch Probe) Run BEFORE any MCP tool call. Probes are parallel and instant. Usage in phases: Load details: Read("references/mcp-detection.md") Pattern 2: Handoff Files Write structured JSON after every major phase. Survives context compaction and rate limits. Location: .claude/chain/ — numbered files for ordering, descriptive names for clarity. Load schema: Read("references/handoff-schema.md") Pattern 3: Checkpoint-Resume Read state at skill start. If found, skip completed phases. Load protocol: Read("references/checkpoint-resume.md") Pattern 4: Worktree-Isolated Agents Use isolation: "worktree" when spawning agents that WRITE files in parallel. When to use worktree: Agents with Write/Edit tools running in parallel. Isolation is additive only (#4557): per-spawn isolation can add a worktree but can never remove one an agent declares in frontmatter, and a frontmatter-isolated agent fails to spawn from a non-git cwd ("Cannot create agent worktree"). So ork agents leave it off their frontmatter and the caller opts in per spawn. Only git-operations-engineer and release-engineer declare it; spawn those from inside the target repo. CC 2.1.157 worktree lifecycle: EnterWorktree can switch between Claude-managed worktrees mid-session, and worktrees are left unlocked when the agent finishes — so git worktree remove/prune cleans them up without --force. Session-aware worktree check (CC 2.1.145): before parallel-worktree work, detect concurrent same-repo sessions with claude agents --json (filter by workingdir) rather than ps/pgrep — it returns sessionid, parentagentid, workingdir, awaitinginput, and elapsed per live session, so you can tell which sessions share this repo. When NOT to use: Read-only agents (brainstorm, assessment, review). …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills yonatangross/chain-patterns--28c5f6