Skip to content

Add an agent skill for refactoring onto ts-implscan - #6

Merged
thomasrepnik merged 3 commits into
masterfrom
feat/refactor-skill
Nov 9, 2026
Merged

thomasrepnik merged 3 commits into
masterfrom
feat/refactor-skill

Conversation

@thomasrepnik

Copy link
Copy Markdown
Owner

Summary

Agents refactoring strategies onto a Dispatchable wrote correct code, but a different architecture each time. This skill gives every refactor the same shape, and a script checks the layout.

 src/app/payment/
+├── context/
+│   ├── api/payment-context.ts             # PaymentContext
+│   └── impl/payment-context.provider.ts   # PaymentContextProvider
+├── handlers/
+│   ├── api/payment-handler.ts             # PaymentHandler
+│   └── impl/card-payment.service.ts       # <Variant>PaymentService
+└── shared/                                # only when implementations share code
skills/ts-implscan-refactor/
├── SKILL.md            # layout, specs, priorities, provideImplscan() placement, scripts
└── check-layout.mjs    # exits 1 and lists each layout problem
evals/refactor-skill/   # blind Angular scenarios, hidden tests, FINDINGS.md

The package now ships skills/. evals/ isn't published, and the generator is unchanged.

Evidence

Eight blind Angular scenarios, run by fresh agents against hidden tests. Each hazard check was shown to catch a deliberately broken solution, except the import cycle, which is recorded as a generator issue in FINDINGS.md.

  • Before (no skill): 8/8 hidden test scenarios, 0/7 check-layout, 22/35 convention checks, 18 new tests kept
    After (final skill): 8/8 hidden test scenarios, 7/7 check-layout, 35/35 convention checks, 52 new tests kept
  • Reference project: check-layout passes unchanged on the hand-made demo the layout comes from.
  • Repo: typecheck, 69 tests and npm run test:package pass locally. The smoke test checks that the tarball contains the skill.

Limits:

  • These are small apps, with one or two runs per scenario on one model.
  • Agents were pointed at the skill, so automatic loading is untested.
  • The optional shared/ folder is only covered by unit tests, because it was added after the last blind run.
  • Refactors touch more files with the skill: 88 against 58 across seven refactors.

Merge Danger

Door: two-way

Nothing changes at runtime. Reverting removes the skill and the lab. Copies already installed in a project stay until removed.

Blast Radius: packaging

The npm tarball gains about 9 kB. The repo gains about 140 lab fixture files, which CI doesn't run.

Agents refactoring strategies onto a Dispatchable produced correct code
but a different architecture each time. The skill fixes the file layout,
naming, context provider, priorities and where provideImplscan() goes,
and requires specs of the old selection first.

check-layout.mjs ships with the skill and enforces the layout. The
package now includes skills/.

evals/refactor-skill holds the blind Angular scenarios used to test it,
with the results in FINDINGS.md.
Agents using the skill searched the web or npmjs for ts-implscan before
installing it. The skill now installs the package first and points at
the README in node_modules, which matches the installed version.
The old opening explained the mechanism before the benefit and assumed
the reader knows Spring.
@thomasrepnik
thomasrepnik merged commit f1cbc0c into master Nov 9, 2026
3 checks passed
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