AI and vibe coding
AI assistants write CRUD screens quickly, but they write all of it: DTOs, validators, controllers, queries, permission checks, tenant filters, every time, slightly differently. That’s a lot of tokens, and a lot of places to get something wrong.
With Attritect, the assistant writes one small class per screen, and the engine does the rest.
| AI writes plain .NET | AI writes Attritect | |
|---|---|---|
| Code generated per screen | ≈ 650–950 lines in 6–8 files | ≈ 30–40 lines in one class |
| Tokens | All of it, every screen | Roughly 15–20× fewer (early measurements; a published benchmark is coming) |
| Tenant filter and permission checks | Written by the AI on every screen, and easy to forget | In the engine, tested once, can’t be forgotten |
| Mistakes | Found at runtime, or in review | Many caught at build time (compile-time checks CRUD001–CRUD017) |
| Every screen behaves the same | Depends on the prompt | Yes: same paging, errors and permissions |
The line counts come from Why Attritect.
The AI kit
Free rules and skills that teach your assistant how Attritect works, what the engine already guarantees and where its guarantees end, so it writes the small class, not the 900 lines.
Download the AI kit (zip) See it on GitHub
Works with Claude Code, Cursor, GitHub Copilot, Windsurf, Codex and Gemini.
Starting a new project? You don’t need the download: every template already includes the kit.
dotnet new install Attritect.Templates
dotnet new attritect-cleanarch -n MyApp
Add it to an existing project
Run this in your repository’s root folder. It doesn’t overwrite files you already have.
PowerShell (Windows):
Invoke-WebRequest https://attritect.io/downloads/attritect-ai-kit.zip -OutFile ai-kit.zip; Expand-Archive ai-kit.zip -DestinationPath .; Remove-Item ai-kit.zip
macOS / Linux:
curl -fsSL https://attritect.io/downloads/attritect-ai-kit.zip -o ai-kit.zip && unzip -n ai-kit.zip && rm ai-kit.zip
Then:
- Open
AGENTS.mdand fill in the This project table: your folders, tenant column, translation files and build command. - If you already had an
AGENTS.md,CLAUDE.mdor.github/copilot-instructions.md, merge the Attritect parts into it (PowerShell stops at the first file that already exists;unzip -nskips existing files). - Commit. Every developer’s assistant now follows the same rules.
What’s inside
| File | Used by |
|---|---|
AGENTS.md | The rules: how Attritect works, do’s and don’ts, where the engine’s guarantees end, fixes for CRUDxxx build errors. Read by most AI tools. |
CLAUDE.md | Claude Code (imports AGENTS.md) |
.github/copilot-instructions.md | GitHub Copilot |
.github/prompts/add-crud-feature.prompt.md | Copilot prompt /add-crud-feature |
.cursor/rules/attritect.mdc | Cursor |
.windsurf/rules/attritect.md | Windsurf |
.claude/skills/attritect-*/SKILL.md | The skills below. Claude Code loads them as skills; other tools read them as instructions. |
The skills
| Skill | What it does |
|---|---|
| attritect-add-feature | The full workflow: entity, EF configuration, migration, page model, rules, translations and tests, finished with a build and a test run |
| attritect-crud-page | Write or change a page: columns, search, form fields, validation, sorting, enums, fixed filters |
| attritect-relations | Lookups (drop-downs), master-detail pages, row actions, computed columns |
| attritect-rules | Business logic: page events, handlers for many pages, behaviors, several saves in one transaction |
| attritect-security | Permissions, roles, the host role, multi-tenancy, restricted fields, row rules |
| attritect-localization | Translations, Arabic/English, right to left, Hijri dates |
Prompts that work
Describe the screen in business words; the skills turn it into a page model, rules and tests.
Add a Products page: name (required, unique, max 100), price (0–100,000), category as a lookup to Categories, active flag. Searchable by name and category, sortable by name and price. Arabic and English labels.
Add a Visits page under Patients (master-detail): visit date, doctor as a lookup, notes. Only users with the Doctor role can edit. Each clinic sees only its own visits.
Before saving an Invoice, refuse it if the total is negative, and send an email after it’s saved.
Before you ship
AI-written code still needs a human review and a test run. The engine guards its own operations: the HTTP API and ICrudService. Custom EF queries, raw SQL and background jobs are your code; see Security by design for exactly where the guarantees end. The kit tells the assistant the same thing, but check it anyway.
Want the story behind the token savings? Read Our story.