Skip to content

feat(implement): load coding principles on demand from reference files - #37

Merged
mastro993 merged 1 commit into
mainfrom
docs/implement-skill-principles
Nov 28, 2026
Merged

mastro993 merged 1 commit into
mainfrom
docs/implement-skill-principles

Conversation

@mastro993

Copy link
Copy Markdown
Owner

Why

The implement skill packed every coding principle into SKILL.md, so each run carried all of them whether the change needed them or not, and several principles were only half there: how to judge a test, how a rerun should behave after a crash, why a lock is the last resort for shared state.

What

Each principle now lives in its own short file with its rule and a test the change is checked against. SKILL.md keeps the steps and a table that says which file to read for which kind of change, so a run loads only what it needs.

  skills/implement/
- SKILL.md               1,359 words, all principles inline
+ SKILL.md               939 words: steps, "read when" table, outside-contract rule, report
+ references/            14 files, one per principle
+   redesign-from-first-principles.md   subtract-before-you-add.md
+   laziness-protocol.md                foundational-thinking.md
+   model-the-domain.md                 type-system-discipline.md
+   boundary-discipline.md              make-operations-idempotent.md
+   separate-before-serializing-shared-state.md
+   migrate-callers-then-delete-legacy-apis.md
+   outcome-oriented-execution.md       build-the-lever.md
+   test-behavior-not-implementation.md minimize-reader-load.md
  evals/
+   discount-code-expiry/   tests pinned to internals and message text
+   report-json-flag/       smallest change, one decision point, no extra options

New guidance the inline version lacked: judging each test against "break the behavior" and "change the internals", pairing a "never happens" test with one where it does, passing the clock and other outside systems in as fakes, checking a rerun after a crash at every point, "instructions are not concurrency control", and laying shared types and fakes before the feature.

Measured against the old skill on 8 cases, 2 runs each, with a grader per case ranking the four runs without knowing which version made which:

New Old
Assertions passed 90/90 87/90
Mean blind rank (1 best) 2.31 2.69
First places 5 3
Tokens / wall time +5% / +7%

Runs read 6 to 9 of the 14 files, matched to the change (the rerun file only on rerun cases, the shared-state file only on the parallel sync case). The old skill's three misses were all on discount-code-expiry, where it kept tests that patch internals and compare message text. A first draft made order-cancel-status runs add an unrequested error class; the test file now asks for error-type assertions only where the code already has one, and a rerun confirmed the class no longer appears.

Merge danger

Reversible: yes. The change is skill text and eval fixtures; a revert restores the old SKILL.md.

Blast radius: contained. Every code change that loads implement, directly or through implement-issue, now reads the principle files its change triggers. implement-issue's references to implement's first check run and subtraction still hold: SKILL.md keeps the first check run, and the subtraction rule is in subtract-before-you-add.md, which every measured run read. Version bumped to 0.17.1 in every manifest and the README badge.

How to test

Automated: the Manifests workflow checks the versions match. Both new fixtures pass their own suites on the starting code (python3 -m unittest discover -s tests -t . in files/till and files/tally).

Manual

  • Run the implement evals (all 8 cases) against this branch and main, and compare.

SKILL.md keeps the design, build, and check steps, the outside-contract
rule, and the report, plus a table saying when to read each principle.
Each of the 14 principles is now a short file in references/ with its
rule and a test the change is checked against, so a run loads only the
ones its change triggers.

The reference files add what the inline version lacked: the two
imagined edits for judging tests, pairing "never happens" with a case
where it does, passing the clock and other outside systems in as fakes,
the crash-at-every-point check for reruns, "instructions are not
concurrency control", and scaffolding shared types and fakes first.

Two eval cases cover principles the suite didn't: discount-code-expiry
(tests pinned to internals and message text) and report-json-flag
(smallest change, one decision point, no speculative options).

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Approach: sound — moves each coding principle into its own references/ file and keeps SKILL.md as the steps plus a "read when" table, so a run loads only what its change triggers.

Reviewed changes

Read the full diff and checked the result against implement-issue's references to implement. I also ran both new fixture suites.

  • SKILL.md restructure — the inline principles become a trigger table. Steps 1–3, the outside-contract rule, and the report shape are kept, and step 3 now checks the diff against each loaded principle's test.
  • 14 principle files — each has a rule and a closing Test: line. The new guidance is in test-behavior-not-implementation.md, make-operations-idempotent.md, and separate-before-serializing-shared-state.md.
  • Two eval cases — discount-code-expiry and report-json-flag, each with a fixture, prompt, and graders. python3 -m unittest discover -s tests -t . passes on both starting trees (7 and 1 tests).
  • Version bump to 0.17.1 — matches in .claude-plugin/plugin.json, plugin.json, gemini-extension.json, and the README badge.
  • implement-issue still holds — its "subtraction" reference now resolves to subtract-before-you-add.md, which SKILL.md lists in the table.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@mastro993
mastro993 merged commit 0faf2e6 into main Nov 28, 2026
2 checks passed
@mastro993
mastro993 deleted the docs/implement-skill-principles branch November 28, 2026 10:53
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