-
Notifications
You must be signed in to change notification settings - Fork 11
t1023: Reduce AGENTS.md instruction count from 67 to <50 #1331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a9c0ff0
bc2280a
759be50
f950d40
2763801
01c5eb1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -658,6 +658,38 @@ git remote prune origin | |
| | Unmerged + stale (>30 days) | Ask user about status | | ||
| | Unmerged + active | Keep | | ||
|
|
||
| ### Worktree Ownership | ||
|
|
||
| **CRITICAL**: NEVER remove a worktree unless you meet ALL of these conditions: | ||
|
|
||
| 1. **You created it in this session**, OR | ||
| 2. **It belongs to a task in your active batch** AND the task is deployed/complete, OR | ||
| 3. **The user explicitly asks** | ||
|
|
||
| **Why this matters**: Worktrees may belong to parallel sessions. Removing them destroys another agent's working directory mid-work. | ||
|
|
||
| **Safe cleanup workflow**: | ||
|
|
||
| ```bash | ||
| # 1. Check ownership registry | ||
| worktree-helper.sh registry list | ||
|
|
||
| # 2. Only remove worktrees you personally merged | ||
| # The registry tracks which PID owns each worktree | ||
|
|
||
| # 3. Use helper commands (they enforce ownership checks) | ||
| worktree-helper.sh remove feature/my-feature # Refuses if owned by another live process | ||
| worktree-helper.sh clean # Only removes worktrees you own | ||
| ``` | ||
|
|
||
| **What NOT to do**: | ||
|
|
||
| - NEVER assume unrecognized worktrees are safe to remove | ||
| - NEVER use `git worktree remove` directly (bypasses ownership checks) | ||
| - NEVER remove worktrees for tasks you didn't personally merge | ||
|
|
||
| **Ownership registry**: `worktree-helper.sh registry list` shows which PID owns each worktree. The `remove` and `clean` commands automatically refuse to touch worktrees owned by other live processes. | ||
|
Comment on lines
+661
to
+691
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Search for potential duplicates of Worktree Ownership guidance across .agents/
echo "=== Searching for Worktree Ownership related patterns ==="
rg -n --glob '.agents/**/*.md' "Worktree Ownership|ownership registry|worktree-helper\.sh (remove|clean|registry list)"
echo ""
echo "=== Broader search for worktree cleanup guidance ==="
rg -n --glob '.agents/**/*.md' -i "worktree.*clean|worktree.*remov|git worktree" | head -30Repository: marcusquinn/aidevops Length of output: 4727 Consolidate Worktree Ownership guidance—it already exists in The rg scan confirms duplication: worktree ownership, registry patterns, and safe cleanup workflows are already comprehensively documented in
Ensure the final structure avoids split ownership guidance across files. 🤖 Prompt for AI Agents |
||
|
|
||
| ## User Experience Levels | ||
|
|
||
| These workflows support all skill levels: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify helper script path to avoid PATH-dependent failures.
Earlier examples use the full
~/.aidevops/agents/scripts/...path, but this block assumesworktree-helper.shis on PATH. Please align with the canonical path or explicitly state it must be on PATH to prevent confusion in safety-critical cleanup steps.🔧 Suggested doc tweak
🤖 Prompt for AI Agents