Skip to content

re-frame2-setup

Scaffolds a fresh re-frame2 ClojureScript project from nothing — deps, npm packages, shadow-cljs.edn, entry namespace, first counter — and stops when the counter mounts.

What it does

The re-frame2-setup skill bootstraps a greenfield re-frame2 project. The author starts with nothing (or close to nothing — a deps.edn they intend to fill in, an empty package.json, no source). When the skill is done, the author has a project that compiles under shadow-cljs watch, mounts a working counter in the browser, and is ready to switch to the re-frame2 skill for writing application code.

The skill teaches only the re-frame2-specific wiring: which artefacts to add, the lockstep VERSION discipline (every day8/re-frame2* framework artefact ships at one VERSION, per Conventions §Lockstep versioning through 1.0; mixing versions is unsupported; Xray and Story are tools and ship on their own xray-v* / story-v* tags), the canonical (rf/init! reagent-adapter/adapter) entry-namespace shape, and a counter that exercises every layer end-to-end (event → handler → app-db change → sub recompute → view re-render). It does not teach deps.edn, npm, or shadow-cljs themselves — those are assumed.

When to reach for it

Load this skill when any of these are true:

  • The author has just created a new directory and wants re-frame2 set up in it.
  • The author has an existing CLJS project but no re-frame2 wiring yet.
  • The author says "start a re-frame2 project", "scaffold re-frame2", "how do I set up re-frame2", "give me a hello-world re-frame2 app".
  • A counter / event / sub fails to compile because the build doesn't yet know what re-frame.core or re-frame.adapter.reagent is.

Do not use this skill for:

  • Writing application code in a project that's already on re-frame2 → use re-frame2.
  • Migrating a re-frame v1 project → use re-frame-migration.
  • Inspecting / debugging a running app → use re-frame2-pair.

Kickoff

The skill auto-triggers on greenfield-setup phrasings. To force-load:

/skill re-frame2-setup

The skill walks six steps in order: write the thirteen files of the canonical scaffold (the generator template's own emission — core + the Reagent adapter + reagent/reagent, a two-build shadow-cljs.edn, the entry namespace, split events / subs / views, a first story, a starter test, the page — with the template's pinned baseline already in deps.edn and package.json, no question asked), point the framework coordinates at the reviewed checkout while re-frame2 is unpublished, then npm install, a terminating npx shadow-cljs compile app, the watch, and the report — the skill runs every command itself and hands back the URL. An unqualified request takes no clarification round; the Reagent adapter is the default reference substrate, and UIx is supported only on explicit request as a four-file swap. Story, the component playground, comes wired at #/stories; nothing else beyond the counter is day-one — schemas, Xray and the rest attach later, on request. The skill stops at "the counter mounts" — the author confirms the mount in the open page, and writing tests, schemas, or further features is the next skill's job.

Where the skill lives

  • Source: skills/re-frame2-setup/
  • SKILL.md: skills/re-frame2-setup/SKILL.md
  • Reference leaves: skills/re-frame2-setup/references/first-counter.md (the default scaffold: the thirteen files, derived from the generator template and drift-locked against it — the only leaf the default route reads), deps-versions.md (the lockstep contract; the default pins and how to override them; the pre-publish coordinate shapes), shadow-cljs.md (the build config and page explained key by key), entry-namespace.md (the entry-namespace boot lifecycle; why rf/init! runs first; the UIx four-file swap).