You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scripts/scaffold.mjs mutates many files (package.json, README, CHANGELOG, AGENTS.md), deletes files, then deletes itself — with no error handling, no rollback, and no guard against re-running on an already-scaffolded repo. Certain inputs also produce an invalid package.json name. Make scaffolding safe to run and safe to fail.
Acceptance Criteria
On startup, if the repo is already scaffolded (e.g. .construct sentinel exists), the script refuses to run with a clear message
The mutation phase is wrapped so a mid-run failure reports clearly and does not leave a silently half-customized repo (rollback or at minimum a clear "partial state" error)
slugify collapses repeated/leading/trailing hyphens and falls back to a default when the result is empty or otherwise invalid as an npm package name; the project name is validated/escaped before being written into JSON/markdown
delete pkg.scripts.scaffold is used rather than relying on JSON.stringify dropping an undefined value
Final "next steps" output matches the generated README (.env vs .env.local consistency — see docs accuracy issue)
Goal
scripts/scaffold.mjsmutates many files (package.json, README, CHANGELOG, AGENTS.md), deletes files, then deletes itself — with no error handling, no rollback, and no guard against re-running on an already-scaffolded repo. Certain inputs also produce an invalidpackage.jsonname. Make scaffolding safe to run and safe to fail.Acceptance Criteria
.constructsentinel exists), the script refuses to run with a clear messageslugifycollapses repeated/leading/trailing hyphens and falls back to a default when the result is empty or otherwise invalid as an npm package name; the project name is validated/escaped before being written into JSON/markdowndelete pkg.scripts.scaffoldis used rather than relying onJSON.stringifydropping anundefinedvalue.envvs.env.localconsistency — see docs accuracy issue)Context / Files
scripts/scaffold.mjs— whole mutation flow (~lines 76-230);slugify~43-48;.constructwrite ~135-142 (never read back);pkg.scripts.scaffold = undefined~84; next-steps mismatch (line 109 README vs line 230 output).envnaming