Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
d2d5a85
chore: start the scaffold feature-gallery (#824)
Jul 7, 2026
1990dc2
feat(cli): gallery flagship /todo example (optimistic + a11y + PE + m…
Jul 7, 2026
6349270
feat(cli): gallery /tic-tac-toe example (client-only signals) (#824)
Jul 7, 2026
1244433
feat(cli): gallery /components example (factory, signals, slots) (#824)
Jul 7, 2026
35a37ab
feat(cli): gallery /routing example (static + dynamic [id] param) (#824)
Jul 7, 2026
be675dd
feat(cli): gallery /server-actions example (.server vs use server) (#…
Jul 7, 2026
b40c73d
feat(cli): wire the always-on example gallery into the full-stack sca…
Jul 7, 2026
0a14a77
refactor(ui): default webjs projects to styles/globals.css
Jul 7, 2026
705e242
fix(cli): use object-form orderBy in the gallery todo query
Jul 7, 2026
011ecba
docs(cli): teach scaffold agents the gallery, pruning, and app-routin…
Jul 7, 2026
17a84f5
fix(cli): fix two type errors in the gallery components
Jul 7, 2026
7d8fcd1
feat(cli): add async-render, directives, and route-handler gallery ex…
Jul 7, 2026
87b0372
refactor(cli): split the gallery into features/ and one example app
Jul 7, 2026
4249c46
docs(cli): tell agents to study the gallery fully before pruning
Jul 7, 2026
7fd3183
fix(cli): repair stale /examples/ links in the moved feature demos
Jul 7, 2026
5f25164
test(cli): guard against stale /examples/ links in feature pages
Jul 7, 2026
cba8c8e
docs(cli): point gallery comments at the app's own AGENTS.md
Jul 7, 2026
7ea4955
fix(cli): polish gallery components with the UI kit
Jul 7, 2026
d642319
feat(cli): redesign gallery components to real-product quality
Jul 7, 2026
8981148
fix(cli): make the hero accent stable across back-navigation
Jul 7, 2026
a5f0c42
fix(cli): show a title-cased app name in the example hero
Jul 7, 2026
0442427
feat(cli): match the scaffold accent to the webjs website (light + dark)
Jul 7, 2026
1ed26d8
feat(cli): add the forms feature demo (no-JS PE + page action)
Jul 7, 2026
65d7b86
fix(cli): stop the accent flipping to neutral on back-navigation
Jul 7, 2026
e3e4fbe
refactor(cli): use one canonical shadcn token system (no invented vocab)
Jul 7, 2026
da19914
fix: correct the docs domain to webjs.dev (we own .dev, not .com)
Jul 7, 2026
9d0ede6
fix(cli): stop the layout forcing a scrollbar on short pages
Jul 7, 2026
0c6e457
fix(cli): give saas its own home; teach agents the single-theme rule
Jul 7, 2026
13d6452
feat(cli): add a "Built with webjs" footer with the brand mark
Jul 7, 2026
922631b
feat(cli): add 9 advanced gallery feature demos (#827)
Jul 7, 2026
b140fb7
docs(cli): sync the single-theme token rule across all agent rule files
Jul 7, 2026
229c0ed
test(server): update dev-handler docs URL assertion to webjs.dev
Jul 7, 2026
2a0d59c
fix(cli): register the service worker at root /sw.js in the demo
Jul 7, 2026
91473f8
feat(cli): showcase type-safe routes in the routing gallery demo
Jul 7, 2026
4b6cf30
docs(cli): note navigate() route type-safety in the routing demo
Jul 7, 2026
e6b40c1
docs(cli): contrast navigate() vs redirect() in the routing demo
Jul 7, 2026
5e0c2db
fix(cli): restore the --accent-tint token the theme rename dropped
Jul 7, 2026
b4ec348
feat(cli): give the api template a JSON root index instead of a 404
Jul 7, 2026
05465e2
fix(cli): use shadcn token roles (primary=brand, accent=neutral hover)
Jul 7, 2026
76048b9
docs(cli): update brand-tint token examples to primary in rule files
Jul 7, 2026
ad903a7
feat(cli): ship the feature gallery in the saas template too
Jul 7, 2026
d8209ef
feat(cli): add a backend-features showcase to the api template
Jul 7, 2026
f819b35
fix(cli): serve the api stream demo as text/plain so browsers render it
Jul 7, 2026
10eeabe
fix(cli): make the POST/WS api demos explorable with a GET usage handler
Jul 7, 2026
f251c02
docs(cli): add the missing explanatory header to the delete-todo action
Jul 7, 2026
b7f361f
docs: document the scaffold gallery + api backend showcase across sur…
Jul 7, 2026
cbc89a7
chore: add a webjs-scaffold-sync skill (scaffold-side sibling of doc-…
Jul 7, 2026
b75b707
feat: hard-gate scaffold sync on framework-feature commits (#826)
Jul 7, 2026
761bc04
refactor(cli): use buttonClass() for the todo composer Add button
Jul 7, 2026
c89b1aa
refactor(cli): use inputClass() for the todo composer input
Jul 7, 2026
d0b8848
revert(cli): restore the bespoke todo composer (input + button)
Jul 7, 2026
ffd1c79
fix(docs): avoid the literal placeholder token in the getting-started…
Jul 7, 2026
d724654
Merge remote-tracking branch 'origin/main' into feat/scaffold-feature…
Jul 7, 2026
6503983
docs(scaffold): say prune after using features AND examples as reference
Jul 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/webjs-doc-sync/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ applies, then update or consciously skip each.
2. **`README.md`** (repo root). Update when a headline capability changes (the
feature list, the quickstart, the runtime/template matrix).
3. **The docs site: `docs/app/docs/<topic>/page.tsx`.** This is the
user-facing documentation at docs.webjs.com. Find the topic page(s) that cover
user-facing documentation at docs.webjs.dev. Find the topic page(s) that cover
the area (`server-actions`, `routing`, `components`, `caching`, `configuration`,
`client-router`, `data-fetching`, ...) and update them. `llms.txt` /
`llms-full.txt` are generated LIVE from the doc pages (no build step), so they
Expand Down
98 changes: 98 additions & 0 deletions .claude/hooks/require-scaffold-with-src.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#!/usr/bin/env bash
#
# PreToolUse hook: BLOCK a `git commit` that changes framework FEATURE
# source but stages NO scaffold surface. The scaffold is webjs's PRIMARY
# teaching surface for AI agents: an agent learns the framework by reading
# the generated gallery/showcase and its comments, then builds the real app
# by adapting them. So when a webjs FEATURE is added or changed, the scaffold
# that teaches it must move too, exactly as the docs must (this is the
# scaffold twin of require-docs-with-src.sh).
#
# It fires on every commit, decides from the STAGED diff (not model
# judgement), and BLOCKS (exit 2) when framework-feature source is staged
# with no scaffold surface in the same commit.
#
# What a hook CANNOT do: know WHETHER a given change actually needs a
# scaffold demo (a bug fix, an internal perf change, or a tweak to an
# already-demoed feature may not). So it enforces the floor (a
# feature-source commit must stage SOME scaffold surface OR consciously opt
# out) and points at the webjs-scaffold-sync skill for the per-surface walk
# and the mandatory generate-boot-check.
#
# Scope: only fires on `git commit` Bash calls. Inspects the STAGED diff,
# so `git add` choices drive it.
#
# Trigger (feature source that MAY need a scaffold update): the runtime +
# CLI packages' src, packages/(core|server|cli)/src/**. Editor plugins, the
# MCP, and intellisense do not shape the scaffold, so they are excluded.
#
# Satisfying surface: the scaffold itself, packages/cli/templates/** (the
# template files + per-agent rule files) OR packages/cli/lib/** (the
# create.js / saas-template.js / api-gallery.js generators).
#
# Allowed (exit 0): commits touching no feature src; commits that stage a
# scaffold surface alongside the source; and a change that genuinely needs
# no scaffold update (a bug fix, an internal refactor, a tweak to an
# already-demoed feature) via WEBJS_NO_SCAFFOLD_GATE=1.
#
# Rule: AGENTS.md "Code workflow" (Scaffold) + the webjs-scaffold-sync skill.

set -euo pipefail

if [ "${WEBJS_NO_SCAFFOLD_GATE:-}" = "1" ]; then
exit 0
fi

payload=$(cat)
cmd=$(printf '%s' "$payload" | jq -r '.tool_input.command // empty' 2>/dev/null || true)
if [ -z "$cmd" ]; then exit 0; fi

# Match `git commit` as a whole word (a real commit, not git commit-tree).
if ! printf '%s' "$cmd" | grep -Eq '(^|[^[:alnum:]-])git commit([^[:alnum:]-]|$)'; then
exit 0
fi

if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then exit 0; fi

staged=$(git diff --cached --name-only 2>/dev/null || true)
if [ -z "$staged" ]; then exit 0; fi

# Framework FEATURE source: the runtime + CLI packages' src. A change here is
# the kind that MAY need the scaffold that teaches it to move too.
src_touched=$(printf '%s\n' "$staged" | grep -E '^packages/(core|server|cli)/src/' || true)
if [ -z "$src_touched" ]; then exit 0; fi

# Any scaffold surface staged in the same commit? The scaffold is the
# templates (files + per-agent rule files) and the generators (cli/lib).
scaffold_staged=$(printf '%s\n' "$staged" | grep -E '^packages/cli/(templates|lib)/' || true)
if [ -n "$scaffold_staged" ]; then exit 0; fi

cat >&2 <<'EOF'
BLOCKED: this commit changes framework-feature source but stages no scaffold.

Staged source under packages/(core|server|cli)/src/** with no scaffold
surface in the same commit. The scaffold is webjs's PRIMARY teaching surface
for AI agents (they learn the framework by reading the generated
gallery/showcase, then build the real app by adapting it), so a task is NOT
done until the scaffold that teaches the changed feature is in sync too.

If this added or changed a webjs FEATURE an agent should learn from the
scaffold (a new export/API, an html hole, a lifecycle hook, a server-action
capability, a config key, a CLI behaviour), invoke the webjs-scaffold-sync
skill, then `git add` the scaffold surface(s) and commit again:
packages/cli/templates/gallery/ a UI feature-gallery demo (full-stack + saas)
packages/cli/lib/api-gallery.js an api backend-showcase endpoint
packages/cli/lib/{create,saas-template}.js the generators (home, theme, schema, wiring)
packages/cli/templates/ (AGENTS/CONVENTIONS/.cursorrules/...) scaffold rules in lockstep
test/scaffolds/** the scaffold assertions for the above
The skill walks every surface AND runs the mandatory generate + boot +
`webjs check` verification (the generators emit strings, so escaping bugs
only show in a freshly generated app).

Change that genuinely needs no scaffold update (a bug fix, an internal
refactor, a tweak to an already-demoed feature)? Re-run with
WEBJS_NO_SCAFFOLD_GATE=1.

Hook: .claude/hooks/require-scaffold-with-src.sh
EOF
exit 2
19 changes: 19 additions & 0 deletions .claude/hooks/route-skills.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,25 @@ if has '(doc|documentation) (gap|drift|sync|coverage|debt)' \
add_match "webjs-doc-sync: the request is about documentation sync, drift, or a doc gap. Invoke the webjs-doc-sync skill BEFORE editing any doc. It holds the authoritative map of EVERY surface (AGENTS.md + agent-docs/, README, the docs site under docs/app/docs/, the marketing website/, and the scaffold templates' per-agent rule files) and the change-type to surface mapping, so no surface is silently skipped. File each confirmed gap via webjs-file-issue."
fi

# --- webjs-scaffold-sync: keep every scaffold surface in sync -----------
# Triggers: change what `webjs create` generates (a gallery/showcase demo, a
# template, the generated layout/home/theme/schema), sync the scaffold,
# "update all three templates", check the scaffold is consistent, teach
# agents via the scaffold. The scaffold is webjs's PRIMARY teaching surface,
# so a change must propagate across the generators (packages/cli/lib/*), the
# per-agent rule files, the scaffold tests, the framework template-matrix
# docs, and the preview apps, with a mandatory "generate + boot + check".
if has '(sync|update|check|fix|add to).{0,24}(the )?(scaffold|template)' \
|| has '(all (three|3) )?(scaffold )?templates?\b' \
|| has 'gallery.{0,40}(template|saas|api|full-?stack|scaffold)' \
|| has '(ship|include|add|put).{0,30}(the )?(gallery|showcase)' \
|| has '(add|new|update).{0,24}(gallery|showcase)' \
|| has '(scaffold|gallery) (consistent|in sync|drift|gap)' \
|| has 'what `?webjs create`? generates' \
|| has '(feature|backend) gallery'; then
add_match "webjs-scaffold-sync: the request changes what \`webjs create\` generates (a gallery/showcase demo, a template, a generated file, a scaffold convention). Invoke the webjs-scaffold-sync skill BEFORE editing. It holds the authoritative map of every scaffold surface (the packages/cli/lib/* generators, the templates/, the per-agent rule files in lockstep, the scaffold tests, the framework template-matrix docs, the preview apps) plus the mandatory generate-boot-check verification, so no surface is silently skipped. It is the scaffold-side sibling of webjs-doc-sync."
fi

# --- code-review: review the diff before a PR is ready ------------------
# Triggers: review the PR/diff/branch/changes, code review, look it over
# for bugs. Reviewing every change before it is marked ready is a standing
Expand Down
4 changes: 4 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
"type": "command",
"command": ".claude/hooks/require-docs-with-src.sh"
},
{
"type": "command",
"command": ".claude/hooks/require-scaffold-with-src.sh"
},
{
"type": "command",
"command": ".claude/hooks/require-bun-parity-with-runtime-src.sh"
Expand Down
10 changes: 8 additions & 2 deletions .claude/skills/webjs-doc-sync/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ applies, then update or consciously skip each.
2. **`README.md`** (repo root). Update when a headline capability changes (the
feature list, the quickstart, the runtime/template matrix).
3. **The docs site: `docs/app/docs/<topic>/page.tsx`.** This is the
user-facing documentation at docs.webjs.com. Find the topic page(s) that cover
user-facing documentation at docs.webjs.dev. Find the topic page(s) that cover
the area (`server-actions`, `routing`, `components`, `caching`, `configuration`,
`client-router`, `data-fetching`, ...) and update them. `llms.txt` /
`llms-full.txt` are generated LIVE from the doc pages (no build step), so they
Expand All @@ -59,7 +59,13 @@ applies, then update or consciously skip each.
`.gemini` / `.opencode` / `.claude` rule files. These per-agent files all carry
the SAME rules in each agent's format; a workflow/convention change must land in
ALL of them in lockstep (the #134 / #136 divergence lesson). The CLI help text
in `packages/cli/` is part of this surface for a new command or flag.
in `packages/cli/` is part of this surface for a new command or flag. When the
change is to what `webjs create` GENERATES (a gallery/showcase demo, a
template, the generated layout/home/theme/schema, a scaffold convention),
this surface has more parts (the `packages/cli/lib/*` generators, the scaffold
tests, the framework template-matrix docs, the preview apps) and a mandatory
"generate + boot + check" step: use the dedicated **`webjs-scaffold-sync`**
skill for those, and treat this doc-sync entry as the docs-only slice.
6. **Example / dogfood apps** (`examples/blog/CONVENTIONS.md` and friends). Update
when a convention the example demonstrates changes.

Expand Down
Loading
Loading