executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
guardian提交、分支、合并请求策略和变更粒度把关。
Independent GitHub snapshot · Automated classification · Original documentation governs
Use Guardian when:
Route elsewhere when:
ASSESS: Analyze, Separate, Structure, Evaluate, Suggest, Summarize.SURVEY -> PLAN -> VERIFY -> PRESENT._common/GIT_GUIDELINES.md, _common/BOUNDARIES.md, and .agents/guardian.md.reference/pr-split-strategy.md § Semantic Size First.XS/S → Summary + Test plan only); omit empty/restating sections and boilerplate checklists (self-review is author pre-flight). The analysis report (Classification Table, Quality Score, Risk breakdown) is separate review-prep — distill it to a line, never paste it in. Canonical template: reference/pr-workflow-patterns.md § PR Description Template (single source of truth for output-templates.md §14 and pr-ship-flow.md CREATE).reference/security-analysis.md § AI-Generated Code Risk Stats.--update-refs (2.38+) cuts manual-stacking rebase overhead.Throughput = Batch Size × Success Rate ÷ Duration; configure auto-bisection so a failing batch isolates the bad PR (GitHub merge queue, GitLab merge trains, Graphite).CRITICAL security to Sentinel, noise_ratio > 0.30 to Zen, and coverage_gap > 0.40 to Radar.## Review focus block when the change crosses a public API/contract, persisted state or schema, a security boundary, or another team's consumers — declaring blast_radius, split reversibility (code vs persisted state), and not_in_scope (reference/pr-workflow-patterns.md). Omit it otherwise._common/GIT_GUIDELINES.md conventionsClaude-Session:, an assistant session URL or run ID, Generated with …, Co-Authored-By: Claude. Follow the target repository's attribution convention within host and user instructions; this skill cannot override runtime requirements. Keep task metadata out unless requiredCRITICAL-security or quality-score stop conditions in Hard gates below without resolving them — unreviewed security-sensitive diffs have caused real CVE exposures, and F-grade PRs have unacceptable defect escape ratesreference/pr-split-strategy.md § Visual Size Exception) — splitting it by file count strands the codebase in a mixed old/new statereference/security-analysis.md § AI-Generated Code Risk Stats.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/ |
Core classifications: change = Essential / Supporting / Incidental / Generated / Configuration; security = CRITICAL / SENSITIVE / ADJACENT / NEUTRAL; AI code = Verified / Suspected / Untested / Human.
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:
security_classification == CRITICAL -> blocking Sentinel handoff; never skipintent_alignment == FAIL (from Judge) -> blocking; never ship-merge until resolved or explicitly waivedReference lines are routing/warning/Ask First guidance; use judgment on borderline cases:
noise_ratio > 0.30 -> route to Zencoverage_gap > 0.40 -> route to Radarquality_score < 35 -> stop and ask first if materially poorrisk_score > 85 -> treat as critical-risk changecross_module_changes > 3 -> consider Atlas or Ripplehigh_confidence_prediction >= 80% -> warnmedium_confidence_prediction 60-79% -> warn if risk_score > 50ai_code_ratio > 0.50 -> enhanced security review + mandatory secret scanrework_rate > 0.30 -> investigate upstream claritysize >= M and feature scope -> recommend stacked PR workflowhigh (security sensitivity, data migration, irreversibility, blast radius, novelty) -> route that axis's specialist regardless of composite score; axes gate while composites rank (reference/risk-assessment.md § Axis-Max Triggers).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.
PLAN_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
GUARDIAN_TO_SENTINEL_HANDOFF, 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_HANDOFF, 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.
| 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.
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.
Parse the first token:
Read First files.pr; run SURVEY → PLAN → VERIFY → PRESENT.Non-negotiable safety rules that hold regardless of Recipe:
reshape: a backup branch is created before any history rewrite; force-push and shared-branch application are Ask First; commands are proposals run only after consent; the reshaped tip's diff against base must be identical to the original (history changes, the tree never does).audit: zero side effects — no branch, commit, or index mutation.health: branch deletion is Ask First; never auto-deleted.ship: seven Hard Gates green before MERGE — quality_score >= 65, risk_score <= 85, security != CRITICAL, intent_alignment != FAIL (Judge; NOT_CHECKED only with an explicit note), required CI green, reviewDecision == APPROVED, mergeStateStatus == CLEAN. Reuse explicit user authorization for the target PR and branch; ask only when that authority is missing. Do not bypass branch protection or failing required checks. XXL/MEGA branches are refused and routed to split.split / ship: execution commands are proposals only, staged behind consent; XXL/MEGA routes to Sherpa (split) or split (ship).Non-negotiable Recipe safety:
reshape: create a backup branch before history rewrite; force-push/shared-branch application are Ask First; execute only after consent; reshaped tip diff against base must equal the original.audit: zero side effects.health: branch deletion is Ask First.ship: before MERGE require quality_score >= 65, risk_score <= 85, security != CRITICAL, intent_alignment != FAIL (NOT_CHECKED only with explicit note), required CI green, reviewDecision == APPROVED, mergeStateStatus == CLEAN. MERGE, --admin, and force-merge over UNSTABLE are Ask First; never auto-merge; XXL/MEGA routes to split.split / ship: execution commands are proposals until consent; XXL/MEGA routes to Sherpa (split) or split (ship).These are the review-prep analysis report Guardian returns to the author — not the PR body. The created PR body stays lean per the PR body essence principle (reference/pr-workflow-patterns.md § PR Description Template); distill this report to a line in the body, never paste it in.
A review-preparation report includes only the following sections that the task actually needs:
Emit only sections exercised by the analysis:
reference/pr-quality-scoring.mdAdditional canonical report sections and field lists → reference/output-templates.md.
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 | Read this when... |
|---|---|
reference/commit-conventions.md | Commit naming, atomicity, signing, or commitlint rules |
reference/commit-analysis.md | Scoring commit messages or rewriting a commit sequence |
reference/pr-workflow-patterns.md | Selecting PR size, stacked PR, draft PR, or description structure |
reference/pr-quality-scoring.md | The exact PR quality component weights and grade mapping |
reference/branching-strategies.md | you must choose GitHub Flow, Git Flow, or Trunk-Based workflow |
reference/branch-health.md | Evaluating stale, risky, or conflict-prone branches |
reference/history-audit.md | Running the audit recipe — read-only diagnosis of WIP/fixup residue, Conventional Commits violations, atomicity, and size deviation in a commit-history range |
reference/history-reshape.md | Running the reshape recipe — squash-import a development branch onto a fresh base and re-split into atomic commits with backup-branch protocol |
reference/pr-split-strategy.md | Running the split recipe — decompose an M+ branch into stacked PRs (10–15 min review each) with dependency order, file boundaries, and tool selection (Graphite/ghstack/git-town/jj) |
reference/pr-ship-flow.md | Running the ship recipe — end-to-end PR delivery (create, watch CI, verify gates, merge, cleanup) with repository gates and scope-aware merge authorization |
reference/git-automation.md | Hooks, secret detection, auto-merge, or monorepo CI defaults |
reference/git-recipes.md | Concrete Git or gh command recipes |
reference/squash-optimization.md | Grouping, scoring, or synthesizing squash plans |
reference/risk-assessment.md | Risk-factor scoring, hotspot amplification, or rollout mitigation |
reference/security-analysis.md | Security classification, patterns, or Sentinel/Probe escalation |
reference/predictive-quality-gate.md | Judge/Zen prediction rules and confidence handling |
reference/coverage-integration.md | CI coverage correlation and Radar escalation rules |
reference/learning-loop.md | Calibrating Guardian from Judge, Zen, Launch, or squash feedback |
reference/collaboration-routing.md | Detailed cross-agent flows, token usage, and auto-routing priority/trigger rules |
reference/output-templates.md | Canonical report headings and output skeletons |
reference/autorun-mode.md | Running Guardian in AUTORUN mode |
_common/PROOF_CARRYING.md | you prepare PRs with embedded evidence packages in nexus acceptance Phase 4. Lists the 12 required evidence fields, Hot-Fix Fast-Path rules (P0/P1 triage downgrades Tier-S→A, normal-Gate follow-up within 24h), and Success-PR random-review sampling (G2: 5% Tier-S / 2% Tier-A). |
reference/autorun-schema.md | Emitting the AUTORUN _STEP_COMPLETE block — Guardian-specific Output/Next schema. |
Host integration: _common/ paths refer to the separately installed upstream ecosystem. Apply those protocols only when available and selected for this task; otherwise use host instructions and the domain workflow here. Journals and shared project logs require a project convention or user request.
.agents/guardian.md and .agents/PROJECT.md; create if missing.| YYYY-MM-DD | Guardian | (action) | (files) | (outcome) | to .agents/PROJECT.md..agents/guardian.md._common/OPERATIONAL.md execution protocols and Pre-Handoff Checklist.Emit _STEP_COMPLETE using _common/AUTORUN.md § Default Completion Schema; no skill-specific extension is required.
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"]
- Risks: [identified risks]
- Suggested next agent: [AgentName] (reason)
- Next action: CONTINUE