<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mediawiki.comfac.net/index.php?action=history&amp;feed=atom&amp;title=Directed_Execution%3A_Token-Efficient_Agent_Development_Process</id>
	<title>Directed Execution: Token-Efficient Agent Development Process - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mediawiki.comfac.net/index.php?action=history&amp;feed=atom&amp;title=Directed_Execution%3A_Token-Efficient_Agent_Development_Process"/>
	<link rel="alternate" type="text/html" href="https://mediawiki.comfac.net/index.php?title=Directed_Execution:_Token-Efficient_Agent_Development_Process&amp;action=history"/>
	<updated>2026-08-04T11:33:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://mediawiki.comfac.net/index.php?title=Directed_Execution:_Token-Efficient_Agent_Development_Process&amp;diff=261&amp;oldid=prev</id>
		<title>Justinaquino: Add Directed Execution: Token-Efficient Agent Development Process v0.1</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.comfac.net/index.php?title=Directed_Execution:_Token-Efficient_Agent_Development_Process&amp;diff=261&amp;oldid=prev"/>
		<updated>2026-07-15T11:02:54Z</updated>

		<summary type="html">&lt;p&gt;Add Directed Execution: Token-Efficient Agent Development Process v0.1&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Directed Execution: Token-Efficient Agent Development Process =&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;CGG IT — Process &amp;amp; Skillset Definition v0.1&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Owner: JCA · Status: Draft for team review · Date: 2026-07-15&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== 1. Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
Developers are consuming Claude Sonnet and Opus tokens for raw code generation. This inverts the economics of the model market. Frontier-model output tokens are the single most expensive resource in the stack (Opus 4.8 output: ₱1,450/M; Fable 5: ₱2,900/M), while commodity-model output is nearly free by comparison (DeepSeek V4 Flash: ₱16/M — a 90× to 180× spread). Meanwhile, frontier-model &amp;#039;&amp;#039;input&amp;#039;&amp;#039; tokens are roughly 5× cheaper than their own output tokens, and cache hits cheaper still.&lt;br /&gt;
&lt;br /&gt;
The consequence is a simple design rule that the current workflow violates:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;#039;&amp;#039;&amp;#039;Expensive models should read a lot and write a little. Cheap models should write a lot and be corrected.&amp;#039;&amp;#039;&amp;#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nobody has directed the developers to work this way, and there is no shared mechanism for making the cheap models better over time. Both gaps are addressed here: a role-separated loop for day-to-day work, and a skill system that converts QA corrections into reusable capability for the cheap agents.&lt;br /&gt;
&lt;br /&gt;
== 2. Economic Rationale (worked example) ==&lt;br /&gt;
&lt;br /&gt;
Assume a typical feature task: ~30K tokens of relevant context, ~50K tokens of generated code and tests.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Current pattern — Opus does everything:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
30K in (₱8.70) + 50K out (₱72.50), plus one revision cycle of similar size ≈ &amp;#039;&amp;#039;&amp;#039;₱150–160 per task&amp;#039;&amp;#039;&amp;#039;, with no independent QA gate.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Directed pattern:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Step !! Model !! Tokens !! Cost&lt;br /&gt;
|-&lt;br /&gt;
| Plan + FRD || Opus 4.8 || 30K in / 2K out || ₱11.60&lt;br /&gt;
|-&lt;br /&gt;
| Execute || DS V4 Flash || 35K in / 50K out || ₱1.08&lt;br /&gt;
|-&lt;br /&gt;
| QA review || Opus 4.8 || 60K in / 1K out || ₱18.85&lt;br /&gt;
|-&lt;br /&gt;
| Correction || DS V4 Flash || 40K in / 20K out || ₱0.64&lt;br /&gt;
|-&lt;br /&gt;
| Re-check || Opus 4.8 (cached ctx) || 25K in / 0.5K out || ~₱8&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Total&amp;#039;&amp;#039;&amp;#039; || &amp;#039;&amp;#039;&amp;#039;≈ ₱40&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Roughly a 70–75% cost reduction &amp;#039;&amp;#039;while adding a QA gate that did not previously exist&amp;#039;&amp;#039;. The QA read is the largest line item, which is correct — that is where the intelligence is actually needed. Substituting Sonnet as the checker for routine tasks pushes the total under ₱20. As skills accumulate and first-pass acceptance rises, the correction cycle amortizes toward zero.&lt;br /&gt;
&lt;br /&gt;
The point is not merely savings. It is that &amp;#039;&amp;#039;&amp;#039;judgment and volume are different products&amp;#039;&amp;#039;&amp;#039;, and we have been buying volume at judgment prices.&lt;br /&gt;
&lt;br /&gt;
== 3. Principles ==&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Direction is the deliverable of intelligence.&amp;#039;&amp;#039;&amp;#039; The frontier model&amp;#039;s job is decomposition, constraints, acceptance criteria, and verdicts — all short, dense outputs. If Claude is emitting more than ~2K tokens on a task, something is misrouted.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Deterministic-first, same as Synopsis.&amp;#039;&amp;#039;&amp;#039; Anything checkable by a linter, test suite, type checker, or script never reaches a paid model. Machine checks run before Claude sees the diff.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Every correction is an asset.&amp;#039;&amp;#039;&amp;#039; A QA correction consumed once is an expense; distilled into a skill, it is capital. The loop is not complete until the correction is either distilled or explicitly judged one-off.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Cheap agents are pushed, not babysat.&amp;#039;&amp;#039;&amp;#039; Executors get hard objectives with clear acceptance criteria and their accumulated skill library — not hand-holding. Failures are information for the skill system.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;The loop is the curriculum.&amp;#039;&amp;#039;&amp;#039; Interns learn the same process the agents run: plan, execute, check, correct, distill. Team-wide token efficiency is a literacy goal, not a dev-only optimization.&lt;br /&gt;
&lt;br /&gt;
== 4. Roles ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Role !! Model tier !! Reads !! Writes !! Output budget&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Director&amp;#039;&amp;#039;&amp;#039; || Claude Opus / Fable || Objective, codebase context, skill index || FRD: decomposition, interfaces, acceptance criteria, risks || ≤ 2K tokens&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Executor&amp;#039;&amp;#039;&amp;#039; || DS V4 Flash, Kimi K2.6; later local Qwen/DeepSeek via OpenCode || FRD + relevant skills + code context || Code, tests, migration scripts — full volume || Unbounded&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Checker&amp;#039;&amp;#039;&amp;#039; || Claude Opus (critical) / Sonnet (routine) || Full diff + FRD + machine-check results || Verdict: PASS/FAIL per acceptance criterion, itemized corrections anchored to lines || ≤ 1K tokens&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Skill Librarian&amp;#039;&amp;#039;&amp;#039; || Human (rotating dev/intern) + cheap model drafting || QA correction logs || Skill drafts, skill index maintenance || —&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Director and Checker should be &amp;#039;&amp;#039;&amp;#039;separate sessions&amp;#039;&amp;#039;&amp;#039; even when the same model — the Checker must evaluate against the FRD, not defend its own plan.&lt;br /&gt;
&lt;br /&gt;
Model routing within tiers: DeepSeek V4 Flash is the default executor. Kimi K2.6 when the task needs multimodal input (screenshots, UI review) or its larger instant-mode quality helps. Local agents take over as the vLLM/Ollama stack proves out on benchmarked task classes — the skill library transfers with them, which is the strategic payoff: skills are model-portable capability, not vendor lock-in.&lt;br /&gt;
&lt;br /&gt;
== 5. The Loop ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Plan → Execute → Machine-check → QA → Correct → Distill → Reuse&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Plan.&amp;#039;&amp;#039;&amp;#039; Director receives the objective and produces an FRD-lite (template below). No code beyond interface signatures and test-case &amp;#039;&amp;#039;descriptions&amp;#039;&amp;#039;. The FRD is the contract; ambiguity discovered later is a planning defect and goes back to the Director, not patched silently by the Executor.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Execute.&amp;#039;&amp;#039;&amp;#039; Executor works in OpenCode with the FRD and the relevant skills loaded (skills prepended as a stable prefix — this also maximizes cache hits). It generates code and tests to satisfy the acceptance criteria. It may burn tokens freely; that is what it is for.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Machine-check.&amp;#039;&amp;#039;&amp;#039; Lint, type-check, test run, formatter. Automated (n8n or a pre-commit script). Failures loop back to the Executor without any paid QA read. Claude never reviews code that fails machine checks.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;QA.&amp;#039;&amp;#039;&amp;#039; Checker reads FRD + diff + machine-check results and returns a structured verdict. It does not rewrite code. Each FAIL item states &amp;#039;&amp;#039;what is wrong, why, and the principle violated&amp;#039;&amp;#039; — the &amp;quot;why&amp;quot; is raw material for distillation.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Correct.&amp;#039;&amp;#039;&amp;#039; Executor applies corrections. Two correction cycles maximum; a third failure escalates to a human plus a mandatory skill-gap review (&amp;quot;what skill would have prevented this?&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Distill.&amp;#039;&amp;#039;&amp;#039; Weekly, the Skill Librarian reviews the QA correction log. Any correction pattern appearing &amp;#039;&amp;#039;&amp;#039;twice or more&amp;#039;&amp;#039;&amp;#039; becomes a skill candidate. A cheap model drafts the skill from the correction transcripts; a human reviews and merges it into the Forgejo skill repo.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Reuse.&amp;#039;&amp;#039;&amp;#039; Skills are indexed by trigger. The Director&amp;#039;s FRD names which skills apply; the Executor loads them. Cheap agents therefore climb: yesterday&amp;#039;s correction is today&amp;#039;s default behavior.&lt;br /&gt;
&lt;br /&gt;
== 6. Deliverable Contracts ==&lt;br /&gt;
&lt;br /&gt;
=== FRD-lite (Director output) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
FRD-&amp;lt;seq&amp;gt;: &amp;lt;title&amp;gt;&lt;br /&gt;
Objective: one sentence.&lt;br /&gt;
Scope in / Scope out: explicit exclusions.&lt;br /&gt;
Interfaces: function/API signatures the Executor must implement.&lt;br /&gt;
Acceptance criteria: numbered, each machine- or QA-checkable.&lt;br /&gt;
Constraints: security, style, dependency, and performance rules that apply.&lt;br /&gt;
Skills to load: skill IDs from the index.&lt;br /&gt;
Risk notes: where the Executor is most likely to go wrong.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== QA Verdict (Checker output) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
VERDICT: PASS | FAIL&lt;br /&gt;
AC-1: PASS/FAIL — &amp;lt;one line&amp;gt;&lt;br /&gt;
AC-n: ...&lt;br /&gt;
Corrections (if FAIL):&lt;br /&gt;
  C1 [file:line] What / Why / Principle violated&lt;br /&gt;
Distill flags: corrections likely to recur → candidate skill name&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Principle violated&amp;quot; field is deliberately mandatory. It is what makes the verdict distillable rather than a one-off patch instruction.&lt;br /&gt;
&lt;br /&gt;
== 7. The Skill System ==&lt;br /&gt;
&lt;br /&gt;
A skill is a short markdown file teaching a cheap model a specific competence, in the same shape Anthropic uses for Claude skills — which means skills built here also work when the executor &amp;#039;&amp;#039;is&amp;#039;&amp;#039; Claude, or a local model, or whatever comes next.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Format&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;SKILL.md&amp;lt;/code&amp;gt; per skill, one directory per skill in the Forgejo repo, e.g. &amp;lt;code&amp;gt;skills/erpnext-patch-migrations/&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
name: &amp;lt;kebab-case&amp;gt;&lt;br /&gt;
trigger: when this skill applies (used by Director for routing)&lt;br /&gt;
procedure: numbered steps / rules&lt;br /&gt;
examples: one good, one bad (drawn from real QA corrections)&lt;br /&gt;
anti-patterns: the specific failures that birthed this skill&lt;br /&gt;
provenance: FRD/QA references, author, date&lt;br /&gt;
status: draft | reviewed | adopted | deprecated&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Lifecycle.&amp;#039;&amp;#039;&amp;#039; Draft (from correction log, cheap-model-written) → Reviewed (human, PR in Forgejo) → Adopted (in the index, loadable) → Deprecated (superseded or model-obsoleted). Skills are versioned like code because they are code — for the agents.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ownership.&amp;#039;&amp;#039;&amp;#039; Devs are consumers and reviewers, not the bottleneck. Interns, working with the local DS agents in OpenCode, author most drafts as part of their objectives. The repo&amp;#039;s PR history doubles as an intern portfolio.&lt;br /&gt;
&lt;br /&gt;
== 8. Escalation Rules ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Situation !! Route&lt;br /&gt;
|-&lt;br /&gt;
| Routine feature/bugfix, skills exist || Flash executes, Sonnet checks&lt;br /&gt;
|-&lt;br /&gt;
| Novel architecture, security-sensitive, cross-system design || Opus/Fable plans and checks&lt;br /&gt;
|-&lt;br /&gt;
| Executor fails 2 correction cycles || Human review + skill-gap analysis&lt;br /&gt;
|-&lt;br /&gt;
| Executor requests clarification || Back to Director (cheap→expensive calls are Director-mediated, never ad hoc)&lt;br /&gt;
|-&lt;br /&gt;
| Anything touching secrets, credentials, prod data || Local agents only; no external API&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The last row is a hard rule and aligns with the transcription-tool memo posture: sensitive context stays on the ZeroTier overlay.&lt;br /&gt;
&lt;br /&gt;
== 9. Metrics &amp;amp; Token Ledger ==&lt;br /&gt;
&lt;br /&gt;
Per task, logged (SQLite to start, consistent with the Synopsis MVP philosophy; ERPNext later if it earns its keep):&lt;br /&gt;
&lt;br /&gt;
* Tokens and ₱ by role (Director / Executor / Checker), per task and per week.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;First-pass acceptance rate&amp;#039;&amp;#039;&amp;#039; — the headline metric. Rising FPA means skills are working.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Correction cycles per task&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;escalation rate&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Skill reuse count&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;skills authored&amp;#039;&amp;#039;&amp;#039; per person — the intern scoreboard.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Cost per merged deliverable&amp;#039;&amp;#039;&amp;#039;, trended. Target: sustained &amp;lt;30% of the all-frontier baseline within one quarter.&lt;br /&gt;
&lt;br /&gt;
The ledger is not surveillance; it is the feedback signal that tells us when a task class is ready to move from Flash to a local model, and when a checker can be downgraded from Opus to Sonnet.&lt;br /&gt;
&lt;br /&gt;
== 10. Rollout ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Week 1 — Instrument and declare.&amp;#039;&amp;#039;&amp;#039; Stand up the skill repo in Forgejo, the token ledger, and the machine-check gate. Short directive to the team: no frontier-model code generation for tasks with an FRD path; frontier models plan and check.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Week 2 — Seed skills.&amp;#039;&amp;#039;&amp;#039; Mine the last month of Claude chat history for recurring correction patterns; interns draft the first 5–10 skills (likely candidates: ERPNext patch conventions, Frappe API idioms, our lint/commit standards, test scaffolding).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Week 3 — First directed sprints.&amp;#039;&amp;#039;&amp;#039; Each intern gets one challenging objective run fully through the loop with a local DS agent in OpenCode. Devs act as Skill Librarian reviewers. Every completed objective must ship at least one skill PR.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Week 4 — Review.&amp;#039;&amp;#039;&amp;#039; FPA, cost per deliverable, and skill count reviewed against baseline. Decide the first task class to pilot on fully local models.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Steady state.&amp;#039;&amp;#039;&amp;#039; The loop is the standard operating rhythm. Quarterly, revisit model routing (the pricing table this document was built from will be stale in months) and prune deprecated skills.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Reasoning summary: the spread between frontier output pricing and commodity output pricing (90×+) makes &amp;quot;smart model writes code&amp;quot; the single most expensive habit in the workflow, while the input/output asymmetry (5×) makes &amp;quot;smart model reads everything, writes verdicts&amp;quot; nearly free by comparison. The skill system converts the residual cost — QA corrections — into permanent, model-portable capability, so the cheap tier&amp;#039;s quality compounds and the expensive tier&amp;#039;s involvement shrinks over time. Interns are the labor force and the beneficiaries of the same loop.&amp;#039;&amp;#039;&lt;/div&gt;</summary>
		<author><name>Justinaquino</name></author>
	</entry>
</feed>