Provision Project
Overview
Copies curated Antigravity workflow templates into the current project's .agent/workflows/ directory. Templates are maintained in the global template library and synced via daily-maintenance.
When to Use
- •User says "provision this project", "set up workflows", "load workflows", "add workflows"
- •Starting work on a new project that has no
.agent/workflows/directory - •User asks "what workflows are available?"
Portable Paths
All steps use these variables — never hardcode user-specific paths:
$ANTIGRAVITY_HOME = Join-Path $HOME ".gemini/antigravity" $TEMPLATE_DIR = Join-Path $ANTIGRAVITY_HOME "skills/provision-project/templates"
[!IMPORTANT] Never hardcode user paths. Always derive from
$HOME. This ensures portability across machines.
How to Provision
Default: PowerShell (fast — ~1 second)
Run this single PowerShell command via run_command. It copies all templates, respects # LOCKED files, and prunes orphans:
$TEMPLATE_DIR = Join-Path $HOME ".gemini/antigravity/skills/provision-project/templates"
$DEST_DIR = Join-Path $PWD ".agent/workflows"
if (!(Test-Path $DEST_DIR)) { New-Item -ItemType Directory -Path $DEST_DIR -Force | Out-Null }
$added = 0; $refreshed = 0; $skipped = 0; $removed = 0
# Copy all templates, respecting LOCKED files
Get-ChildItem $TEMPLATE_DIR -Filter "*.md" | ForEach-Object {
$dest = Join-Path $DEST_DIR $_.Name
if (Test-Path $dest) {
$firstLine = Get-Content $dest -TotalCount 1
if ($firstLine -match '^# LOCKED') { $skipped++; return }
$refreshed++
} else { $added++ }
Copy-Item $_.FullName $dest -Force
}
# Remove orphaned workflows that no longer exist in templates
$templateNames = (Get-ChildItem $TEMPLATE_DIR -Filter "*.md").Name
Get-ChildItem $DEST_DIR -Filter "*.md" | Where-Object { $_.Name -notin $templateNames } | ForEach-Object {
$firstLine = Get-Content $_.FullName -TotalCount 1
if ($firstLine -notmatch '^# LOCKED') { Remove-Item $_.FullName -Force; $removed++ }
}
Write-Output "Provisioned: $added added, $refreshed refreshed, $skipped skipped (LOCKED), $removed removed"
# Seed .upstream-workflows.txt if missing (enables daily-maintenance orphan pruning)
$manifestPath = Join-Path $TEMPLATE_DIR ".upstream-workflows.txt"
if (!(Test-Path $manifestPath)) { $templateNames | Set-Content $manifestPath }
# Create .gemini/workflows junction for VS Code / Gemini Code Assist discovery
$geminiWf = Join-Path $PWD ".gemini/workflows"
if (!(Test-Path $geminiWf)) {
try {
$geminiDir = Join-Path $PWD ".gemini"
if (!(Test-Path $geminiDir)) { New-Item -ItemType Directory -Path $geminiDir -Force | Out-Null }
New-Item -ItemType Junction -Path $geminiWf -Target (Resolve-Path $DEST_DIR).Path -ErrorAction Stop | Out-Null
Write-Output "Created .gemini/workflows junction for VS Code discovery"
} catch {
Write-Output "⚠️ Junction creation failed: $($_.Exception.Message) — workflows still available via .agent/workflows"
}
}
[!TIP] Set
SafeToAutoRun: trueon this command — it only copies files within the project and is non-destructive.
Fallback: Internal File Tools (slow — for restricted environments)
If PowerShell is unavailable, use view_file + write_to_file to read each template and write it to .agent/workflows/:
- •List templates:
list_dirorfind_by_nameon$TEMPLATE_DIR - •Read each:
view_file(batch 10–15 in parallel) - •Write each:
write_to_filewithOverwrite: true(check first line for# LOCKEDbefore overwriting) - •Prune orphans: Delete any project workflow files that don't exist in the template library (respecting LOCKED files)
- •Seed manifest: Write
.upstream-workflows.txtin the template dir if it doesn't exist - •Report: How many added, refreshed, skipped, removed
Workflow Catalog
Available workflows (12): brainstorm, create, debug, deploy, enhance, execute-plan, orchestrate, plan, preview, status, test, ui-ux-pro-max
Key Rules
- •PowerShell first — use the PowerShell script by default for speed; fall back to
view_file/write_to_fileonly if shell is unavailable - •Never overwrite LOCKED files — if first line is
# LOCKED, skip it - •Always create
.agent/workflows/if missing —write_to_filehandles this automatically - •Prune orphans — remove project workflows that no longer exist in the template library (respecting LOCKED files)
- •Report changes — tell user what was added, refreshed, skipped, and removed
- •No hardcoded paths — all paths derive from
$HOME; portable across machines - •Idempotent — safe to run multiple times