From idev
Scans the codebase to auto-detect backend code conventions (controllers, services, entities, DTOs, DI registration) and caches them. Use when creating or modifying backend code so new files follow existing patterns exactly.
How this skill is triggered — by the user, by Claude, or both
Slash command
/idev:backend-patternsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Auto-detect backend code conventions by scanning the codebase. Works on ANY backend stack — .NET, Node.js, Python, Java, Go, Ruby, PHP, Rust, etc.
Auto-detect backend code conventions by scanning the codebase. Works on ANY backend stack — .NET, Node.js, Python, Java, Go, Ruby, PHP, Rust, etc.
When creating or modifying backend code and no cached patterns exist yet.
This skill does NOT hardcode patterns or assume any technology. Instead, it:
Results are cached in .claude/idev/backend-patterns/cache.md after first scan.
Run these checks to identify the backend technology. Check ALL — do not assume:
Marker File Detection:
*.sln / *.csproj → .NET (C#)
go.mod → Go
Cargo.toml → Rust
pom.xml → Java (Maven)
build.gradle (no /app dir) → Java/Kotlin (Gradle)
requirements.txt / pyproject.toml / setup.py → Python
Gemfile → Ruby
composer.json → PHP
package.json (with express/fastify/nest/koa/hapi) → Node.js
Framework Detection (read marker file contents):
.NET: grep *.csproj for "Microsoft.AspNetCore" → ASP.NET Core
Python: grep for "django|flask|fastapi|starlette" in requirements/pyproject
Java: grep pom.xml for "spring-boot|quarkus|micronaut"
Ruby: grep Gemfile for "rails|sinatra|grape"
PHP: grep composer.json for "laravel|symfony|slim"
Node.js: grep package.json for "express|fastify|nestjs|koa|hapi"
Go: grep go.mod for "gin|echo|fiber|chi|mux"
ORM/Database Detection:
.NET: grep for "DbContext|EntityFramework" → EF Core
Python: grep for "django.db|sqlalchemy|tortoise" → ORM
Java: grep for "JpaRepository|@Entity" → JPA/Hibernate
Node.js: grep for "prisma|typeorm|sequelize|mongoose|knex" → ORM
Ruby: grep for "ActiveRecord" → Rails ORM
Go: grep for "gorm|sqlx|ent" → ORM
Based on detected stack, scan for key directories. The scan adapts to the technology:
1. Find route/controller files → API layer location
2. Find service/business logic files → Service layer location
3. Find model/entity files → Data layer location
4. Find DTO/schema/serializer files → Data transfer layer
5. Find dependency injection/module registration → DI setup
6. Find database config/context → DB layer
7. Find middleware files → Middleware layer
8. Find test files → Test location and framework
.NET:
Controllers: **/*Controller.cs
Services: **/*Service.cs (exclude I*Service.cs)
Interfaces: **/I*Service.cs
Entities: **/Entities/**/*.cs
DTOs: **/*Dto.cs
DI: file containing "AddTransient|AddScoped"
DB: file containing "DbSet<"
Node.js/Express:
Routes: **/routes/*.ts or **/*.routes.ts
Controllers: **/controllers/*.ts or **/*.controller.ts
Services: **/services/*.ts or **/*.service.ts
Models: **/models/*.ts or **/*.model.ts
Middleware: **/middleware/*.ts
DB: file containing "prisma|mongoose.model|sequelize"
Python/Django:
Views: **/views.py or **/views/*.py
Models: **/models.py or **/models/*.py
Serializers: **/serializers.py
URLs: **/urls.py
Admin: **/admin.py
Python/FastAPI:
Routers: **/routers/*.py or **/*_router.py
Services: **/services/*.py
Models: **/models/*.py or **/schemas/*.py
DB: file containing "SessionLocal|create_engine"
Java/Spring:
Controllers: **/*Controller.java
Services: **/*Service.java or **/*ServiceImpl.java
Repositories: **/*Repository.java
Entities: **/entity/*.java or **/model/*.java
DTOs: **/dto/*.java
Go:
Handlers: **/handlers/*.go or **/*handler.go
Services: **/services/*.go
Models: **/models/*.go
Routes: file containing "HandleFunc|router.GET"
Ruby/Rails:
Controllers: app/controllers/**/*_controller.rb
Models: app/models/**/*.rb
Serializers: app/serializers/**/*.rb
Routes: config/routes.rb
For each discovered layer, read ONE representative file and extract the exact pattern:
Pick one route handler (not base/abstract)
Extract: namespace/module, routing decorator/attribute, base class/mixin,
constructor/DI params, response wrapper, auth middleware
Detect: how request params are parsed, how responses are formatted,
how errors are returned, how auth context is accessed
Pick one service implementation
Extract: constructor/init DI params, error handling pattern, repository/DB usage
Detect: transaction handling, logging pattern, exception types,
how service methods are structured (async/sync, return types)
Pick one data model
Extract: base class, primary key pattern, common fields (timestamps, soft delete, etc.)
Detect: audit fields, multi-tenancy fields, relationship patterns,
naming conventions (PascalCase, camelCase, snake_case)
Find data transfer objects (DTOs, schemas, serializers, validators)
Extract: naming convention, validation approach, field types
Detect: mapping methods (manual, AutoMapper, extension methods, serializer classes)
separate Create/Update/Response types or unified
Find where services are registered/configured
Extract: registration method (DI container, module imports, middleware chain)
Detect: grouping convention, insertion point for new registrations
Note: exact file path and line number
Find database setup (DbContext, Prisma schema, models.py, etc.)
Extract: how models are registered, connection config
Detect: migration approach, seeding pattern
Note: exact file path and insertion point for new models
After scanning, write all discovered patterns to:
.claude/idev/backend-patterns/cache.md
Format:
# Backend Patterns Cache
## Generated: [date]
## Project: [detected project name]
## Stack: [framework] + [language] + [ORM] + [other key libs]
### Paths
[All discovered paths with descriptions]
### Route/Controller Template
[extracted pattern with {{PLACEHOLDERS}}]
### Service Template
[extracted pattern with {{PLACEHOLDERS}}]
### Model/Entity Template
[extracted pattern with {{PLACEHOLDERS}}]
### DTO/Schema Templates
[extracted patterns - create, update, response]
### Registration Points
DI/Module File: [path] → Insert at line [N]
DB Config: [path] → Insert after line [N]
### Conventions
- Language: [detected]
- Naming: [PascalCase/camelCase/snake_case]
- Soft delete: [pattern or "not used"]
- Multi-tenancy: [pattern or "not used"]
- Audit fields: [list or "not used"]
- Error handling: [pattern]
- Response wrapper: [pattern]
- Auth context: [how user identity is accessed]
- Testing: [framework and pattern]
### Function Index
[Compact list of exported/public functions, one per line:]
functionName — file:line — one-line purpose
[Cap at ~100 entries, most-used first. Used by function-extract for targeted
reads and by cache-refresh for incremental updates. Update entries whenever
adding or modifying functions.]
On subsequent tasks, load only the cache file instead of rescanning. Keep the cache under ~250 lines by trimming examples if it grows beyond that. Rescan if user says "refresh patterns" or if cache is older than 7 days.
When creating a new backend feature, the scanner detects what files are needed:
.claude/idev/rules.md or the project config)Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub theophiluschinomona/idev --plugin idev