-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Problem
When AI agents work on multi-step tasks, they often need to create or update multiple related tasks at once. Currently, this requires N separate bn task create or bn task update calls, which:
- Increases latency - Each command opens storage, parses JSONL, updates cache
- Fragments audit logs - Related operations appear as separate log entries instead of a single atomic batch
- Loses atomicity - If agent crashes mid-batch, partial state may be left behind
- Verbose for agents - MCP tool calls multiply, increasing context window usage
Proposed Solution
Add batch operation commands:
bn task create-batch
# Create multiple tasks from JSON array (stdin or file)
echo '[{"title": "Task A"}, {"title": "Task B", "priority": 1}]' | bn task create-batch
# Or from file
bn task create-batch --file tasks.json
# With common defaults
bn task create-batch --priority 2 --tag sprint-1 --file tasks.jsonOutput (JSON):
{
"created": ["bn-a1b2", "bn-c3d4"],
"count": 2,
"errors": []
}bn task update-batch
# Update multiple tasks at once
echo '[{"id": "bn-a1b2", "status": "done"}, {"id": "bn-c3d4", "status": "in_progress"}]' | bn task update-batchbn link add-batch
# Create multiple edges at once (common when creating a task tree)
echo '[{"source": "bn-a1b2", "target": "bn-c3d4", "type": "depends_on"}]' | bn link add-batchBenefits
- Performance: Single storage open/close cycle for all operations
- Atomicity: Either all succeed or transaction can be rolled back
- Audit clarity: Single log entry shows "batch created 5 tasks"
- Agent efficiency: One MCP tool call instead of N
- Enables workflows: "Create PRD → spawn 10 subtasks → link all" becomes practical
Acceptance Criteria
-
bn task create-batchaccepts JSON array from stdin or--file -
bn task update-batchaccepts JSON array with id + fields to update -
bn link add-batchaccepts JSON array of edge definitions - Batch operations produce single audit log entry
- On error, partial results are returned with error details
- MCP manifest includes batch tool definitions
- Human-readable output shows summary (e.g., "Created 5 tasks")
Related
- This would complement Tools to help organize tasks #2 (tools to organize tasks)
- Enables workflows like "import folder structure as task tree" from
prds/PRD_FOLDER_IMPORT.md
Metadata
Metadata
Assignees
Labels
No labels