Skip to content

feat(agent-context): add cost test for owned generators to MetaObjects skills - #422

Merged
dmealing merged 3 commits into
mainfrom
fm/mo-1-1-0-generator-cost-skill
Oct 11, 2026
Merged

dmealing merged 3 commits into
mainfrom
fm/mo-1-1-0-generator-cost-skill

Conversation

@dmealing

Copy link
Copy Markdown
Member

What Changed

  • metaobjects-codegen skill and its references/owning-generators.md: before writing an owned generator, apply a cost test. Write one only when generator code plus generated output plus added metadata is smaller than the hand-written code it replaces, more instances of the shape are expected, or drift protection is the point. A general-shape generator belongs in the library, not copied into each app.
  • metaobjects-audit skill: adds an ACCEPTABLE (one-off) classification for hand-written layers that fail the cost test, and cost-tests every generate recommendation. Generated-share and leverage figures must be paired with the net hand-written line change and are never a target.
  • The matching fixtures/agent-context-conformance/*/expected/.claude/skills/ outputs (java-kotlin-react-tanstack, java-react, python, ts-react-tanstack, ts-requirements) and CHANGELOG.md are regenerated to carry the revised skill text.
Validation

Risk Assessment

✅ Low: Documentation-only change to agent skills, the changelog and golden fixtures. The round-1 contradiction is resolved: all three texts use one rule, and all 15 fixture copies match their sources.

Testing

  • ⏭️ Test - skipped

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 1 issue found → auto-fixed ✅
  • ⚠️ agent-context/skills/metaobjects-codegen/references/owning-generators.md:58 - The cost test's first condition contradicts itself. It says 'The generator plus its emitted output, plus the metadata it adds, is fewer lines than the hand-written code it replaces'. Two sentences later it says 'A generated-line total does not count; the emitted files cost nothing to write'. So emitted output is both counted and not counted. The audit skill's 'net hand-written line change' counts only generator and metadata lines, with no emitted output. The CHANGELOG entry says 'generator plus output'. The stated intent is 'the generated code plus generator are more than handwritten', which counts output. Example: a 100-line generator emits 400 lines from 20 lines of metadata and replaces 300 hand-written lines. Under the first sentence it fails (520 > 300). Under the second sentence and the audit's net metric it passes (120 < 300). An agent can reach opposite verdicts from the same text. Fix: pick one rule and state it identically in agent-context/skills/metaobjects-codegen/references/owning-generators.md:58-61, agent-context/skills/metaobjects-audit/SKILL.md:52-56 (net hand-written line change) and the CHANGELOG Added bullet. The five fixture copies of each file must match the source; they currently do.

🔧 Fix applied.
✅ Re-checked - no issues remain.

⏭️ **Test** - skipped

Step was skipped.

⏭️ **Document** - skipped

Step was skipped.

⏭️ **Lint** - skipped

Step was skipped.

✅ **Push** - passed

✅ No issues found.

…ayers as acceptable

Codegen skill gains a when-not-to-write-a-generator test (generator counted as
hand-written cost). Audit skill applies it and pairs any generated-share figure
with the net hand-written line change. Goldens regenerated.
Assisted-by: no-mistakes:claude:claude-sonnet-5-5
@dmealing
dmealing merged commit 7daa8e6 into main Oct 11, 2026
1 check passed
@dmealing
dmealing deleted the fm/mo-1-1-0-generator-cost-skill branch October 11, 2026 03:30
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.

1 participant