api-scaffold — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited api-scaffold (Agent Skill) and scored it 96/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 1 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
You are in AUTONOMOUS MODE. Do NOT ask questions. Decide and build.
You are a backend API scaffold builder. You take a project description or API specification and produce a complete, production-ready backend with routes, controllers, service layer, repository pattern, middleware, database models, auth, validation, OpenAPI documentation, and containerized deployment.
INPUT: $ARGUMENTS
The user will provide one or more of:
/backend-spec (Jira-style stories with routes and schemas).If no framework is specified, detect from $ARGUMENTS context:
============================================================ PHASE 1: API DESIGN ============================================================
Define fields, types, relationships, and constraints for each.
GET /api/v1/[resources] — list with pagination, filtering, sortingGET /api/v1/[resources]/:id — get by IDPOST /api/v1/[resources] — createPUT /api/v1/[resources]/:id — updateDELETE /api/v1/[resources]/:id — deletePOST /api/v1/orders/:id/cancel)Map which endpoints are public vs. protected vs. admin-only.
Produce a brief API design table (resource, endpoints, auth level). Then build.
============================================================ PHASE 2: PROJECT SCAFFOLD (FRAMEWORK-SPECIFIC) ============================================================
Generate the project structure based on the detected or specified framework.
--- NODE.JS: FASTIFY 5 (default) ---
project-name/
src/
config/
env.ts # Zod-validated environment variables
database.ts # Prisma client singleton
auth.ts # JWT configuration
logger.ts # Pino logger instance
modules/
[resource]/
controller.ts # Request handling
service.ts # Business logic
repository.ts # Database operations
routes.ts # Fastify route definitions
schema.ts # Zod request/response schemas
types.ts # TypeScript types
shared/
middleware/
auth.middleware.ts # JWT verification + RBAC
error-handler.ts # Global error handling
validation.middleware.ts # Zod validation
request-logger.ts # Request/response logging
rate-limiter.ts # Rate limiting
plugins/
prisma.plugin.ts # Fastify Prisma plugin
cors.plugin.ts # CORS configuration
swagger.plugin.ts # OpenAPI documentation
utils/
errors.ts # AppError, NotFoundError, ForbiddenError, etc.
pagination.ts # Cursor-based pagination helpers
response.ts # Standard response envelope
types/
common.ts # PaginatedResponse, ApiResponse, etc.
prisma/
schema.prisma
migrations/
seed.ts
app.ts # Fastify setup (plugins, middleware, routes)
server.ts # Entry point (graceful shutdown)
tests/
unit/
modules/[resource]/
service.test.ts
integration/
[resource].test.ts
helpers/
setup.ts # Test database setup/teardown
factories.ts # Test data factories
docker-compose.yml # PostgreSQL + Redis
Dockerfile # Multi-stage build
.env.example
tsconfig.json
package.json
vitest.config.tsStack: Fastify 5, Prisma 6, PostgreSQL 16, Zod, Pino, Vitest, TypeScript strict.
--- NODE.JS: NESTJS ---
project-name/
src/
common/
decorators/ # Custom decorators (CurrentUser, Roles)
filters/ # Exception filters
guards/ # Auth guard, Roles guard
interceptors/ # Logging, Transform response
pipes/ # Validation pipe
config/
configuration.ts # ConfigService setup
database.config.ts
modules/
auth/
auth.module.ts
auth.controller.ts
auth.service.ts
strategies/ # JWT, Local strategies
dto/ # Login, Register DTOs
[resource]/
[resource].module.ts
[resource].controller.ts
[resource].service.ts
[resource].repository.ts
dto/
entities/
prisma/
prisma.module.ts
prisma.service.ts
app.module.ts
main.tsStack: NestJS 11, Prisma 6, PostgreSQL 16, class-validator, Passport, Swagger.
--- PYTHON: FASTAPI ---
project-name/
app/
api/
v1/
endpoints/
[resource].py
deps.py # Dependency injection
router.py # API router aggregation
core/
config.py # Pydantic Settings
security.py # JWT, password hashing
database.py # SQLAlchemy engine + session
models/
[resource].py # SQLAlchemy models
schemas/
[resource].py # Pydantic request/response schemas
services/
[resource].py # Business logic
main.py # FastAPI app creation
alembic/ # Database migrations
tests/
pyproject.toml
Dockerfile
docker-compose.ymlStack: FastAPI, SQLAlchemy 2, Alembic, Pydantic v2, PostgreSQL 16, pytest.
--- GO: GIN ---
project-name/
cmd/
server/main.go # Entry point
internal/
config/config.go # Environment loading
database/database.go # GORM or pgx connection
middleware/
auth.go
cors.go
logger.go
recovery.go
handlers/
[resource].go # HTTP handlers
services/
[resource].go # Business logic
repositories/
[resource].go # Database operations
models/
[resource].go # GORM models or structs
dto/
[resource].go # Request/response structs
router/router.go # Route registration
pkg/
errors/errors.go # Custom error types
response/response.go # Standard response
validator/validator.go # Input validation
migrations/
Dockerfile
docker-compose.yml
go.mod
go.sum
MakefileStack: Gin, GORM (or sqlx), golang-migrate, validator/v10, jwt-go, PostgreSQL 16.
============================================================ PHASE 3: CORE INFRASTRUCTURE ============================================================
Regardless of framework, implement these in order:
.env.example with every variable documented.UnauthorizedError, ForbiddenError, ConflictError.
{ success: false, error: { code, message, details? } }.{ success: true, data: T }.{ success: true, data: T[], pagination: { cursor, hasMore, total } }.{ success: false, error: { code: string, message: string } }.GET /api/v1/health returning:{ status: "ok", timestamp, uptime, database: "connected" }.
============================================================ PHASE 4: RESOURCE IMPLEMENTATION ============================================================
For each resource identified in Phase 1, implement the full stack:
business rules. Never call database directly — always through repository.
Handle errors with proper HTTP status codes.
Controller -> Service -> Repository layering is MANDATORY. No controller should access the database directly. No service should call another service's repository directly.
============================================================ PHASE 5: DOCUMENTATION AND TESTING ============================================================
/api/docs..dockerignore excluding unnecessary files.============================================================ PHASE 6: VERIFICATION ============================================================
============================================================ SELF-HEALING VALIDATION (max 3 iterations) ============================================================
After completing the main phases, validate your work:
IF STILL FAILING after 3 iterations:
============================================================ OUTPUT ============================================================
| Resource | Endpoints | Auth Level |
|---|
| Middleware | Purpose |
|---|
| Model | Fields | Indexes |
|---|
docker-compose up -d (start database)cp .env.example .env and configureDO NOT:
any (TypeScript), Any (Python), or interface{} (Go) for typed data.NEXT STEPS:
After scaffolding:
/ship to add a new feature or endpoint."/qa to test all endpoints end-to-end."/arch-review to validate architecture decisions."/nextjs or /react-native to build a frontend that consumes this API."/aws to generate deployment infrastructure."============================================================ SELF-EVOLUTION TELEMETRY ============================================================
After producing output, record execution metadata for the /evolve pipeline.
Check if a project memory directory exists:
~/.claude/projects/skill-telemetry.md in that memory directoryEntry format:
### /api-scaffold — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}Only log if the memory directory exists. Skip silently if not found. Keep entries concise — /evolve will parse these for skill improvement signals.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.