feat(skills): install better-auth/skills when --auth better-auth#119
Conversation
WalkthroughinstallSkills gains an optional authProvider parameter, AGENT_FLAGS and a PROVIDER_SKILLS mapping; when a provider matches, an extra provider-specific skill install runs. The create and link commands now pass the selected auth provider into installSkills across affected flows. ChangesAuth Provider Skill Installation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
3 issues found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/commands/create.ts">
<violation number="1" location="src/commands/create.ts:163">
P2: The `--org-id` description currently promises a saved-default fallback that this command does not implement, which makes the CLI help misleading.</violation>
<violation number="2" location="src/commands/create.ts:167">
P2: `--dir` is currently a no-op: the flag is declared but never used when choosing the scaffold directory.</violation>
<violation number="3" location="src/commands/create.ts:168">
P1: `--deploy` is advertised but not wired into execution; deployment behavior is unchanged and still prompt-driven.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
| .option('--template <template>', 'Template to use: react, nextjs, chatbot, crm, e-commerce, todo, or empty') | ||
| .option('--auth <provider>', 'Wire a third-party auth provider into the chosen template (currently: better-auth)') | ||
| .option('--dir <name>', 'Directory to scaffold the template into (default: project name); ignored for blank/--template empty') | ||
| .option('--deploy', 'Auto-deploy after scaffolding (templates only). Pair with --no-deploy to opt out without prompting.') |
There was a problem hiding this comment.
P1: --deploy is advertised but not wired into execution; deployment behavior is unchanged and still prompt-driven.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/commands/create.ts, line 168:
<comment>`--deploy` is advertised but not wired into execution; deployment behavior is unchanged and still prompt-driven.</comment>
<file context>
@@ -160,12 +160,14 @@ export function registerCreateCommand(program: Command): void {
.option('--template <template>', 'Template to use: react, nextjs, chatbot, crm, e-commerce, todo, or empty')
.option('--auth <provider>', 'Wire a third-party auth provider into the chosen template (currently: better-auth)')
+ .option('--dir <name>', 'Directory to scaffold the template into (default: project name); ignored for blank/--template empty')
+ .option('--deploy', 'Auto-deploy after scaffolding (templates only). Pair with --no-deploy to opt out without prompting.')
.action(async (opts, cmd) => {
- const { json, apiUrl } = getRootOpts(cmd);
</file context>
| .description('Create a new InsForge project') | ||
| .option('--name <name>', 'Project name') | ||
| .option('--org-id <id>', 'Organization ID') | ||
| .option('--org-id <id>', 'Organization ID (falls back to your saved default; only required for first multi-org create)') |
There was a problem hiding this comment.
P2: The --org-id description currently promises a saved-default fallback that this command does not implement, which makes the CLI help misleading.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/commands/create.ts, line 163:
<comment>The `--org-id` description currently promises a saved-default fallback that this command does not implement, which makes the CLI help misleading.</comment>
<file context>
@@ -160,12 +160,14 @@ export function registerCreateCommand(program: Command): void {
.description('Create a new InsForge project')
.option('--name <name>', 'Project name')
- .option('--org-id <id>', 'Organization ID')
+ .option('--org-id <id>', 'Organization ID (falls back to your saved default; only required for first multi-org create)')
.option('--region <region>', 'Deployment region (us-east, us-west, eu-central, ap-southeast)')
.option('--template <template>', 'Template to use: react, nextjs, chatbot, crm, e-commerce, todo, or empty')
</file context>
| .option('--org-id <id>', 'Organization ID (falls back to your saved default; only required for first multi-org create)') | |
| .option('--org-id <id>', 'Organization ID (required with --json when you belong to multiple organizations)') |
| .option('--region <region>', 'Deployment region (us-east, us-west, eu-central, ap-southeast)') | ||
| .option('--template <template>', 'Template to use: react, nextjs, chatbot, crm, e-commerce, todo, or empty') | ||
| .option('--auth <provider>', 'Wire a third-party auth provider into the chosen template (currently: better-auth)') | ||
| .option('--dir <name>', 'Directory to scaffold the template into (default: project name); ignored for blank/--template empty') |
There was a problem hiding this comment.
P2: --dir is currently a no-op: the flag is declared but never used when choosing the scaffold directory.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/commands/create.ts, line 167:
<comment>`--dir` is currently a no-op: the flag is declared but never used when choosing the scaffold directory.</comment>
<file context>
@@ -160,12 +160,14 @@ export function registerCreateCommand(program: Command): void {
.option('--region <region>', 'Deployment region (us-east, us-west, eu-central, ap-southeast)')
.option('--template <template>', 'Template to use: react, nextjs, chatbot, crm, e-commerce, todo, or empty')
.option('--auth <provider>', 'Wire a third-party auth provider into the chosen template (currently: better-auth)')
+ .option('--dir <name>', 'Directory to scaffold the template into (default: project name); ignored for blank/--template empty')
+ .option('--deploy', 'Auto-deploy after scaffolding (templates only). Pair with --no-deploy to opt out without prompting.')
.action(async (opts, cmd) => {
</file context>
Fold provider-specific skill packs into `installSkills` instead of bolting on a second execAsync call at every call site. When the user opts into a third-party auth provider via `link --auth <provider>` or `create --auth <provider>`, install the provider's upstream skill repo alongside InsForge's own. Currently only `better-auth → better-auth/skills` is wired up; the lookup makes it trivial to add more providers later without touching call sites. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
833a862 to
160593d
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/lib/skills.ts (1)
96-98:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winFailure recovery commands are now out of sync with the executed install commands.
On Line 97 and Line 133, the suggested retry commands omit flags (
-g -yand agent targets) used by the actual installs, so manual retries may not reproduce intended behavior.Suggested patch
- clack.log.info('Run `npx skills add insforge/agent-skills` once resolved to see the full output.'); + clack.log.info(`Run \`npx skills add insforge/agent-skills -g -y ${AGENT_FLAGS}\` once resolved to see the full output.`); ... - clack.log.info(`Run \`npx skills add ${providerEntry.repo}\` once resolved to see the full output.`); + clack.log.info(`Run \`npx skills add ${providerEntry.repo} -g -y ${AGENT_FLAGS}\` once resolved to see the full output.`);Also applies to: 132-134
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/lib/skills.ts` around lines 96 - 98, Update the failure-recovery messages so they match the actual install commands: replace the hardcoded retry hints in the clack.log.info calls that currently say "Run `npx skills add insforge/agent-skills`..." with the full command including the flags and agent target(s) used by the installer (e.g., include `-g -y` and the agent name/target). Locate the two offending log lines in src/lib/skills.ts (the clack.log.info messages shown in the diff and the similar message at the later occurrence around lines 132–134) and make their suggested retry commands identical to the real install invocation used by the code that performs the install.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/lib/skills.ts`:
- Around line 96-98: Update the failure-recovery messages so they match the
actual install commands: replace the hardcoded retry hints in the clack.log.info
calls that currently say "Run `npx skills add insforge/agent-skills`..." with
the full command including the flags and agent target(s) used by the installer
(e.g., include `-g -y` and the agent name/target). Locate the two offending log
lines in src/lib/skills.ts (the clack.log.info messages shown in the diff and
the similar message at the later occurrence around lines 132–134) and make their
suggested retry commands identical to the real install invocation used by the
code that performs the install.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: caac1de4-0148-4a7b-aa7e-977538e8f75d
📒 Files selected for processing (3)
src/commands/create.tssrc/commands/projects/link.tssrc/lib/skills.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/commands/projects/link.ts
Ship #119 (install better-auth/skills when --auth better-auth is used). The CLI already installed insforge/agent-skills and find-skills globally on every link/create; 0.1.74 also installs the upstream better-auth/skills pack whenever the user opts into Better Auth, so agents get the provider's own scaffolding patterns alongside InsForge's bridge skills. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
installSkillsfunction instead of adding a secondexecAsyncblock at every call sitelink --auth better-authorcreate --auth better-authis used, also installbetter-auth/skillsalongsideinsforge/agent-skillsandvercel-labs/skillsPROVIDER_SKILLS) makes it trivial to add more providers later without touching call sitesAGENT_FLAGSconstant keeps the agent target list in lockstep across all three installsTest plan
npm run buildcleannpm test— 228/228 passnpm run lint— warnings only (pre-existing)link --auth better-authagainst cloud project showed all three install lines:Installing InsForge agent skills (global)...→ successInstalling find-skills (global)...→ successInstalling Better Auth skills (global)...→ success🤖 Generated with Claude Code
Summary by cubic
Automatically installs
better-auth/skillswhen--auth better-authis used withcreateorlink. Provider installs are centralized ininstallSkills, and the selected auth provider is now passed from call sites.New Features
better-auth/skillsalongsideinsforge/agent-skillsandvercel-labs/skillswhen--auth better-authis specified.Refactors
installSkills;createandlinknow pass the selected--authprovider.AGENT_FLAGSand aPROVIDER_SKILLSmap to keep agent targets aligned and make adding providers easy.Written for commit 160593d. Summary will update on new commits.
Summary by CodeRabbit
New Features
--org-idCLI option to specify target organization during project creation, with automatic fallback to saved default.Improvements