[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6C6MZG1XE06HSCKM02SN2TG":3,"skill-same:01M6C6MZG1XE06HSCKM02SN2TG":79},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":42,"linkOnly":43,"markdownContent":44,"markdownBody":45,"frontMatter":46,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":52,"repositoryHtmlUrl":53,"repositoryHomepageUrl":54,"ownerHtmlUrl":55,"ownerBlogUrl":56,"ownerDescription":57,"updatedAt":58,"install":59,"resources":72},"01M6C6MZG1XE06HSCKM02SN2TG","add-adapter",null,"Playbook for adding a new BarefootJS template adapter package (IR → target template language + native runtime). Use when: adding an adapter for a new template engine or backend language, porting the bf helpers \u002F ParsedExpr evaluator to a new language, or wiring an adapter into conformance, compat, CI, release, and docs.","piconic-ai\u002Fbarefootjs","piconic-ai","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F248307881?v=4","01M6C6MWCHP3XFVX9N9BB6NA08","01M6C6MWH6SQWFMBKQ0JV4TPQ3",26,"MIT","https:\u002F\u002Fgithub.com\u002Fpiconic-ai\u002Fbarefootjs\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fadd-adapter\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41],"add","add adapter","adapter","runtime","new","helpers","when","porting","wiring","for","conformance","native","end","docs","barefootjs","backend","use","template engine","engine","template","playbook","ci","package","release","2026-11-10 10:12:30",false,"---\nname: add-adapter\ndescription: \"Playbook for adding a new BarefootJS template adapter package (IR → target template language + native runtime). Use when: adding an adapter for a new template engine or backend language, porting the bf helpers \u002F ParsedExpr evaluator to a new language, or wiring an adapter into conformance, compat, CI, release, and docs.\"\nmetadata:\n  short-description: \"Add a new BarefootJS adapter end-to-end\"\n---\n# Add a New Adapter\n\nThis is the end-to-end playbook for adding a `packages\u002Fadapter-\u003Cname>` package. It exists\nbecause the task is long (a full adapter lands ~30 files, ~6k lines) and the failure mode is\npredictable: writing lots of adapter code before the conformance loop is running, or finishing\nthe package but missing the repo-wide integration points. Follow the phases **in order** — each\none ends with something that compiles and a test loop that stays green.\n\n## Read first (in this order, before writing any code)\n\n1. `spec\u002Fcompiler.md` — \"Adapter API\" and \"Implementing a New Adapter\" sections (the\n   `TemplateAdapter` contract, `TemplateSections`, per-kind emitter pattern, capability flags).\n2. `spec\u002Fadapter-architecture.md` — the constitution: IR carries semantics, adapters never\n   parse\u002Fregex expression strings, thin adapter object + pure domain modules over `EmitContext`.\n3. `docs\u002Fcore\u002Fadapters\u002Fcustom-adapter.md` — step-by-step coding walkthrough of each render method.\n4. `spec\u002Ftemplate-helpers.md` — the `bf` helper catalogue the native runtime must implement.\n5. Skim the newest comparable adapter's initial commit for the authoritative file list:\n   `git log --oneline --grep 'adapter' -- packages\u002Fadapter-blade packages\u002Fadapter-rust`\n   (e.g. `9da1880` blade, `0e6aeeb` rust — both land nearly self-contained in one package).\n\n## Phase 0 — Scoping decisions (write these down before coding)\n\nPick the closest existing adapter and copy its skeleton; do not design from scratch:\n\n| Target runtime | Copy from | Base class |\n|---|---|---|\n| Full JS engine template (can run JS at SSR) | `packages\u002Fadapter-hono` | `JsxAdapter` |\n| String-template DSL, compiled language | `packages\u002Fadapter-go-template`, `adapter-rust` | `BaseAdapter` (Go), `DslTemplateAdapter` (Rust) |\n| String-template DSL, dynamic language | `packages\u002Fadapter-erb`, `adapter-jinja`, `adapter-twig`, `adapter-blade` | `DslTemplateAdapter` |\n| Perl family | `packages\u002Fadapter-mojolicious`, `adapter-xslate`, `adapter-perl` | `DslTemplateAdapter` |\n\n`DslTemplateAdapter` (`packages\u002Fjsx\u002Fsrc\u002Fadapters\u002Fdsl-template-adapter.ts`) owns `generate()` and\nthe per-compile state it resets; the adapter supplies its diagnostic name, its reserved-name\nspelling, any extra state (`resetAdapterState`), its script registrations and its two seeds.\n\nDecide and record:\n- **Runtime model**: JS-engine (`clientShimSource`, `acceptsTemplateCall`) vs DSL\n  (`templatePrimitives` map only, both others `undefined`).\n- **`templatesPerComponent`** and the template file `extension`.\n- **Where the native runtime lives**: in-package (like `adapter-erb\u002Flib`, `adapter-go-template\u002Fruntime`)\n  or shared with a sibling (like blade reusing `adapter-php`'s runtime).\n- **Helper naming convention** for lowering-node dispatch (`bf_*` Go, `bf->*` Perl\u002FMojo,\n  `$bf.*` Xslate, `bf.*` Ruby\u002FJinja-family) — stay consistent with the language's idiom.\n\n## Phase 1 — Package skeleton (compiles, empty adapter)\n\nCreate `packages\u002Fadapter-\u003Cname>\u002F` by copying the chosen reference. The invariant shape:\n\n```\npackage.json          # exports: \".\" , \".\u002Fadapter\" (src), \".\u002Fvite\", \".\u002Ftest-render\" (\"bun\" condition ONLY)\ntsconfig.json\nsrc\u002Findex.ts          # re-exports adapter + conformancePins\nsrc\u002Fvite.ts            # barefoot() — composes core @barefootjs\u002Fvite's plugin with this adapter's\n                        # TemplateAdapter instance; the user's vite.config.ts imports this, not a\n                        # barefoot.config.ts factory (that pipeline is gone — see PR 7a-7c)\nsrc\u002Fconformance-pins.ts  # ConformancePins — per-fixture BF101\u002FBF103 refusals (also consumed by bf compat)\nsrc\u002Ftest-render.ts    # spawns the REAL backend toolchain; Bun-only, behind the \"bun\" export condition\nsrc\u002F__tests__\u002F\u003Cname>-adapter.test.ts  # the single runAdapterConformanceTests(...) call\nsrc\u002Fadapter\u002F\n  \u003Cname>-adapter.ts   # thin orchestrator: TemplateAdapter impl, CompileState, dispatch methods\n  emit-context.ts     # the seam domain modules depend on (never the concrete class)\n  analysis\u002Fcomponent-tree.ts\n  expr\u002F{emitters,array-method,operand}.ts   # ParsedExpr → target language\n  lib\u002F{constants,ir-scope,\u003Clang>-naming,types}.ts\n  memo\u002Fseed.ts        props\u002F…  spread\u002Fspread-codegen.ts  value\u002F…\n\u003Cnative runtime dir>  # lib\u002F (gem), runtime\u002F (go module), php\u002F, … with its own tests\n```\n\nThe workspace glob (`packages\u002F*`) picks the package up automatically. Deps: `@barefootjs\u002Fshared`\nas dependency, `@barefootjs\u002Fjsx` as peer + dev, `@barefootjs\u002Fadapter-tests` as dev.\n\n**Checkpoint**: `bun install && tsgo --noEmit -p packages\u002Fadapter-\u003Cname>` passes.\n\n## Phase 2 — Adapter core\n\nImplement `TemplateAdapter` (`packages\u002Fjsx\u002Fsrc\u002Fadapters\u002Finterface.ts`). Non-negotiables:\n\n- **Emit via the shared dispatchers** — implement `ParsedExprEmitter` \u002F `IRNodeEmitter\u003CCtx>` \u002F\n  `AttrValueEmitter` visitor interfaces. Never write your own `switch (kind)` with a permissive\n  `default`: the shared dispatchers' `assertNever` is the drift-defence that turns a new IR kind\n  into a compile error in your adapter.\n- **No expression parsing.** `parseExpression`, `ts.createSourceFile`, and regex over expression\n  strings are forbidden in adapter code — the IR supplies `ParsedExpr` (`MemoInfo.parsed`,\n  `IRExpression.parsed`, `parsedCondition`, `ExpressionAttr.parsed`). If a field you need isn't\n  carried yet, extend the shared layer per \"How to add a unit\" in `spec\u002Fadapter-architecture.md`.\n- **Sections, not post-processing**: return `AdapterOutput.sections` (`imports\u002Ftypes\u002Fcomponent\u002F\n  defaultExport\u002FmoduleConstants`); the compiler concatenates and never parses your template.\n- **Hydration markers**: `renderScopeMarker` \u002F `renderSlotMarker` \u002F `renderCondMarker` emit\n  `bf-s` \u002F `bf` \u002F `bf-c`; the marker-conformance suite asserts the ids match the IR's.\n- **Lowering nodes** (`packages\u002Fjsx\u002Fsrc\u002Flowering-registry.ts`): in `generate()` bind matchers once\n  with `prepareLoweringMatchers(ir.metadata)` and store them in `CompileState`. When lowering a\n  call, try the matchers; render a `LoweringNode` with one renderer per node kind, **dispatching on\n  the `helper` id** (guarded by `isValidHelperId`) mapped to your runtime naming (e.g. `query` →\n  `bf_query`). Reference: `packages\u002Fadapter-go-template\u002Fsrc\u002Fadapter\u002Fexpr\u002Furl-builder.ts`. Never\n  render an unmapped helper verbatim, and never special-case a built-in like `queryHref` outside\n  this path (see AGENTS.md \"Structural lowering registration\").\n- Keep the object thin: per-compile state in `CompileState` reset per `generate()`, logic in pure\n  functions over `emit-context.ts`, stateless helpers in `lib\u002F`.\n\n**Checkpoint**: the simplest shared fixture compiles to a plausible template (drive it from a\nscratch test before wiring the full suite).\n\n## Phase 3 — Native runtime + golden vectors\n\nThe target language needs a runtime package shipping:\n- The `bf` **template helpers** per `spec\u002Ftemplate-helpers.md` (incl. the `query` helper matching\n  client `queryHref` semantics exactly — guards, emptiness, array append).\n- A **ParsedExpr evaluator** porting `packages\u002Fadapter-tests\u002Fvectors\u002Feval-reference.ts` semantics.\n- **Golden-vector replay tests** in the target language for both\n  `packages\u002Fadapter-tests\u002Fvectors\u002Fvectors.json` and `eval-vectors.json`, plus a hand-maintained\n  `vector-divergences.json` in your package (auto-discovered by\n  `packages\u002Fadapter-tests\u002Fsrc\u002F__tests__\u002Fdivergences.test.ts` — and note its `EXPECTED_BACKENDS`\n  list must gain your language).\n- Dev-reload support if the scaffold story needs it (pattern: `lib\u002Fbarefoot_js\u002Fdev_reload.rb`,\n  `runtime\u002Fbfdev\u002F`).\n\nFollow `packages\u002Fadapter-tests\u002Fvectors\u002FREADME.md` \"Adding a new backend\".\n\n**Checkpoint**: native-language test suite green locally (skip gracefully when the toolchain is\nmissing — see `onRenderError` in existing conformance tests).\n\n## Phase 4 — The conformance loop (this is most of the work)\n\nWire `runAdapterConformanceTests` (`packages\u002Fadapter-tests\u002Fsrc\u002Frun-adapter-conformance.ts`) in\nyour `src\u002F__tests__\u002F` with: `name`, `factory`, `render` (your `test-render.ts` spawning the real\nbackend), `onRenderError`, `expectedDiagnostics: conformancePins`, and initially-broad `skipJsx`.\n\nThen iterate: **pick one failing fixture at a time**, make it pass, shrink the skip list, commit.\n~190 shared fixtures exist; do not try to clear them in one pass and do not edit shared fixtures\nto fit your adapter. Rules for what remains skipped\u002Fpinned at the end:\n- A **genuine capability refusal** (target language can't express it) becomes an\n  `expectedDiagnostics` pin in `conformance-pins.ts` whose `limitation` field cites the registry\n  entry (`packages\u002Fadapter-tests\u002Flimitations\u002F\u003Cid>.ts`) it is an instance of — add the entry (or\n  add your fixture to an existing one) in the same PR; the join test refuses an unknown id.\n- `skipJsx` (derived from `renderDivergences`, which cites an entry the same way) \u002F\n  `skipTemplatePrimitives` \u002F `skipMarkerConformance` entries likewise each carry a limitation\n  pointer. An unexplained skip is a review blocker.\n\nAlso verify: `no-bun-coupling.test.ts` (published sources Bun-free except the `\"bun\"`-gated\n`.\u002Ftest-render`), marker conformance, and the CSR conformance suite (adapter-independent — you\nshould never need to touch `csr-conformance.test.ts`).\n\n**Checkpoint**: `bun test packages\u002Fadapter-\u003Cname>` and `bun test packages\u002Fadapter-tests` green;\n`tsgo --noEmit` and `bun run lint` (biome) clean.\n\n## Phase 5 — Repo integration checklist (every line, in this order)\n\nThe initial package commit is nearly self-contained, but these cross-cutting registrations are\neasy to miss — check off each one:\n\n- [ ] `packages\u002Fadapter-tests\u002Fsrc\u002F__tests__\u002Fdivergences.test.ts` — add the language to\n      `EXPECTED_BACKENDS` (only if this is a new backend language).\n- [ ] `packages\u002Fadapter-tests\u002Fsrc\u002F__tests__\u002Fimport-map-injection.contract.test.ts` — add the\n      adapter to `ADAPTERS`.\n- [ ] `packages\u002Fcompat\u002Fsrc\u002Fadapter-registry.ts` — add `{ pkg, className }` to `COMPAT_ADAPTERS`\n      (the ONE enumeration of TemplateAdapter packages); add the workspace devDependency in\n      `packages\u002Fcompat\u002Fpackage.json`; regenerate `ui\u002Fcompat.lock.json` via `bun run compat:lock`\n      (CI fails on drift).\n- [ ] Publish set — nothing to edit: `scripts\u002Flib\u002Fworkspace-packages.ts` derives it (every\n      non-private `packages\u002F*` not in `.changeset\u002Fconfig.json`'s ignore list, dependencies first),\n      and `scripts\u002Flib\u002F__tests__\u002Fpublishable-packages.test.ts` pins that. Run that test to see\n      the new package listed for npm, and — if it has TS `src` exports — for JSR.\n- [ ] **Create the package on each registry before the release that first ships it.** Trusted\n      Publishing (OIDC) can only publish to a package that already exists, so the release\n      workflow refuses to publish anything until these exist (`scripts\u002Frelease-preflight.ts`\n      prints the exact steps; the summary):\n      - npm: publish the first version by hand with a token (`bun pm pack` +\n        `npm publish \u003Ctarball> --access public`), then on npmjs.com → package → Settings →\n        Trusted Publisher → GitHub Actions (`piconic-ai\u002Fbarefootjs`, `release.yml`) **with the\n        \"npm publish\" permission** — without it the next publish fails with\n        \"OIDC permission denied for this action\".\n      - JSR (TS packages only): create it at `https:\u002F\u002Fjsr.io\u002Fnew?scope=barefootjs&package=\u003Cname>`\n        and link the GitHub repository in its settings. No manual publish needed.\n      - Native registry (CPAN \u002F PyPI \u002F RubyGems \u002F crates.io \u002F Packagist): whatever that registry's\n        trusted-publishing setup requires — see the matching job in `release.yml`.\n- [ ] `.github\u002Fworkflows\u002Fci-\u003Cname>.yml` — new workflow, path-filtered on\n      `packages\u002F{client,shared,jsx,adapter-\u003Cname>,adapter-tests}\u002F**`, installing the language\n      toolchain, running native runtime tests then `bun test packages\u002Fadapter-\u003Cname>`\n      (copy the closest `ci-*.yml`). It belongs to the heavy set: keep the copied\n      `pull_request` trigger's `branches: [main]` and its default activity types (no `edited`),\n      and do not add it to `EVERY_PR_WORKFLOWS` in `scripts\u002Flib\u002Fheavy-gate.ts`. The lint\n      `bun test scripts\u002Flib\u002F__tests__\u002Fheavy-gate.test.ts` fails otherwise (AGENTS.md, \"CI on\n      stacked PRs\").\n- [ ] `.github\u002Fworkflows\u002Frelease.yml` — per-language registry publish job (gem\u002Fcrates\u002FPyPI\u002FCPAN\u002F\n      Packagist…), following the existing Trusted-Publishing patterns.\n- [ ] Add a changeset (`.changeset\u002F`) — CI enforces it.\n- [ ] Optional, separate PRs: `bf init` scaffold (`ADAPTERS` map in\n      `packages\u002Fcli\u002Fsrc\u002Flib\u002Ftemplates.ts` + `packages\u002Fcli\u002Fsrc\u002Flib\u002Fadapters\u002F\u003Cname>.ts` +\n      scaffold\u002Fdev-reload contract tests), an `integrations\u002F\u003Cframework>\u002F` example app\n      (+ `integrations\u002FREADME.md`, `docker-compose.yml` mounts), site landing demo backends\n      (`site\u002Fcore\u002Flanding\u002Fgenerate-demo-outputs.ts` `BACKENDS` — every demo must compile there).\n\n## Phase 6 — Docs\n\n- [ ] `docs\u002Fcore\u002Fadapters.md` — \"Available Adapters\" table (generated) and the runtime-model paragraph.\n- [ ] New `docs\u002Fcore\u002Fadapters\u002F\u003Clang>-adapter.md` page (pattern: `ruby-adapter.md`), plus its entry in `site\u002Fcore\u002Flib\u002Fnavigation.ts` and `site\u002Fcore\u002Fcomponents\u002Fmobile-menu.tsx`.\n- [ ] `spec\u002Fcompiler.md` — \"Available Adapters\" list.\n- [ ] `spec\u002Ftemplate-helpers.md` — helper naming column, if a new convention.\n- [ ] `packages\u002Fadapter-tests\u002Fvectors\u002FREADME.md` — runners table.\n- [ ] `AGENTS.md` — Architecture adapter list.\n- [ ] `docs\u002Fcore\u002Fllms.txt` index.\n\n## Working discipline (how to run this as a long task)\n\n- **One phase per commit (minimum).** Within Phase 4, commit every time the skip list shrinks.\n  Each commit message states which fixtures went green.\n- **Keep a scratch checklist** of the Phase 5\u002F6 boxes from the start; tick them as you go rather\n  than reconstructing at the end.\n- **Verify with the suite, not by eye**: the conformance runner comparing against the reference\n  adapter's frozen snapshots is the ground truth. When output differs, diff the emitted template\n  against the closest sibling adapter's output for the same fixture before touching code.\n- **When blocked on a fixture**: check the registry (`packages\u002Fadapter-tests\u002Flimitations\u002F`)\n  first — a sibling adapter may already have pinned the same case; mirror its pin and cite the\n  same limitation id.\n- **Never** edit shared fixtures, frozen snapshots, or the shared dispatchers to make your\n  adapter pass; if the shared layer genuinely needs a new IR-carried field, that is its own\n  stacked, byte-identical-for-existing-adapters PR (spec\u002Fadapter-architecture.md \"How to add a unit\").\n- Final gate before the PR: `bun run build`, `bun test`, `tsgo --noEmit`, `bun run lint`,\n  `bun run compat:lock` drift check, and re-read this checklist top to bottom.\n\n## Kickoff prompt template\n\nPaste this (filled in) to start the task in a fresh session:\n\n```\nAdd a new BarefootJS adapter for \u003CTEMPLATE ENGINE \u002F LANGUAGE> as packages\u002Fadapter-\u003Cname>.\n\nFollow .agents\u002Fskills\u002Fadd-adapter\u002FSKILL.md exactly, phase by phase — read its \"Read first\"\nlist before writing code. Scoping answers: runtime model = \u003CDSL | JS-engine>; copy skeleton\nfrom packages\u002Fadapter-\u003Cclosest>; native runtime lives \u003Cin-package | shared with X>; helper\nnaming = \u003Cbf_* | bf.* | …>.\n\nWork in small commits: package skeleton first, then the adapter core, then the native runtime\nwith golden-vector replay, then grind the conformance suite one fixture at a time (skip list\nshrinks every commit; every surviving skip\u002Fpin cites a registry limitation id). Finish\nwith the Phase 5 integration checklist and Phase 6 docs — every box, none skipped. Do not edit\nshared fixtures, snapshots, or dispatchers. Gate on: bun run build, bun test, tsgo --noEmit,\nbun run lint, bun run compat:lock.\n```\n","# Add a New Adapter\n\nThis is the end-to-end playbook for adding a `packages\u002Fadapter-\u003Cname>` package. It exists\nbecause the task is long (a full adapter lands ~30 files, ~6k lines) and the failure mode is\npredictable: writing lots of adapter code before the conformance loop is running, or finishing\nthe package but missing the repo-wide integration points. Follow the phases **in order** — each\none ends with something that compiles and a test loop that stays green.\n\n## Read first (in this order, before writing any code)\n\n1. `spec\u002Fcompiler.md` — \"Adapter API\" and \"Implementing a New Adapter\" sections (the\n   `TemplateAdapter` contract, `TemplateSections`, per-kind emitter pattern, capability flags).\n2. `spec\u002Fadapter-architecture.md` — the constitution: IR carries semantics, adapters never\n   parse\u002Fregex expression strings, thin adapter object + pure domain modules over `EmitContext`.\n3. `docs\u002Fcore\u002Fadapters\u002Fcustom-adapter.md` — step-by-step coding walkthrough of each render method.\n4. `spec\u002Ftemplate-helpers.md` — the `bf` helper catalogue the native runtime must implement.\n5. Skim the newest comparable adapter's initial commit for the authoritative file list:\n   `git log --oneline --grep 'adapter' -- packages\u002Fadapter-blade packages\u002Fadapter-rust`\n   (e.g. `9da1880` blade, `0e6aeeb` rust — both land nearly self-contained in one package).\n\n## Phase 0 — Scoping decisions (write these down before coding)\n\nPick the closest existing adapter and copy its skeleton; do not design from scratch:\n\n| Target runtime | Copy from | Base class |\n|---|---|---|\n| Full JS engine template (can run JS at SSR) | `packages\u002Fadapter-hono` | `JsxAdapter` |\n| String-template DSL, compiled language | `packages\u002Fadapter-go-template`, `adapter-rust` | `BaseAdapter` (Go), `DslTemplateAdapter` (Rust) |\n| String-template DSL, dynamic language | `packages\u002Fadapter-erb`, `adapter-jinja`, `adapter-twig`, `adapter-blade` | `DslTemplateAdapter` |\n| Perl family | `packages\u002Fadapter-mojolicious`, `adapter-xslate`, `adapter-perl` | `DslTemplateAdapter` |\n\n`DslTemplateAdapter` (`packages\u002Fjsx\u002Fsrc\u002Fadapters\u002Fdsl-template-adapter.ts`) owns `generate()` and\nthe per-compile state it resets; the adapter supplies its diagnostic name, its reserved-name\nspelling, any extra state (`resetAdapterState`), its script registrations and its two seeds.\n\nDecide and record:\n- **Runtime model**: JS-engine (`clientShimSource`, `acceptsTemplateCall`) vs DSL\n  (`templatePrimitives` map only, both others `undefined`).\n- **`templatesPerComponent`** and the template file `extension`.\n- **Where the native runtime lives**: in-package (like `adapter-erb\u002Flib`, `adapter-go-template\u002Fruntime`)\n  or shared with a sibling (like blade reusing `adapter-php`'s runtime).\n- **Helper naming convention** for lowering-node dispatch (`bf_*` Go, `bf->*` Perl\u002FMojo,\n  `$bf.*` Xslate, `bf.*` Ruby\u002FJinja-family) — stay consistent with the language's idiom.\n\n## Phase 1 — Package skeleton (compiles, empty adapter)\n\nCreate `packages\u002Fadapter-\u003Cname>\u002F` by copying the chosen reference. The invariant shape:\n\n```\npackage.json          # exports: \".\" , \".\u002Fadapter\" (src), \".\u002Fvite\", \".\u002Ftest-render\" (\"bun\" condition ONLY)\ntsconfig.json\nsrc\u002Findex.ts          # re-exports adapter + conformancePins\nsrc\u002Fvite.ts            # barefoot() — composes core @barefootjs\u002Fvite's plugin with this adapter's\n                        # TemplateAdapter instance; the user's vite.config.ts imports this, not a\n                        # barefoot.config.ts factory (that pipeline is gone — see PR 7a-7c)\nsrc\u002Fconformance-pins.ts  # ConformancePins — per-fixture BF101\u002FBF103 refusals (also consumed by bf compat)\nsrc\u002Ftest-render.ts    # spawns the REAL backend toolchain; Bun-only, behind the \"bun\" export condition\nsrc\u002F__tests__\u002F\u003Cname>-adapter.test.ts  # the single runAdapterConformanceTests(...) call\nsrc\u002Fadapter\u002F\n  \u003Cname>-adapter.ts   # thin orchestrator: TemplateAdapter impl, CompileState, dispatch methods\n  emit-context.ts     # the seam domain modules depend on (never the concrete class)\n  analysis\u002Fcomponent-tree.ts\n  expr\u002F{emitters,array-method,operand}.ts   # ParsedExpr → target language\n  lib\u002F{constants,ir-scope,\u003Clang>-naming,types}.ts\n  memo\u002Fseed.ts        props\u002F…  spread\u002Fspread-codegen.ts  value\u002F…\n\u003Cnative runtime dir>  # lib\u002F (gem), runtime\u002F (go module), php\u002F, … with its own tests\n```\n\nThe workspace glob (`packages\u002F*`) picks the package up automatically. Deps: `@barefootjs\u002Fshared`\nas dependency, `@barefootjs\u002Fjsx` as peer + dev, `@barefootjs\u002Fadapter-tests` as dev.\n\n**Checkpoint**: `bun install && tsgo --noEmit -p packages\u002Fadapter-\u003Cname>` passes.\n\n## Phase 2 — Adapter core\n\nImplement `TemplateAdapter` (`packages\u002Fjsx\u002Fsrc\u002Fadapters\u002Finterface.ts`). Non-negotiables:\n\n- **Emit via the shared dispatchers** — implement `ParsedExprEmitter` \u002F `IRNodeEmitter\u003CCtx>` \u002F\n  `AttrValueEmitter` visitor interfaces. Never write your own `switch (kind)` with a permissive\n  `default`: the shared dispatchers' `assertNever` is the drift-defence that turns a new IR kind\n  into a compile error in your adapter.\n- **No expression parsing.** `parseExpression`, `ts.createSourceFile`, and regex over expression\n  strings are forbidden in adapter code — the IR supplies `ParsedExpr` (`MemoInfo.parsed`,\n  `IRExpression.parsed`, `parsedCondition`, `ExpressionAttr.parsed`). If a field you need isn't\n  carried yet, extend the shared layer per \"How to add a unit\" in `spec\u002Fadapter-architecture.md`.\n- **Sections, not post-processing**: return `AdapterOutput.sections` (`imports\u002Ftypes\u002Fcomponent\u002F\n  defaultExport\u002FmoduleConstants`); the compiler concatenates and never parses your template.\n- **Hydration markers**: `renderScopeMarker` \u002F `renderSlotMarker` \u002F `renderCondMarker` emit\n  `bf-s` \u002F `bf` \u002F `bf-c`; the marker-conformance suite asserts the ids match the IR's.\n- **Lowering nodes** (`packages\u002Fjsx\u002Fsrc\u002Flowering-registry.ts`): in `generate()` bind matchers once\n  with `prepareLoweringMatchers(ir.metadata)` and store them in `CompileState`. When lowering a\n  call, try the matchers; render a `LoweringNode` with one renderer per node kind, **dispatching on\n  the `helper` id** (guarded by `isValidHelperId`) mapped to your runtime naming (e.g. `query` →\n  `bf_query`). Reference: `packages\u002Fadapter-go-template\u002Fsrc\u002Fadapter\u002Fexpr\u002Furl-builder.ts`. Never\n  render an unmapped helper verbatim, and never special-case a built-in like `queryHref` outside\n  this path (see AGENTS.md \"Structural lowering registration\").\n- Keep the object thin: per-compile state in `CompileState` reset per `generate()`, logic in pure\n  functions over `emit-context.ts`, stateless helpers in `lib\u002F`.\n\n**Checkpoint**: the simplest shared fixture compiles to a plausible template (drive it from a\nscratch test before wiring the full suite).\n\n## Phase 3 — Native runtime + golden vectors\n\nThe target language needs a runtime package shipping:\n- The `bf` **template helpers** per `spec\u002Ftemplate-helpers.md` (incl. the `query` helper matching\n  client `queryHref` semantics exactly — guards, emptiness, array append).\n- A **ParsedExpr evaluator** porting `packages\u002Fadapter-tests\u002Fvectors\u002Feval-reference.ts` semantics.\n- **Golden-vector replay tests** in the target language for both\n  `packages\u002Fadapter-tests\u002Fvectors\u002Fvectors.json` and `eval-vectors.json`, plus a hand-maintained\n  `vector-divergences.json` in your package (auto-discovered by\n  `packages\u002Fadapter-tests\u002Fsrc\u002F__tests__\u002Fdivergences.test.ts` — and note its `EXPECTED_BACKENDS`\n  list must gain your language).\n- Dev-reload support if the scaffold story needs it (pattern: `lib\u002Fbarefoot_js\u002Fdev_reload.rb`,\n  `runtime\u002Fbfdev\u002F`).\n\nFollow `packages\u002Fadapter-tests\u002Fvectors\u002FREADME.md` \"Adding a new backend\".\n\n**Checkpoint**: native-language test suite green locally (skip gracefully when the toolchain is\nmissing — see `onRenderError` in existing conformance tests).\n\n## Phase 4 — The conformance loop (this is most of the work)\n\nWire `runAdapterConformanceTests` (`packages\u002Fadapter-tests\u002Fsrc\u002Frun-adapter-conformance.ts`) in\nyour `src\u002F__tests__\u002F` with: `name`, `factory`, `render` (your `test-render.ts` spawning the real\nbackend), `onRenderError`, `expectedDiagnostics: conformancePins`, and initially-broad `skipJsx`.\n\nThen iterate: **pick one failing fixture at a time**, make it pass, shrink the skip list, commit.\n~190 shared fixtures exist; do not try to clear them in one pass and do not edit shared fixtures\nto fit your adapter. Rules for what remains skipped\u002Fpinned at the end:\n- A **genuine capability refusal** (target language can't express it) becomes an\n  `expectedDiagnostics` pin in `conformance-pins.ts` whose `limitation` field cites the registry\n  entry (`packages\u002Fadapter-tests\u002Flimitations\u002F\u003Cid>.ts`) it is an instance of — add the entry (or\n  add your fixture to an existing one) in the same PR; the join test refuses an unknown id.\n- `skipJsx` (derived from `renderDivergences`, which cites an entry the same way) \u002F\n  `skipTemplatePrimitives` \u002F `skipMarkerConformance` entries likewise each carry a limitation\n  pointer. An unexplained skip is a review blocker.\n\nAlso verify: `no-bun-coupling.test.ts` (published sources Bun-free except the `\"bun\"`-gated\n`.\u002Ftest-render`), marker conformance, and the CSR conformance suite (adapter-independent — you\nshould never need to touch `csr-conformance.test.ts`).\n\n**Checkpoint**: `bun test packages\u002Fadapter-\u003Cname>` and `bun test packages\u002Fadapter-tests` green;\n`tsgo --noEmit` and `bun run lint` (biome) clean.\n\n## Phase 5 — Repo integration checklist (every line, in this order)\n\nThe initial package commit is nearly self-contained, but these cross-cutting registrations are\neasy to miss — check off each one:\n\n- [ ] `packages\u002Fadapter-tests\u002Fsrc\u002F__tests__\u002Fdivergences.test.ts` — add the language to\n      `EXPECTED_BACKENDS` (only if this is a new backend language).\n- [ ] `packages\u002Fadapter-tests\u002Fsrc\u002F__tests__\u002Fimport-map-injection.contract.test.ts` — add the\n      adapter to `ADAPTERS`.\n- [ ] `packages\u002Fcompat\u002Fsrc\u002Fadapter-registry.ts` — add `{ pkg, className }` to `COMPAT_ADAPTERS`\n      (the ONE enumeration of TemplateAdapter packages); add the workspace devDependency in\n      `packages\u002Fcompat\u002Fpackage.json`; regenerate `ui\u002Fcompat.lock.json` via `bun run compat:lock`\n      (CI fails on drift).\n- [ ] Publish set — nothing to edit: `scripts\u002Flib\u002Fworkspace-packages.ts` derives it (every\n      non-private `packages\u002F*` not in `.changeset\u002Fconfig.json`'s ignore list, dependencies first),\n      and `scripts\u002Flib\u002F__tests__\u002Fpublishable-packages.test.ts` pins that. Run that test to see\n      the new package listed for npm, and — if it has TS `src` exports — for JSR.\n- [ ] **Create the package on each registry before the release that first ships it.** Trusted\n      Publishing (OIDC) can only publish to a package that already exists, so the release\n      workflow refuses to publish anything until these exist (`scripts\u002Frelease-preflight.ts`\n      prints the exact steps; the summary):\n      - npm: publish the first version by hand with a token (`bun pm pack` +\n        `npm publish \u003Ctarball> --access public`), then on npmjs.com → package → Settings →\n        Trusted Publisher → GitHub Actions (`piconic-ai\u002Fbarefootjs`, `release.yml`) **with the\n        \"npm publish\" permission** — without it the next publish fails with\n        \"OIDC permission denied for this action\".\n      - JSR (TS packages only): create it at `https:\u002F\u002Fjsr.io\u002Fnew?scope=barefootjs&package=\u003Cname>`\n        and link the GitHub repository in its settings. No manual publish needed.\n      - Native registry (CPAN \u002F PyPI \u002F RubyGems \u002F crates.io \u002F Packagist): whatever that registry's\n        trusted-publishing setup requires — see the matching job in `release.yml`.\n- [ ] `.github\u002Fworkflows\u002Fci-\u003Cname>.yml` — new workflow, path-filtered on\n      `packages\u002F{client,shared,jsx,adapter-\u003Cname>,adapter-tests}\u002F**`, installing the language\n      toolchain, running native runtime tests then `bun test packages\u002Fadapter-\u003Cname>`\n      (copy the closest `ci-*.yml`). It belongs to the heavy set: keep the copied\n      `pull_request` trigger's `branches: [main]` and its default activity types (no `edited`),\n      and do not add it to `EVERY_PR_WORKFLOWS` in `scripts\u002Flib\u002Fheavy-gate.ts`. The lint\n      `bun test scripts\u002Flib\u002F__tests__\u002Fheavy-gate.test.ts` fails otherwise (AGENTS.md, \"CI on\n      stacked PRs\").\n- [ ] `.github\u002Fworkflows\u002Frelease.yml` — per-language registry publish job (gem\u002Fcrates\u002FPyPI\u002FCPAN\u002F\n      Packagist…), following the existing Trusted-Publishing patterns.\n- [ ] Add a changeset (`.changeset\u002F`) — CI enforces it.\n- [ ] Optional, separate PRs: `bf init` scaffold (`ADAPTERS` map in\n      `packages\u002Fcli\u002Fsrc\u002Flib\u002Ftemplates.ts` + `packages\u002Fcli\u002Fsrc\u002Flib\u002Fadapters\u002F\u003Cname>.ts` +\n      scaffold\u002Fdev-reload contract tests), an `integrations\u002F\u003Cframework>\u002F` example app\n      (+ `integrations\u002FREADME.md`, `docker-compose.yml` mounts), site landing demo backends\n      (`site\u002Fcore\u002Flanding\u002Fgenerate-demo-outputs.ts` `BACKENDS` — every demo must compile there).\n\n## Phase 6 — Docs\n\n- [ ] `docs\u002Fcore\u002Fadapters.md` — \"Available Adapters\" table (generated) and the runtime-model paragraph.\n- [ ] New `docs\u002Fcore\u002Fadapters\u002F\u003Clang>-adapter.md` page (pattern: `ruby-adapter.md`), plus its entry in `site\u002Fcore\u002Flib\u002Fnavigation.ts` and `site\u002Fcore\u002Fcomponents\u002Fmobile-menu.tsx`.\n- [ ] `spec\u002Fcompiler.md` — \"Available Adapters\" list.\n- [ ] `spec\u002Ftemplate-helpers.md` — helper naming column, if a new convention.\n- [ ] `packages\u002Fadapter-tests\u002Fvectors\u002FREADME.md` — runners table.\n- [ ] `AGENTS.md` — Architecture adapter list.\n- [ ] `docs\u002Fcore\u002Fllms.txt` index.\n\n## Working discipline (how to run this as a long task)\n\n- **One phase per commit (minimum).** Within Phase 4, commit every time the skip list shrinks.\n  Each commit message states which fixtures went green.\n- **Keep a scratch checklist** of the Phase 5\u002F6 boxes from the start; tick them as you go rather\n  than reconstructing at the end.\n- **Verify with the suite, not by eye**: the conformance runner comparing against the reference\n  adapter's frozen snapshots is the ground truth. When output differs, diff the emitted template\n  against the closest sibling adapter's output for the same fixture before touching code.\n- **When blocked on a fixture**: check the registry (`packages\u002Fadapter-tests\u002Flimitations\u002F`)\n  first — a sibling adapter may already have pinned the same case; mirror its pin and cite the\n  same limitation id.\n- **Never** edit shared fixtures, frozen snapshots, or the shared dispatchers to make your\n  adapter pass; if the shared layer genuinely needs a new IR-carried field, that is its own\n  stacked, byte-identical-for-existing-adapters PR (spec\u002Fadapter-architecture.md \"How to add a unit\").\n- Final gate before the PR: `bun run build`, `bun test`, `tsgo --noEmit`, `bun run lint`,\n  `bun run compat:lock` drift check, and re-read this checklist top to bottom.\n\n## Kickoff prompt template\n\nPaste this (filled in) to start the task in a fresh session:\n\n```\nAdd a new BarefootJS adapter for \u003CTEMPLATE ENGINE \u002F LANGUAGE> as packages\u002Fadapter-\u003Cname>.\n\nFollow .agents\u002Fskills\u002Fadd-adapter\u002FSKILL.md exactly, phase by phase — read its \"Read first\"\nlist before writing code. Scoping answers: runtime model = \u003CDSL | JS-engine>; copy skeleton\nfrom packages\u002Fadapter-\u003Cclosest>; native runtime lives \u003Cin-package | shared with X>; helper\nnaming = \u003Cbf_* | bf.* | …>.\n\nWork in small commits: package skeleton first, then the adapter core, then the native runtime\nwith golden-vector replay, then grind the conformance suite one fixture at a time (skip list\nshrinks every commit; every surviving skip\u002Fpin cites a registry limitation id). Finish\nwith the Phase 5 integration checklist and Phase 6 docs — every box, none skipped. Do not edit\nshared fixtures, snapshots, or dispatchers. Gate on: bun run build, bun test, tsgo --noEmit,\nbun run lint, bun run compat:lock.\n```\n",{"name":5,"metadata":47,"description":7},{"short-description":48},"Add a new BarefootJS adapter end-to-end","main","5cd8ab284f7f3de6ee2d32c50864168e51f94c80",".agents\u002Fskills\u002Fadd-adapter",0,"https:\u002F\u002Fgithub.com\u002Fpiconic-ai\u002Fbarefootjs","https:\u002F\u002Fbarefootjs.dev","https:\u002F\u002Fgithub.com\u002Fpiconic-ai","https:\u002F\u002Fpiconic.ai\u002F","Baby steps to Giant strides.","2026-11-14 17:33:54",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add piconic-ai\u002Fbarefootjs --skill add-adapter",{"tool":65,"command":66},"bunx","bunx skills add piconic-ai\u002Fbarefootjs --skill add-adapter",{"tool":68,"command":69},"pnpm","pnpm dlx skills add piconic-ai\u002Fbarefootjs --skill add-adapter","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpiconic-ai\u002Fbarefootjs\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fadd-adapter\u002FSKILL.md",true,[73],{"path":74,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":78},"requires.yaml","REFERENCE","参考文档",48,"https:\u002F\u002Fgithub.com\u002Fjthorare\u002Fagentic-workflow\u002Fblob\u002Fmain\u002Fskills\u002Fdesign-verify-web\u002Frequires.yaml",[80,108,132,151],{"skillNo":81,"name":32,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":90,"publishedAt":42},"01M6C6NAJSHPWEGBNZB6R96GEK","Build, inspect, and debug UI components using @barefootjs\u002Fcli. Use when: creating\u002Fediting\u002Freviewing components, investigating signal dependencies, debugging reactive updates, scaffolding new components, or looking up component APIs.","https:\u002F\u002Fgithub.com\u002Fpiconic-ai\u002Fbarefootjs\u002Fblob\u002Fmain\u002Fplugins\u002Fbarefootjs\u002Fskills\u002Fbarefootjs\u002FSKILL.md",[85],{"categoryNo":86,"categoryName":87,"taxonomyType":88,"taxonomyTypeDesc":89},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[32,91,92,93,94,95,96,97,98,34,99,100,101,102,103,104,105,106,107,24,22],"debugging","editing","debug","component","components","cli","development","ui","up","scaffolding","debug ui","ui components","component development","inspect","updates","reactive","signal",{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":42},"01M6C6N801YG3PVBHJCQPB911F","polish-pr","Finish BarefootJS PRs by addressing CI failures and Pullfrog reviews through current-head verification and one final human notification. Use for PR polish or blocker removal, not a read-only review or status request.","https:\u002F\u002Fgithub.com\u002Fpiconic-ai\u002Fbarefootjs\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fpolish-pr\u002FSKILL.md",[],[115,116,117,118,119,27,120,121,122,123,124,125,126,127,128,39,129,34,130,32,131],"polish pr","pr","polish","prs","request","notification","reviews","read-only","finish","head","review","status","verification","pr polish","read","only","human",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":42},"01M6C6N57NJYRAZQ5BZ106B6XF","implement-issues","Implement BarefootJS GitHub issues or tracked limitations through tested pull requests. Use for issue-to-PR work; use polish-pr for an existing PR's CI and review follow-up.","https:\u002F\u002Fgithub.com\u002Fpiconic-ai\u002Fbarefootjs\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fimplement-issues\u002FSKILL.md",[],[139,140,141,142,125,143,144,116,145,146,39,117,147,34,99,148,32,149,27,150],"implement","issues","implement issues","requests","github","pull requests","github issues","pull","work","issue","follow-up","Existing",{"skillNo":152,"name":32,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":155,"publishedAt":42},"01M6C6N2XR6ZDBYYK5R99XFZ2W","https:\u002F\u002Fgithub.com\u002Fpiconic-ai\u002Fbarefootjs\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fbarefootjs\u002FSKILL.md",[],[32]]