Loading...
Loading...
Build AdonisJS 6 features from scratch through production. Full lifecycle - build, debug, test, optimize, refactor. Follows TypeScript-first, Lucid ORM, and AdonisJS conventions.
npx skill4agent add filipebraida/skills adonisjs// 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 });
}
}// 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),
}),
);// 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;
}// 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();
}
}workflows/# 1. Type check
pnpm typecheck
# 2. Run tests
node ace test tests/functional/changed.spec.ts
# 3. Lint
pnpm lintreferences/workflows/| File | Purpose |
|---|---|
| build-feature.md | Create new feature/endpoint from scratch |
| debug.md | Find and fix bugs |
| write-tests.md | Write and run tests |
| optimize-performance.md | Profile and speed up |
| refactor.md | Restructure code following patterns |
| </workflows_index> |