adonisjs

Build AdonisJS 6 features from scratch through production. Full lifecycle - build, debug, test, optimize, refactor. Follows TypeScript-first, Lucid ORM, and AdonisJS conventions.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "adonisjs" with this command: npx skills add filipebraida/skills/filipebraida-skills-adonisjs

<essential_principles>

AdonisJS 6 Principles

TypeScript-first - Every request, service, and model is typed. Prefer explicit types over any.

1. Thin Controllers, Focused Services

Controllers orchestrate. Business logic lives in services or domain modules.

// app/controllers/users_controller.ts
import type { HttpContext } from "@adonisjs/core/http";
import CreateUserService from "#services/users/create_user_service";

export default class UsersController {
  async store({ request, response }: HttpContext) {
    const payload = await request.validateUsing(CreateUserService.validator);
    const user = await new CreateUserService().handle(payload);
    return response.created({ data: user });
  }
}

2. Validate Every Input with VineJS

Never trust request data. Validate on entry.

// app/validators/create_user.ts
import vine from "@vinejs/vine";

export const createUserValidator = vine.compile(
  vine.object({
    email: vine.string().email(),
    fullName: vine.string().minLength(2).maxLength(120),
    password: vine.string().minLength(8),
  }),
);

3. Lucid Models Own Persistence

Use models for persistence and relationships. Keep queries in one place.

// app/models/user.ts
import { BaseModel, column } from "@adonisjs/lucid/orm";

export default class User extends BaseModel {
  @column({ isPrimary: true })
  declare id: number;

  @column()
  declare email: string;
}

4. Middleware for Cross-Cutting Concerns

Authentication, tenant scoping, and rate limiting belong in middleware.

// app/middleware/auth_middleware.ts
import type { HttpContext } from "@adonisjs/core/http";
import type { NextFn } from "@adonisjs/core/types/http";

export default class AuthMiddleware {
  async handle(ctx: HttpContext, next: NextFn) {
    await ctx.auth.check();
    return next();
  }
}

</essential_principles>

<intake> **What would you like to do?**
  1. Build a new feature/endpoint
  2. Debug an existing issue
  3. Write/run tests
  4. Optimize performance
  5. Refactor code
  6. Something else

Then read the matching workflow from workflows/ and follow it. </intake>

<routing> | Response | Workflow | |----------|----------| | 1, "new", "create", "build", "feature", "endpoint", "api" | `workflows/build-feature.md` | | 2, "broken", "fix", "debug", "crash", "bug", "error" | `workflows/debug.md` | | 3, "test", "tests", "spec", "coverage" | `workflows/write-tests.md` | | 4, "slow", "optimize", "performance", "fast", "n+1" | `workflows/optimize-performance.md` | | 5, "refactor", "clean", "improve", "restructure" | `workflows/refactor.md` | | 6, other | Clarify, then select workflow or references | </routing>

<verification_loop>

After Every Change

# 1. Type check
pnpm typecheck

# 2. Run tests
node ace test tests/functional/changed.spec.ts

# 3. Lint
pnpm lint

Report: "Types: OK | Tests: X pass | Lint: clean" </verification_loop>

<reference_index>

Domain Knowledge

All in references/:

Architecture: architecture.md Models: models.md Controllers: controllers.md Serialization (DTOs): serialization.md Validations: validations-callbacks.md Background Jobs: background-jobs.md Performance: performance.md Testing: testing.md Multi-Tenant: multi-tenant.md Anti-Patterns: anti-patterns.md </reference_index>

<workflows_index>

Workflows

All in workflows/:

FilePurpose
build-feature.mdCreate new feature/endpoint from scratch
debug.mdFind and fix bugs
write-tests.mdWrite and run tests
optimize-performance.mdProfile and speed up
refactor.mdRestructure code following patterns
</workflows_index>

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

inertia-adonisjs

No summary provided by upstream source.

Repository SourceNeeds Review
General

shadcn-ui

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.

Repository SourceNeeds Review
162K94.2Kanthropics
Coding

remotion-best-practices

Use this skills whenever you are dealing with Remotion code to obtain the domain-specific knowledge.

Repository SourceNeeds Review
148.9K2.1Kremotion-dev