Sync AGENTS.md files by extracting knowledge from completed work threads. Use after closing an epic or manually with doc-sync command.
This skill inherits all available tools. When active, it can use any tool Claude has access to.
Automatically sync AGENTS.md files by extracting knowledge from Amp threads linked in closed beads issues.
doc-sync/doc-syncsync docsupdate agents.md from threadsThread URLs must be saved in beads notes (via execution-workflow):
bd update <id> --notes "THREAD: <url>"bd update <id> --notes "COMPLETED: ... THREAD: <url>. Files changed: ..."bd list --status closed --json
Filter to relevant issues:
For each closed issue:
THREAD: https://ampcode.com/threads/T-xxxFallback if no threads in notes:
find_thread file:<changed-files-from-notes>
For each thread ID, use read_thread to extract:
read_thread(
threadID: "T-xxx",
goal: "Extract: API changes, patterns, gotchas, decisions, commands"
)
For each issue with extracted findings:
Priority:
skills/beads/AGENTS.md)For each target AGENTS.md:
git diff -- "**/AGENTS.md"
DOC-SYNC: <epic-or-scope>
THREADS FOUND: <count>
- T-xxx: <brief description>
- T-yyy: <brief description>
EXTRACTED:
- [commands] <new command discovered>
- [pattern] <new pattern established>
- [decision] <key decision made>
TARGETS:
- skills/beads/AGENTS.md → +2 commands, +1 pattern
- AGENTS.md → +1 architecture note
[Shows git diff]
REVIEW: Confirm changes? (y/n)
| Case | Handling |
|---|---|
| No threads in notes | Use find_thread file:<files> as fallback |
| AGENTS.md doesn't exist | Ask user if should create new file |
| Thread not accessible | Log warning, continue with remaining threads |
| Conflicting info between threads | Prefer most recent thread (by timestamp) |
| No changes to make | Report "No new documentation needed" |
User: doc-sync for the auth epic
Agent: [Finds closed issues under auth epic]
[Extracts 3 thread URLs from notes]
[Reads threads, finds 2 new patterns and 1 command]
[Updates skills/auth/AGENTS.md]
[Shows diff for review]
When closing an epic, agent automatically: