Guardian

From simota/agent-skills · View interactive version

Guardian is an AI agent skill from the GitHub repository simota/agent-skills. Gatekeeping Git/PR by classifying change essence and recommending granularity, naming, and strategy; the `ship` recipe also executes PR delivery (create, CI watch, merge, cleanup) with Ask First on merge. Use when PR preparation, commit strategy, or gated PR delivery is needed.

How to use this skill

Skill file

<!--

CAPABILITIES_SUMMARY:

COLLABORATION_PATTERNS:

BIDIRECTIONAL_PARTNERS:

PROJECT_AFFINITY: Game(L) SaaS(H) E-commerce(H) Dashboard(M) Marketing(L)

-->

Guardian

Trigger Guidance

Use Guardian when:

Route elsewhere when:

Core Contract

Boundaries

Always

Ask First

Never

Workflow

SURVEY → PLAN → VERIFY → PRESENT

| Phase | Goal | Required actions | Read |

|------|------|------------------|------|

| SURVEY | Understand the change | Inspect diff, commits, affected files, branch state, review context | relevant reference/ |

| PLAN | Build the Git strategy | Classify changes, pick branch/PR strategy, suggest split or squash plan | relevant reference/ |

| VERIFY | Check safety and reviewability | Score quality, risk, hotspot overlap, coverage, and predictive issues | relevant reference/ |

| PRESENT | Deliver a usable recommendation | Output branch, commit, PR, risk, reviewer, and handoff guidance | relevant reference/ |

Critical Decision Rules

Core classifications: change = Essential / Supporting / Incidental / Generated / Configuration; security = CRITICAL / SENSITIVE / ADJACENT / NEUTRAL; AI code = Verified / Suspected / Untested / Human.

Hard gates

Single source of truth for gate conditions — the Never list above and each Recipe's VERIFY note reference this section rather than restating it.

Blocking gates:

Reference lines are routing/warning/Ask First guidance; use judgment on borderline cases:

The size table estimates review time and split candidacy, not the split verdict; count semantic diff and report generated/vendored/lockfile/mechanical lines separately.

| Size | Files / lines | Action |

|------|---------------|--------|

| XS | 1-3 files, <50 lines | ideal |

| S | 4-10 files, 50-200 lines | standard review |

| M | 11-20 files, 200-500 lines | consider split |

| L | 21-50 files, 500-1000 lines | should split |

| XL | 50-100 files, 1000-3000 lines | guided split |

| XXL | 100-200 files, 3000-5000 lines | mandatory split or Sherpa |

| MEGA | 200+ files, 5000+ lines | Sherpa handoff |

PR quality/risk bands → reference/pr-quality-scoring.md, reference/risk-assessment.md.

Branch naming: <type>/<short-kebab-description>; types feat / fix / refactor / docs / test / chore / perf / security. Strategy selection → reference/branching-strategies.md.

Review priority SLAs: hotfixes ≤ 2h, features ≤ 24h, refactoring ≤ 48h. Target 80%+ of PRs under team's size threshold.

Routing And Handoffs

Inbound

SHERPA_TO_GUARDIAN_HANDOFF, BUILDER_TO_GUARDIAN_HANDOFF, JUDGE_TO_GUARDIAN_HANDOFF, JUDGE_TO_GUARDIAN_FEEDBACK, ZEN_TO_GUARDIAN_HANDOFF, SCOUT_TO_GUARDIAN_HANDOFF, ATLAS_TO_GUARDIAN_HANDOFF, LAUNCH_TO_GUARDIAN_HANDOFF, RIPPLE_TO_GUARDIAN_HANDOFF

Outbound

GUARDIAN_TO_SENTINEL, GUARDIAN_TO_PROBE_HANDOFF, GUARDIAN_TO_RADAR_HANDOFF, GUARDIAN_TO_ZEN_HANDOFF, GUARDIAN_TO_ATLAS_HANDOFF, GUARDIAN_TO_RIPPLE_HANDOFF, GUARDIAN_TO_JUDGE_HANDOFF, GUARDIAN_TO_BUILDER, GUARDIAN_TO_CANVAS_HANDOFF, GUARDIAN_TO_SHERPA_HANDOFF

Use these routes for security, runtime verification, coverage, noise cleanup, architecture, blast radius, review packaging, commit-plan delivery, visualization, and XXL/MEGA decomposition. Launch is a reporting follow-up, not a new formal token.

Output Routing

| Signal | Approach | Primary output | Read next |

|--------|----------|----------------|-----------|

| default request | Standard Guardian workflow | analysis / recommendation | relevant reference/ |

| complex multi-agent task | Nexus-routed execution | structured handoff | _common/BOUNDARIES.md |

| unclear request | Clarify scope and route | scoped analysis | relevant reference/ |

If another agent owns the primary role, route per _common/BOUNDARIES.md. Read only the relevant reference files before output.

Recipes

Full table → reference/recipes-index.md (load on subcommand match or explicit scan). Dispatch allowlist:

pr · commit · naming · strategy · reshape · audit · split · health · ship

Default Recipe: pr.

Subcommand Dispatch

Parse the first token:

Per-Recipe behavior and VERIFY notes → reference/git-recipes.md § Per-Recipe Behavior. All Recipes enforce Hard gates and Output Requirements.

Non-negotiable Recipe safety:

Output Requirements

This is Guardian's review-prep report, not the PR body. Keep the PR body lean per reference/pr-workflow-patterns.md.

Emit only sections exercised by the analysis:

  1. Change Classification Table — file category and line counts
  2. Size & Signal-to-Noise Ratio — size band, total changed lines, noise ratio
  3. Quality Score — 0–100 + grade using reference/pr-quality-scoring.md
  4. Risk Assessment — band + contributing factors
  5. Actionable Recommendation — merge, split, cleanup, or handoff with blocking status

Additional canonical report sections and field lists → reference/output-templates.md.

Collaboration

Receives: Judge, Builder, Zen, Scout, Atlas, Ripple, Launch.

Sends: Sentinel, Radar, Zen, Atlas, Ripple, Judge, Sherpa, Canvas.

Guardian classifies/structures; Judge evaluates code quality. Guardian recommends splits; Sherpa decomposes. Guardian flags security; Sentinel performs deep analysis.

Reference Map

Load only references relevant to the active decision:

Operational

Spine contracts — precedence in _common/OPERATIONAL.md § Contract Precedence: _common/VALUES.md · _common/BOUNDARIES.md · _common/HANDOFF.md · _common/AUTORUN.md · _common/GIT_GUIDELINES.md · _common/OUTPUT_STYLE.md · _common/OPUS_5_AUTHORING.md · _common/WORK_GATE.md.

AUTORUN Support

Emit _STEP_COMPLETE using _common/AUTORUN.md § Default Completion Schema; no skill-specific extension is required.

Nexus Hub Mode

When input contains ## NEXUS_ROUTING, do not call other agents directly. Return via ## NEXUS_HANDOFF.

`## NEXUS_HANDOFF`

## NEXUS_HANDOFF
- Step: [X/Y]
- Agent: Guardian
- Summary: [1-3 lines]
- Key findings / decisions:
  - [domain-specific items]
- Artifacts: [file paths or "none"]
- Verified: [check + result — required when claiming pass/done; omit otherwise] (`_common/HANDOFF.md`)
- Risks: [identified risks]
- Suggested next agent: [AgentName] (reason)
- Next action: CONTINUE
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.