Rename project from hybrids-spec to clearstack, restructure the scaffolder from a nested sub-package into a first-class npm package at the repo root, and shift the developer model from "npx a remote tool" to "install as a devDependency and operate via its binary."
The original scaffolder/ was a nested package designed for one-shot npx usage. That model breaks down for a living spec that needs to push doc and config updates to consuming projects over time. By making clearstack an installed devDependency, projects get:
- Version-pinned spec enforcement via
clearstack check - Controlled upgrades:
pnpm update clearstack→npm run spec:update→ review git diff - No duplicated spec scripts — the package binary handles validation
- Config-driven thresholds read from the project's own
.env
The rename from hybrids-spec to clearstack reflects that this is a full framework specification, not just opinions about the hybrids library.
bin/cli.js— CLI entry point with-y/--yesnon-interactive mode and--mode/--portflagslib/—init.js,update.js,check.js,copy.js,package-gen.jsat repo root (flattened fromscaffolder/)templates/— project templates at repo root (flattened fromscaffolder/templates/)docs/app-spec/README.md+ENTITIES.md— POC app-specific specs demonstrating thedocs/app-spec/patternscripts/sync-docs.js— syncsdocs/*.md→templates/shared/docs/clearstack/before publishscripts/release.js— version bump + docs sync + git tag helper.github/workflows/release.yml— automated npm publish + GitHub Release on tag pushsrc/server.js— moved from rootserver.jsintosrc/
- Package identity: root
package.jsonis now the publishableclearstacknpm package ("bin","files"pointing tobin/,lib/,templates/,docs/) - POC deps moved to devDependencies:
express,hybrids,lucide-static,ws— they're for the proof-of-concept app, not the published package - Published deps: only
@inquirer/promptsanddotenv - Scaffolded projects:
clearstackadded as devDependency;spec,spec:code,spec:docs,spec:updatescripts delegate to theclearstackbinary instead of local script copies - Docs folder structure: scaffolded projects get
docs/clearstack/(spec docs, synced on update) anddocs/app-spec/(project-specific, never touched by updates) server.js→src/server.js: both POC and templates; all imports, configs, scripts, and doc references updated- All references renamed:
hybrids-spec→clearstack/Clearstackacross CLI, lib, templates, docs, configs, workflows, README, CONTRIBUTING updatecommand: now syncs bothdocs/clearstack/and.configs/(previously only docs)checkcommand: supports subcommands (clearstack check code,clearstack check docs)initcommand: always scaffolds into current directory (removed "create subdirectory" mode);-yflag for non-interactive CI usage- Template scripts: removed
spec.js,spec-check.js,spec-run.jsfrom templates — the installed package binary handles spec enforcement
lib/copy.js— missingresolveimport fromnode:pathpackage-gen.js— supports merging with existingpackage.json(preservesprivate,author,license,engines,packageManager,keywords)scripts/spec-run.js— filtersnode_moduleserrors from tsc output (Express v5 ships broken JS that tsc follows via imports).configs/eslint.config.js— updated ignores fromscaffolder/templates/totemplates/src/server.js— added@type {any}cast onexpress()to suppress Express v5 type inference issues
scaffolder/directory — flattened into repo rootscaffolder/package.json— replaced by rootpackage.jsonscaffolder/tests/scaffolder.test.js— needs rewrite for new structure- Root
server.js— moved tosrc/server.js
✅ Code (max 150 lines) (155 files)
✅ Docs (max 500 lines) (36 files)
✅ ESLint
✅ Prettier
✅ JSDoc types (tsc)
✅ Node tests
✅ Browser tests
7/7 checks passed.
- New tests cover the changes — scaffolder test needs rewrite for flattened structure
- All existing tests still pass (import paths updated for
src/server.js) -
npm run spec allpasses (7/7) — needs full run after commit
- Updated:
QUICKSTART.md— new CLI commands, folder structure, clearstack branding - Updated:
FRONTEND_IMPLEMENTATION_RULES.md—src/server.jspath in project tree - Updated:
SERVER_AND_DEPS.md—src/server.jsreferences - Updated:
TESTING.md—src/server.jsimport paths and file mapping table
-
Patterns discovered: The devDependency model is the right abstraction for a living spec — it gives you version pinning, controlled upgrades via package manager, and a clean binary interface. Flattening the scaffolder into the repo root eliminates the awkward nested-package publish dance. Non-interactive
-yflag is essential for testing and CI. -
Unexpected breakage:
npm linktriggerspostinstall, which tried to vendor hybrids (a devDependency not installed during link). Fixed with--ignore-scripts. pnpm workspace root requires explicit-wflag.@inquirer/promptsdoesn't work with piped stdin — drove the-yflag addition. Templatecopy.jshad a missingresolveimport that only surfaced when actually copying files. -
What would you test differently? Need an automated integration test that installs clearstack into a temp directory, runs
init -y, verifies the file tree and package.json merge, then runsupdateandcheck. The oldscaffolder.test.jstested the nested structure and needs a full rewrite.