feat: agents stop committing task files — coordinator owns task status on main
Agents no longer commit task files (tasks/*.md) to their feature branches. This eliminates the highest-frequency merge conflict category (parallel agents committing metadata to the same file set). The coordinator updates task status on main after merging source code changes. Implementation specialist changes: - Removed 'Update Task' workflow step (status/summary updates) - Completion summary now included in worktree notify message - Simplified Safe Exit (no task file commit step) - Added 'do not commit task files' instruction to commit step Coordinator changes: - Added Task File Handling section with coordinator ownership model - Updated spawn prompt template to include task file convention - Added post-merge task status update step
This commit is contained in:
@@ -134,8 +134,9 @@ Your task: {{task}}
|
||||
3. Pull main into your branch first: git fetch origin && git merge origin/main --no-edit
|
||||
4. Implement the changes, following all acceptance criteria.
|
||||
5. Run npm run build, npm run lint, npm test. Fix any failures.
|
||||
6. Commit your changes.
|
||||
7. Notify: worktree({action: "notify", args: {message: "Task completed: {{task}}", level: "info"}})
|
||||
6. Commit ONLY source code — do not commit task files (tasks/*.md). The coordinator manages task status on main.
|
||||
7. Push: git push origin $(git branch --show-current)
|
||||
8. Notify: worktree({action: "notify", args: {message: "Task completed: {{task}}. <brief summary>", level: "info"}})
|
||||
|
||||
Key project constraints:
|
||||
- [project-specific constraints from AGENTS.md or README]
|
||||
@@ -229,12 +230,26 @@ Only spawn a review task as an agent if the review requires extensive manual ins
|
||||
|
||||
## Task File Handling
|
||||
|
||||
Task files (`tasks/*.md`) live in the repository. Agents may commit their task file with status updates and notes. This can cause merge conflicts when multiple agents commit task files in parallel.
|
||||
Task files (`tasks/*.md`) are coordination state. They live in the repo for discoverability and historical record, but **agents do not commit them** — only the coordinator updates task files on main.
|
||||
|
||||
Handling strategies:
|
||||
- Before merging, if `git merge` complains about untracked task files conflicting, temporarily remove the local `tasks/` directory, merge, then restore from backup
|
||||
- When resolving task file conflicts, prefer the incoming (feature branch) version — it has the agent's status update
|
||||
- The `tasks/` directory is coordination state — it's expected to be messy during active coordination
|
||||
### Why Agents Don't Commit Task Files
|
||||
|
||||
When multiple agents commit task files in parallel branches, merging causes conflicts on files that are essentially metadata. Eliminating task file commits from feature branches removes the highest-frequency, lowest-value conflict category.
|
||||
|
||||
### Coordinator Responsibilities
|
||||
|
||||
After merging a task's source code changes into main, update the task file:
|
||||
1. Find the task file in `tasks/`
|
||||
2. Update frontmatter `status: completed` (or `blocked` / `failed`)
|
||||
3. Add a brief summary to the `## Summary` section (from the agent's completion notification)
|
||||
4. Commit on main: `git commit -m "chore: update task <id> status to completed"`
|
||||
|
||||
### If an Agent Accidentally Commits a Task File
|
||||
|
||||
If `git merge` complains about conflicting task files:
|
||||
- Don't spend time resolving them — it's just metadata
|
||||
- Use `git checkout --theirs tasks/` to accept the incoming version, or temporarily remove `tasks/` before merging
|
||||
- After merge, update the task files on main with correct status
|
||||
|
||||
## Context Management
|
||||
|
||||
|
||||
@@ -113,39 +113,20 @@ git diff --stat
|
||||
|
||||
Check each acceptance criterion in the task file.
|
||||
|
||||
### 5. Update Task
|
||||
|
||||
Edit the task file:
|
||||
|
||||
```yaml
|
||||
---
|
||||
status: completed # or blocked, failed
|
||||
---
|
||||
```
|
||||
|
||||
Fill summary:
|
||||
|
||||
```markdown
|
||||
## Summary
|
||||
|
||||
Implemented <brief description>.
|
||||
- Created: <files>
|
||||
- Modified: <files>
|
||||
- Tests: <count>, all passing
|
||||
```
|
||||
|
||||
### 6. Commit and Notify
|
||||
### 5. Commit and Notify
|
||||
|
||||
```bash
|
||||
# Stage and commit from worktree
|
||||
git add .
|
||||
# Stage only source code — NOT task files
|
||||
git add src/ test/ docs/ # or specific files as appropriate
|
||||
git commit -m "feat(<task-id>): <description>"
|
||||
git push origin $(git branch --show-current)
|
||||
```
|
||||
|
||||
**Do NOT commit task files** (`tasks/*.md`). Task files are coordination state managed by the coordinator on main. Committing them in your feature branch causes merge conflicts when multiple tasks run in parallel. Include your completion summary in the notify message instead.
|
||||
|
||||
```text
|
||||
# Notify coordinator of completion
|
||||
worktree({action: "notify", args: {message: "Task completed: <task-id>", level: "info"}})
|
||||
worktree({action: "notify", args: {message: "Task completed: <task-id>. <brief summary of what was done, files changed, test count>", level: "info"}})
|
||||
```
|
||||
|
||||
**Critical**: Push immediately so coordinator sees progress.
|
||||
@@ -168,27 +149,11 @@ When task becomes untendable:
|
||||
### Process
|
||||
|
||||
1. **Stop** - don't force through
|
||||
2. **Update task**:
|
||||
```yaml
|
||||
status: blocked
|
||||
```
|
||||
3. **Document in Notes**:
|
||||
```markdown
|
||||
## Notes
|
||||
|
||||
Blocked: <clear explanation>
|
||||
```
|
||||
4. **Commit the task file** (so coordinator sees status):
|
||||
```bash
|
||||
git add tasks/<task-id>.md
|
||||
git commit -m "blocked(<task-id>): <reason>"
|
||||
git push origin $(git branch --show-current)
|
||||
```
|
||||
5. **Notify coordinator**:
|
||||
2. **Notify coordinator**:
|
||||
```text
|
||||
worktree({action: "notify", args: {message: "Blocked on <task-id>: <reason>", level: "blocking"}})
|
||||
```
|
||||
6. **Exit** - coordinator handles escalation
|
||||
3. **Exit** - coordinator handles escalation
|
||||
|
||||
### Wrong Directory Recovery
|
||||
|
||||
|
||||
Reference in New Issue
Block a user