Agent skill

Cross Agent Delegation

by alinaqi in alinaqi/maggy

Cross-agent task routing — Codex auto-review, Kimi delegation by complexity score (iCPG + Claude reasoning), iCPG + Mnemos mandatory for all agents

MITAuto-check passed

Install Cross Agent Delegation

skills CLI
$ npx skills add alinaqi/maggy --skill cross-agent-delegation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install alinaqi/maggy cross-agent-delegation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/alinaqi/maggy.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/cross-agent-delegation .claude/skills/cross-agent-delegation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cross-agent-delegation
GitHub stars
707
Token cost
~1.9k tokens
SKILL.md length
509 words
Files
1
Skills in repo
71
Repo updated
First seen
Licence
MIT

At a glance

Cross-agent task routing — Codex auto-review, Kimi delegation by complexity score (iCPG + Claude reasoning), iCPG + Mnemos mandatory for all agents

  • Works in 5 steps: Score complexity, not file count → Sum → routing → Floor — trivial-case shortcut → …
  • SKILL.md covers Tool Detection, Codex Auto-Review (Stop Hook —…, Kimi Delegation (Claude… and iCPG — Mandatory for All Agents, plus 2 more sections
  • Calls git

What it does

Cross Agent Delegation is an agent skill from alinaqi/maggy. Cross-agent task routing — Codex auto-review, Kimi delegation by complexity score (iCPG + Claude reasoning), iCPG + Mnemos mandatory for all agents

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It works with Kimi. The repository describes itself as: What started as an opinionated Claude Code setup kit is now an autonomous AI engineering command center. The licence is MIT.

Example prompts

  • “/cross-agent-delegation”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Score complexity, not file count
  2. Sum → routing
  3. Floor — trivial-case shortcut
  4. Delegate via Bash
  5. Read Results

What it can do on your machine

Read from SKILL.md and the folder at commit 72a456e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cross Agent Delegation loads about 1.9k tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 509 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~43
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from alinaqi/maggy at commit 72a456e, republished under its MIT licence (© alinaqi). 509 words, ~1,882 tokens.

Download SKILL.mdSave it as .claude/skills/cross-agent-delegation/SKILL.md (or your agent's skills folder).
name
cross-agent-delegation
description
Cross-agent task routing — Codex auto-review, Kimi delegation by complexity score (iCPG + Claude reasoning), iCPG + Mnemos mandatory for all agents
when-to-use
Always loaded when multiple AI CLI tools are available (Claude, Kimi, Codex)
user-invocable
false
effort
medium

Cross-Agent Delegation

Claude Code orchestrates task routing to Kimi and Codex. The user interacts with Claude only — delegation happens behind the scenes.


Tool Detection

At session start, detect available tools:

bash
command -v kimi &>/dev/null && HAS_KIMI=true || HAS_KIMI=false
command -v codex &>/dev/null && HAS_CODEX=true || HAS_CODEX=false

Codex Auto-Review (Stop Hook — Automatic)

When Codex is installed, a Stop hook reviews code after tests pass:

  1. TDD loop check runs tests
  2. codex-auto-review.sh runs Codex on the diff
  3. Critical/High findings feed back to Claude (exit 2)
  4. Clean reviews pass through (exit 0)

Fully automatic. No user or Claude action needed.


Kimi Delegation (Claude Orchestrates)

When Kimi is installed and the task complexity is bounded, Claude delegates directly — the user does not need to run anything.

Step 1: Score complexity, not file count

File count is a poor proxy for delegation risk. A 1-file change to an authz path is harder than a 12-file rename. Score the task on five dimensions, each 0-2, sourced from iCPG signals plus Claude's semantic reasoning:

Dimension0 (low)1 (medium)2 (high)Source
Cyclomatic / surface depth<10 LOC, no branches10-50 LOC, ≤3 branches50+ LOC or nested control flowiCPG query_graph over function bodies
Fan-out (consumer blast radius)0-2 callers3-10 callers11+ callersiCPG trace_path(<symbol>, mode=callers)
Crosses a security boundary (SEC-006, auth, PII, RLS, org-scope, billing, payments)NoneTangentialDirect read or writeiCPG SEC-* / R-063 tags + grep for org_id, user_id, auth, pii
Concurrency / transactionalPure / syncAsync onlyLocks, transactions, atomic claims, FOR UPDATE, asyncio.Lock, session.beginiCPG concurrency flags + grep
Domain invariants requiredNone / well-documented inlineSome implicit (need to read 1-2 files)Heavy (cross-doc, ADR-bound, RFC-bound)Claude reasoning + iCPG ADR linkage
bash
# Auto-collect signals
icpg query blast <scope> --format json    # fan-out, async flags, sec tags
grep -rE "org_id|user_id|auth|pii"  <file>  # cheap sec heuristic if iCPG flags absent
grep -rE "asyncio.Lock|FOR UPDATE|session.begin" <file>  # concurrency heuristic
Step 2: Sum → routing
Total scoreRouteRationale
0-3Kimi soloBounded surface, no security/concurrency/cross-doc concerns
4-6Kimi → Codex auto-review (no user prompt)Real risk, but not so high that we need full Claude context — Codex catches what Kimi might miss
7-10Claude handles directlyCross-cutting / security-critical / concurrency-heavy — needs full context
Show full SKILL.md (194 more words)Show less
Step 3: Floor — trivial-case shortcut

To skip iCPG-query cost on truly trivial work:

bash
# If <2 files changed AND no SEC/auth/PII/concurrency keyword in diff,
# → auto-Kimi without scoring.
FILES=$(git diff --name-only | wc -l)
HAS_RISK_KEYWORDS=$(git diff | grep -ciE "org_id|auth|pii|asyncio|FOR UPDATE|transaction|session\.begin" || true)
if [ "$FILES" -lt 2 ] && [ "$HAS_RISK_KEYWORDS" -eq 0 ]; then
  AUTO_KIMI=true
fi

This handles the trivial-rename / typo-fix case without paying the iCPG round-trip.

When NOT to Delegate (overrides scoring)
  • User explicitly asked Claude to do it
  • Cross-service changes (API + frontend + database) — needs full context regardless of score
  • Production hotfix on a release branch — cross-tool review latency is too high
  • Score 7+ in any single dimension (one critical axis is enough to keep Claude in the loop)
Step 4: Delegate via Bash

Claude writes a mnemos checkpoint, then runs Kimi headless:

bash
# 1. Save current context to disk
mnemos checkpoint --force

# 2. Get context summary for Kimi
CONTEXT=$(mnemos resume 2>/dev/null)

# 3. Get constraints for target files
CONSTRAINTS=$(icpg query constraints <target-file> 2>/dev/null)

# 4. Run Kimi headless with full context
kimi --print -y -w . -p "
## Context (from mnemos checkpoint)
$CONTEXT

## Constraints (from iCPG)
$CONSTRAINTS

## Task
<specific task description>

## Rules
- Run tests after changes
- Record changes: icpg record --base main
- Write checkpoint when done: mnemos checkpoint --force
"
Step 4: Read Results

After Kimi finishes, Claude:

bash
# Read what Kimi did
mnemos resume          # Kimi's checkpoint
icpg status            # Kimi's recorded symbols
git diff               # Kimi's file changes
When NOT to Delegate
  • Security-sensitive code (auth, crypto, payments)
  • Cross-service changes (API + frontend + database)
  • Refactors that touch shared interfaces
  • User explicitly asked Claude to do it

iCPG — Mandatory for All Agents

Before ANY code change, Claude runs these (and includes results when delegating):

Pre-Task Queries
bash
# 1. Duplicate check — already done?
icpg query prior "<goal>"

# 2. Constraints — what invariants apply?
icpg query constraints <file-path>

# 3. Risk — is this symbol fragile?
icpg query risk <symbol-name>
After Code Changes
bash
icpg record --reason <id> --base main
icpg drift check

Mnemos — Mandatory for All Agents

At Task Start
bash
mnemos add goal "<task description>"
At Sub-Goal Boundaries
bash
mnemos checkpoint
At Task End (auto-handled by Stop hook)
bash
mnemos checkpoint --force
Context Transfer Between Tools

The checkpoint is the bridge. Claude writes it, Kimi reads it:

bash
# Claude saves state
mnemos checkpoint --force

# Kimi (or Codex) reads state
mnemos resume

The checkpoint contains: goal, constraints, recent files, git state, fatigue level.


Full Orchestration Flow

TASK ARRIVES (user tells Claude)
    |
    v
[1] Claude: icpg query prior "<goal>"     ← Already done?
[2] Claude: trivial-case shortcut         ← <2 files & no risk keywords?
    |
    +-- YES + Kimi installed -----> AUTO-KIMI (no scoring)
    |
    +-- NO ↓
    v
[3] Claude: score complexity (5 dims × 0-2, iCPG + reasoning)
    |
    +-- score 0-3   ----> KIMI SOLO PATH
    |   [a] mnemos checkpoint --force
    |   [b] kimi --print -y -p "..."
    |   [c] mnemos resume + git diff
    |   [d] Continue in Claude
    |
    +-- score 4-6   ----> KIMI + CODEX REVIEW PATH
    |   [a] mnemos checkpoint --force
    |   [b] kimi --print -y -p "..."
    |   [c] codex review --uncommitted    ← Auto-review the diff
    |   [d] If P0/P1 findings: re-prompt Kimi with findings
    |   [e] Once clean: continue in Claude
    |
    +-- score 7-10  ----> CLAUDE DIRECT PATH (full context)
    |
    v
[4] icpg query constraints <files>         ← Invariants
[5] icpg query risk <symbols>              ← Fragility
[6] mnemos add goal "<task>"               ← Track in memory
    |
    v
[7] IMPLEMENT (TDD: RED -> GREEN)
    |
    v
[8]  Stop: tdd-loop-check.sh               ← Tests pass?
[9]  Stop: codex-auto-review.sh            ← Codex reviews diff
[10] Stop: icpg-stop-record.sh             ← Record symbols
[11] Stop: mnemos-checkpoint.sh            ← Save memory

© alinaqi, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/cross-agent-delegation of alinaqi/maggy.

Open the folder on GitHubat commit 72a456e

Compare with similar skills

Cross Agent Delegation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cross Agent Delegation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cross Agent Delegation this skillalinaqi/maggy707—~1.9kAutomated safety check: PassMIT
CCS Task Delegationkaitranntt/ccs2.9k—~1.8kAutomated safety check: PassMIT
Ccmanager Configkbwo/ccmanager1.3k—~1.5kAutomated safety check: PassMIT
Kimi WebbridgeMoonshotAI/kimi-code7.8k—~3.6kAutomated safety check: PassMIT
Open Kimi Pptjinwyp/open-ppt-skill1612 repos~5.1kAutomated safety check: PassMIT
Helmor Bump Vendorsdohooo/helmor1.3k—~2.1kAutomated safety check: PassApache-2.0

Similar skills

  • CCS Task Delegation

    kaitranntt/ccs

    Hands simple, deterministic tasks such as typo fixes, tests and small refactors to cheaper models through the ccs CLI, choosing a profile from your config.

    2.9k GitHub stars~1.8k tokensUpdated 10 days ago
    Agent WorkflowsAuto-check passed
  • Ccmanager Config

    kbwo/ccmanager

    Set up, review, or repair a CCManager config — .ccmanager.json at a git repository root, or the global ~/.config/ccmanager/config.json.

    1.3k GitHub stars~1.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Kimi Webbridge

    MoonshotAI/kimi-code

    Kimi Browser Extension(Kimi 浏览器扩展,原 Kimi WebBridge)lets AI control the user's real browser — navigate, click, type, read, screenshot, and interact with any website using the user's actual login…

    7.8k GitHub stars~3.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Open Kimi Ppt

    jinwyp/open-ppt-skill

    Create, edit, replicate, read, and export presentations. An agent skill from jinwyp/open-ppt-skill.

    161 GitHub starsUsed in 2 repos~5.1k tokens
    Documents & OfficeAuto-check passed
  • Helmor Bump Vendors

    dohooo/helmor

    Bump or upgrade the pinned versions of Helmor's bundled agent CLIs, SDKs, and supporting binaries — Claude Code + claude-agent-sdk (lockstep), Codex, Cursor SDK, OpenCode, Kimi, Pi, and gh / glab /…

    1.3k GitHub stars~2.1k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • Gen Changesets

    MoonshotAI/kimi-code

    A skill your agent uses when generating changesets in the kimi-code repository — deciding whether to write one, which package to list, the bump level, the wording, and the confirmation workflow.

    7.8k GitHub stars~1.1k tokensUpdated today
    DevelopmentAuto-check passed

More from alinaqi/maggy

All 71 skills in this repo
  • Aeo Optimization

    alinaqi/maggy

    AI Engine Optimization - semantic triples, page templates, content clusters for AI citations

    707 GitHub stars~3.7k tokensUpdated 17 days ago
    Auto-check passed
  • Agent Teams

    alinaqi/maggy

    Claude Code Agent Teams - default team-based development with strict TDD pipeline enforcement

    707 GitHub stars~5k tokensUpdated 17 days ago
    Auto-check: notes
  • AI Models

    alinaqi/maggy

    Latest AI models reference - Claude, OpenAI, Gemini, Eleven Labs, Replicate

    707 GitHub stars~4.1k tokensUpdated 17 days ago
    Auto-check passed
  • Android Java

    alinaqi/maggy

    Android Java development with MVVM, ViewBinding, and Espresso testing

    707 GitHub stars~3.9k tokensUpdated 17 days ago
    Auto-check: notes
  • Android Kotlin

    alinaqi/maggy

    Android Kotlin development with Coroutines, Jetpack Compose, Hilt, and MockK testing

    707 GitHub stars~3k tokensUpdated 17 days ago
    Auto-check passed
  • Autonomous Testing

    alinaqi/maggy

    AI-driven testing agent that auto-discovers, generates, executes, evaluates, and fixes tests for any project type

    707 GitHub stars~1.1k tokensUpdated 17 days ago
    Auto-check passed

Works with

Questions about Cross Agent Delegation

What does Cross Agent Delegation do?

Cross-agent task routing — Codex auto-review, Kimi delegation by complexity score (iCPG + Claude reasoning), iCPG + Mnemos mandatory for all agents. Cross Agent Delegation is an agent skill from alinaqi/maggy.

How do I install Cross Agent Delegation in Claude Code?

Run `npx skills add alinaqi/maggy --skill cross-agent-delegation -a claude-code`. Or copy the skill folder (skills/cross-agent-delegation in alinaqi/maggy) into .claude/skills/cross-agent-delegation in your project. Claude Code loads it when a task matches its description.

How do I install Cross Agent Delegation in Codex?

Run `npx skills add alinaqi/maggy --skill cross-agent-delegation -a codex`. Or copy the skill folder (skills/cross-agent-delegation in alinaqi/maggy) into .agents/skills/cross-agent-delegation in your project. Codex loads it when a task matches its description.

Can I use Cross Agent Delegation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add alinaqi/maggy --skill cross-agent-delegation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cross-agent-delegation, .gemini/skills/cross-agent-delegation, .github/skills/cross-agent-delegation and .opencode/skills/cross-agent-delegation in your project.

What does Cross Agent Delegation need to run?

Going by SKILL.md and its folder, Cross Agent Delegation needs the command-line tools its instructions call (git).

Does Cross Agent Delegation access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Cross Agent Delegation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Cross Agent Delegation use?

Cross Agent Delegation is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cross Agent Delegation use?

About 1.9k tokens (SKILL.md is roughly 7.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cross Agent Delegation?

Skills that share tags, products or a category with Cross Agent Delegation: CCS Task Delegation (kaitranntt/ccs, 2.9k stars), Ccmanager Config (kbwo/ccmanager, 1.3k stars), Kimi Webbridge (MoonshotAI/kimi-code, 7.8k stars) and Open Kimi Ppt (jinwyp/open-ppt-skill, 161 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cross Agent Delegation?

alinaqi (a GitHub user) maintains it in alinaqi/maggy, which has 707 GitHub stars. The repository holds 71 skills in this directory. The repository was last updated on September 24, 2026.

Source: alinaqi/maggy on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.