dev-api — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited dev-api (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
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.
Create well-structured, documented and testable APIs.
Before coding, define:
GET /resources → List (with pagination)
GET /resources/:id → Detail
POST /resources → Create
PUT /resources/:id → Full update
PATCH /resources/:id → Partial update
DELETE /resources/:id → Delete// Success
{
"success": true,
"data": { ... },
"meta": {
"page": 1,
"limit": 20,
"total": 100
}
}
// Error
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Email is required",
"details": [
{ "field": "email", "message": "Required" }
]
}
}// With Zod
const createUserSchema = z.object({
email: z.string().email(),
name: z.string().min(2).max(100),
role: z.enum(['user', 'admin']).default('user')
});
// In the handler
const data = createUserSchema.parse(req.body);paths:
/users:
post:
summary: Create a user
tags: [Users]
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateUser'
responses:
'201':
description: User created
content:
application/json:
schema:
$ref: '#/components/schemas/User'
'400':
$ref: '#/components/responses/ValidationError'describe('POST /api/users', () => {
it('should create user with valid data', async () => {
const response = await request(app)
.post('/api/users')
.send({ email: '[email protected]', name: 'Test' })
.expect(201);
expect(response.body.success).toBe(true);
expect(response.body.data.email).toBe('[email protected]');
});
it('should return 400 for invalid email', async () => {
const response = await request(app)
.post('/api/users')
.send({ email: 'invalid', name: 'Test' })
.expect(400);
expect(response.body.error.code).toBe('VALIDATION_ERROR');
});
});For a full-stack TypeScript monorepo, tRPC gives end-to-end type safety with no codegen.
// Server: initTRPC + Zod-validated procedures
const t = initTRPC.context<Context>().create({ transformer: superjson });
const protectedProcedure = t.procedure.use(({ ctx, next }) => {
if (!ctx.session) throw new TRPCError({ code: 'UNAUTHORIZED' });
return next({ ctx: { ...ctx, user: ctx.session.user } });
});
export const userRouter = t.router({
list: t.procedure.input(z.object({ cursor: z.string().nullish() }))
.query(({ input, ctx }) => ctx.userService.paginate(input)), // cursor-based pagination
create: protectedProcedure.input(createUserSchema)
.mutation(({ input, ctx }) => ctx.userService.create(input)),
});protectedProcedure for authenticated operations.httpBatchLink + transformer + provider; hooks useQuery, useMutation, useInfiniteQuery.Let the API evolve while keeping existing clients working. URL Path versioning (/v1/, /v2/) is recommended for most cases.
Deprecation, Sunset and Link (successor-version) headers.## API: [Endpoint name]
### Endpoint
`POST /api/v1/resources`
### Request{ "field1": "string", "field2": 123 }
### Response (201){ "success": true, "data": { ... } }
### Errors
| Code | Status | Description |
|------|--------|-------------|
| VALIDATION_ERROR | 400 | Invalid data |
| NOT_FOUND | 404 | Resource not found |
| UNAUTHORIZED | 401 | Not authenticated |~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.