Repository navigation
feat(webkit): derive the Claude bundle from cli-templates and fence the CLAUDE.md fragment - #968
Merged
Merged
Conversation
…he CLAUDE.md fragment The `webkit init` Claude bundle was a hand-maintained list in plan.js that had already drifted from the templates on disk: `webkit-comments.md` shipped in cli-templates/claude/rules/ but was never copied into a consumer's .claude/. bundle.js now derives the bundle by walking rules/, skills/, and agents/ under the templates directory, so every template ships automatically and can never silently fall out of sync again. The CLAUDE.md fragment was guarded by a single append-once marker line with no closing fence, so it could only ever be written once — a project that already ran `init` never received updated invariants/skills from a newer webkit version, and a fragment that ended up duplicated (the docs repo has it at two positions today) could never be repaired. The fragment is now wrapped in a `<!-- @aziontech/webkit:start/end -->` fence that is replaced in place on every `init` run. A pre-fence legacy marker is migrated into the fence automatically, and a fragment duplicated across more than one legacy marker is collapsed back down to a single fenced block. apply.js gains a `fence` action type (written | merged | skipped) alongside the existing append/copy/patch-entry actions, and cli.js's dry-run printer gets an explicit case for it.
… limit apply.js and bundle.js carried comment blocks over the construction-standard 5-line limit and, in bundle.js, enough prose to trip comment-heavy-file. The long rationale (why the bundle is derived, why the fragment is fenced, how legacy-marker migration/repair works) already lives in docs/toolkit/cli.md — trim the source comments to short, objective notes and point there instead of restating it inline.
…ariable' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
guilherme-santana-azion
approved these changes
Sep 16, 2026
Contributor
|
Fragile coupling worth flagging (non-blocking)
Latent risk in listBundle() (non-blocking, but worth a decision)
|
robson-junior-azion
approved these changes
Sep 16, 2026
Merged
gabriel-lisboa-azion
added a commit
that referenced
this pull request
Sep 21, 2026
demo/vue-sample had drifted 540 ahead / 31 behind main while most of its webkit work was reviewed and landed upstream (#941 command-menu, #942 GlobalHeader placements, #943 NavigationMenu, #952 Menu, #960 sidebar collapse, #973 floating-panel placement, #975 paginator, #977 templates exports, #921 amount ladder), after which main swept comments (#951) and reworked the CLI onto a derived bundle (#968/#970). Main is the source for everything the two share. Of the 28 conflicted source files, 17 differed from main only in comments — their code was byte-identical — and 6 more were genuinely newer on main, so all 23 take main verbatim, including the use-placement TypeScript rewrite that replaces the old index.js. Three carve-outs keep demo work main does not have yet: - sidebar: main's CSS-driven collapse is the base; the `side` axis is re-applied on top of it as data-[side=end] variants rather than the JS edge map it used to be, and the drag sign moves into the rail composable. The one test that asserted the removed inline transform now asserts the panel's published edge, since the direction is CSS the unstyled test env cannot see. - theme: texts.data.js keeps demo's 13 extra text-wrap and 10 extra tracking declarations (PR #982, in flight). Both sides carry the same 34 entries, so an entry count would not have caught the loss. - doc-prose keeps its chrome-padding fix (PR #981, in flight). catalog.json, authoring-baseline.json, the theme dist and the lockfile are regenerated rather than hand-resolved; the 13 conflicted visual baselines take main's and are regenerated from CI next. Verified: every file main touched is byte-identical to main except the 22 accounted for above; 2364 browser tests, 179 toolkit tests, lint, vue-tsc, 99.98% type coverage, both ratchets, the Storybook build and the webkit-sample build all pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
webkit init's Claude Code bundle fromcli-templates/claude/{rules,skills,agents}(bundle.js#listBundle) instead of a hand-maintained list inplan.jsthat had already drifted —webkit-comments.mdshipped on disk but was never copied.CLAUDE.mdmarker with a fenced block (<!-- @aziontech/webkit:start -->…<!-- @aziontech/webkit:end -->) thatbundle.js#spliceFragmentreplaces in place on everyinitrun, so template updates reach a project that already raninit. A pre-fence legacy marker is migrated automatically, and a fragment duplicated across more than one legacy marker (the real case in the docs repo) is repaired down to one fenced block.fenceaction (written | merged | skipped) toapply.js, wired intocli.js's dry-run printer.How to test
pnpm --filter @aziontech/webkit test:toolkit— newtest/cli/bundle.test.mjscoverslistBundle(equals a plain directory walk, includeswebkit-comments.mdand every skill'sSKILL.md) andspliceFragment(empty file, existing content, legacy single marker, legacy duplicated marker, already-fenced replace, stray extra fenced block — each asserted idempotent);test/cli/plan.test.mjsupdated for the derived bundle and thefenceaction.pnpm --filter @aziontech/webkit lintandpnpm --filter @aziontech/webkit format:check.pnpm --filter @aziontech/webkit run smoke:consume(ornode packages/webkit/scripts/smoke-consume.mjsdirectly) — builds the real packages, packs them, scaffolds a Vite app, runs the packedwebkit init, and builds it. Confirms the consumer's.claude/gets all 44 templates (was 43) includingwebkit-comments.md, andCLAUDE.mdgets exactly one fenced block.inittwice against a project whoseCLAUDE.mdalready has the old single-line marker (optionally duplicated at two positions) and confirm it converges to one fenced block with the current fragment body, with surrounding user content preserved.Notes
None. Exported surface for anything building on top of this (e.g. a future
webkit sync):bundle.jsexportsCLAUDE_TEMPLATES,listBundle(templatesDir?),spliceFragment(source, body, { start?, end? }),FRAGMENT_START,FRAGMENT_END,LEGACY_MARKER;plan.jskeeps re-exporting the legacy marker asCLAUDE_FRAGMENT_MARKERfor backward compatibility; thefenceaction shape is{ type: 'fence', path, start, end, content }.