-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Description
feat(subagent-driven-development): accumulate discoveries across tasks and feed them to subsequent subagents
Is your feature request related to a problem? Please describe.
When using subagent-driven-development, each subagent starts completely fresh. Knowledge discovered during one task (codebase quirks, gotchas, unexpected behavior) is invisible to subsequent subagents in the same plan execution. They rediscover the same issues independently instead of building on each other's findings.
Real example: a Task 9 implementer discovered that Drizzle ORM wraps PostgresError inside DrizzleQueryError, so you must check error.cause. Task 10 encountered the same issue independently, debugged it through a failing test, and had to fix it again. The knowledge existed in the session but was not forwarded to later tasks.
Describe the solution you'd like
Add a Project Discoveries field to the implementer report format. The controller accumulates these into a growing block and injects them into every subsequent subagent prompt within the current plan execution.
Two changes:
implementer-prompt.md: add## Project Discoveriesto the report format (codebase quirks, gotchas, patterns worth passing to the next subagent)SKILL.md: controller maintains an## Accumulated Discoveriesblock and prepends it to each new subagent prompt
Example of what gets injected into Task 10's prompt after Task 9 runs:
## Accumulated Discoveries
- Drizzle wraps PostgresError in DrizzleQueryError, always check error.cause
- @IsUUID() rejects non-v4 UUIDs, use @Matches(UUID_REGEX) instead
- Postgres ignores IN clause order for FOR UPDATE, must add ORDER BY
Discoveries are scoped to the current plan execution only. When a new plan starts, the slate is clean.
Acceptance criteria
- Each task inherits all discoveries from prior tasks
- Duplicate discoveries appear only once
- New plan execution starts with empty discoveries
Describe alternatives you've considered
ralph already solves this for non-interactive loop execution. Ralph spawns a fresh Claude instance per task (claude -p), and each instance reads a shared discoveries.txt file on disk before starting. After completing a task, the instance appends its discoveries to discoveries.txt and exits. The next fresh instance reads discoveries.txt and starts with everything prior iterations discovered: patterns, errors, gotchas.
This proposal brings the same pattern into subagent-driven-development, with the controller playing the role of discoveries.txt: accumulating discoveries in memory and injecting them into each subsequent subagent prompt.