fix(project create): guide to name it instead of inventing a junk-named project#50
Conversation
…ed project
Follow-up to the no-prompt fix. Bare `insta project create` in a generic dir
(~/projects, /tmp, the home dir) previously auto-generated a random name and
provisioned real postgres/storage/compute under it — surprising for a bare
command. Now it guides instead:
name your project: insta project create <name>
(or just ask your coding agent — it has the insta skill and will do this for you)
Still never prompts/hangs, and still uses the dir basename when it's a real
project-dir name (~/my-app → my-app). Agents always pass a name via the skill,
so the guide path is only the manual bare-command case. resolveProjectName now
returns string|null (null = guide); removed the name generator. 77/77 green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GMbAe5K1RfwaAcge5inX7P
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
jwfing
left a comment
There was a problem hiding this comment.
Summary
Clean, well-scoped follow-up to #46: resolveProjectName now returns string | null and the generic-dir case guides the user to name the project instead of inventing a junk name and provisioning real resources under it.
Requirements context
No matching spec/plan found — this repo has no docs/superpowers/ (nor docs/specs/ or a docs/ dir at all). Assessed against the PR description, the linked #46 intent, and the repo-local .claude/skills/developing-insta-cli conventions.
Findings
Critical
(none)
Suggestion
- Software engineering — the fixed behavior itself is not directly tested.
src/commands/project.ts:52-58The bug being fixed (#46: barecreatein a generic dir provisioning real postgres/storage/compute) lives inprojectCreate's early-return guide branch, but the tests only cover the pureresolveProjectNamedecision (returnsnull). Nothing asserts thatprojectCreateprints the guide and returns without calling the API / provisioning whenresolvedisnull. That said,projectCreateisn't structured for DI (infoandApiClient.loadare module-level, unlike the injected-runner pattern the repo skill calls out forensure-skills.ts/setup.ts), so a regression test here is non-trivial — hence a suggestion, not a blocker. If you do add one, guarding "generic dir → no API call" would directly pin the regression.
Information
- Software engineering — good simplification.
src/commands/project.ts:42-48Dropping thegenerateDI param and makingresolveProjectNamesynchronous is a net cleanup; theawaitat the (only) call site was removed correctly,generateProjectName/ADJ/NOUNare fully deleted, and a repo-wide grep confirms no dangling references. README already documentsinsta project create <name>, so no doc drift. - Functionality — home-vs-dirname source mismatch (harmless).
test/create-name.test.ts:25-27The home-dir test readsprocess.env.HOME, while the implementation usesos.homedir(). These normally agree, but they're different sources; usinghomedir()in the test would exercise the exact code path. - Functionality — pre-existing edge case, not introduced here.
src/commands/project.ts:46A real project directory whose basename equals the username (base === home) will guide rather than create. This behavior is unchanged from the prior implementation and out of scope for this PR — noting only for awareness.
Security
No security-relevant changes. Removed logic was Math.random-based name generation (not security-sensitive); the resolved name is sent as a JSON body field (POST /orgs/:id/projects), not interpolated into SQL/shell, and slugifyName restricts it to [a-z0-9-]. No secrets logged, no auth/authorization changes.
Performance
No performance-relevant changes. Removed two small arrays and a generator; the function is now synchronous with no I/O.
Verdict
approved (informational — a human still gives the explicit GitHub approval via the approve flow). Zero Critical findings; the one Suggestion is a nice-to-have regression test. Verified locally: vitest 77/77 pass, tsc --noEmit clean.
jwfing
left a comment
There was a problem hiding this comment.
Review — fix(project create): guide to name it instead of inventing a junk-named project
Summary: A tight, well-scoped follow-up to #46 that replaces auto-generation of a random project name in generic dirs with a non-blocking guidance message, so a bare insta project create in ~/projects//tmp/home no longer provisions real resources under a junk name.
Requirements context
No docs/superpowers/ or docs/specs/ directory exists in this repo — no matching spec/plan found, so I assessed against the PR description, the referenced design follow-up (#46), and the repo-local .claude/skills/developing-insta-cli/SKILL.md conventions. Verified locally at head 0b51c64: npm run typecheck clean and npm test → 77/77 green, matching the PR's claims.
Findings
Critical
(none)
Suggestion
- Software engineering — the core new behavior isn't directly tested (
src/commands/project.ts:50-58). The tests coverresolveProjectNamereturningnullwell, but nothing asserts thatprojectCreateactually short-circuits — i.e. prints the guide and returns without callingApiClient.load()/POST /orgs/:id/projects— when the name resolves tonull. That "don't provision under a junk name" guarantee is the whole point of the PR, and it's currently only covered transitively via the pure function. I recognizeprojectCreatecallsApiClient.load()directly with no injection seam and the repo's convention is to avoid mocking globals (SKILL.md), so this is a nice-to-have rather than a blocker — but a small DI hook (or an injected client) enabling a "guide branch makes no API call" regression test would harden the intended behavior.
Information
- Project convention — CLI reference doc (
SKILL.md:35-37). The skill requires command/flag changes to be mirrored in theinstaskill'scli-reference.md(a superproject submodule, not present in this repo, so I couldn't verify). This is a behavior change to bareinsta project createrather than a surface change, so it may not strictly apply — but if that reference documents the previous auto-generated-name behavior, it's now stale and worth updating in the same change set so skill-equipped agents don't rely on it. - Functionality — explicit-arg-that-slugifies-to-empty (
src/commands/project.ts:43,51-58). An explicit but all-symbol arg (e.g.insta project create "###") slugifies to'', which is falsy, so it now takes the guide branch instead of POSTing an empty name as the prior code would have. This is an improvement, not a regression — just noting the interaction; no action needed. - Security / Performance: no security-relevant changes (no new user input reaching SQL/shell/HTTP unsanitized —
nameand cwd basename are both slugified; no secrets logged; no auth/authorization touched) and no performance-relevant changes (pure sync helper, no loops or I/O added; net −7 lines).
Also worth calling out positively: the generateProjectName generator and ADJ/NOUN tables were fully removed with no dangling references (verified repo-wide), the resolveProjectName signature change from async … Promise<string> to sync string | null has no other callers, and the test updates honestly track the new contract rather than papering over it.
Verdict
approved (informational — human approval via the approve flow). Zero Critical findings; the items above are non-blocking.
…51) Ships PR #50. Claude-Session: https://claude.ai/code/session_01GMbAe5K1RfwaAcge5inX7P Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Follow-up to the no-prompt fix (#46), per design discussion: a bare
insta project createin a generic dir (~/projects,/tmp, the home dir) was auto-generating a random name (swift-meadow-482) and provisioning real postgres/storage/compute under it — too much for a bare command.Now it guides instead of inventing:
~/my-app→my-app).resolveProjectNamenow returnsstring | null(null = guide); dropped the name generator.77/77 tests green, tsc clean; verified with a built binary that a
projectsdir guides and does not create.🤖 Generated with Claude Code
https://claude.ai/code/session_01GMbAe5K1RfwaAcge5inX7P
Summary by cubic
insta project createnow guides you to name the project when run in generic dirs (like~/projects,/tmp, or home) instead of inventing a random name, preventing accidental provisioning under junk names.Bug Fixes
~/my-app→my-app).Refactors
resolveProjectNamenow returnsstring | null; removed the random name generator.Written for commit 0b51c64. Summary will update on new commits.