thibautbaissac/rails_ai_agents/crud-patterns
Claude Code and agent skill by thibautbaissac/rails_ai_agents
- community
Checking that the SKILL.md file is still in the repository.
Generates RESTful controllers mapping any action to CRUD by creating new resources instead of custom actions. Use when adding features, creating controllers, designing routes, or handling state changes via REST. WHEN NOT: Non-REST APIs (use api-patterns), view/template work (use turbo-patterns), or model business logic (use model-patterns).
Install
npx vskill@latest install thibautbaissac/rails_ai_agents/crud-patternsSKILL.md
CRUD Patterns (37signals)
Map any action to CRUD. When something doesn't fit standard CRUD, create a new resource.
Project knowledge
Tech Stack: Rails 8.2 (edge), Turbo, Stimulus, Solid Queue, MySQL/SQLite Routing: Use scope module: for namespacing nested resources Controllers: Thin with concerns for shared behavior
Commands:
Resource thinking
When asked to add functionality, ask: "What resource does this represent?"
| User request | Resource to create | |
|---|---|---|
| "Let users close cards" | Cards::ClosuresController (create/destroy) | |
| "Let users mark important" | Cards::GoldnessesController (create/destroy) | |
| "Let users follow a card" | Cards::WatchesController (create/destroy) | |
| "Let users assign cards" | Cards::AssignmentsController (create/destroy) | |
| "Let users publish boards" | Boards::PublicationsController (create/destroy) | |
| "Let users position cards" | Cards::PositionsController (update) | |
| "Let users archive projects" | Projects::ArchivalsController (create/destroy) |
State change controllers (singular resources)
Toggle state via POST (create) and DELETE (destroy) on a singular resource:
Standard CRUD controllers (plural resources)
Nested resource controllers
Routing patterns
Singular resource for toggles
Module scoping for organization
Polymorphic routes with resolve
Scoping concerns
Provide parent resource lookup for nested controllers:
Create new scoping concerns as needed:
Response patterns
Turbo Stream responses (preferred)
Multi-format responses
Authorization pattern
Keep authorization checks thin, delegate logic to models:
Files to create for a new resource
- Controller:
app/controllers/[namespace]/[resource]_controller.rb - Route entry: Add to
config/routes.rb - Test:
test/controllers/[namespace]/[resource]_controller_test.rb - Concern (if needed):
app/controllers/concerns/[resource]_scoped.rb
Boundaries
- Always: Map actions to CRUD, create new resources for state changes, use concerns for scoping, only 7 REST actions, use strong parameters
- Ask first: Before adding custom actions, before creating non-REST routes, before modifying routing constraints
- Never: Add member/collection routes, create controllers without tests, put business logic in controllers
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.claude_37signals/skills/crud-patterns/SKILL.md
Popularity
- Repository stars
- 589
- Repository forks
- 67
- 7-day trend score
- 32
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/thibautbaissac/rails_ai_agents/crud-patterns)