Skip to content

feat(better-auth): add use-better-auth workflow skill#159

Merged
amondnet merged 1 commit into
mainfrom
amondnet/use-better-auth-skill
Apr 23, 2026
Merged

feat(better-auth): add use-better-auth workflow skill#159
amondnet merged 1 commit into
mainfrom
amondnet/use-better-auth-skill

Conversation

@amondnet
Copy link
Copy Markdown
Contributor

@amondnet amondnet commented Apr 23, 2026

Summary

Adds a hand-written use-better-auth workflow skill to the better-auth plugin, mirroring the structure and intent of Vercel's use-ai-sdk skill.

What was added and where

  • New skill: plugins/better-auth/.agents/skills/use-better-auth/SKILL.md (216 lines, imperative voice, no second-person)
  • Reference docs (4 files under .../references/):
    • adapters.md — supported framework adapters
    • plugins.md — built-in plugin catalogue
    • databases.md — supported database adapters
    • common-errors.md — common error patterns and fixes
  • Version bump: plugins/better-auth/.claude-plugin/plugin.json 1.1.0 → 1.2.0
  • Changelog: 1.2.0 entry prepended to plugins/better-auth/CHANGELOG.md

Why hand-written instead of vendor-synced

This skill is a meta-skill that teaches agents how to work with better-auth, not end-user best-practices that belong upstream in the better-auth source repository. Specifically:

  • It mirrors the use-ai-sdk pattern from the Vercel plugin: ground every code-generation step in the installed package version by querying $(ask src better-auth) rather than trusting training-data knowledge that may be months behind the latest release.
  • Vendor-synced skills (those with SYNC.md) are generated from upstream Gemini CLI extensions. There is no upstream source for this grounding skill — it was authored here intentionally.
  • Placing it in .agents/skills/ (not skills/) keeps it out of the auto-sync pipeline and avoids accidental overwrites on the next bun run skills:sync.

Verification

  • claude plugin validate plugins/better-auth passes with version 1.2.0.
  • Plugin, adapter, and integration names in the reference files were spot-checked against $(ask src better-auth) source tree (e.g. betterAuth, prismaAdapter, twoFactor, admin).
  • SKILL.md body is written in imperative mood with no second-person ("you") references, consistent with skill authoring standards.
  • skills-lock.json was intentionally left untouched — it is managed exclusively by bunx skills add / vendor sync.

Summary by cubic

Adds a hand-written use-better-auth workflow skill to the better-auth plugin to ground auth work in the installed package version via the ask CLI. Mirrors the use-ai-sdk pattern to provide accurate, version-aware guidance.

  • New Features

    • Added plugins/better-auth/.agents/skills/use-better-auth/SKILL.md that queries local better-auth source to avoid stale APIs.
    • Included references/ for adapters, plugins, databases, and common errors sourced from the repo.
    • Placed the skill under .agents/skills/ to stay out of the vendor sync pipeline.
  • Dependencies

    • Bumped plugin version to 1.2.0 and updated CHANGELOG.md.

Written for commit 404540d. Summary will update on new commits.

Add a hand-written `use-better-auth` skill under
`plugins/better-auth/.agents/skills/use-better-auth/` that mirrors
Vercel's `use-ai-sdk` workflow skill in structure and intent.

The skill teaches agents to ground all better-auth work in the
installed version by querying the source tree via the `ask` CLI
(e.g. `ask src better-auth`) instead of relying on training-data
knowledge that may be stale. Reference files cover adapters,
plugins, database support, and common errors sourced from the
actual package.

This is a hand-written skill (no SYNC.md marker) and is not
vendor-synced — it lives alongside the auto-synced better-auth
skills without interfering with the sync pipeline.

Also bumps plugin version 1.1.0 → 1.2.0 and prepends a 1.2.0
entry to CHANGELOG.md.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
claude-code-plugins Ready Ready Preview, Comment Apr 23, 2026 6:14am

Request Review

Copy link
Copy Markdown
Contributor

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

No issues found across 7 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant Agent as Agent (Claude)
    participant CLI as ask CLI
    participant FS as Local Source Code ($SRC)
    participant Ref as Reference Docs (NEW)
    participant App as App Code (Server/Client)
    participant DB as Database

    Note over Agent,Ref: Grounding Phase (NEW: use-better-auth skill)

    Agent->>CLI: NEW: Get source path via "ask src better-auth"
    CLI-->>Agent: Local path to library source
    
    Agent->>FS: NEW: Enumerate plugins & adapters in $SRC
    Note right of FS: Validates real exports instead of<br/>relying on stale training data
    FS-->>Agent: Directory structure / index exports

    Agent->>Ref: NEW: Consult reference/adapters.md
    Ref-->>Agent: Framework-specific mounting logic

    Note over Agent,App: Implementation Phase

    Agent->>App: NEW: Generate auth.ts with verified plugins
    Agent->>App: NEW: Generate framework-specific client (e.g. better-auth/react)
    
    opt Schema Synchronization
        Agent->>CLI: Run "npx auth generate"
        CLI->>DB: Inspect/Diff database schema
        DB-->>Agent: Schema drift status
    end

    alt Runtime/Type Error
        Agent->>Ref: NEW: Check common-errors.md for symptom
        Ref-->>Agent: Canonical fix (e.g. Secret strength, CORS)
        Agent->>App: CHANGED: Apply version-aware fix
    else Success
        Agent-->>Agent: Finalize workflow
    end
Loading

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new use-better-auth skill to the better-auth plugin, providing comprehensive documentation and reference guides for framework adapters, common errors, database configurations, and built-in plugins. It also bumps the plugin version to 1.2.0. However, the placement of the new skill files in the .agents/skills/ directory violates the repository's style guide, as this directory is reserved for externally managed skills and should not be modified directly when a skills-lock.json file is present.

Comment thread plugins/better-auth/.claude-plugin/plugin.json
@amondnet amondnet merged commit 0945eb2 into main Apr 23, 2026
7 checks passed
@amondnet amondnet deleted the amondnet/use-better-auth-skill branch April 23, 2026 06:19
@pleaseai-bot pleaseai-bot Bot mentioned this pull request Apr 23, 2026
amondnet added a commit that referenced this pull request Apr 23, 2026
Add a hand-written `use-mastra` skill under
`plugins/mastra/.agents/skills/use-mastra/` that mirrors Vercel's
`use-ai-sdk` workflow skill in structure and intent. Teaches coding
agents to install the relevant `mastra` / `@mastra/*` package and
read the docs shipped at `node_modules/<pkg>/dist/docs/SKILL.md`
(and `references/*.md`) instead of relying on stale training-data
APIs.

Confirmed via `npm pack` that these packages ship `dist/docs/`:
mastra, @mastra/core, @mastra/memory, @mastra/rag, @mastra/evals,
@mastra/deployer, @mastra/server, @mastra/pg, @mastra/libsql,
@mastra/mcp. Only @mastra/observability is remote-only.

Keeps the existing `mastra` primer skill (v2.0.0, installed via
skills.sh from `mastra-ai/skills`) untouched; `use-mastra` is the
task-triggered workflow complement.

Bumps plugins/mastra from 1.2.0 to 1.3.0 and logs the change in
CHANGELOG.md (matching PR #159's format).
amondnet added a commit that referenced this pull request Apr 23, 2026
* feat(mastra): add use-mastra workflow skill

Add a hand-written `use-mastra` skill under
`plugins/mastra/.agents/skills/use-mastra/` that mirrors Vercel's
`use-ai-sdk` workflow skill in structure and intent. Teaches coding
agents to install the relevant `mastra` / `@mastra/*` package and
read the docs shipped at `node_modules/<pkg>/dist/docs/SKILL.md`
(and `references/*.md`) instead of relying on stale training-data
APIs.

Confirmed via `npm pack` that these packages ship `dist/docs/`:
mastra, @mastra/core, @mastra/memory, @mastra/rag, @mastra/evals,
@mastra/deployer, @mastra/server, @mastra/pg, @mastra/libsql,
@mastra/mcp. Only @mastra/observability is remote-only.

Keeps the existing `mastra` primer skill (v2.0.0, installed via
skills.sh from `mastra-ai/skills`) untouched; `use-mastra` is the
task-triggered workflow complement.

Bumps plugins/mastra from 1.2.0 to 1.3.0 and logs the change in
CHANGELOG.md (matching PR #159's format).

* chore(mastra): apply AI code review suggestions

- Update agent.generate() calls to nested memory: { thread, resource }
  API instead of the deprecated top-level threadId/resourceId fields
  (agents-and-workflows.md and common-errors.md).
- Use createVectorQueryTool from @mastra/rag instead of createTool for
  the vector-query recipe in agents-and-workflows.md.

Addresses cubic-dev-ai P1 + P2 suggestions on PR #161.

* chore: update agent memory for cubic review PR #161
amondnet added a commit that referenced this pull request Apr 29, 2026
#164)

* fix(mastra): move use-mastra skill to skills/ per repo convention

The hand-written use-mastra skill was added at .agents/skills/use-mastra/
in #161, but .agents/skills/ is reserved for vendor-managed skills.sh
output tracked in skills-lock.json (see CLAUDE.md). Move it to the default
skills/ location and switch the plugin.json skills field to array form
["./skills/", "./.agents/skills/"] so both paths load. No skill content
changed.

Refs #161

* fix(better-auth): move use-better-auth skill to skills/ per repo convention

The hand-written use-better-auth skill was added at .agents/skills/use-better-auth/
in #159, but .agents/skills/ is reserved for vendor-managed skills.sh
output tracked in skills-lock.json (see CLAUDE.md). Move it to the default
skills/ location and switch the plugin.json skills field to array form
["./skills/", "./.agents/skills/"] so both paths load. No skill content
changed.

Refs #159

* chore: revert manual CHANGELOG and version bumps (release-please owns them)

Both CHANGELOG.md and plugin.json version are auto-managed by
release-please for plugins/* (see release-please-config.json
extra-files: [{ jsonpath: "$.version" }] and existing release
PRs #158/#160/#163). Manual edits race with the next release PR.

Skill relocations and the plugin.json `skills` array change remain
intact — they're the actual fix release-please will pick up via the
fix(...) commits already on this branch.
@pleaseai-bot pleaseai-bot Bot mentioned this pull request Apr 29, 2026
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.

1 participant