Docs: Add subagent workflow documentation #6
@@ -78,12 +78,49 @@ When calling `delegate_task`, include this skill and structure:
|
||||
- Research/docs: `docs/issue-{N}-{short-title}`
|
||||
- Fixes/tools: `fix/issue-{N}-{short-title}`
|
||||
|
||||
## Branch Hygiene
|
||||
|
||||
**Prevention (critical):** Always create branches from `main` explicitly:
|
||||
```bash
|
||||
git checkout -b fix/issue-N-title main # CORRECT
|
||||
git checkout -b fix/issue-N-title # WRONG — uses current HEAD
|
||||
```
|
||||
|
||||
**Detection:** If a branch has unwanted commits from another branch:
|
||||
```bash
|
||||
# See commits not in main
|
||||
git log main..HEAD
|
||||
|
||||
# Check which branch a specific commit belongs to
|
||||
git branch --contains COMMIT_SHA
|
||||
```
|
||||
|
||||
**Fix:** Rebase onto correct base:
|
||||
```bash
|
||||
git rebase --onto main wrong-base-branch branch-to-fix
|
||||
git push --force-with-lease origin branch-to-fix
|
||||
```
|
||||
|
||||
## Known Pitfalls
|
||||
|
||||
1. **Subagent API tools unreliable** — curl from `terminal()` is the only reliable method
|
||||
2. **Large curl bodies blocked** — write to `/tmp/findings-{N}.md` first, then `curl -d @file`
|
||||
3. **JSON in curl body** — use `python3 -c "import sys,json; print(json.dumps({...}))"` or write to file
|
||||
4. **Branch contamination** — always specify `main` as base, never rely on current HEAD
|
||||
5. **git worktree** — use for true isolation per issue (optional):
|
||||
```bash
|
||||
git worktree add ../issue-N-workspace main
|
||||
```
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
# Symlink
|
||||
# Symlink (skill lives in repo for portability)
|
||||
ln -s ~/repositories/kugetsu/.hermes/skills/agent-workflows ~/.hermes/skills/agent-workflows
|
||||
|
||||
# Or copy
|
||||
cp -r ~/repositories/kugetsu/.hermes/skills/agent-workflows ~/.hermes/skills/
|
||||
# Others: clone repo, then symlink
|
||||
git clone https://git.example.com/user/repo.git
|
||||
ln -s repo/.hermes/skills/agent-workflows ~/.hermes/skills/
|
||||
```
|
||||
|
||||
**Note:** This skill is stored in the repo, NOT in `~/.hermes/skills/` directly. This ensures portability — anyone cloning the repo gets the skill automatically.
|
||||
|
||||
Reference in New Issue
Block a user