alinaqi/maggy/cross-agent-delegation
- community
Checking that the SKILL.md file is still in the repository.
Cross-agent task routing — Codex auto-review, Kimi delegation by complexity score (iCPG + Claude reasoning), iCPG + Mnemos mandatory for all agents
Install
npx vskill@latest install alinaqi/maggy/cross-agent-delegationSKILL.md
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:
Codex Auto-Review (Stop Hook — Automatic)
When Codex is installed, a Stop hook reviews code after tests pass:
- TDD loop check runs tests
codex-auto-review.shruns Codex on the diff- Critical/High findings feed back to Claude (exit 2)
- 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:
| Dimension | 0 (low) | 1 (medium) | 2 (high) | Source | |
|---|---|---|---|---|---|
| Cyclomatic / surface depth | <10 LOC, no branches | 10-50 LOC, ≤3 branches | 50+ LOC or nested control flow | iCPG query_graph over function bodies | |
| Fan-out (consumer blast radius) | 0-2 callers | 3-10 callers | 11+ callers | iCPG trace_path(<symbol>, mode=callers) | |
| Crosses a security boundary (SEC-006, auth, PII, RLS, org-scope, billing, payments) | None | Tangential | Direct read or write | iCPG SEC-* / R-063 tags + grep for org_id, user_id, auth, pii | |
| Concurrency / transactional | Pure / sync | Async only | Locks, transactions, atomic claims, FOR UPDATE, asyncio.Lock, session.begin | iCPG concurrency flags + grep | |
| Domain invariants required | None / well-documented inline | Some implicit (need to read 1-2 files) | Heavy (cross-doc, ADR-bound, RFC-bound) | Claude reasoning + iCPG ADR linkage |
Step 2: Sum → routing
| Total score | Route | Rationale | |
|---|---|---|---|
| 0-3 | Kimi solo | Bounded surface, no security/concurrency/cross-doc concerns | |
| 4-6 | Kimi → 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-10 | Claude handles directly | Cross-cutting / security-critical / concurrency-heavy — needs full context |
Step 3: Floor — trivial-case shortcut
To skip iCPG-query cost on truly trivial work:
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:
Step 4: Read Results
After Kimi finishes, Claude:
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
After Code Changes
Mnemos — Mandatory for All Agents
At Task Start
At Sub-Goal Boundaries
At Task End (auto-handled by Stop hook)
Context Transfer Between Tools
The checkpoint is the bridge. Claude writes it, Kimi reads it:
The checkpoint contains: goal, constraints, recent files, git state, fatigue level.
Full Orchestration Flow
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cross-agent-delegation/SKILL.md
Popularity
- Repository stars
- 701
- Repository forks
- 55
- 7-day trend score
- 33
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/alinaqi/maggy/cross-agent-delegation)