Skip to content

docs(skill): recommend cost-tier model per phase (#314)#391

Open
tirth8205 wants to merge 1 commit into
Egonex-AI:mainfrom
tirth8205:feat/cost-tier-recommendations
Open

docs(skill): recommend cost-tier model per phase (#314)#391
tirth8205 wants to merge 1 commit into
Egonex-AI:mainfrom
tirth8205:feat/cost-tier-recommendations

Conversation

@tirth8205

Copy link
Copy Markdown
Contributor

Summary

Closes #314.

/understand Phase 2 fans out one file-analyzer subagent per batch — dozens-to-hundreds per run. When the session model is Opus, every analyzer inherits it and drains premium budgets even though the analyzer's work is largely deterministic (it runs the bundled extract-structure.mjs + emits templated summaries on top of tree-sitter facts). The strongest model only materially helps on the rare synthesis-heavy single-dispatch phases (architecture-analyzer, tour-builder).

Why this is a docs change, not an agent-frontmatter change

The cleanest fix would be a per-agent model: frontmatter field, but that path is blocked by an existing portability constraint documented in CLAUDE.md:

Agent model field is omitted from frontmatter so each platform falls back to its configured default — inherit was a Claude Code-only keyword that opencode (and similar tools) treated as a literal model id and rejected with ProviderModelNotFoundError (see #167).

So this PR is documentation-first. Orchestrators that support per-dispatch model selection are expected to apply the table; platforms that cannot route per-agent fall back to the session model with no behaviour change.

Per-phase recommendations introduced

Phase Agent Suggested tier
1 project-scanner Cheap (Haiku) or mid (Sonnet)
2 file-analyzer (high fan-out) Cheap (Haiku) or mid (Sonnet)
3 assemble-reviewer Mid (Sonnet)
4 architecture-analyzer Strong (Opus)
5 tour-builder Strong (Opus)
6 graph-reviewer (only with --review) Mid (Sonnet) or Strong (Opus)

Files changed

  • understand-anything-plugin/skills/understand/SKILL.md — new "Model Cost-Tier Recommendations" section with rationale, table, and a future-shape sketch for a config.json models map (not wired into the runtime). Inline "Cost tier:" reminders at every phase dispatch step.
  • understand-anything-plugin/skills/understand-knowledge/SKILL.md — Phase 3 (article-analyzer) gains the same hint; this is the other high-fan-out phase in the plugin.
  • README.md — "Multi-Agent Pipeline" section gains a "Model cost tiers (per phase)" subsection with the table and cross-link to SKILL.md, plus the opencode-portability rationale.

What this PR does not do

  • No agent frontmatter is modified — agents/*.md files are untouched.
  • No runtime model-selection plumbing is added. The config.json models map shape is documented as a future opt-in only.

Test plan

  • Verified grep -n "^model:" understand-anything-plugin/agents/*.md returns no matches (the opencode portability constraint is preserved).
  • Diff scope confirmed: only README.md, understand/SKILL.md, understand-knowledge/SKILL.md.
  • Maintainer sanity-check: does the recommended tier mapping match how you'd want orchestrators to route?

High-fan-out phases like `file-analyzer` dispatch dozens-to-hundreds of
subagents per `/understand` run. When the session model is Opus, every
analyzer inherits it and drains premium budgets even though the
analyzer's work is largely deterministic (runs `extract-structure.mjs`
plus templated summaries). Synthesis-heavy single-dispatch phases
(`architecture-analyzer`, `tour-builder`) are where the strongest model
actually pays off.

The cleanest fix would be a per-agent `model:` frontmatter field, but
that path is blocked: `model: inherit` is a Claude Code-only keyword
that broke opencode with `ProviderModelNotFoundError` (issue Egonex-AI#167, PR
Egonex-AI#200). Agent frontmatter must therefore stay portable, so this PR is
documentation-only:

- Add a "Model Cost-Tier Recommendations" section to
  `understand/SKILL.md` with a per-phase table and the explicit rationale
  for not using agent frontmatter.
- Inline "Cost tier:" reminders at every phase dispatch step
  (`project-scanner`, `file-analyzer`, `assemble-reviewer`,
  `architecture-analyzer`, `tour-builder`, `graph-reviewer --review`).
- Same hint added to `understand-knowledge/SKILL.md` Phase 3 for the
  high-fan-out `article-analyzer` path.
- Document the shape of a future `config.json` `models` map (not wired
  into the runtime yet) so downstream tooling can converge.
- README "Multi-Agent Pipeline" gains a "Model cost tiers" subsection
  with the same table and cross-link to SKILL.md.

No agent frontmatter is modified — the opencode-portability constraint
from CLAUDE.md is preserved.

Closes Egonex-AI#314

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: default high-fan-out subagents (file-analyzer) to a cheaper model instead of inheriting the session model

1 participant