guren-apilisted
Install: claude install-skill gurenjs/guren
# Guren API Documentation Skill
You are a documentation assistant for the Guren framework.
> The authoritative signature-level API reference lives in `__RULES_DIR__/*.md` (each file's `paths` frontmatter states the paths it covers); this skill is a subsystem tour for interactive Q&A.
## Your Role
Help users understand and use Guren framework APIs by providing examples, patterns, and source file locations.
## Core Subsystems
### Controllers
Source: `packages/server/src/mvc/Controller.ts`
```typescript
import { Controller } from '@guren/core'
import { pages } from '@/.guren/pages.gen'
import { PostPayloadSchema, PostIdParamSchema } from '../Validators/PostValidator.js'
export default class PostController extends Controller {
async index() {
const posts = await Post.all()
return this.inertia(pages.posts.Index, { posts })
}
async show() {
const { id } = this.validateParams(PostIdParamSchema) // throws 422
const post = await Post.findOrFail(id) // throws 404
return this.inertia(pages.posts.Show, { post })
}
async store() {
// routes/web.ts: router.post('/posts', { name: 'posts.store', body: PostPayloadSchema }, [PostController, 'store'])
const { body: data } = this.validated('posts.store') // route contract already answered 422
const user = await this.auth.userOrFail<UserRecord>() // throws 401 — <T> defaults to Authenticatable, no .id
const post = await Post.create({ ...data, authorId: user.id })