You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Author AGENTS.md for this repo. NOT a copy of pi-permissions' AGENTS.md — worktree management is exactly the operation pi-permissions warns against (do not reset/clean a worktree containing uncommitted developer work), so this plugin must be especially self-aware.
Sections
Plugin scope
One-paragraph description of what pi-worktree is and is not.
After every squash-merge, verify auto-close (allow ~60s for async)
Worktree safety (the unique-to-this-plugin section)
This plugin operates on worktrees, which means agent-driven workflows on this codebase cannot use the same agent A in main + agent B in worktree pattern naively — we'd be modifying the very mechanism we're testing.
Rules:
Do NOT use parallel worktrees of pi-worktree itself for development; use sequential dispatch on the main worktree
All worktree operations in tests must use a temp directory (tmp/test-repos/), never the actual dev worktree
The five footguns (branch-already-checked-out, dirty-remove, prune-before-delete, detached-HEAD, locked-leftover) are the same five contributors must avoid
Fail-closed semantics: persistence corruption → deny operations, never silently allow
Six-pass code review lenses
security, error_handling, type_safety, performance, architecture, simplicity. Mandatory for non-trivial PRs.
Forbidden patterns
TODO/FIXME/HACK/XXX in source
Bypass comments (biome-ignore, ts-ignore)
Dead code / speculative abstractions
ALL_CAPS.md scratch files
Documentation policy
200-PR test: will this be true in 200 PRs? Yes → document principle. No → code comment or skip.
Why
Without AGENTS.md, every agent session re-derives conventions and re-discovers traps. pi-permissions paid that cost; we don't have to.
Acceptance criteria
AGENTS.md exists at repo root
All sections above present
Worktree-safety section explicitly addresses the dev-on-the-plugin-being-developed paradox
What
Author AGENTS.md for this repo. NOT a copy of pi-permissions' AGENTS.md — worktree management is exactly the operation pi-permissions warns against (do not reset/clean a worktree containing uncommitted developer work), so this plugin must be especially self-aware.
Sections
Plugin scope
One-paragraph description of what pi-worktree is and is not.
Pre-push quality gates (non-negotiable)
Code style & conventions
Git workflow
Worktree safety (the unique-to-this-plugin section)
This plugin operates on worktrees, which means agent-driven workflows on this codebase cannot use the same agent A in main + agent B in worktree pattern naively — we'd be modifying the very mechanism we're testing.
Rules:
Six-pass code review lenses
security, error_handling, type_safety, performance, architecture, simplicity. Mandatory for non-trivial PRs.
Forbidden patterns
Documentation policy
200-PR test: will this be true in 200 PRs? Yes → document principle. No → code comment or skip.
Why
Without AGENTS.md, every agent session re-derives conventions and re-discovers traps. pi-permissions paid that cost; we don't have to.
Acceptance criteria
Out of scope