Skip to content

feat(templates): /trellis-template command + web-app template#16

Merged
mattmaynes merged 2 commits into
mainfrom
web-app-template
Jun 28, 2026
Merged

feat(templates): /trellis-template command + web-app template#16
mattmaynes merged 2 commits into
mainfrom
web-app-template

Conversation

@mattmaynes

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the /trellis-install --template <name> flag with a dedicated /trellis-template command (list with no arg, apply with <name>). Applying an opt-in, per-repo bundle is a distinct action from the one-time base install; the flag conflated the two.
  • The owned//seed/ split, the registry (.trellis-templates / .trellis-owned-<name>), and /trellis-update maintenance are unchanged - only the apply entry point moves. No backward-compat path for the old flag (clean break).
  • Adds the web-app template: Next.js 16 (App Router), TypeScript strict, Tailwind CSS v4, and @rogueoak/canopy. The conventions doc is owned/ (refreshed on update); the starter config is seed/ (copied once), so updates never clobber the consumer's app.

Removing a shipped flag is breaking, so this ships as 1.0.0 after merge.

Verification

  • Dry-run: /trellis-template applies both web-app and plugin-release into a scratch repo (owned clobbers, seed cp -Rn never clobbers, registry dedupes); /trellis-update refreshes owned and leaves seed untouched.
  • All CI checks pass locally: check-compliance.test.sh (20), bump-version.test.sh (22), whats-new.test.sh (10); bump-version.sh --check in sync; plugin-release dogfood diff clean; compliance pass clean; all JSON valid.
  • No --template references remain in shipped code/docs (only historical spec/plan/0.4.0-note).

Spec / Plan

  • docs/specs/0006-web-app-template.md
  • docs/plans/0006-web-app-template.md

🤖 Generated with Claude Code

Replace the `/trellis-install --template <name>` flag with a dedicated
`/trellis-template` command (list with no arg, apply with a name). Applying
an opt-in, per-repo bundle is a distinct action from the one-time base
install; the flag conflated the two. The owned/seed split, the registry
(.trellis-templates / .trellis-owned-<name>), and `/trellis-update`
maintenance are unchanged - only the apply entry point moves.

Add the web-app template: Next.js 16 (App Router), TypeScript strict,
Tailwind CSS v4, and the @rogueoak/canopy design system. The conventions
doc is owned (refreshed on update); the starter config is seed (copied
once), so updates never clobber the consumer's app.

Removing a shipped flag is breaking; this ships as 1.0.0.

Refs docs/specs/0006-web-app-template.md, docs/plans/0006-web-app-template.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread trellis/skills/trellis-template/SKILL.md
Comment thread trellis/skills/trellis-template/SKILL.md Outdated
Comment thread trellis/skills/trellis-template/SKILL.md Outdated
Comment thread trellis/skills/trellis-template/SKILL.md Outdated
Comment thread trellis/skills/trellis-template/SKILL.md Outdated
Comment thread trellis/skills/trellis-template/SKILL.md Outdated
Comment thread trellis/skills/trellis-template/SKILL.md Outdated
…oots

Address PR #16 review:

- tester (major): the apply/list logic lived as prose in SKILL.md, untestable
  by CI. Extract it to a shipped script, trellis/scripts/template.sh
  (list/apply/refresh), called by both /trellis-template and /trellis-update so
  the copy/registry logic has one tested home and cannot drift. Add
  template.test.sh (22 cases) and wire it into CI.
- security (minor): guard the template name charset ([A-Za-z0-9_-]) before any
  path use, closing a ../-traversal write.
- engineer/architect/tester (minor): remove the dead `before=$(find ...)` and
  implement a real "seed kept" report; restore the dropped touch of
  .trellis-templates.
- portability bug found while testing: BSD cp -Rn exits non-zero when it skips
  an existing file, failing apply under set -e on a re-apply (macOS). Replace
  with a portable per-file seed copy.

Also add the @rogueoak/roots design foundation to the web-app template
(imported before canopy in globals.css; deps, conventions, and READMEs updated).

Capture the lessons in docs/feedback/0007 and docs/overview/learnings.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mattmaynes

Copy link
Copy Markdown
Contributor Author

Review addressed (4cb1656)

All seven persona comments resolved:

  • Tester (major) - no test coverage. Extracted the apply/list/refresh logic into a shipped script trellis/scripts/template.sh, called by both /trellis-template and /trellis-update (one tested implementation, no drift). Added template.test.sh (22 cases) wired into CI.
  • Security (minor) - path traversal. Template name is charset-guarded ([A-Za-z0-9_-]) before any path use; covered by a test.
  • Engineer/Architect/Tester (minor) - dead before=, unimplemented skip report, dropped touch. Removed the dead code, implemented a real per-file "seed kept" report, restored the touch.

Also found and fixed while writing the test: BSD cp -Rn exits non-zero when it skips an existing file, which failed a re-apply under set -e on macOS. Replaced with a portable per-file seed copy. Lessons captured in docs/feedback/0007 + docs/overview/learnings.md.

Separately, added the @rogueoak/roots design foundation to the web-app template (imported before canopy).

Local CI-equivalent: all four test suites green (compliance 20, bump-version 22, whats-new 10, template 22), compliance pass clean, bump-version.sh --check in sync, plugin-release dogfood diff clean, no --template left in shipped code/docs.

@mattmaynes mattmaynes merged commit fe6e7e5 into main Jun 28, 2026
1 check passed
@mattmaynes mattmaynes mentioned this pull request Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant