Skip to content

feat(skills): add Inertia skill + resourceful controller in FastAPI skill#127

Merged
bedus-creation merged 2 commits into
mainfrom
feat/skills-inertia-fastapi-resourceful
Jun 15, 2026
Merged

feat(skills): add Inertia skill + resourceful controller in FastAPI skill#127
bedus-creation merged 2 commits into
mainfrom
feat/skills-inertia-fastapi-resourceful

Conversation

@bedus-creation

Copy link
Copy Markdown
Contributor

Summary

Implements TASK #108 — two changes to the AI skills module under fastapi_startkit/src/fastapi_startkit/skills/:

  1. Update FastAPI skill (stubs/.ai/fastapi-startkit/fastapi/SKILL.md): now teaches a full resourceful controller with the seven standard CRUD methods (index, create, store, show, edit, update, destroy) consistent with router.resource(), including a verb/URI mapping table and only=/excepts= usage.
  2. Add Inertia skill (new stubs/.ai/fastapi-startkit/inertia/SKILL.md + "inertia" key in SkillRegistry.skills): Inertia.js + FastAPI guidance with concrete examples — Inertia.render(...) with resource serialization, a resourceful Inertia controller (GET renders, writes 303-redirect), and Inertia.share().

How it fits the export mechanism

Skills are declared by adding the provider's provider_key to SkillRegistry.skills plus a shipped stub at skills/stubs/.ai/fastapi-startkit/<key>/SKILL.md. InertiaProvider already uses provider_key="inertia", so no provider change was needed. On artisan ai:skills --sync, stubs publish into the project's .ai/ (editable source of truth) and adapters render to .claude/skills/<name>/SKILL.md and GEMINI.md.

Verification

  • Both stubs parse via SkillParser; discover() picks up inertia.
  • End-to-end publish(target="all") in a temp project exports to .ai/, .claude/skills/, and GEMINI.md — confirmed fastapi-startkit-inertia rendered.
  • Full suite: 1493 passed, 7 skipped (--ignore=tests/masoniteorm/postgres; Postgres failures are environmental — no live DB).
  • All examples checked against real APIs: Inertia.render/InertiaResponse (inertia/inertia.py), Model.find_or_fail/all/create/update/delete, JsonResource(...).serialize()/.collection().

🤖 Generated with Claude Code

bedus-creation and others added 2 commits June 15, 2026 13:01
…kill

Update the FastAPI skill stub to teach a full resourceful controller with the
seven standard CRUD methods (index, create, store, show, edit, update,
destroy) consistent with router.resource().

Add a new Inertia (Inertia.js + FastAPI) skill stub and register the
"inertia" provider key in SkillRegistry.skills, mirroring the existing
fastapi/database skills. Includes concrete render/props/resource examples,
a resourceful Inertia controller, and shared data.

Verified end-to-end: both stubs parse, discover() picks up inertia, and
publish() exports to .ai/, .claude/skills/, and GEMINI.md. Full suite:
1493 passed, 7 skipped (Postgres-only tests excluded — no live DB).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extend the Inertia skill with the client side and server-side validation:
- Pages & components: how createInertiaApp resolves Pages/<name> and props flow
- Persistent layouts via `Component.layout = page => <Layout>{page}</Layout>`
- Inertia form helper `useForm` (data/setData/verb methods/processing/errors),
  including a search-as-you-type example
- Inertia HTTP helper `router` (get/post/delete/reload, visit options)
- Request validation with `RequestModel` (Pydantic): EmailStr, constrained
  str, int, and optional/mixed fields via Field(...)

Note: the requested `useHttp` is not a real @inertiajs/react export — the
form helper is `useForm` (its data/setData/get/processing API matches the
shared snippet) and the programmatic HTTP helper is `router`. Documented
both real APIs. EmailStr/Field constraints and RequestModel verified at
runtime; stub re-parsed and re-rendered to .claude/ successfully.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bedus-creation bedus-creation merged commit 465ec95 into main Jun 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant