Skip to content

Commit 29d7f46

Browse files
committed
feat: improve nuxt-users skill score to 100%
Hey @rrd108 πŸ‘‹ I ran your skills through `tessl skill review` at work and found some targeted improvements. Here's the full before/after: | Skill | Before | After | Change | |-------|--------|-------|--------| | nuxt-users | 94% | 100% | +6% | <details> <summary>Changes summary</summary> - **Removed redundant "When to use this skill" section** β€” the YAML description already covers trigger terms comprehensively, so this section was duplicating context without adding value - **Consolidated CLI fallback explanation** β€” the `loadNuxt` / `DB_*` fallback behavior was repeated across three sections (config reference, CLI commands, edge cases); consolidated into a single production note in the CLI section - **Replaced verbose edge cases with a troubleshooting table** β€” swapped the 6-item numbered list for a compact symptom/fix table, removing entries that restated earlier config guidance (password validation, Google OAuth) - **Trimmed unnecessary explanatory phrases** β€” removed padding like "This skill helps you work with..." (redundant with description), "required for protected routes" (evident from context), and "if needed for older setups" - **Reduced line count from 165 β†’ 141** while preserving all actionable content </details> Honest disclosure β€” I work at @tesslio where we build tooling around skills like these. Not a pitch - just saw room for improvement and wanted to contribute. Want to self-improve your skills? Just point your agent (Claude Code, Codex, etc.) at [this Tessl guide](https://docs.tessl.io/evaluate/optimize-a-skill-using-best-practices) and ask it to optimize your skill. Ping me - [@rohan-tessl](https://github.com/rohan-tessl) - if you hit any snags. Thanks in advance πŸ™
1 parent 7dba30f commit 29d7f46

1 file changed

Lines changed: 12 additions & 36 deletions

File tree

β€Žskills/nuxt-users/SKILL.mdβ€Ž

Lines changed: 12 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,7 @@ metadata:
99

1010
# Nuxt Users skill
1111

12-
This skill helps you work with the **nuxt-users** module: user authentication, authorization, database setup, and CLI for Nuxt 3 and Nuxt 4 apps.
13-
14-
## When to use this skill
15-
16-
- User asks to add login, register, or logout to a Nuxt app
17-
- User needs to set up or change the database (SQLite, MySQL, PostgreSQL) for nuxt-users
18-
- User wants to run CLI commands: `npx nuxt-users migrate`, `npx nuxt-users create-user`
19-
- User needs to configure permissions, roles, or public routes (whitelist)
20-
- User is customizing password validation, session duration, or mailer (password reset)
21-
- User is using composables like `useAuthentication`, `useUsers`, `usePublicPaths`, or `usePasswordValidation`
22-
- User is styling or integrating components like `NUsersLoginForm`, `NUsersLogoutLink`, `NUsersProfileInfo`, `NUsersResetPasswordForm`, `NUsersList`, `NUsersUserForm`
23-
24-
## Step-by-step: initial setup
12+
## Initial setup
2513

2614
1. **Install the module and peer dependencies**
2715
```bash
@@ -49,8 +37,7 @@ This skill helps you work with the **nuxt-users** module: user authentication, a
4937
```
5038
Flags: `-e` email, `-n` name, `-p` password, `-r` role (optional).
5139

52-
5. **Configure permissions (required for protected routes)**
53-
Without `auth.permissions`, authenticated users cannot access protected routes. Prefer early configuration:
40+
5. **Configure permissions**
5441
```ts
5542
export default defineNuxtConfig({
5643
modules: ['nuxt-users'],
@@ -90,7 +77,7 @@ All options live under `nuxtUsers` in `nuxt.config.ts`.
9077
| Data | `hardDelete` | `true` = hard delete, `false` = soft delete (default) |
9178
| Locale | `locale.default`, `locale.texts`, `locale.fallbackLocale` | Localization |
9279

93-
Runtime config is also supported: use `runtimeConfig.nuxtUsers` for env-based or server-only settings. The CLI merges that when `loadNuxt` succeeds from the **project root**. If `loadNuxt` fails (no `nuxt.config`, output-only deploy, or missing `nuxt`/`@nuxt/kit` under `--omit=dev`), the CLI falls back to `DB_*` env vars and **defaults** for other options β€” custom `tables` / `passwordValidation` from config may not apply. See `docs/user-guide/configuration.md` (CLI sections).
80+
Runtime config is also supported: use `runtimeConfig.nuxtUsers` for env-based or server-only settings.
9481

9582
## CLI commands
9683

@@ -106,15 +93,15 @@ Run from the project root so `nuxt.config.ts` (and optionally `.env`) are found.
10693
npx nuxt-users create-user -e <email> -n "<name>" -p <password> [-r <role>]
10794
```
10895

109-
- **Legacy/table creation** (if needed for older setups)
96+
- **Legacy/table creation**
11097
```bash
11198
npx nuxt-users create-users-table
11299
npx nuxt-users create-personal-access-tokens-table
113100
npx nuxt-users create-password-reset-tokens-table
114101
npx nuxt-users create-migrations-table
115102
```
116103

117-
> **Production:** The CLI is not inside `.output/` alone; you need `nuxt-users` (and peers) installed where you run Node. `npx` may download the package if absent. A `package.json` script (`"nuxt-users": "nuxt-users"`) uses the local binary. **Full config** requires the app root with `nuxt.config` and resolvable `@nuxt/kit`; build-only or `omit=dev` deploys often hit **env fallback** (`DB_*`) instead β€” see configuration docs.
104+
> **Production:** The CLI requires `nuxt-users` (and peers) installed where Node runs β€” it is not bundled inside `.output/`. Full config needs the app root with `nuxt.config`; build-only or `--omit=dev` deploys fall back to `DB_*` env vars. See `docs/user-guide/configuration.md`.
118105
119106
## Composables (auto-imported)
120107

@@ -133,25 +120,14 @@ Run from the project root so `nuxt.config.ts` (and optionally `.env`) are found.
133120
- `NUsersList` β€” List users (admin)
134121
- `NUsersUserForm` β€” Create/edit user form
135122

136-
## Common edge cases
137-
138-
1. **Users get redirected to login on protected routes**
139-
Configure `nuxtUsers.auth.permissions` so each role has access to the routes they need (e.g. `admin: ['*']`, `user: ['/profile']`).
140-
141-
2. **CLI says config not found or uses wrong tables / password rules**
142-
Run the CLI from the directory that contains `nuxt.config`. If you only deploy `.output/` or run with `nuxt` omitted from production, `loadNuxt` may fail and the CLI uses `DB_*` fallback with **defaults** for non-connector options. Set `DB_*` (and see docs) or run the CLI from CI with a full app checkout.
143-
144-
3. **Migrations table missing**
145-
Run `npx nuxt-users migrate` once from the project root. The module will warn at runtime if the migrations table is missing.
146-
147-
4. **Password validation too strict**
148-
Adjust `nuxtUsers.passwordValidation` (e.g. lower `minLength`, set `requireUppercase`/`requireNumbers`/`requireSpecialChars` to `false`). Do not disable all checks in production without good reason.
149-
150-
5. **Database driver errors**
151-
Install the correct peer: SQLite β†’ `better-sqlite3`, MySQL β†’ `mysql2`, PostgreSQL β†’ `pg`. Ensure `connector.name` and `connector.options` match the driver and environment (e.g. correct host, port, credentials).
123+
## Troubleshooting
152124

153-
6. **Google OAuth**
154-
Set `nuxtUsers.auth.google` with `clientId`, `clientSecret`, and optionally `callbackUrl`, `successRedirect`, `errorRedirect`, `scopes`, `allowAutoRegistration`.
125+
| Symptom | Fix |
126+
|---------|-----|
127+
| Redirected to login on protected routes | Set `auth.permissions` so each role has access to needed routes |
128+
| CLI config not found / wrong tables | Run CLI from the directory containing `nuxt.config`; see production note above |
129+
| Migrations table missing | Run `npx nuxt-users migrate` from project root |
130+
| Database driver errors | Install correct peer: SQLite β†’ `better-sqlite3`, MySQL β†’ `mysql2`, PostgreSQL β†’ `pg` |
155131

156132
## File references
157133

0 commit comments

Comments
Β (0)