# Nuxt Models

> Domain model classes with automatic hydration, relations, and type casting. Use when creating models for API entities, defining relationships between models, casting properties to enums/dates, or creating value objects.

- **Type:** Skill
- **Install:** `agentstack add skill-leeovery-agentic-skills-nuxt-models`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [leeovery](https://agentstack.voostack.com/s/leeovery)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [leeovery](https://github.com/leeovery)
- **Source:** https://github.com/leeovery/agentic-skills/tree/main/nuxt/skills/nuxt-models

## Install

```sh
agentstack add skill-leeovery-agentic-skills-nuxt-models
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Nuxt Models

Type-safe domain models with automatic hydration, relations, and property casting.

## Core Concepts

**[models.md](references/models.md)** - Complete model patterns, lifecycle, relations, casts
**[values.md](references/values.md)** - Value objects for typed wrappers (DateValue, etc.)

## Basic Model

```typescript
// app/models/Post.ts
import Model from '#layers/base/app/models/Model'
import type { Castable } from '#layers/base/app/types'
import PostStatus from '~/enums/PostStatus'
import DateValue from '~/values/DateValue'
import Author from '~/models/Author'

export default class Post extends Model {
  ulid: string
  title: string
  content: string
  status: PostStatus
  isDraft: boolean
  author: Author
  createdAt: DateValue

  public override primaryKey(): string {
    return 'ulid'
  }

  public override casts(): Record {
    return {
      status: PostStatus,
      createdAt: DateValue,
    }
  }

  public override relations(): Record {
    return {
      author: Author,
    }
  }

  public isPublished(): boolean {
    return !this.isDraft
  }
}
```

## Model Lifecycle

```
API Response → booting() → transform() → Property Assignment
     → Relations Hydrated → Casts Applied → booted() → Ready
```

## Usage

```typescript
// Hydrate from API response
const post = Post.hydrate(apiResponse.data)

// Hydrate collection
const posts = Post.collect(apiResponse.data)

// Access typed properties
post.status.color()           // Enum method
post.createdAt.format()       // Value object method
post.author.name              // Relation property

// Compare models
post.is(otherPost)            // Same primary key?
```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [leeovery](https://github.com/leeovery)
- **Source:** [leeovery/agentic-skills](https://github.com/leeovery/agentic-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-leeovery-agentic-skills-nuxt-models
- Seller: https://agentstack.voostack.com/s/leeovery
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
