plan-gen-dag
Skill2 starsChanged 18 days agoMITView on GitHub
Orchestrate GeoAssets' 5-phase Tri-Planar Outer-Loop read-only planning and architecture verification DAG over Claude Code (architecture/domain reasoning) and GitHub Copilot (C# 14 contracts/xUnit QA matrix) with zero code or working-tree changes. Activate when the user invokes /plan-gen-dag or asks for a multi-agent implementation plan without modifying code.
In this repository12 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- code-gen-dagSkill
- outer-loop-dag-orchestratorSkill
- solid-code-synthesizerSkill
- csharp-conventionsSkill
- jira-conventionsSkill
- observability-conventionsSkill
- outer-loop-dag-orchestratorSkill
- solid-code-synthesizerSkill
- ui-ux-pro-maxSkill
- solid-code-synthesizerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 1 is distinctive, and 16 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
16
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
If a ticket key or slug is given (e.g., XD01-195-spatial-buffer-cache or XD01-195), normalize to a valid slug (^[a-zA-Z0-9._-]+$) suitable …
- Very specific: line 40
If only a free-form feature request is given, derive a concise <kebab-slug> taskId.
- Very specific: line 45
Only write a Markdown file to <path> if --out <path> is explicitly passed.
- Distinctive: line 56
Run a read-only inspection from the repository root:
- Very specific: line 62
Read CLAUDE.md, .github/copilot-instructions.md, BannedSymbols.txt, and relevant .claude/skills/<domain>/SKILL.md files.
- Very specific: line 63
If taskId references a Jira key and Jira MCP tools are available, read the full issue description (without transitioning status!) and check …
- Very specific: line 71
Check CLI availability (command -v claude, command -v copilot).
- Very specific: line 88
Wait until both Branch 2A and Branch 2B return their structured planning outputs before entering Phase 3.
- Very specific: line 97
Run git status --porcelain and verify it matches baselineGitStatus identically.
- Very specific: line 99
Verify every [MODIFY] file path and every referenced .csproj actually exists on disk.
- Very specific: line 100
Verify any UI component change pairs .razor markup with a .razor.cs partial class.
- Very specific: line 101
Verify coreLogicSpec (Branch 2A) and testAndBoilerplateSpec (Branch 2B) file lists have zero intersection (2A ∩ 2B = ∅) so /code-gen-dag …
- Very specific: line 106
Every proposed async signature accepts CancellationToken.
- Very specific: line 114
If all 4 gates pass (Code 0), proceed to Phase 5.
- Very specific: line 129
If issues remain after maxSelfHealRetries attempts, stop iterating and highlight the unresolved architectural trade-offs in a dedicated > …
- Very specific: line 136
Write the verified plan to <artifactDir>/plan-<taskId>.md using write_file with ArtifactMetadata: { UserFacing: true, RequestFeedback: …
- Very specific: line 151
If --out <path> was explicitly provided, also write the Markdown file to <path>.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GeoAssets Tri-Planar Read-Only Planning Orchestrator (/plan-gen-dag)
Act as Google Antigravity in the ControlPlane-OuterLoop (Read-Only Planning) role defined in
.antigravity/workflows/plan-gen-dag.json
and .antigravity/workflows/plan-gen-dag.md.
Non-Negotiable Invariant — Zero Repository Changes: Never create, edit, stage, or delete files in the repository workspace, and never create branches, worktrees, or commits during
/plan-gen-dag(unless the user explicitly passes--out <path>for Phase 5 export). All inner-loop agents must run strictly with read-only permissions.
Reference Contracts (Read on Demand)
- Planning DAG Blueprint:
.antigravity/workflows/plan-gen-dag.json - Downstream Execution DAG:
.antigravity/workflows/code-gen-dag.json - Categorical & SOLID Synthesis Contracts:
../outer-loop-dag-orchestrator/SKILL.mdand../solid-code-synthesizer/SKILL.md - Claude Code Contract & Personas (Branch 2A):
CLAUDE.md,.claude/agents/arch-designer.md,.claude/agents/task-planner.md, and.claude/skills/*/SKILL.md - GitHub Copilot Contract & Persona (Branch 2B):
.github/copilot-instructions.mdand.claude/agents/test-agent.md - Static Guardrails:
Directory.Build.propsandBannedSymbols.txt
Invocation & Parameters
Expected invocation format:
/plan-gen-dag <taskId | description | Jira key> [--base origin/develop] [--retries 3] [--out <path>]taskId:- If a ticket key or slug is given (e.g.,
XD01-195-spatial-buffer-cacheorXD01-195), normalize to a valid slug (^[a-zA-Z0-9._-]+$) suitable for direct handoff to/code-gen-dag. - If only a free-form feature request is given, derive a concise
<kebab-slug>taskId.
- If a ticket key or slug is given (e.g.,
baseRef(default:origin/develop;main,origin/main,master,origin/masterare forbidden as target integration baselines).maxSelfHealRetries(default:3, range:1..5).--out <path>(optional):- By default, deliver the final plan strictly as an Antigravity Conversation Artifact in
<artifactDir>/plan-<taskId>.mdso the repository working tree stays untouched. - Only write a Markdown file to
<path>if--out <path>is explicitly passed.
- By default, deliver the final plan strictly as an Antigravity Conversation Artifact in
Execution Protocol
Execute the 5 read-only planning phases strictly in order.
Phase 1 — Read-Only Baseline Snapshot & Scope Grounding
- Capture Working-Tree Baseline:
- Run a read-only inspection from the repository root:
git status --porcelain && git rev-parse --short HEAD - Save
baselineGitStatusso Phase 3 and Phase 5 can prove zero workspace files were mutated.
- Run a read-only inspection from the repository root:
- Ground Requirements & Codebase Context:
- Read
CLAUDE.md,.github/copilot-instructions.md,BannedSymbols.txt, and relevant.claude/skills/<domain>/SKILL.mdfiles. - If
taskIdreferences a Jira key and Jira MCP tools are available, read the full issue description (without transitioning status!) and check both formalBlockslinks and prose"Depends on <KEY>"dependencies. - Locate real projects, interfaces, and existing test suites in
GeoAssets.slnto produce groundedarchitectureBrief(2A) andtestAndScaffoldingBrief(2B) inputs.
- Read
Phase 2 — Parallel Read-Only Specialist Dispatch (2A + 2B)
- Probe Inner-Loop Runtimes:
- Check CLI availability (
command -v claude,command -v copilot).
- Check CLI availability (
- Dispatch Branch 2A (
claude-code) and Branch 2B (github-copilot) in Parallel (Strictly Read-Only):- Branch 2A (
claude-code— Architecture & Domain Reasoning):- External CLI mode (if
claudeis installed): Run strictly read-only:claude -p "<architectureBrief>" --allowedTools "Read,Glob,Grep"(never grantEdit,Write, or mutatingBash). - Native Subagent fallback (if
claudeCLI is unavailable): Invoke the read-onlyresearchsubagent (ordefine_subagentwithEnableWriteTools: false) loaded withCLAUDE.md,.claude/agents/arch-designer.md,.claude/agents/task-planner.md, and relevant.claude/skills/*. - Required Outputs:
- Architectural & Onion-layer design (
core/isolation, provider/workflow ports & adapters, RFC 7946[lon, lat]SRID 4326 coordinate-array source-of-truth). System.TimeProvider,CancellationToken, and OpenTelemetryActivitySource/ UI token considerations.- Sequenced implementation tasks, risk/trade-off matrix, and proposed
coreLogicSpecfile list ([NEW]/[MODIFY]).
- Architectural & Onion-layer design (
- External CLI mode (if
- Branch 2B (
github-copilot— Contracts, Manifest & xUnit QA Matrix):- External CLI mode (if read-only non-mutating prompt flag is verified) or Native Subagent mode (
researchordefine_subagentwithEnableWriteTools: false) loaded with.github/copilot-instructions.mdand.claude/agents/test-agent.md. - Required Outputs:
- Concrete C# 14 / .NET 10 type & interface signatures (
readonly record struct,sealed record,JsonSerializerContext,ArgumentNullException.ThrowIfNull,TimeProvider,CancellationToken) as Markdown code blocks. - File-by-file touch manifest enforcing
.razor+.razor.cscode-behind separation and proposedtestAndBoilerplateSpecfile list ([NEW]/[MODIFY]). - Exhaustive xUnit
[Fact]/[Theory]test matrix (happy paths, guard clauses, boundary cases,FakeTimeProvider, cancellation) +DomainTestDataBuilders&NSubstitutemock design targeting 100% branch coverage.
- Concrete C# 14 / .NET 10 type & interface signatures (
- External CLI mode (if read-only non-mutating prompt flag is verified) or Native Subagent mode (
- Branch 2A (
- Join Barrier:
- Wait until both Branch
2Aand Branch2Breturn their structured planning outputs before entering Phase 3.
- Wait until both Branch
Phase 3 — Deterministic Plan Oracle Verification
Audit the combined 2A + 2B plan deterministically against four gates:
- Gate 0 — Zero-Mutation Check (
Code 2on failure):- Run
git status --porcelainand verify it matchesbaselineGitStatusidentically. If any file was modified or created, abort immediately and report the violation.
- Run
- Gate 1 — Path Existence & Disjoint File Ownership (
Code 10on failure):- Verify every
[MODIFY]file path and every referenced.csprojactually exists on disk. - Verify any UI component change pairs
.razormarkup with a.razor.cspartial class. - Verify
coreLogicSpec(Branch2A) andtestAndBoilerplateSpec(Branch2B) file lists have zero intersection (2A ∩ 2B = ∅) so/code-gen-dagcan execute them in parallel without write races.
- Verify every
- Gate 2 — Static Guardrail & Banned Symbol Audit (
Code 20on failure):- Audit every proposed C# signature and code snippet against
BannedSymbols.txtandDirectory.Build.props:- Zero
DateTime.Now/UtcNow/TodayorDateTimeOffset.Now/UtcNow(RS0030— must useTimeProvider/FakeTimeProvider). - Zero
.Result,.Wait(),.GetAwaiter().GetResult(),Thread.Sleep, or unguardedTask.Run(AsyncFixer). - Every proposed async signature accepts
CancellationToken. - Zero
#pragma warning disable,[SuppressMessage], or<NoWarn>.
- Zero
- Audit every proposed C# signature and code snippet against
- Gate 3 — Onion Architecture, SOLID & Branch Coverage Audit (
Code 30on failure):- Confirm zero
Npgsql,Microsoft.EntityFrameworkCore,GeoAssets.Provider.PostgreSQL, or raw PostGIS references are planned insidecore/projects. - Confirm proposed interfaces respect ISP role segregation (
<= 5cohesive methods per new port; splitI*Readervs.I*Writer), preserve LSP across providers/REST boundaries (ServiceOrderRepositoryContractTests/ bidirectional HTTP exception translation), and introduce zeroNotImplementedExceptionstubs. - Confirm geometry plans keep coordinate arrays as the serialized source of truth (RFC 7946
[lon, lat], SRID 4326) rather than NTS objects. - Confirm every proposed public method, branch, and guard clause in
2Ahas corresponding xUnit test cases in2B's test matrix.
- Confirm zero
If all 4 gates pass (Code 0), proceed to Phase 5. On Code 10, 20, or 30, enter Phase 4.
Phase 4 — Bounded Plan Self-Healing Loop
Track planHealAttempt from 1 up to maxSelfHealRetries (default 3):
Code 10(PathExistenceOrDisjointOwnershipViolation) → Route togithub-copilotplanner (read-only):- Fix hallucinated
[MODIFY]paths against real repo paths, add missing.razor.cspairs, and re-partition any overlapping file paths cleanly between2Aand2B, then re-run Phase 3.
- Fix hallucinated
Code 20(BannedSymbolOrSignatureViolation) → Route toclaude-codeplanner (read-only):- Replace banned clock/async APIs with
System.TimeProviderandCancellationToken-aware async signatures, sync updated contracts with2B, then re-run Phase 3.
- Replace banned clock/async APIs with
Code 30(OnionArchitectureOrCoverageGap) → Route toclaude-code&github-copilotplanners (read-only):- Introduce clean domain ports in
core/+ infrastructure adapters inproviders//workflow/, add missing xUnit branch test cases to the QA matrix, then re-run Phase 3.
- Introduce clean domain ports in
If issues remain after maxSelfHealRetries attempts, stop iterating and highlight the unresolved architectural trade-offs in a dedicated > [!WARNING] block inside the Phase 5 artifact for human decision.
Phase 5 — Conversation Artifact Synthesis & /code-gen-dag Handoff
- Create Interactive Conversation Artifact:
- Write the verified plan to
<artifactDir>/plan-<taskId>.mdusingwrite_filewithArtifactMetadata: { UserFacing: true, RequestFeedback: true, Summary: "..." }. - Structure the artifact with:
- Executive Summary & Dependencies (baseline commit SHA,
origin/developintegration target, JiraBlocks/"Depends on"check) - Architecture & Data Flow Diagram (
mermaidflowchart/sequence diagram showing Onion layers) - Shared C# 14 Type & Interface Contract (exact namespaces, records, interfaces,
TimeProvider&CancellationTokensignatures) - Disjoint Execution Manifest:
- Branch 2A —
claude-code(coreLogicSpec): Owned[NEW]/[MODIFY]production files + step-by-step domain logic rules - Branch 2B —
github-copilot(testAndBoilerplateSpec): Owned[NEW]/[MODIFY]DTO/builder/test files
- Branch 2A —
- Exhaustive xUnit Test &
DomainTestDataBuildersMatrix (table of test method names, inputs,FakeTimeProvidersetup, expected assertions) - Risks, Observability (
ActivitySource) & Rollback Notes - One-Command Execution Handoff:
/code-gen-dag <taskId> Implement verified plan from plan-<taskId>.md
- Executive Summary & Dependencies (baseline commit SHA,
- Write the verified plan to
- Optional Export (
--out <path>) & Final Clean-Repo Proof:- If
--out <path>was explicitly provided, also write the Markdown file to<path>. - Otherwise, run
git status --porcelainone final time to confirm zero files were modified in the repository, and point the user to the generated plan artifact for review.
- If
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

