Repository navigation
feat(cli): add vibe rules addon - #481
Conversation
🦋 Changeset detectedLatest commit: e264d5d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Caution Review failedThe pull request is closed. WalkthroughThis update introduces the "vibe-rules" addon to the CLI, including its setup logic, compatibility rules, prompt options, and a Handlebars template for rule documentation. The PR centralizes error and cancellation handling across the CLI, replacing inline process exits and colored messages with reusable utility functions. Minor label adjustments and ignore rule updates are also included. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant ErrorUtils
participant VibeRulesSetup
User->>CLI: Run project setup
CLI->>User: Prompt for addons
User->>CLI: Selects "vibe-rules"
CLI->>VibeRulesSetup: Calls setupVibeRules(config)
VibeRulesSetup->>User: Prompts for editors
User->>VibeRulesSetup: Selects editors or cancels
alt User cancels
VibeRulesSetup->>ErrorUtils: exitCancelled("Operation cancelled")
ErrorUtils->>User: Show cancellation message and exit
else User selects editors
VibeRulesSetup->>CLI: Runs commands to apply rules
VibeRulesSetup->>User: Shows progress and success/failure
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~35 minutes Possibly related PRs
Poem
Note 🔌 MCP (Model Context Protocol) integration is now available in Early Access!Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
commit: |
There was a problem hiding this comment.
Actionable comments posted: 12
🔭 Outside diff range comments (5)
apps/web/src/app/(home)/showcase/page.tsx (1)
46-46: Critical: Public API key exposed in client codeThe image URL embeds a live API key. This leaks a secret to every visitor and any scraper.
Action:
- Rotate/revoke the exposed key immediately.
- Serve the image via a server-side proxy or pre-generate and host a static asset. Never embed secrets in client bundles.
If you need help implementing a minimal Next.js API proxy that fetches and caches the image safely, I can provide it.
apps/cli/src/utils/template-processor.ts (1)
18-28: Preserve original error as thecausewhen rethrowingThe current catch block logs the error but then throws a brand-new
Error, losing the original stack and context. To aid debugging, include the original error as thecause:• File:
apps/cli/src/utils/template-processor.ts
• Lines: 18–28} catch (error: unknown) { consola.error(`Error processing template ${srcPath}:`, error); - throw new Error(`Failed to process template ${srcPath}`); + // Preserve original error details for better diagnostics + throw new Error( + `Failed to process template ${srcPath}`, + { cause: error as Error }, + ); }This keeps your centralized CLI commands free to catch and handle the enriched error, without exiting the process prematurely.
apps/cli/src/helpers/database-providers/neon-setup.ts (1)
69-74: Sanitize user input and eliminateshell: truein Neon commandsWe’ve confirmed that
executeNeonCommandin
apps/cli/src/helpers/database-providers/neon-setup.ts
usesawait execa(fullCommand, { shell: true })and that
projectNameis interpolated directly into the shell string (lines 69–74). This same pattern appears across multiple setup scripts (prisma, supabase, tauri, etc.), creating a real command-injection risk.Required fixes:
- At the prompt, validate
projectNameagainst a strict allowlist (no spaces or shell metacharacters):diff -- apps/cli/src/commands/new.ts - const projectName = await text({ - message: "Enter a name for your Neon project:", - defaultValue: suggestedProjectName, - initialValue: suggestedProjectName, - }); + const projectName = await text({ + message: "Enter a name for your Neon project:", + initialValue: suggestedProjectName, + validate: (val) => { + if (typeof val !== "string" || !/^[A-Za-z0-9._-]+$/.test(val.trim())) { + return "Project name may only include letters, numbers, dots (.), underscores (_), or hyphens (-)."; + } + }, + });- Long-term refactor
executeNeonCommandto accept an array of args and invokeexeca(cmd, args)(droppingshell: true):async function executeNeonCommand( pm: PackageManager, args: string[], spinnerText?: string ) { const [cmd, ...cmdArgs] = getPackageExecutionCommand(pm, args); const s = spinner(); if (spinnerText) s.start(spinnerText); try { const { stdout } = await execa(cmd, cmdArgs); if (spinnerText) s.stop(); return stdout; } catch (err) { s.stop("error"); throw err; } }This will fully eliminate interpolation-based injection vectors.
apps/cli/src/helpers/project-generation/command-handlers.ts (1)
62-66: Potential bug: projectDirectory uses projectName instead of finalResolvedPathThis can break downstream path-based logic. Use the resolved path from setupProjectDirectory.
- const cliInput = { - ...input, - projectDirectory: input.projectName, - }; + const cliInput = { + ...input, + projectDirectory: finalResolvedPath, + };apps/cli/src/helpers/database-providers/prisma-postgres-setup.ts (1)
197-201: String replace is brittleReplacing the exact line export const db = new PrismaClient(); may miss common variants (no export, different spacing). Use a regex with broader match or an AST transform.
- dbFileContent = dbFileContent.replace( - "export const db = new PrismaClient();", - "export const db = new PrismaClient().$extends(withAccelerate());", - ); + // Replace any `new PrismaClient()` assignment for `db` (exported or not) + dbFileContent = dbFileContent.replace( + /(?:export\s+)?const\s+db\s*=\s*new\s+PrismaClient\(\)\s*;?/, + 'export const db = new PrismaClient().$extends(withAccelerate());', + );
♻️ Duplicate comments (2)
apps/cli/src/prompts/addons.ts (1)
126-127: Same cancellation-helper type caveat applies.As in other prompts, returning
exitCancelled()assumes aneverreturn type – verify once for the whole codebase.Also applies to: 179-180
apps/cli/src/utils/project-directory.ts (1)
52-53: Cancellation path: confirmexitCancelledtyping.Both early-returns rely on
exitCancelledbeingnever; otherwise the enclosingwhile (true)loop becomes non-exhaustive.Also applies to: 73-74
🧹 Nitpick comments (19)
biome.json (1)
22-23: Optional: keep ignore lists consistent across tools sections
You already exclude .smoke at files.includes. To avoid confusion, either:
- also exclude it in formatter.includes and linter.includes, or
- rely solely on files.includes and remove duplicate excludes in formatter/linter sections.
This reduces drift between sections.
apps/cli/src/prompts/project-name.ts (1)
80-80: Unify cancellation message punctuationThis file uses “Operation cancelled.” (with a period), while others omit it. Standardize for consistency.
Apply:
- if (isCancel(response)) return exitCancelled("Operation cancelled."); + if (isCancel(response)) return exitCancelled("Operation cancelled");apps/cli/src/prompts/backend.ts (1)
66-66: Standardize cancel copy across filesSome files include a trailing period, some don’t. Pick one.
- if (isCancel(response)) return exitCancelled("Operation cancelled"); + if (isCancel(response)) return exitCancelled("Operation cancelled.");(Or vice versa—apply consistently across the codebase.)
apps/cli/src/helpers/setup/ultracite-setup.ts (1)
75-75: Ensure exitCancelled fully handles termination; keep message consistentReturning the helper is appropriate if typed as never and it exits. Also align punctuation of “Operation cancelled” across files.
To standardize punctuation here:
- if (isCancel(editors)) return exitCancelled("Operation cancelled"); + if (isCancel(editors)) return exitCancelled("Operation cancelled."); - if (isCancel(rules)) return exitCancelled("Operation cancelled"); + if (isCancel(rules)) return exitCancelled("Operation cancelled.");Optional: If you have an exitWithError utility, consider using it in this file’s catch block for parity with the new error model.
Also applies to: 87-87
apps/cli/src/prompts/orm.ts (1)
54-54: Confirm exitCancelled typing and unify messageShould be typed never and reliably terminate. Also align punctuation with other files.
- if (isCancel(response)) return exitCancelled("Operation cancelled"); + if (isCancel(response)) return exitCancelled("Operation cancelled.");Use the earlier verification script to confirm typing and check global message consistency.
apps/cli/src/helpers/setup/fumadocs-setup.ts (1)
56-56: Cancellation path: verify never type and standardize messageEnsure exitCancelled exits/throws (never) and align the message punctuation.
- if (isCancel(template)) return exitCancelled("Operation cancelled"); + if (isCancel(template)) return exitCancelled("Operation cancelled.");Re-use the previously provided script to validate implementation and consistency.
apps/cli/src/validation.ts (1)
166-174: Remove unreachable branch checkingoptions.examples.includes("none")Inside the
elseblock (already guaranteeing"none"is not present), this condition can never be true, so it’s dead code.config.examples = options.examples.filter( (ex): ex is Examples => ex !== "none", ); - if (options.examples.includes("none") && config.backend !== "convex") { - config.examples = []; - }apps/cli/src/helpers/database-providers/turso-setup.ts (2)
125-126: Cancellation path consistency and clarity
- Ensure
exitCancelledreturnsnever(same rationale as other modules).- Optional: make messages contextual (e.g., “Turso setup cancelled”) to aid telemetry/logs.
- if (isCancel(selectedGroup)) return exitCancelled("Operation cancelled"); + if (isCancel(selectedGroup)) return exitCancelled("Turso setup cancelled"); - if (isCancel(shouldInstall)) return exitCancelled("Operation cancelled"); + if (isCancel(shouldInstall)) return exitCancelled("Turso setup cancelled"); - if (isCancel(dbNameResponse)) return exitCancelled("Operation cancelled"); + if (isCancel(dbNameResponse)) return exitCancelled("Turso setup cancelled");Also applies to: 229-231, 259-260
9-9: Align error logging with centralized utilitiesThis file still uses
consola.errorandconsole.error. To keep the CLI consistent, consider using a centralized error helper (e.g.,handleError) for the error message while preserving the fallback env/manual-setup flow.Proposed diff:
-import { exitCancelled } from "../../utils/errors"; +import { exitCancelled, handleError } from "../../utils/errors"; @@ } catch (error) { - setupSpinner.stop(pc.red("Turso CLI availability check failed")); - consola.error( - pc.red( - `Error during Turso setup: ${ - error instanceof Error ? error.message : String(error) - }`, - ), - ); + setupSpinner.stop(pc.red("Turso CLI availability check failed")); + handleError( + `Error during Turso setup: ${ + error instanceof Error ? error.message : String(error) + }`, + ); await writeEnvFile(projectDir); displayManualSetupInstructions(); log.success("Setup completed with manual configuration required."); }Also applies to: 279-290
apps/cli/src/prompts/database.ts (1)
58-58: EnsureexitCancelledisneverand add explicit return type (optional)Same as other prompts: returning
exitCancelledis sound only if it’snever. Optionally annotate the function return type for clarity.-export async function getDatabaseChoice( +export async function getDatabaseChoice( database?: Database, backend?: Backend, runtime?: Runtime, -): Promise<Database> { +): Promise<Database> {apps/cli/src/prompts/frontend.ts (1)
69-70: Minor UX: repeated literal message string.The same
"Operation cancelled"literal is repeated three times.
Consider a small helperconst CANCEL_MSG = "Operation cancelled";(or reuse a constant from the error utility) to avoid duplication and keep wording consistent project-wide.Also applies to: 84-85, 107-108
apps/cli/src/helpers/setup/vibe-rules-setup.ts (3)
54-65: Guard against empty editor selection.If the user hits without selecting an editor,
selectedEditorsis[].
You still start the “Applying rules” spinner and iterate, but nothing happens – confusing UX.+if (selectedEditors.length === 0) { + log.warn("No editors selected – skipping rule application."); + return; +}
66-77:run()re-implementsexecwith spinner; consider deduplication.
run()andexec()differ only by spinner handling. A single wrapper that optionally receives a spinner message would reduce duplication.
104-107: Silent catch masks clean-up failure.Failing to remove
.btsis ignored. At least loglog.warn(...)so users know the temp folder remains.apps/cli/src/prompts/addons.ts (1)
45-48: Capitalisation / branding of addon label.All other labels are Title-cased (“Turborepo”, “PWA”). For consistency consider
"Vibe Rules"rather than"vibe-rules".apps/cli/src/helpers/database-providers/prisma-postgres-setup.ts (1)
154-156: Idempotency: avoid duplicating dotenv importPrepend only if not already present to keep the file clean.
- let content = await fs.readFile(prismaConfigPath, "utf8"); - content = `import "dotenv/config";\n${content}`; - await fs.writeFile(prismaConfigPath, content); + let content = await fs.readFile(prismaConfigPath, "utf8"); + if (!content.includes('import "dotenv/config"')) { + content = `import "dotenv/config";\n${content}`; + await fs.writeFile(prismaConfigPath, content); + }apps/cli/src/utils/errors.ts (2)
10-13: Nit: avoid red styling with cancel()cancel already conveys cancellation; red can be perceived as an error. Optional.
-export function exitCancelled(message = "Operation cancelled"): never { - cancel(pc.red(message)); +export function exitCancelled(message = "Operation cancelled"): never { + cancel(message); process.exit(0); }
5-8: Optional: make exits test-friendlyProcess exits complicate tests. Consider honoring an env flag to throw instead of exiting in test environments.
-export function exitWithError(message: string): never { - consola.error(pc.red(message)); - process.exit(1); -} +export function exitWithError(message: string): never { + consola.error(pc.red(message)); + if (process.env.BTS_TEST_MODE === "1") throw new Error(message); + process.exit(1); +} @@ -export function exitCancelled(message = "Operation cancelled"): never { - cancel(pc.red(message)); - process.exit(0); -} +export function exitCancelled(message = "Operation cancelled"): never { + cancel(message); + if (process.env.BTS_TEST_MODE === "1") throw new Error(message); + process.exit(0); +} @@ - consola.error(pc.red(message)); - process.exit(1); + consola.error(pc.red(message)); + if (process.env.BTS_TEST_MODE === "1") throw new Error(message); + process.exit(1);Also applies to: 10-13, 15-20
apps/cli/templates/addons/vibe-rules/.bts/rules.md.hbs (1)
102-104: pnpm: prefer “pnpm dlx” over “pnpx”Modern pnpm recommends dlx; pnpx is an alias but dlx is clearer.
-{{#if (eq packageManager "bun")}}bunx{{else if (eq packageManager "pnpm")}}pnpx{{else}}npx{{/if}} create-better-t-stack +{{#if (eq packageManager "bun")}}bunx{{else if (eq packageManager "pnpm")}}pnpm dlx{{else}}npx{{/if}} create-better-t-stack
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (41)
.gitignore(1 hunks)apps/cli/src/constants.ts(1 hunks)apps/cli/src/helpers/database-providers/neon-setup.ts(3 hunks)apps/cli/src/helpers/database-providers/prisma-postgres-setup.ts(4 hunks)apps/cli/src/helpers/database-providers/turso-setup.ts(4 hunks)apps/cli/src/helpers/project-generation/add-addons.ts(1 hunks)apps/cli/src/helpers/project-generation/add-deployment.ts(1 hunks)apps/cli/src/helpers/project-generation/command-handlers.ts(5 hunks)apps/cli/src/helpers/project-generation/create-project.ts(2 hunks)apps/cli/src/helpers/project-generation/template-manager.ts(1 hunks)apps/cli/src/helpers/setup/addons-setup.ts(2 hunks)apps/cli/src/helpers/setup/fumadocs-setup.ts(2 hunks)apps/cli/src/helpers/setup/ultracite-setup.ts(3 hunks)apps/cli/src/helpers/setup/vibe-rules-setup.ts(1 hunks)apps/cli/src/index.ts(2 hunks)apps/cli/src/prompts/addons.ts(5 hunks)apps/cli/src/prompts/api.ts(2 hunks)apps/cli/src/prompts/auth.ts(2 hunks)apps/cli/src/prompts/backend.ts(2 hunks)apps/cli/src/prompts/config-prompts.ts(3 hunks)apps/cli/src/prompts/database-setup.ts(2 hunks)apps/cli/src/prompts/database.ts(2 hunks)apps/cli/src/prompts/examples.ts(2 hunks)apps/cli/src/prompts/frontend.ts(5 hunks)apps/cli/src/prompts/git.ts(2 hunks)apps/cli/src/prompts/install.ts(2 hunks)apps/cli/src/prompts/orm.ts(2 hunks)apps/cli/src/prompts/package-manager.ts(2 hunks)apps/cli/src/prompts/project-name.ts(2 hunks)apps/cli/src/prompts/runtime.ts(2 hunks)apps/cli/src/prompts/web-deploy.ts(3 hunks)apps/cli/src/types.ts(1 hunks)apps/cli/src/utils/compatibility-rules.ts(10 hunks)apps/cli/src/utils/errors.ts(1 hunks)apps/cli/src/utils/project-directory.ts(4 hunks)apps/cli/src/utils/template-processor.ts(1 hunks)apps/cli/src/validation.ts(25 hunks)apps/cli/templates/addons/vibe-rules/.bts/rules.md.hbs(1 hunks)apps/web/src/app/(home)/showcase/page.tsx(1 hunks)apps/web/src/lib/constant.ts(1 hunks)biome.json(1 hunks)
🔇 Additional comments (41)
.gitignore (1)
40-41: .smoke ignore added — LGTMMatches the Biome config and keeps local smoke artifacts out of VCS.
biome.json (1)
22-23: Exclude _generated and .smoke from Biome workspace — LGTMGiven vcs.useIgnoreFile=false, placing these negated globs in files.includes is the correct way to keep them out of Biome’s formatter/linter scope.
apps/web/src/app/(home)/showcase/page.tsx (1)
51-51: Consistent label update — LGTMTag renamed to “TanStack Start” to match the new naming across the app.
apps/cli/src/constants.ts (1)
138-139: Add “vibe-rules” to addon compatibility — LGTMUsing an empty array follows the existing convention for globally compatible addons (e.g., biome, husky).
apps/cli/src/utils/template-processor.ts (1)
32-32: New Handlebars helperne— LGTMComplements
eqand keeps template conditions readable.apps/cli/src/types.ts (1)
46-47: Addons enum extended with “vibe-rules” — LGTMType-safe plumbing for the new addon looks correct and consistent with constants and prompts.
apps/web/src/lib/constant.ts (1)
60-61: Rename to “TanStack Start” — LGTMMatches the showcase tag and CLI prompt text for consistency.
apps/cli/src/helpers/project-generation/add-deployment.ts (1)
6-6: ExitWithError return type verified asnever—no action required.apps/cli/src/prompts/auth.ts (1)
24-24: exitCancelled returns never as expected
Verified inapps/cli/src/utils/errors.tsthatexport function exitCancelled(message = "Operation cancelled"): never { … }so
return exitCancelled("Operation cancelled")correctly never returns and poses no type or unreachable-code issues.apps/cli/src/prompts/config-prompts.ts (1)
105-106: exitCancelled correctly returnsnever, no further action neededThe
exitCancelledfunction inapps/cli/src/utils/errors.tsis declared with a return type ofnever, ensuring thatonCancel: () => exitCancelled("…")aborts execution as intended.apps/cli/src/prompts/runtime.ts (1)
51-51: exitCancelled has a never return type
TheexitCancelledfunction inapps/cli/src/utils/errors.tsis declared as returningnever, so usingreturn exitCancelled("Operation cancelled")correctly signals non-returning control flow. No changes needed.apps/cli/src/index.ts (1)
23-23: Good move to centralized error handlingReplacing local logging/exit with handleError improves consistency and maintainability. No further changes needed here.
Also applies to: 105-105
apps/cli/src/prompts/package-manager.ts (1)
31-31: exitCancelled is correctly typed as neverThe
exitCancelledfunction inapps/cli/src/utils/errors.tsis declared as:export function exitCancelled(message = "Operation cancelled"): never { cancel(pc.red(message)); process.exit(0); }This
: neversignature ensures that usingreturn exitCancelled(...)in async functions (e.g. those returningPromise<PackageManager>) type-checks correctly and prevents any code fallthrough. No changes required.apps/cli/src/prompts/git.ts (1)
13-13: Centralized cancellation looks good; verify exitCancelled typingRefactor is consistent with the new error utilities. As above, ensure
exitCancelled’s return type isnever(orPromise<never>) so this return branch type-checks in all callers.apps/cli/src/prompts/database-setup.ts (1)
104-104: Uniform cancel handling; verify exitCancelled signaturePattern matches the new centralized approach. Please confirm
exitCancelledis typed asnever(orPromise<never>) to keep return types sound.apps/cli/src/helpers/database-providers/neon-setup.ts (1)
181-181: Good consolidation of cancel handlingBoth cancel checks now use
exitCancelled, improving consistency and avoiding inline exits. No further issues here.Also applies to: 199-201
apps/cli/src/prompts/api.ts (1)
46-46: Consistent cancel handling; confirm never-typed exit pathLooks good. As with other modules, please verify
exitCancelledreturnsnever(orPromise<never>) to satisfy the function’s declared return type in all branches.apps/cli/src/prompts/project-name.ts (2)
8-8: Centralized cancel handling import looks goodSwitching to a single exit helper improves consistency and reduces duplication.
80-80: exitCancelled is correctly typed and terminates executionVerified in apps/cli/src/utils/errors.ts that
export function exitCancelled(message = "Operation cancelled"): never { … process.exit(0); }- it logs the message and calls
process.exit(0), so it never returns to the callerUsing
return exitCancelled("Operation cancelled.");is safe—no fall-through or type mismatch will occur.apps/cli/src/prompts/backend.ts (2)
4-4: Good move to shared cancel pathImporting and using exitCancelled keeps flow consistent across prompts.
66-66: Confirm exitCancelled terminates (typed never) to satisfy Backend returnIf it doesn’t exit/throw, the function might continue unexpectedly.
Use the repo-wide script in the earlier comment to confirm typing and message consistency.
apps/cli/src/helpers/setup/ultracite-setup.ts (1)
6-6: Importing exitCancelled aligns with the new error modelRefactor is on the right track.
apps/cli/src/prompts/orm.ts (1)
4-4: Exit helper import: nice consistency improvementKeeps cancellation flow uniform across prompts.
apps/cli/src/helpers/setup/fumadocs-setup.ts (1)
8-8: Consistent centralized cancellationImporting exitCancelled here aligns this setup helper with the refactor.
apps/cli/src/prompts/install.ts (1)
1-1: Centralized cancellation import: LGTMMoving to
exitCancelledkeeps prompt modules thin and consistent.Also applies to: 3-3
apps/cli/src/validation.ts (2)
29-29: Centralized error handling import: LGTMGood replacement for scattered
consola.fatal+process.exit(1).
46-49: exitWithError correctly returns never
Confirmed that inapps/cli/src/utils/errors.ts(line 5)export function exitWithError(message: string): never {is typed to return
never, so there’s no risk of fall-through. No changes required.apps/cli/src/prompts/database.ts (1)
1-1: Centralized cancellation import: LGTMConsistent with the new pattern across prompts.
Also applies to: 4-4
apps/cli/src/helpers/project-generation/add-addons.ts (1)
7-7: CentralizedexitWithError: LGTMGood move removing the local helper and reusing the shared one.
apps/cli/src/prompts/frontend.ts (1)
31-31: Return type relies onexitCancelledbeingnever– double-check.
return exitCancelled("Operation cancelled")is only type-safe ifexitCancelledis declared to returnnever.
If it instead returnsvoid, the function’s Promise<Frontend[]> signature is violated and TypeScript will complain.Confirm the signature in
utils/errors.ts:export function exitCancelled(msg: string): never { … }If it isn’t
never, update it accordingly.apps/cli/src/utils/compatibility-rules.ts (1)
31-33: Early-exit helper must beneverto avoid dead-code warnings.
exitWithError(...)replacesprocess.exit(1). Ensure it is typed/implemented asnever; otherwise the compiler will flag subsequent code as unreachable yet still type-checked.
If it already is, great – just pointing out the importance here because this file relies on that behaviour dozens of times.Also applies to: 36-38, 53-56
apps/cli/src/utils/project-directory.ts (1)
100-102:handleErrormust terminate or rethrow.After catching a failure to empty the directory,
handleError(error)is invoked.
IfhandleErroronly logs and returnsvoid, the code continues into an inconsistent state.
EnsurehandleErrorexits (never) or rethrows so the function doesn’t proceed with a half-cleared directory.apps/cli/src/helpers/project-generation/command-handlers.ts (4)
2-2: LGTM: import cleanup is correctRemoved use of cancel; only intro/log/outro retained.
135-135: Centralized error handling call looks goodOnce handleError uses the fallback (see errors.ts note), this will surface clearer context to users.
145-147: Good: fail-fast with a clear messageexitWithError here is appropriate; unreachable code after is fine due to return type never.
215-215: Consistent error handlingConsistent with the refactor; again, ensure handleError uses the fallback message.
apps/cli/src/helpers/database-providers/prisma-postgres-setup.ts (4)
2-2: LGTM: imports reflect centralized cancellation flowUsing isCancel/text/select/log and exitCancelled is correct.
Also applies to: 9-9
243-243: LGTM: cancel on setup method exits cleanlyexitCancelled here is appropriate.
179-188: Import path is correct
The Prisma schema templates specifyoutput = "../generated", so the client is generated underprisma/generated/client. Usingimport { PrismaClient } from "./generated/client";in
prisma/index.tsmatches that configuration. No changes required.
116-116: Cancel behavior is already consistentBoth
setupWithCreateDb(line 64) and the alternate setup path (line 116) useif (isCancel(databaseUrl)) return null;so the “skip on cancel” behavior is the same in both places. No changes are needed here.
apps/cli/templates/addons/vibe-rules/.bts/rules.md.hbs (1)
9-15: Custom Handlebars helpers are properly registered
Verified thateq,ne,and,or, andincludesare registered inapps/cli/src/utils/template-processor.ts(lines 31–39). The conditional helpers used inapps/cli/templates/addons/vibe-rules/.bts/rules.md.hbswill resolve as expected.
|
|
||
| .smoke No newline at end of file |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Ensure packaging/CI also excludes .smoke (and optionally _generated)
If you publish to npm or build containers, verify .smoke isn’t bundled. Consider aligning other ignore sources (.npmignore, package.json "files", .dockerignore).
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Checking for .smoke directories in repo (hidden included):"
fd -H -t d ".smoke" || true
echo -e "\n.package.json 'files' (if present):"
if [ -f package.json ]; then
jq -r '.files // empty' package.json || true
else
echo "package.json not found"
fi
echo -e "\n.npmignore entry for .smoke (if present):"
if [ -f .npmignore ]; then
rg -n "^[.]?smoke/?$" .npmignore || echo "No explicit .smoke entry"
else
echo ".npmignore not found (using package.json 'files' or defaults)"
fi
echo -e "\n.dockerignore entry for .smoke (if present):"
if [ -f .dockerignore ]; then
rg -n "^[.]?smoke/?$" .dockerignore || echo "No explicit .smoke entry"
else
echo ".dockerignore not found"
fiLength of output: 775
Ensure .smoke Is Excluded from All Published Artifacts
Currently .smoke is only listed in .gitignore. Verify and update your packaging/CI configs so that no .smoke directories or files are ever bundled or published:
• There is no .npmignore, so npm will fall back to .gitignore defaults – consider adding a .npmignore entry for /.smoke
• No "files" field in package.json – you can explicitly omit smoke/ or only whitelist the directories you intend to publish
• No .dockerignore – add /.smoke (and optionally /_generated) to ensure Docker builds don’t include it
🤖 Prompt for AI Agents
In the .gitignore file around lines 40 to 41, the .smoke directory is ignored
for git but not explicitly excluded from npm packages, Docker builds, or other
published artifacts. To fix this, add an entry for /.smoke in a new or existing
.npmignore file to prevent it from being included in npm packages, add a "files"
field in package.json to whitelist only intended directories or explicitly
exclude smoke/, and create or update a .dockerignore file to include /.smoke and
optionally /_generated to exclude these from Docker builds.
| cancel("Database setup cancelled"); | ||
| return null; | ||
| } | ||
| if (isCancel(databaseUrl)) return null; |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Cancellation semantics: cancel currently “skips” instead of exiting
Returning null on isCancel(databaseUrl) treats a user cancel as “skip DB config” and proceeds to manual instructions. If that’s intentional, consider a confirm (“Skip DB configuration?”). If not, align with exitCancelled for consistency.
Option to align with exit:
- if (isCancel(databaseUrl)) return null;
+ if (isCancel(databaseUrl)) return exitCancelled("Database setup cancelled");🏁 Script executed:
#!/bin/bash
set -e
# Locate the Prisma Postgres setup helper
file=$(fd --hidden --glob 'prisma-postgres-setup.ts')
echo "Found file: $file"
# Show lines 1–100 to capture imports, helper definitions, and function context
echo "---- File head (1–100) ----"
sed -n '1,100p' "$file"
echo "----------------------------"
# Show lines 50–90 around the cancellation check
echo "---- Context around line 64 ----"
sed -n '50,90p' "$file"
echo "----------------------------"
# Find the isCancel helper definition and usages
echo "---- isCancel definition ----"
rg -n "function isCancel" -C3
echo "---- isCancel usages ----"
rg -n "isCancel" -C1
# Find the exitCancelled helper definition and usages
echo "---- exitCancelled definition ----"
rg -n "function exitCancelled" -C3
echo "---- exitCancelled usages ----"
rg -n "exitCancelled" -C1Length of output: 4252
🏁 Script executed:
#!/bin/bash
set -e
# Locate the errors utility file
error_file=$(fd --hidden --glob 'errors.ts' | grep 'apps/cli/src/utils/errors.ts' || true)
echo "Found errors file: $error_file"
# Display the contents to see exitCancelled implementation
echo "---- errors.ts (1–200) ----"
sed -n '1,200p' "$error_file"
echo "---------------------------"
# Find all usages of exitCancelled in the codebase
echo "---- exitCancelled usages ----"
rg -n "exitCancelled" -C1Length of output: 13626
Ensure consistent cancellation behavior in Prisma Postgres setup
The setupWithCreateDb helper in
apps/cli/src/helpers/database-providers/prisma-postgres-setup.ts
currently does:
const databaseUrl = await text({ … });
if (isCancel(databaseUrl)) return null;
Returning null on cancel causes the CLI to “skip” DB configuration and fall back to manual instructions. All other prompts abort via exitCancelled. To keep UX consistent (and avoid surprising skips), replace the null return with an exitCancelled call:
- if (isCancel(databaseUrl)) return null;
+ if (isCancel(databaseUrl)) return exitCancelled("Database setup cancelled");If you intended to let users skip and continue, consider adding an explicit confirmation (e.g. confirm("Skip DB configuration?")) instead.
🤖 Prompt for AI Agents
In apps/cli/src/helpers/database-providers/prisma-postgres-setup.ts at line 64,
the code returns null when isCancel(databaseUrl) is true, causing inconsistent
cancellation behavior. Replace the return null statement with a call to
exitCancelled() to ensure the CLI aborts consistently on cancellation instead of
silently skipping DB configuration.
| import type { AddInput, CreateInput, ProjectConfig } from "../../types"; | ||
| import { trackProjectCreation } from "../../utils/analytics"; | ||
| import { displayConfig } from "../../utils/display-config"; | ||
| import { exitWithError, handleError } from "../../utils/errors"; |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Double-check handleError fallback semantics
You’re passing a friendly fallback, but handleError currently ignores fallback when error is an Error. See proposed fix in errors.ts so the user-friendly context actually shows up.
🏁 Script executed:
#!/bin/bash
set -e
echo "=== Showing handleError implementation ==="
rg -n "handleError" -A20 apps/cli/src/utils/errors.ts
echo
echo "=== Showing usages of handleError in command-handlers.ts ==="
rg -n "handleError" -C3 apps/cli/src/helpers/project-generation/command-handlers.tsLength of output: 1306
Double-check handleError fallback logic in utils/errors.ts
The current implementation in apps/cli/src/utils/errors.ts always selects error.message for any Error instance, so your provided fallback is never used when an actual Error is thrown:
export function handleError(error: unknown, fallbackMessage?: string): never {
const message =
error instanceof Error
? error.message // ← fallbackMessage is ignored here
: fallbackMessage || String(error);
consola.error(pc.red(message));
process.exit(1);
}To ensure the friendly fallback is displayed when given, flip the logic to prefer fallbackMessage first:
-export function handleError(error: unknown, fallbackMessage?: string): never {
- const message =
- error instanceof Error ? error.message : fallbackMessage || String(error);
+export function handleError(error: unknown, fallbackMessage?: string): never {
+ const message =
+ fallbackMessage ??
+ (error instanceof Error ? error.message : String(error));
consola.error(pc.red(message));
process.exit(1);
}• File: apps/cli/src/utils/errors.ts
• Adjust lines 15–18 as shown above.
🤖 Prompt for AI Agents
In apps/cli/src/utils/errors.ts around lines 15 to 18, the handleError function
always uses error.message when error is an instance of Error, ignoring the
fallbackMessage. To fix this, modify the logic to prioritize fallbackMessage if
provided, otherwise use error.message, and if neither is available, convert
error to string. This ensures the friendly fallback message is displayed when
given.
| import pc from "picocolors"; | ||
| import type { ProjectConfig } from "../../types"; | ||
| import { writeBtsConfig } from "../../utils/bts-config"; | ||
| import { exitWithError } from "../../utils/errors"; |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Unify error handling via handleError; avoid double-logging and keep stack context
Use the centralized handler instead of mixing console.error + exitWithError. This keeps behavior consistent across the CLI and avoids duplicated output.
-import { exitWithError } from "../../utils/errors";
+import { handleError } from "../../utils/errors";
@@
} catch (error) {
- if (error instanceof Error) {
- console.error(error.stack);
- exitWithError(`Error during project creation: ${error.message}`);
- } else {
- console.error(error);
- exitWithError(`An unexpected error occurred: ${String(error)}`);
- }
+ handleError(error, "Error during project creation");
}Also applies to: 106-112
🤖 Prompt for AI Agents
In apps/cli/src/helpers/project-generation/create-project.ts at line 5 and also
lines 106 to 112, replace the current error handling that uses console.error
combined with exitWithError by using the centralized handleError function
instead. This will unify error handling, prevent double-logging, and preserve
the error stack context consistently across the CLI. Update the imports and
calls accordingly to use handleError for all error cases in these sections.
| if (addon === "vibe-rules") continue; | ||
|
|
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Explicitly skipping 'vibe-rules' templates—add code comment and verify dedicated setup path handles it.
Good call if ‘vibe-rules’ is handled by a dedicated setup to avoid duplication. Add a brief comment to document the rationale and verify the setup path is indeed invoked.
Suggested inline comment:
- if (addon === "vibe-rules") continue;
+ // 'vibe-rules' has a dedicated setup (see helpers/setup/vibe-rules-setup.ts).
+ // Skip template copy here to avoid duplication/conflicts.
+ if (addon === "vibe-rules") continue;Verification script:
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Searching for 'setupVibeRules' definition and invocations..."
rg -n 'setupVibeRules' -A 3 -B 3 || true
echo
echo "Checking addons setup wiring..."
rg -n 'setupAddons' -A 20 apps/cli/src/helpers/setup || trueLength of output: 3815
Add inline documentation for skipping ‘vibe-rules’ templates
To avoid confusion and clarify that ‘vibe-rules’ is processed via its own setup routine, please annotate the skip logic in apps/cli/src/helpers/project-generation/template-manager.ts.
• Location: around line 538 in apps/cli/src/helpers/project-generation/template-manager.ts
• Dedicated setup found in: apps/cli/src/helpers/setup/vibe-rules-setup.ts
Suggested diff:
// 'vibe-rules' has its own setup handler
// (apps/cli/src/helpers/setup/vibe-rules-setup.ts).
// Skip copying templates here to prevent duplication/conflicts.
- if (addon === "vibe-rules") continue;
+ if (addon === "vibe-rules") continue;Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In apps/cli/src/helpers/project-generation/template-manager.ts around lines 538
to 539, add an inline comment above the line that skips 'vibe-rules' templates
explaining that these templates are excluded here because they are handled
separately by their own setup routine located in
apps/cli/src/helpers/setup/vibe-rules-setup.ts. This will clarify the reason for
skipping and improve code readability.
| cancel(pc.red("Operation cancelled")); | ||
| process.exit(0); | ||
| } | ||
| if (isCancel(response)) return exitCancelled("Operation cancelled"); |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Ensure exitCancelled is typed to return never (and consider explicit return type here).
Returning exitCancelled(...) is correct only if it’s typed as never. Otherwise, this widens the function’s return type and may cause type leaks.
- If
exitCancelledisnever, consider explicitly annotating the function return type for clarity.
Suggested tweak (optional):
-export async function getinstallChoice(install?: boolean) {
+export async function getinstallChoice(install?: boolean): Promise<boolean> {Run to confirm never return type:
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Verify exitCancelled signature and return type
rg -n $'export function exitCancelled\\s*\\(' apps/cli/src/utils/errors.ts -A 1 || true
# Verify exitWithError signature and return type
rg -n $'export function exitWithError\\s*\\(' apps/cli/src/utils/errors.ts -A 1 || trueLength of output: 374
exitCancelled correctly returns never—consider explicitly typing your function’s return type
- In
apps/cli/src/prompts/install.ts(around line 13), the call toexitCancelled(...)is safe because it’s declared as returningneverinapps/cli/src/utils/errors.ts. - To make your API clearer and prevent unintentional return-type widening, you can explicitly annotate
getInstallChoice:
Suggested diff:
-export async function getInstallChoice(install?: boolean) {
+export async function getInstallChoice(install?: boolean): Promise<boolean> {📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if (isCancel(response)) return exitCancelled("Operation cancelled"); | |
| -export async function getInstallChoice(install?: boolean) { | |
| +export async function getInstallChoice(install?: boolean): Promise<boolean> { |
🤖 Prompt for AI Agents
In apps/cli/src/prompts/install.ts at line 13, the call to exitCancelled is safe
because exitCancelled returns never, but the function getInstallChoice should be
explicitly typed with a return type that reflects this behavior. Add an explicit
return type annotation to getInstallChoice to clarify that it may not return
normally, preventing unintentional return-type widening and improving API
clarity.
| import { DEFAULT_CONFIG } from "../constants"; | ||
| import type { Backend, Frontend, Runtime, WebDeploy } from "../types"; | ||
| import { WEB_FRAMEWORKS } from "../utils/compatibility"; | ||
| import { exitCancelled } from "../utils/errors"; |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Ensure exitCancelled is never-returning; avoid returning it
Same rationale as other prompts: returning exitCancelled is unnecessary if it returns never. If it doesn’t, it can violate the function’s return type.
Verification:
Refactor if needed:
- if (isCancel(response)) return exitCancelled("Operation cancelled");
+ if (isCancel(response)) {
+ exitCancelled("Operation cancelled");
+ }Also applies to: 59-60, 105-106
🏁 Script executed:
#!/bin/bash
rg -n "export (const|function) exitCancelled" apps/cli/src/utils/errors.ts -A 3 -B 1Length of output: 219
Avoid returning exitCancelled; invoke it directly
Since exitCancelled is declared to return never, using return exitCancelled(...) is unnecessary and may conflict with surrounding return types. Replace all instances of:
- if (isCancel(response)) return exitCancelled("Operation cancelled");
+ if (isCancel(response)) {
+ exitCancelled("Operation cancelled");
+ }Locations to update:
- apps/cli/src/prompts/web-deploy.ts, lines 59-60
- apps/cli/src/prompts/web-deploy.ts, lines 105-106
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In apps/cli/src/prompts/web-deploy.ts at lines 59-60 and 105-106, the code uses
'return exitCancelled(...)' but since exitCancelled returns never, you should
remove the 'return' keyword and call exitCancelled directly to avoid type
conflicts and improve clarity.
| export function handleError(error: unknown, fallbackMessage?: string): never { | ||
| const message = | ||
| error instanceof Error ? error.message : fallbackMessage || String(error); | ||
| consola.error(pc.red(message)); | ||
| process.exit(1); | ||
| } |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Use fallback message and include details; optionally log stack in debug
Current logic ignores fallback when error is an Error. Prefer a friendly base message plus details. Also log the stack at debug level when available.
-export function handleError(error: unknown, fallbackMessage?: string): never {
- const message =
- error instanceof Error ? error.message : fallbackMessage || String(error);
- consola.error(pc.red(message));
- process.exit(1);
-}
+export function handleError(error: unknown, fallbackMessage?: string): never {
+ const base = fallbackMessage ?? "An unexpected error occurred";
+ let detailed = "";
+ if (error instanceof Error) {
+ detailed = error.message || "";
+ if (error.stack) consola.debug(error.stack);
+ } else if (error != null) {
+ detailed = String(error);
+ }
+ const message = detailed ? `${base}: ${detailed}` : base;
+ consola.error(pc.red(message));
+ process.exit(1);
+}🤖 Prompt for AI Agents
In apps/cli/src/utils/errors.ts around lines 15 to 20, the handleError function
currently uses the error message directly if error is an Error, ignoring the
fallbackMessage. Update the logic to always use the fallbackMessage as a base
friendly message and append error details if available. Additionally, if the
error has a stack trace, log it at the debug level using consola.debug. This
will provide a clearer user message and detailed debug info.
| - **`apps/web/`** - Frontend application{{#if (includes frontend "tanstack-router")}} (React with TanStack Router){{else | ||
| if (includes frontend "react-router")}} (React with React Router){{else if (includes frontend "next")}} (Next.js){{else | ||
| if (includes frontend "nuxt")}} (Nuxt.js){{else if (includes frontend "svelte")}} (SvelteKit){{else if (includes | ||
| frontend "solid")}} (SolidStart){{/if}} | ||
| {{/if}} |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Handlebars “else if” may not be supported; prefer nested ifs or a helper
If your renderer doesn’t support else if, this won’t compile. Either nest blocks or add a custom elseif helper. Example rewrite:
- - **`apps/web/`** - Frontend application{{#if (includes frontend "tanstack-router")}} (React with TanStack Router){{else
- if (includes frontend "react-router")}} (React with React Router){{else if (includes frontend "next")}} (Next.js){{else
- if (includes frontend "nuxt")}} (Nuxt.js){{else if (includes frontend "svelte")}} (SvelteKit){{else if (includes
- frontend "solid")}} (SolidStart){{/if}}
+ - **`apps/web/`** - Frontend application
+ {{#if (includes frontend "tanstack-router")}} (React with TanStack Router)
+ {{else}}
+ {{#if (includes frontend "react-router")}} (React with React Router)
+ {{else}}
+ {{#if (includes frontend "next")}} (Next.js)
+ {{else}}
+ {{#if (includes frontend "nuxt")}} (Nuxt.js)
+ {{else}}
+ {{#if (includes frontend "svelte")}} (SvelteKit)
+ {{else}}
+ {{#if (includes frontend "solid")}} (SolidStart){{/if}}
+ {{/if}}
+ {{/if}}
+ {{/if}}
+ {{/if}}
+ {{/if}}To verify support, search for custom helpers and prior use of {{else if}}:
🏁 Script executed:
#!/bin/bash
rg -n --glob '!node_modules' 'registerHelper\\(|handlebars-helpers|{{else if' -A 3Length of output: 243
🏁 Script executed:
#!/bin/bash
# Search for custom helper registrations
rg -n --glob '!node_modules' 'registerHelper\(' -A 3
# Search for inclusion of handlebars-helpers package
rg -n --glob '!node_modules' 'handlebars-helpers' -A 3
# Search for any use of '{{else if' in .hbs templates
rg -n --glob '!node_modules' --glob '*.hbs' '{{else if' -A 3Length of output: 970
Refactor Handlebars conditionals to avoid unsupported else if
Handlebars only supports a single {{else}} block—not {{else if}}—and there’s no registered elseif helper. To ensure this template compiles across all environments, replace your chained else if with nested {{#if}}…{{else}} blocks.
File: apps/cli/templates/addons/vibe-rules/.bts/rules.md.hbs
Lines: 11–15
- - **`apps/web/`** - Frontend application{{#if (includes frontend "tanstack-router")}} (React with TanStack Router){{else if (includes frontend "react-router")}} (React with React Router){{else if (includes frontend "next")}} (Next.js){{else if (includes frontend "nuxt")}} (Nuxt.js){{else if (includes frontend "svelte")}} (SvelteKit){{else if (includes frontend "solid")}} (SolidStart){{/if}}
+ - **`apps/web/`** - Frontend application
+ {{#if (includes frontend "tanstack-router")}}
+ (React with TanStack Router)
+ {{else}}
+ {{#if (includes frontend "react-router")}}
+ (React with React Router)
+ {{else}}
+ {{#if (includes frontend "next")}}
+ (Next.js)
+ {{else}}
+ {{#if (includes frontend "nuxt")}}
+ (Nuxt.js)
+ {{else}}
+ {{#if (includes frontend "svelte")}}
+ (SvelteKit)
+ {{else}}
+ {{#if (includes frontend "solid")}}
+ (SolidStart)
+ {{/if}}
+ {{/if}}
+ {{/if}}
+ {{/if}}
+ {{/if}}
+ {{/if}}– Replace every {{else if (…)}} with an {{else}} followed by a nested {{#if (…)}}…{{/if}}.
– No else if helper is registered in apps/cli/src/utils/template-processor.ts, so this change is required to avoid compilation errors.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - **`apps/web/`** - Frontend application{{#if (includes frontend "tanstack-router")}} (React with TanStack Router){{else | |
| if (includes frontend "react-router")}} (React with React Router){{else if (includes frontend "next")}} (Next.js){{else | |
| if (includes frontend "nuxt")}} (Nuxt.js){{else if (includes frontend "svelte")}} (SvelteKit){{else if (includes | |
| frontend "solid")}} (SolidStart){{/if}} | |
| {{/if}} | |
| - **`apps/web/`** - Frontend application | |
| {{#if (includes frontend "tanstack-router")}} | |
| (React with TanStack Router) | |
| {{else}} | |
| {{#if (includes frontend "react-router")}} | |
| (React with React Router) | |
| {{else}} | |
| {{#if (includes frontend "next")}} | |
| (Next.js) | |
| {{else}} | |
| {{#if (includes frontend "nuxt")}} | |
| (Nuxt.js) | |
| {{else}} | |
| {{#if (includes frontend "svelte")}} | |
| (SvelteKit) | |
| {{else}} | |
| {{#if (includes frontend "solid")}} | |
| (SolidStart) | |
| {{/if}} | |
| {{/if}} | |
| {{/if}} | |
| {{/if}} | |
| {{/if}} | |
| {{/if}} |
🤖 Prompt for AI Agents
In apps/cli/templates/addons/vibe-rules/.bts/rules.md.hbs around lines 11 to 15,
the Handlebars template uses unsupported `{{else if}}` conditionals which cause
compilation errors. Replace each `{{else if (...)}}` with an `{{else}}` block
containing a nested `{{#if (...)}}...{{/if}}` block to properly nest the
conditions without using `else if`. This ensures compatibility with Handlebars
which only supports a single `{{else}}` block.
| - **`apps/server/`** - Backend server{{#if (eq backend "hono")}} (Hono){{else if (eq backend "express")}} | ||
| (Express){{else if (eq backend "fastify")}} (Fastify){{else if (eq backend "elysia")}} (Elysia){{else if (eq backend | ||
| "next")}} (Next.js API){{/if}} |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Apply the same “else if” handling in other conditional blocks
Repeat the nested-if (or custom elseif helper) pattern for backend and ORM sections to prevent template parse errors.
Also applies to: 55-56, 86-89
🤖 Prompt for AI Agents
In apps/cli/templates/addons/vibe-rules/.bts/rules.md.hbs around lines 19 to 21,
the conditional block for backend uses multiple separate if statements instead
of a consistent "else if" pattern, which can cause template parse errors. Update
this block and similarly at lines 55-56 and 86-89 to use a nested "else if" or a
custom elseif helper for all conditional checks to ensure proper parsing and
consistent logic flow.
refactor error handling
Summary by CodeRabbit
New Features
Improvements
Chores