code-gen-dag
Skill2 starsChanged 18 days agoMITView on GitHub
Orchestrate GeoAssets' 5-phase Tri-Planar Outer-Loop code generation and verification DAG over Claude Code (deep reasoning/core domain) and GitHub Copilot (mechanical scaffolding/xUnit QA) inside an isolated Git worktree. Activate when the user invokes /code-gen-dag or asks Antigravity to orchestrate a task across Claude Code and GitHub Copilot.
- Commits and pushes
In this repository12 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- outer-loop-dag-orchestratorSkill
- plan-gen-dagSkill
- 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
16 rules. About 0 are common, 2 are distinctive, and 14 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
If the user only supplies a prose description or bare Jira key (e.g., XD01-195), derive a normalized <TICKET-KEY>-<kebab-slug> taskId.
- Very specific: line 45
When omitted, stop after Phase 5 verification and leave changes in ../worktrees/<taskId> ready for user review with proposed commit/PR …
- Very specific: line 46
When --ship is explicitly passed, stage, commit (ending with (<TICKET-KEY>)), push, and open a PR targeting develop (never main) only if …
- Very specific: line 57
Read CLAUDE.md and .github/copilot-instructions.md, plus any relevant .claude/skills/<domain>/SKILL.md (csharp-conventions, …
- Very specific: line 58
If taskId references a Jira issue and Jira MCP tools are available, fetch the full issue description and verify both formal Blocks links …
- Distinctive: line 65
Run from the repository root:
- Very specific: line 76
Check CLI availability once (command -v claude, command -v copilot).
- Very specific: line 91
Wait until both Branch 2A and Branch 2B complete before entering Phase 3.
- Very specific: line 97
Run the fast SOLID & Disjoint-Scope Pre-Flight Oracle (< 1s) first to confirm monoidal scope disjointness (2A ∩ 2B = ∅), .razor.cs …
- Very specific: line 101
If verify-solid-contracts.py returns Exit 10, 20, or 30, route directly to Phase 4 before paying full MSBuild compilation cost.
- Distinctive: line 102
Run the 3-stage Oracle gatekeeper from the repository root:
- Very specific: line 118
Run dotnet format style GeoAssets.sln inside ../worktrees/<taskId> without altering domain logic, then return to Phase 3.
- Very specific: line 125
Hard Escalation Rule: If Phase 3 still fails after maxSelfHealRetries attempts, halt immediately, keep ../worktrees/<taskId> intact …
- Very specific: line 138
If a mechanical rebase conflict occurs, route conflict resolution to claude-code with full worktree context.
- Very specific: line 143
Default Mode (No
--ship): Do not commit or push. Report: - Very specific: line 149
--shipMode: Commit using repo conventions ending with (<TICKET-KEY>), push branch (git push -u origin <branch>), and open a PR targeting …
≈ “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 Outer-Loop Orchestrator (/code-gen-dag)
Act as Google Antigravity in the ControlPlane-OuterLoop role defined in
.antigravity/workflows/code-gen-dag.json
and .antigravity/workflows/code-gen-dag.md.
Reference Contracts (Read on Demand)
- DAG Blueprint:
.antigravity/workflows/code-gen-dag.json - Categorical & SOLID DAG Formalism:
../outer-loop-dag-orchestrator/SKILL.mdand../solid-code-synthesizer/SKILL.md - Sandbox Manager:
scripts/agent-sandbox.sh - SOLID & Disjoint-Scope Pre-Flight Oracle:
scripts/verify-solid-contracts.py - Deterministic Oracle:
scripts/verify-agent-worktree.sh - Claude Code Contract (Branch 2A):
CLAUDE.mdand.claude/skills/*/SKILL.md - GitHub Copilot Contract (Branch 2B):
.github/copilot-instructions.md - Static Guardrails:
Directory.Build.propsandBannedSymbols.txt
Invocation & Parameters
Expected invocation format:
/code-gen-dag <taskId> [description | Jira key] [--base origin/develop] [--retries 3] [--ship]taskId(required, regex^[a-zA-Z0-9._-]+$):- Examples:
XD01-195-spatial-buffer-cache,xd01-204-wfs-bbox-filter. - If the user only supplies a prose description or bare Jira key (e.g.,
XD01-195), derive a normalized<TICKET-KEY>-<kebab-slug>taskId. - Hard-reject
main,master,develop, ororigin/*as ataskId.
- Examples:
baseRef(default:origin/develop):- Non-negotiable branch policy:
main,origin/main,master, andorigin/masterare strictly forbidden at every phase.
- Non-negotiable branch policy:
maxSelfHealRetries(default:3, range:1..5).--ship(optional flag, default:false):- When omitted, stop after Phase 5 verification and leave changes in
../worktrees/<taskId>ready for user review with proposed commit/PR metadata. - When
--shipis explicitly passed, stage, commit (ending with(<TICKET-KEY>)), push, and open a PR targetingdevelop(nevermain) only if 100% of build and test gates pass.
- When omitted, stop after Phase 5 verification and leave changes in
Execution Protocol
Execute the 5 DAG phases strictly in order. Do not skip gates or suppress diagnostics.
Phase 1 — Task Decomposition & Worktree Initialization
- Validate Dependencies & Context:
- Read
CLAUDE.mdand.github/copilot-instructions.md, plus any relevant.claude/skills/<domain>/SKILL.md(csharp-conventions,observability-conventions,jira-conventions,ui-ux-pro-max). - If
taskIdreferences a Jira issue and Jira MCP tools are available, fetch the full issue description and verify both formalBlockslinks and prose"Depends on <KEY>"dependencies before proceeding. - Inspect target files in the repository so interfaces and existing conventions are grounded in real code.
- Read
- Decompose with Disjoint File Ownership:
- Because Branch
2Aand Branch2Bexecute concurrently inside the same worktree (../worktrees/<taskId>), define an explicit Shared Type/Interface Contract upfront (exact namespaces, record/class names, method signatures, andCancellationToken/TimeProviderparameters) and assign strictly disjoint file paths:coreLogicSpec(Branch 2A —claude-code): Core domain models, invariants, spatial/topology algorithms, workflow/provider logic, and architectural wiring.testAndBoilerplateSpec(Branch 2B —github-copilot): DTOs/mappers (if disjoint),DomainTestDataBuilders,NSubstitute/Moqtest doubles,FakeTimeProviderfixtures, and exhaustive xUnit[Fact]/[Theory]suites targeting 100% branch coverage.
- Because Branch
- Provision Isolated Worktree:
- Run from the repository root:
./scripts/agent-sandbox.sh create <taskId> <baseRef> - Note:
../worktrees/<taskId>sits outside the repository root directory. Attempt standard execution first; if blocked by workspace path sandboxing, retry that command outside the sandbox. Abort immediately on non-zero exit.
- Run from the repository root:
Phase 2 — Parallel Inner-Loop Dispatch (2A + 2B)
- Probe Inner-Loop Runtimes:
- Check CLI availability once (
command -v claude,command -v copilot).
- Check CLI availability once (
- Dispatch Branch 2A (
claude-code) and Branch 2B (github-copilot) in Parallel inside../worktrees/<taskId>:- Branch 2A (
claude-code— Deep Reasoning):- External CLI mode (if
claudeis installed and authenticated): Run headlessly in../worktrees/<taskId>(e.g.,claude -p "<coreLogicSpec + Shared Contract + disjoint file ownership>" --allowedTools "Read,Edit,Write,Glob,Grep,Bash"). - Native Subagent fallback (if
claudeCLI is unavailable): Usedefine_subagent(EnableWriteTools: true) andinvoke_subagentto launch aclaude-code-specialistsubagent bound toCLAUDE.mdand.claude/skills/*, restricted strictly to../worktrees/<taskId>and2A's owned files.
- External CLI mode (if
- Branch 2B (
github-copilot— Mechanical & QA):- External CLI mode (if standalone agentic
copilotCLI is installed and authenticated): Run headlessly in../worktrees/<taskId>with<testAndBoilerplateSpec + Shared Contract + disjoint file ownership>. - Native Subagent fallback (if agentic
copilotCLI is unavailable): Usedefine_subagent(EnableWriteTools: true) andinvoke_subagentto launch agithub-copilot-workersubagent bound to.github/copilot-instructions.md, restricted strictly to../worktrees/<taskId>and2B's owned files.
- External CLI mode (if standalone agentic
- Branch 2A (
- Mandatory Guardrails & ISP Context Projection Injected into Both Branches:
- ISP Minimal Context Projection ($\pi_k$): Strip unrelated global repository state; pass each branch only the frozen Shared Type/Interface Contract, its strictly assigned target files, and direct upstream port definitions.
- Inject
System.TimeProvider(FakeTimeProviderin tests); never callDateTime.Now/UtcNoworDateTimeOffset.Now/UtcNow(RS0030/BannedSymbols.txt). - Preserve strict Onion Architecture & SOLID invariants: zero
Npgsql,Microsoft.EntityFrameworkCore, or PostGIS references insidecore/projects; zeroNotImplementedExceptionproduction stubs; segregate new role ports (<= 5methods). - Propagate
CancellationTokenacross async methods; zero.Result,.Wait(),.GetAwaiter().GetResult(), orThread.Sleep. - Zero
#pragma warning disable,[SuppressMessage], or<NoWarn>.
- Join Barrier:
- Wait until both Branch
2Aand Branch2Bcomplete before entering Phase 3.
- Wait until both Branch
Phase 3 — Deterministic Oracle Verification
- Run the fast SOLID & Disjoint-Scope Pre-Flight Oracle (< 1s) first to confirm monoidal scope disjointness (
2A ∩ 2B = ∅),.razor.cscode-behind pairing, and C# 14 SOLID/guardrail invariants:
Ifpython3 scripts/verify-solid-contracts.py --target ../worktrees/<taskId> --base origin/develop --scope-a "<2A-paths>" --scope-b "<2B-paths>"verify-solid-contracts.pyreturnsExit 10,20, or30, route directly to Phase 4 before paying full MSBuild compilation cost. - Run the 3-stage Oracle gatekeeper from the repository root:
./scripts/verify-agent-worktree.sh ../worktrees/<taskId> - Map the exit code strictly:
Exit 0: Oracle passed (dotnet format style --verify-no-changes,dotnet build --no-incremental /warnaserror, andNetArchTestarchitecture invariants). Also execute the touched xUnit test project(s) in../worktrees/<taskId>(dotnet test <test-csproj> --no-build --nologo) to verify2B's newly generated unit tests pass. If any unit test fails, treat asExit 30. Otherwise advance to Phase 5.Exit 2: Fatal environment or protected-branch violation. Abort immediately and surface the error.Exit 10/Exit 20/Exit 30: Enter Phase 4.
Phase 4 — Bounded Self-Healing Feedback Loop
Track healAttempt starting at 1 up to maxSelfHealRetries (default 3). Before each retry iteration, capture a local tree snapshot (git -C ../worktrees/<taskId> stash create) so non-convergent edits can be rewound cleanly ($f^{op}$ dual rollback) instead of compounding regressions:
Exit 10(FormattingDrift) → Route togithub-copilot:- Run
dotnet format style GeoAssets.slninside../worktrees/<taskId>without altering domain logic, then return to Phase 3.
- Run
Exit 20(CompilerOrAnalyzerViolation) → Route toclaude-code:- Feed the targeted Roslyn /
AsyncFixer/Meziantou.Analyzer/BannedApiAnalyzersdiagnostics emitted byverify-agent-worktree.shtoclaude-code(or coordinate signature mismatches across2A/2B). - Fix every diagnostic in source without
#pragma warning disable,[SuppressMessage], or<NoWarn>, then return to Phase 3.
- Feed the targeted Roslyn /
Exit 30(ArchitectureOrInvariantFailure/ xUnit Test Failure) → Route toclaude-code:- Feed the failed assertion / stack trace summary to
claude-codeto repair layer coupling or domain defects (and update test setup viagithub-copilotonly if the test expectation itself contradicted the spec), then return to Phase 3.
- Feed the failed assertion / stack trace summary to
Hard Escalation Rule: If Phase 3 still fails after maxSelfHealRetries attempts, halt immediately, keep ../worktrees/<taskId> intact (preserveWorktree: true), and report the exact remaining diagnostics to the user.
Phase 5 — Rebase, Post-Rebase Verification & Merge Preparation
Execute only after Phase 3 achieves Exit 0:
- Rebase onto
origin/develop:- Inside
../worktrees/<taskId>, run:git fetch origin develop && git rebase origin/develop - If a mechanical rebase conflict occurs, route conflict resolution to
claude-codewith full worktree context. If a semantic conflict is detected, rungit rebase --abortand escalate to the user.
- Inside
- Post-Rebase Re-Verification (Never Trust Pre-Rebase Green):
- Re-run
./scripts/verify-agent-worktree.sh ../worktrees/<taskId>(must returnExit 0) and rundotnet test GeoAssets.sln --no-build --nologoinside../worktrees/<taskId>. Any test failure here is a hard stop.
- Re-run
- Prepare Merge Artifact (or Ship if
--ship):- Inspect
git statusandgit diff --statinside../worktrees/<taskId>. - Default Mode (No
--ship): Do not commit or push. Report:- Worktree path (
../worktrees/<taskId>) & branch name - Files modified by Branch
2A(claude-code) vs. Branch2B(github-copilot) - Oracle & test suite verification status + number of self-healing iterations used
- Ready-to-use commit message (
<type>(<scope>): <summary> (<TICKET-KEY>)) and PR title (<TICKET-KEY>: <summary>targetingdevelop) - Cleanup command for after merge:
./scripts/agent-sandbox.sh destroy <taskId>
- Worktree path (
--shipMode: Commit using repo conventions ending with(<TICKET-KEY>), push branch (git push -u origin <branch>), and open a PR targetingdevelop(nevermain) viagh pr create. Remind the user to run./scripts/agent-sandbox.sh destroy <taskId>once the PR is merged intodevelop.
- Inspect
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.

