Skip to content
Merged
Show file tree
Hide file tree
Changes from 65 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
5d05261
Add multi-agent isolation strategy using git worktrees (#2)
don-petry Mar 28, 2026
284306e
feat: add weekly compliance audit workflow (#12)
don-petry Apr 5, 2026
5b2a1a5
chore: run compliance audit every Friday at noon UTC
Apr 5, 2026
6fbdca3
feat: add full CI pipeline for .github repo (#15)
don-petry Apr 5, 2026
d5f8975
feat: extend compliance audit with CI/automation health survey (#13)
don-petry Apr 6, 2026
5d1410b
chore(deps): Bump anthropics/claude-code-action from 1.0.83 to 1.0.89…
dependabot[bot] Apr 6, 2026
109d9ea
feat: split Claude workflow into interactive + issue automation jobs …
don-petry Apr 6, 2026
f21870a
feat: require GitHub Discussions on all repos (#53)
don-petry Apr 6, 2026
c669690
fix: grant claude-issue job tools to create PRs and check CI (#55)
don-petry Apr 6, 2026
0610f24
fix: add concurrency guard and comment tools to claude-issue job
Apr 6, 2026
14969aa
fix: add claude.yml template + checkout audit check (#63)
claude[bot] Apr 6, 2026
51ccfb8
fix: auto-create required labels during compliance audit (#67)
claude[bot] Apr 6, 2026
15f8110
feat: reusable Claude Code workflow with workflows write permission (…
don-petry Apr 6, 2026
65a05f8
Add Feature Ideation workflow as standard for BMAD-enabled repos (#81)
don-petry Apr 7, 2026
c31f252
fix: pass GH_PAT_WORKFLOWS to actions/checkout so git push uses workf…
don-petry Apr 7, 2026
45021c6
fix: encode compliance-fix learnings into standards and Claude prompt…
don-petry Apr 8, 2026
f2e1cf6
feat(workflows): centralize standards via reusable workflows (#87)
don-petry Apr 8, 2026
68266d3
feat(workflows): pin reusable callers to @v1 and document tier model …
don-petry Apr 8, 2026
84567e5
feat(security): add codeql.yml for SAST scanning (#100)
don-petry Apr 8, 2026
d7cf1ab
Replace per-repo CodeQL workflows with GitHub default setup (#103)
don-petry Apr 9, 2026
c4fdd94
Auto-respond to all PR review comments without @claude mention (#123)
don-petry Apr 10, 2026
39a6e4e
fix(ci): move Dependabot exclusion to job-level if in claude-code-reu…
don-petry Apr 16, 2026
a6da3a1
chore(deps): Bump anthropics/claude-code-action from 1.0.89 to 1.0.93…
dependabot[bot] Apr 16, 2026
7e40a70
feat(claude): trigger Claude to fix CI failures on PRs (#148)
don-petry Apr 17, 2026
08f588a
feat(feature-ideation): add curated reputable source list for Mary (#…
don-petry Apr 17, 2026
57daaa5
fix: correct reusable workflow path syntax (remove duplicate .github)…
don-petry Apr 21, 2026
34e0c48
fix(claude-ci-fix): resolve PR via API when check_run payload is empty
don-petry Apr 21, 2026
ccee1c9
docs: document OIDC immutability constraint and exempt claude.yml fro…
don-petry Apr 25, 2026
ba0b828
fix: restore double .github path in agent-shield and claude reusable …
don-petry May 3, 2026
3fd6950
fix: add dedup pre-flight to claude-issue to prevent duplicate PRs (#…
don-petry May 3, 2026
51ecfe0
feat: trigger Claude on CodeRabbit and Copilot review comments (#198)
don-petry May 6, 2026
420ad67
chore(deps): Bump anthropics/claude-code-action from 1.0.97 to 1.0.11…
dependabot[bot] May 7, 2026
6956bc7
chore(deps): Bump anthropics/claude-code-action from 1.0.115 to 1.0.1…
dependabot[bot] May 10, 2026
a7cacb1
chore: deprecate pr-review-agent — remove all traces
don-petry May 11, 2026
b20b86e
feat: make pr-review-mention an org standard (#237)
don-petry May 11, 2026
0579330
fix(claude): add copilot-pull-request-reviewer and gemini-code-assist…
don-petry May 11, 2026
ae60ed7
fix(feature-ideation): address Copilot + CodeRabbit review on PR #85 …
don-petry May 12, 2026
8569952
feat(claude): add claude-fix-review-comments job for bot review respo…
don-petry May 13, 2026
aed8983
feat(auto-rebase): add claude-rebase agentic fallback for merge confl…
don-petry May 14, 2026
c5479fc
chore(dev-lead): deprecate claude.yml in ci-standards, promote dev-le…
don-petry May 16, 2026
41b60a2
chore(deps): Bump actions/upload-artifact from 4.6.2 to 7.0.1 (#303)
dependabot[bot] May 17, 2026
6bfe91a
chore(deps): Bump anthropics/claude-code-action from 1.0.119 to 1.0.1…
dependabot[bot] May 17, 2026
be2f6ef
chore: remove claude-code-reusable.yml and update auto-rebase references
don-petry May 17, 2026
bad7b05
feat(workflows): add Initiatives project auto-add workflow (#388)
don-petry Jun 7, 2026
606479b
fix(dependabot-rebase): handle 404 from compare API — skip PR when br…
don-petry Jun 8, 2026
f17c497
fix(ci): downgrade pnpm/action-setup to v5 in dependency-audit reusab…
don-petry Jun 8, 2026
44d85e1
fix(ci): add gitleaks secret-scan job to satisfy compliance check (#219)
don-petry Jun 11, 2026
a80847b
chore: remove deprecated claude.yml from standards (#379)
don-petry Jun 11, 2026
5f64a9a
fix: enable delete_branch_on_merge on .github repo (#222)
don-petry Jun 11, 2026
9e11ebe
feat(claude-code-reusable): enable rebases in interactive job (#235)
don-petry Jun 11, 2026
111d6df
chore(deps): Bump actions/checkout from 6.0.2 to 6.0.3 (#459)
dependabot[bot] Jun 14, 2026
83f5db2
feat(add-to-project): reusable workflow + reconcile parity (#415) (#466)
don-petry Jun 15, 2026
6051e32
fix(ci): pin claude-code-reusable.yml ref to @v1 (#218)
don-petry Jun 15, 2026
053d655
chore(deps): Bump actions/checkout from 6.0.3 to 7.0.0 (#512)
dependabot[bot] Jun 21, 2026
03370a4
docs(ci-standards): feature-ideation backlog enhancement (backfill) +…
don-petry Jun 26, 2026
ddad000
feat: implement issue #509 — [Phase 3] Document the PR-limits standar…
don-petry Jul 2, 2026
141283d
feat(add-to-project): track all issues + retire Discussion drafts + C…
don-petry Jul 8, 2026
49c827f
feat(#613): relocate canary-rollout engine + bootstrap into .github (…
don-petry Jul 9, 2026
7c5cebf
docs(#631): de-duplicate versioning.md (.github-private is authoritat…
don-petry Jul 9, 2026
511a732
feat(#1008): onboard initiative-planner + idea-triage (organic-traffi…
don-petry Jul 10, 2026
d1e408a
feat(#1159): register ci-failure-analyst in canary-rings.json (PR-2) …
don-petry Jul 11, 2026
b62f726
feat(#515): register idea-enhancer in canary-rings.json (PR-B) (#660)
don-petry Jul 11, 2026
eacf6fb
feat(#614): register feature-ideation in canary-rings.json — fleet dr…
don-petry Jul 11, 2026
731b05b
chore(#665): decommission claude-code — retire reusable + drop from u…
don-petry Jul 11, 2026
1895c1c
feat: implement issue #772 — Compliance: ruleset-drift-code-quality-r…
donpetry-bot Jul 17, 2026
978993b
fix(bot): address bot feedback [skip ci-relay]
donpetry-bot Aug 3, 2026
3bb53c9
chore: dev-lead update (review-changes) [skip ci-relay]
donpetry-bot Aug 3, 2026
757e588
Merge branch 'main' into dev-lead/issue-772-20260717-1354
don-petry Aug 3, 2026
48e8fdd
chore: dev-lead update (review-changes) [skip ci-relay]
donpetry-bot Aug 3, 2026
793cd43
Merge branch 'main' into dev-lead/issue-772-20260717-1354
don-petry Aug 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
222 changes: 18 additions & 204 deletions .github/workflows/dependency-audit.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
# Dependency vulnerability audit.
# Detects ecosystems and runs appropriate audit tools (npm, pnpm, Go, Rust, Python).
# Standard: https://github.com/petry-projects/.github/blob/main/standards/dependabot-policy.md#vulnerability-audit-ci-check
# ─────────────────────────────────────────────────────────────────────────────
# SOURCE OF TRUTH: petry-projects/.github/standards/workflows/dependency-audit.yml
# Standard: petry-projects/.github/standards/ci-standards.md#7-dependency-audit-dependency-audityml
# Reusable: petry-projects/.github/.github/workflows/dependency-audit-reusable.yml
#
# Auto-detects ecosystems present in the repository and runs the appropriate
# audit tool. Fails the build if any dependency has a known security advisory.
# AGENTS — READ BEFORE EDITING:
# • This file is a THIN CALLER STUB. All ecosystem-detection and audit logic
# lives in the reusable workflow above.
# • You MUST NOT change: trigger events, the `uses:` line, or the job name
# `dependency-audit` — it composes the required status check
# `dependency-audit / Detect ecosystems` (codified in
# standards/rulesets/code-quality.json).
# • If you need different behaviour (new ecosystem, tool version bump),
# open a PR against the reusable in the central repo.
# ─────────────────────────────────────────────────────────────────────────────
#
# Add "dependency-audit" as a required status check in branch protection.
#
# Pinned tool versions (update deliberately):
# govulncheck v1.1.4 | cargo-audit 0.22.1 | pip-audit 2.9.0
# Dependency vulnerability audit — thin caller for the org-level reusable.
# Required status check: "dependency-audit / Detect ecosystems".
name: Dependency audit

on:
Expand All @@ -21,198 +28,5 @@ permissions:
contents: read

jobs:
detect:
name: Detect ecosystems
runs-on: ubuntu-latest
outputs:
npm: ${{ steps.check.outputs.npm }}
pnpm: ${{ steps.check.outputs.pnpm }}
gomod: ${{ steps.check.outputs.gomod }}
cargo: ${{ steps.check.outputs.cargo }}
pip: ${{ steps.check.outputs.pip }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4

- name: Detect package ecosystems
id: check
run: |
# npm — look for package-lock.json anywhere (excluding node_modules)
if find . -name 'package-lock.json' -not -path '*/node_modules/*' | grep -q .; then
echo "npm=true" >> "$GITHUB_OUTPUT"
else
echo "npm=false" >> "$GITHUB_OUTPUT"
fi

# pnpm — look for pnpm-lock.yaml anywhere
if find . -name 'pnpm-lock.yaml' -not -path '*/node_modules/*' | grep -q .; then
echo "pnpm=true" >> "$GITHUB_OUTPUT"
else
echo "pnpm=false" >> "$GITHUB_OUTPUT"
fi

# Go modules — detect via go.mod (not go.sum, which may not exist)
if find . -name 'go.mod' -not -path '*/vendor/*' | grep -q .; then
echo "gomod=true" >> "$GITHUB_OUTPUT"
else
echo "gomod=false" >> "$GITHUB_OUTPUT"
fi

# Cargo — detect via Cargo.toml anywhere (lockfile may not exist for libraries)
if find . -name 'Cargo.toml' -not -path '*/target/*' | grep -q .; then
echo "cargo=true" >> "$GITHUB_OUTPUT"
else
echo "cargo=false" >> "$GITHUB_OUTPUT"
fi

# Python — detect pyproject.toml or requirements.txt anywhere
if find . -name 'pyproject.toml' -not -path '*/.venv/*' -not -path '*/venv/*' | grep -q . || \
find . -name 'requirements.txt' -not -path '*/.venv/*' -not -path '*/venv/*' | grep -q .; then
echo "pip=true" >> "$GITHUB_OUTPUT"
else
echo "pip=false" >> "$GITHUB_OUTPUT"
fi

audit-npm:
name: npm audit
needs: detect
if: needs.detect.outputs.npm == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4

- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: "lts/*"

- name: Audit npm dependencies
run: |
# Audit each package-lock.json found in the repo
status=0
while IFS= read -r dir; do
echo "::group::npm audit $dir"
if ! (cd "$dir" && npm audit --audit-level=low); then
status=1
fi
echo "::endgroup::"
done < <(find . -name 'package-lock.json' -not -path '*/node_modules/*' -exec dirname {} \;)
exit $status

audit-pnpm:
name: pnpm audit
needs: detect
if: needs.detect.outputs.pnpm == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4

- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v4

- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: "lts/*"

- name: Audit pnpm dependencies
run: |
# Audit each pnpm-lock.yaml found in the repo
status=0
while IFS= read -r dir; do
echo "::group::pnpm audit $dir"
if ! (cd "$dir" && pnpm audit --audit-level low); then
status=1
fi
echo "::endgroup::"
done < <(find . -name 'pnpm-lock.yaml' -not -path '*/node_modules/*' -exec dirname {} \;)
exit $status

audit-go:
name: govulncheck
needs: detect
if: needs.detect.outputs.gomod == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4

- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v5
with:
go-version: "stable"

- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@v1.1.4 # NOSONAR(githubactions:S8545) pinned @vX.Y.Z is reproducible (verified via Go checksum DB); no --locked equivalent

- name: Audit Go dependencies
run: |
status=0
while IFS= read -r dir; do
echo "::group::govulncheck $dir"
if ! (cd "$dir" && govulncheck ./...); then
status=1
fi
echo "::endgroup::"
done < <(find . -name 'go.mod' -not -path '*/vendor/*' -exec dirname {} \;)
exit $status

audit-cargo:
name: cargo audit
needs: detect
if: needs.detect.outputs.cargo == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4

- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable

- name: Install cargo-audit
run: cargo install cargo-audit@0.22.1 --locked

- name: Audit Cargo dependencies
run: |
# cargo audit operates on Cargo.lock at workspace root
# For workspaces, a single audit at root covers all crates
status=0
while IFS= read -r dir; do
echo "::group::cargo audit $dir"
if ! (cd "$dir" && cargo generate-lockfile 2>/dev/null; cargo audit); then
status=1
fi
echo "::endgroup::"
done < <(find . -name 'Cargo.toml' -not -path '*/target/*' -exec dirname {} \; | sort -u)
exit $status

audit-pip:
name: pip-audit
needs: detect
if: needs.detect.outputs.pip == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4

- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.x"

- name: Install pip-audit
run: 'pip install --require-hashes --only-binary :all: -r scripts/pip-audit-requirements.txt'

- name: Audit Python dependencies
run: |
status=0
# Audit each Python project found in the repo
while IFS= read -r dir; do
echo "::group::pip-audit $dir"
if [ -f "$dir/pyproject.toml" ]; then
if ! pip-audit "$dir"; then
status=1
fi
elif [ -f "$dir/requirements.txt" ]; then
if ! pip-audit -r "$dir/requirements.txt"; then
status=1
fi
fi
echo "::endgroup::"
done < <(
{
find . -name 'pyproject.toml' -not -path '*/.venv/*' -not -path '*/venv/*' -exec dirname {} \;
find . -name 'requirements.txt' -not -path '*/.venv/*' -not -path '*/venv/*' -exec dirname {} \;
} | sort -u
)
exit $status
dependency-audit:
uses: ./.github/workflows/dependency-audit-reusable.yml # local ref — always current (ring0 dogfood, #541)
141 changes: 141 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,33 @@
> treat these as intentional exemptions. To change the cap or the exempt list,
> follow the runbook in [`standards/pr-limits.md`](https://github.com/petry-projects/.github/blob/main/standards/pr-limits.md).

#### Pull Request Limits (automation open-PR cap)

Check failure on line 625 in AGENTS.md

View workflow job for this annotation

GitHub Actions / Lint

Multiple headings with the same content

AGENTS.md:625 MD024/no-duplicate-heading Multiple headings with the same content [Context: "Pull Request Limits (automatio..."] https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md024.md

The org enforces a **soft ceiling on concurrent open, non-draft automation PRs
org-wide** so automation cannot outrun merge throughput and inflate the
auto-rebase fan-out. Full standard, rationale, and operator runbook:
[`standards/pr-limits.md`](https://github.com/petry-projects/.github/blob/main/standards/pr-limits.md).

- **GitHub has no native "max open PRs" surface** (no repo setting, org setting,
or ruleset rule — verified in the [ADR](https://github.com/petry-projects/.github/blob/main/docs/initiatives/pull-request-limits-adr.md)),
so this is enforced **source-side** by [`scripts/lib/pr-limit-gate.sh`](https://github.com/petry-projects/.github/blob/main/scripts/lib/pr-limit-gate.sh):
a PR-creating workflow asks the gate before opening a PR and **defers** (never
fails or closes) when the queue is at the cap. Live-path wiring is Story 3 (#508).
- **The configured value lives only in [`standards/pr-limits.json`](https://github.com/petry-projects/.github/blob/main/standards/pr-limits.json)** —
the single source of truth. Read it with `jq`; never hardcode or restate it.

> **Exempt actors are sanctioned policy, not drift.** `dependabot[bot]`,
> `OrganizationAdmin`, `@petry-projects/org-leads`, the `dependabot-automerge-petry`
> app, and `security`-labeled PRs are on the cap's exempt list — never blocked
> and never counted. This mirrors the ruleset bypass-actor allowance (see
> [Ruleset remediation](https://github.com/petry-projects/.github/blob/main/standards/ruleset-remediation-runbook.md)):
> `dependabot[bot]` is already bounded by its own per-ecosystem
> `open-pull-requests-limit` (so counting it here would double-cap and could
> starve a security PR), the human/admin actors are break-glass and maintainer
> traffic, and the app only operates on existing PRs. A compliance audit should
> treat these as intentional exemptions. To change the cap or the exempt list,
> follow the runbook in [`standards/pr-limits.md`](https://github.com/petry-projects/.github/blob/main/standards/pr-limits.md).

---

## Multi-Agent Isolation — Git Worktrees
Expand Down Expand Up @@ -1087,6 +1114,120 @@

---

## Multi-Agent Isolation — Git Worktrees

Check failure on line 1117 in AGENTS.md

View workflow job for this annotation

GitHub Actions / Lint

Multiple headings with the same content

AGENTS.md:1117 MD024/no-duplicate-heading Multiple headings with the same content [Context: "Multi-Agent Isolation — Git Wo..."] https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md024.md

When multiple agents work on the same repository concurrently, they MUST use **isolated workspaces** to prevent conflicts. Git worktrees are the industry-standard isolation primitive — used by Claude Code, Cursor, Windsurf, Augment Intent, and dmux. Cloud agents (OpenAI Codex, GitHub Copilot, Devin) use containers or ephemeral environments that provide equivalent isolation.

Check failure on line 1119 in AGENTS.md

View workflow job for this annotation

GitHub Actions / Lint

Line length

AGENTS.md:1119:201 MD013/line-length Line length [Expected: 200; Actual: 376] https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md013.md

Never have two agents working in the same working directory simultaneously.

### Rules

1. **One workspace per agent.** Every agent performing code changes MUST operate in its own isolated workspace (git worktree, container, or ephemeral environment). This applies to Claude Code (`isolation: "worktree"` or `--worktree`), Cursor parallel agents, GitHub Copilot coding agent, OpenAI Codex, and any other AI agent tool.

Check failure on line 1125 in AGENTS.md

View workflow job for this annotation

GitHub Actions / Lint

Line length

AGENTS.md:1125:201 MD013/line-length Line length [Expected: 200; Actual: 330] https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md013.md
2. **One agent per story/task.** Each workspace maps to exactly one BMAD story, feature, or bug fix. Do not assign the same story to multiple agents.
3. **No overlapping file ownership.** Two agents MUST NOT modify the same file concurrently. If stories touch shared files (e.g., a shared type definition, config, or lockfile), serialize those stories — do not run them in parallel. This is the single most important rule for multi-agent work.

Check failure on line 1127 in AGENTS.md

View workflow job for this annotation

GitHub Actions / Lint

Line length

AGENTS.md:1127:201 MD013/line-length Line length [Expected: 200; Actual: 293] https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md013.md
4. **Branch from the default branch.** Workspaces MUST branch from the repository's configured default branch (for example, `origin/main`). You MAY use `origin/HEAD` as a shortcut when it is correctly configured, but MUST NOT rely on it being present. Never branch from another agent's branch.

Check failure on line 1128 in AGENTS.md

View workflow job for this annotation

GitHub Actions / Lint

Line length

AGENTS.md:1128:201 MD013/line-length Line length [Expected: 200; Actual: 293] https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md013.md
5. **One PR per workspace.** Each workspace produces exactly one pull request. Do not combine unrelated changes.
6. **3–5 parallel agents max.** Coordination overhead increases non-linearly. Limit concurrent agents to 3–5 per repository.

### Detecting File Overlap

Before launching parallel agents, verify that stories won't modify the same files:

1. Review each story's acceptance criteria and implementation scope for shared files
2. Use `git log --stat` on recent similar changes to identify likely touched files
3. If any overlap is detected or uncertain, serialize the stories — do not run them in parallel

### Worktree Naming Convention

Use descriptive worktree names that identify the scope. For tools that auto-generate branch names from your input (see table below), the name you choose flows into the branch name automatically.

| Tool | You provide | Branch created |
|------|------------|----------------|
| Claude Code (`--worktree <name>`) | `S-3.1-hive-health-card` | `worktree-S-3.1-hive-health-card` |
| Claude Code subagent (`isolation: "worktree"`) | Agent `name` field | `worktree-<name>` |
| GitHub Copilot coding agent | Task description | `copilot/<descriptive-name>` (auto) |
| Cursor parallel agents | Prompt | `feat-N-<random>` (auto) |
| Manual worktree | Full branch name | Whatever you specify |

**Name format:** `<story-or-task-id>-<short-description>`

Examples: `S-3.1-hive-health-card`, `fix-auth-token-expiry`, `S-2.4-offline-sync-banner`

### Tool-Specific Setup

**Claude Code subagents** — set `isolation: "worktree"` in the agent definition:

```yaml
---
name: S-3.1-hive-health-card
isolation: "worktree"
---
```

**Claude Code CLI sessions** — start in a named worktree:

```bash
claude --worktree S-3.1-hive-health-card
```

**GitHub Copilot coding agent** — assign a task via GitHub Issues or the Copilot panel. Copilot creates its own branch (`copilot/...`) and ephemeral environment automatically.

**OpenAI Codex** — use worktree mode in the Codex app, or assign tasks to the cloud agent which runs in isolated containers.

**Manual worktree** (for tools without built-in support):

```bash
git worktree add .worktrees/<name> -b agent/<story-id>-<description>
cd .worktrees/<name>
# run agent session here
```

### Environment & Dependencies

- Git worktrees are fresh checkouts — gitignored files (`.env`, `.env.local`) are NOT copied automatically.
- For Claude Code: add a **`.worktreeinclude`** file at the repo root listing gitignored files that should be copied into new worktrees:

```text
.env
.env.local
```

- After entering a worktree, **install dependencies** (`npm install`, `go mod download`, etc.) before starting work.

### Cleanup

- If the worktree has **no changes**, it is automatically removed when the agent session ends (Claude Code, Cursor).
- If the worktree has **uncommitted changes**, the agent MUST commit or discard before exiting. Do not leave dirty worktrees.
- After a PR is merged, remove the worktree and its branch:

```bash
git worktree remove <worktree-path>
git branch -d <branch-name> # safe delete; may fail after squash/rebase merges
# If the above fails and you've confirmed the PR is merged:
git branch -D <branch-name>
```

### Repository Configuration

Add worktree directories to the project's `.gitignore`:

```gitignore
# Agent worktrees
.claude/worktrees/
.worktrees/
```

### Coordination Checklist (for humans orchestrating multiple agents)

Before launching parallel agents, verify:
- [ ] Each agent has a distinct story/task assignment

Check failure on line 1223 in AGENTS.md

View workflow job for this annotation

GitHub Actions / Lint

Lists should be surrounded by blank lines

AGENTS.md:1223 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "- [ ] Each agent has a distinc..."] https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md032.md
- [ ] No two agents will modify the same files
- [ ] Shared dependencies (lockfiles, generated types) are up to date on the default branch before agents start
- [ ] If stories share a dependency file, run them sequentially, not in parallel
- [ ] No more than 3–5 agents are running concurrently on the same repository

---

## Agent Operation Guidance

- Prefer interactive or dev commands when iterating; avoid running production-only commands from an agent session.
Expand Down
Loading
Loading