Repository navigation
Description
Problem or use case
Follow-up to the deep audit: the maintainer asked whether AI tooling looks good and whether unnecessary code, examples and tests can be removed. Reviewed current main 6a04c45; no code deleted. These are consolidation candidates with observed evidence, not proof that the public features are unused.
examples/cookbook/middleware/*.mjsandrecipes/middleware/middleware/*.mjscontain 14 byte-identical files: 259 duplicate lines / 14,297 bytes.test/recipes.test.tsexplicitly checks the mirror. Both deliverables are used (full cookbook versus copyable recipe), but maintaining two authored versions is unnecessary. Make one canonical and derive the other during build/generation, keeping shipped copies standalone and testing actual packed output.- MCP offers both
run_testsin mcp.ts (in-process, structured events) andrun_testin mcp-authoring.ts (CLI subprocess, bounded stdout/exit status). Both execute request fixtures and are authoring-gated, but policy, environment, timeout, host lifecycle and result contracts differ. [Bug]: verification commands and MCP subprocess runners drop the supplied extension host #778 and MCP in-process run_tests and get_context's suggested commands lack the local review (follow-up to #940) #964 document past fixes that had to reach both paths. Assess one execution implementation with result adapters/compatibility names; do not blindly alias them and change security or caller behavior. If deliberately retaining both, make the distinct use cases explicit. There is no usage evidence here authorizing deletion of either public name. skills/urlcode/SKILL.md(150 lines) and.claude/skills/urlcode-authoring/SKILL.md(311 lines) separately maintain overlapping local authoring, declarative-first, verification and trust instructions. The Claude skill also owns hosted-assisted bootstrap behavior, so it is not a duplicate file to delete. Consider one source for shared sections plus small client/mode sections. The marketplace copies and starter AGENTS.md already have generators; do not add another hand-maintained copy or remove their drift guards.
Proposed behavior and alternatives
Start with the byte-identical middleware source consolidation. Then consider the MCP runner and common skill facts as separate focused changes with explicit compatibility constraints. Measure reduced authored lines/maintenance surfaces and unchanged packaged behavior, rather than optimizing a test/file count.
Keep the distinct contract coverage: source unit tests, packed-consumer smoke, real HTTP/sandbox refusal tests, and Better Auth/Auth.js/native-storage/Hono proofs. Matching frontend files or route shapes do not make those provider/embedding tests redundant. json-api demonstrates a dynamic echo function while json-endpoint demonstrates declarative validation/respond; those are also different lessons despite similar names. No particular regression test was proven safe to delete in this pass.
Public changes need docs in the same PR; packaging/generator changes need full verify and test:package. This issue is a scoped cleanup assessment, not authorization to restore the retired universal adapter roadmap.
Activity
jimhoyd commentedon Sep 30, 2026
Item 1 is addressed in #1103 (the cookbook is the only authored copy, and the recipe copies are generated and checked, including in the packed archive). Below is an assessment of items 2 and 3. No behavior changed. Both items stay open.
Item 2: MCP
run_tests(mcp.ts) vsrun_test(mcp-authoring.ts). These are two execution models, not one duplicated path:run_testsruns fixtures in the server process. It returns structuredtotal/failed/eventsand alocalReviewresult when no pin is present (MCP in-process run_tests and get_context's suggested commands lack the local review (follow-up to #940) #964).run_testspawnsurlcode testas a child process with a minimal environment, SIGTERM/SIGKILL timeouts and bounded output (exitCode,signal,stdout,stderr,truncated), next torun_validateandrun_audit.Their policy forwarding, host lifecycle, timeouts and result contracts differ, and callers depend on both result shapes. Recommendation: do not alias them.
run_testsas an in-process adapter andrun_teststaying a CLI subprocess wrapper. That puts fixes like [Bug]: verification commands and MCP subprocess runners drop the supplied extension host #778/MCP in-process run_tests and get_context's suggested commands lack the local review (follow-up to #940) #964 in one place.Item 3:
skills/urlcode/SKILL.md(150 lines) vs.claude/skills/urlcode-authoring/SKILL.md(311 lines). The overlap is real (local authoring loop, declarative-first, verification, trust model), but the Claude skill also owns hosted-assisted bootstrap. Recommendation: pick one source for the shared sections, for example a fragment file rendered into both by the existinggenerate-agent-assets.tspipeline with--check. Keep the client- and mode-specific sections hand-written. Keepcheck-guidance-claims.tsand the marketplace drift guards as they are.jimhoyd commentedon Sep 30, 2026
Taking this: coordinator session. Item 1 is in #1103; items 2 and 3 are in progress.
fix(docs): reconcile live contract drift; generate the middleware rec…
docs(skills): one authored copy of the sections the two authoring ski…
refactor(mcp): one fixture-execution core behind run_tests and urlcod…