A built-in subagent needs one narrow question
Delegate a concrete investigation: find entry points, trace a call, or compare tests with behavior. The main session receives a concise report without spending its entire context on intermediate findings.
Delegation does not transfer responsibility for truth. Check important findings in files, tests, configuration, or an actual run.
| Request part | Example |
|---|---|
| Question | Where is the response for /users formed? |
| Boundary | Inspect src/api, related services, and tests; do not edit |
| Evidence | Return file:line, function names, and commands run |
| Uncertainty | Mark assumptions as [hypothesis] |
| Result | Short conclusion, limits, open questions, and next step |
Delegation template
Role: read-only runtime-flow researcher.
Question: trace the path from the CLI entry point to result storage.
Area: src/cli, src/services, tests; do not edit.
Check: calls, error handling, and relevant test commands.
Return:
- conclusion;
- file:line and functions;
- checks actually run;
- [hypothesis] for unverified claims;
- open questions;
- next step.Break work into contracts
- Delegate discovery or inventory first.
- Ask separately for a hypothesis check through tests or configuration.
- Formulate the change plan in the main session.
- Run implementation, testing, and review as separate controlled steps.
- Compare the subagent report with primary files before deciding.
Report format matters more than confident tone
- Files and lines show where evidence was found.
- Functions and relationships explain the conclusion.
- Checks name commands or tests actually run.
- Limits state what was not checked.
- Hypotheses remain distinct from facts.
- Next step gives the owner the smallest useful action.
Canonical lesson source · JavaRush
Open JavaRush material