Skip to content

feat(skills): install better-auth/skills when --auth better-auth#119

Merged
tonychang04 merged 1 commit into
mainfrom
feat/install-better-auth-skills
May 12, 2026
Merged

feat(skills): install better-auth/skills when --auth better-auth#119
tonychang04 merged 1 commit into
mainfrom
feat/install-better-auth-skills

Conversation

@tonychang04
Copy link
Copy Markdown
Contributor

@tonychang04 tonychang04 commented May 12, 2026

Summary

  • Fold provider-specific skill installs into the existing installSkills function instead of adding a second execAsync block at every call site
  • When link --auth better-auth or create --auth better-auth is used, also install better-auth/skills alongside insforge/agent-skills and vercel-labs/skills
  • Lookup map (PROVIDER_SKILLS) makes it trivial to add more providers later without touching call sites
  • Shared AGENT_FLAGS constant keeps the agent target list in lockstep across all three installs

Test plan

  • npm run build clean
  • npm test — 228/228 pass
  • npm run lint — warnings only (pre-existing)
  • Live-fire: link --auth better-auth against cloud project showed all three install lines:
    • Installing InsForge agent skills (global)... → success
    • Installing find-skills (global)... → success
    • Installing Better Auth skills (global)... → success

🤖 Generated with Claude Code


Summary by cubic

Automatically installs better-auth/skills when --auth better-auth is used with create or link. Provider installs are centralized in installSkills, and the selected auth provider is now passed from call sites.

  • New Features

    • Auto-install better-auth/skills alongside insforge/agent-skills and vercel-labs/skills when --auth better-auth is specified.
  • Refactors

    • Centralize provider-specific installs in installSkills; create and link now pass the selected --auth provider.
    • Add AGENT_FLAGS and a PROVIDER_SKILLS map 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

    • Added --org-id CLI option to specify target organization during project creation, with automatic fallback to saved default.
  • Improvements

    • Skill installation now respects the selected authentication provider and can install provider-specific skills when applicable, improving setup accuracy and feedback.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

Walkthrough

installSkills 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.

Changes

Auth Provider Skill Installation

Layer / File(s) Summary
installSkills API enhancement and provider-skills mapping
src/lib/skills.ts
installSkills signature now accepts an optional authProvider. AGENT_FLAGS constant introduced. PROVIDER_SKILLS mapping added (includes better-auth). Conditional provider-specific npx skills add <provider-repo> added with separate logging and try/catch handling.
Command callers pass authProvider into skill installation
src/commands/create.ts, src/commands/projects/link.ts
Calls to installSkills updated to pass opts.auth (as `string

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • InsForge/CLI#103: Modifies auth-overlay/install behavior in link-related flows and centralizes related install calls.

Suggested reviewers

  • jwfing

Poem

🐰 I bounced through opts.auth with glee,

Told installSkills which key to see,
better-auth hopped into the mix,
Commands now pass the matching fix,
Hooray — skill installs know who to be!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main feature: installing better-auth/skills when the --auth better-auth flag is used.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/install-better-auth-skills

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/commands/create.ts Outdated
.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.')
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot May 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Fix with Cubic

Comment thread src/commands/create.ts Outdated
.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)')
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot May 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Suggested change
.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)')
Fix with Cubic

Comment thread src/commands/create.ts Outdated
.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')
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot May 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Fix with Cubic

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>
@tonychang04 tonychang04 force-pushed the feat/install-better-auth-skills branch from 833a862 to 160593d Compare May 12, 2026 16:24
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Failure 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 -y and 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

📥 Commits

Reviewing files that changed from the base of the PR and between 833a862 and 160593d.

📒 Files selected for processing (3)
  • src/commands/create.ts
  • src/commands/projects/link.ts
  • src/lib/skills.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/commands/projects/link.ts

tonychang04 added a commit that referenced this pull request May 12, 2026
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>
@tonychang04 tonychang04 enabled auto-merge (squash) May 12, 2026 17:20
Copy link
Copy Markdown
Member

@jwfing jwfing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, approved.

@tonychang04 tonychang04 merged commit 9b0cd23 into main May 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants