Agent Workflow Guide · devkit-pi
This guide describes a lightweight workflow style for using devkit-pi effectively. It is guidance, not a strict runtime policy engine.
1) Scope
This guide is for day-to-day coding tasks with devkit-pi tools:
- subagents
- web research (
web_search,fetch_content) - convert (
convert_content) - LSP (
lsp) - toolkit commands (
/toolkit) - lightweight guards (git context, first-write, verification reminders)
It does not introduce workflow phases, hard gates, or mandatory turn rewrites. Guards are soft reminders only; they do not block tool calls or force follow-up turns.
2) devkit-pi workflow principles
- The main agent makes decisions; subagents handle focused investigation/review.
- Readonly-first by default, especially for reviewer-style work.
- Small tasks can execute directly, but report verification status honestly.
- Large tasks should start with a short plan and step-by-step execution.
- Debug flow: reproduce → narrow down → fix minimally → verify.
- Keep implementation and review separated when possible.
- Use tools/subagents for large outputs instead of polluting the main context.
3) Lightweight flow for small tasks
Recommended sequence:
- Clarify goal and constraints.
- Inspect relevant files quickly.
- Make minimal changes.
- Run the smallest relevant verification command(s).
- Report what changed and what was verified.
4) Flow for larger tasks
Recommended sequence:
- Clarify scope and non-goals.
- Inspect code/docs/tests.
- Write a short plan (2–5 steps).
- Execute in small batches.
- Verify after each meaningful batch.
- Summarize risks, follow-ups, and remaining work.
5) Debug workflow
- Reproduce: confirm how to trigger the issue.
- Observe: collect logs/errors/files.
- Narrow: isolate likely modules.
- Fix: apply minimal targeted fix.
- Verify: run reproduction and/or tests.
- Document: add notes if behavior changed.
Tool mapping:
- Web tools: external research for errors/symptoms
- Convert tool: read complex file formats into markdown
- LSP tool: symbols/definitions/references/diagnostics
- Subagents: focused exploration/review
/toolkit: module status and diagnostics overview
6) Review workflow
Suggested pattern:
- Main agent implements a scoped change.
- Delegate focused review to readonly reviewer subagent.
- Classify findings by severity.
- Main agent decides what to fix.
- Re-verify and summarize.
Review is not a replacement for build/test/lint verification.
7) Verification before completion
Before declaring completion, include verification status.
Common checks:
pnpm typecheckpnpm lintpnpm testpnpm docs:checkwhen docs changedpnpm test:coveragewhen coverage visibility matters; current coverage is a lightweight Node/V8 visibility report, not a threshold gate
Examples:
md
## Verification
- Ran: `pnpm typecheck` ✅
- Ran: `pnpm test` ✅
- Not run: `pnpm docs:check` (no docs changed)If verification was not run:
md
## Verification
- Not run in this session.
- Suggested next step: `pnpm typecheck && pnpm lint && pnpm test`8) Subagent boundaries
- Main agent remains the only orchestrator.
- Do not let subagents recursively orchestrate new subagents.
- Prefer readonly subagents by default.
- Keep final decision authority in the main agent.
9) Anti-patterns
Avoid:
- over-process for tiny tasks
- large refactors without reading tests/docs first
- claiming completion without verification status
- treating workflow guidance as hard runtime gates
10) Reusable templates
A. Small fix template
- Inspect target files.
- Apply minimal change.
- Run one or two focused checks.
- Summarize change + verification.
B. Feature template
- Clarify constraints.
- Plan 2–5 steps.
- Implement incrementally.
- Verify incrementally.
- Summarize behavior, risks, and next steps.
C. Debug template
- Reproduce
- Observe
- Narrow
- Fix
- Verify
- Document