createos-fs
npx skills add https://github.com/sid-nodeops/skills --skill createos-fs
Agent 安装分布
Skill 文档
Backend API Generator â Node.js (Contract-Driven, Swagger-First)
This skill generates runnable backend APIs using Node.js (Express) with Swagger / OpenAPI documentation.
Behavior and complexity are strictly controlled by the user prompt. The skill does not assume databases, infrastructure, or complexity â those are introduced only when explicitly requested.
Table of Contents
- When to Use
- Clarification Questions
- Storage Rules
- Architecture Rules
- API & Swagger Rules
- Placeholder Rules
- Output Requirements
- Governing Contracts
When to Use
Use this skill when the user:
- Wants a backend API
- Needs Swagger / OpenAPI documentation
- Wants a clean, safe backend scaffold
- Is prototyping or building real systems
Triggering phrases include: “Build a backend API”, “Generate Express endpoints”, “Backend with Swagger”, “Node.js API”, “create REST endpoints”, “backend service”.
Clarification Questions
Ask questions only when required to proceed:
- Storage type? â in-memory (default) or PostgreSQL
- Entities / resources? â what data models are needed
- Required operations per entity? â create, list, get, update, delete
- Placeholder allowance? â for complex logic that can’t be fully implemented
If the prompt is sufficient, do not ask questions.
Storage Rules
In-Memory Mode (Default)
Use in-memory storage when the prompt does not mention a database or the user is prototyping:
- Use Maps or arrays
- Treat storage as ephemeral
- No persistence assumptions
PostgreSQL Mode
Use PostgreSQL only when explicitly requested:
- Use
DATABASE_URLfrom environment variables - Use migrations for all schema changes
- Follow database and migration contracts strictly
Architecture Rules
Even in simple or single-file setups, these boundaries must be respected conceptually:
- Routes / Controllers â thin, no business logic
- Services â contain all business logic
- Repositories â handle all persistence
- No layer skipping allowed
API & Swagger Rules
- Swagger is mandatory for all endpoints â accessible via
/docs - Every route must be documented
- Request and response schemas must be explicit
- Error responses must be documented for all failure cases
Placeholder Rules
When the prompt allows placeholders:
- Define stable interfaces that won’t change
- Return deterministic, realistic data
- Document all placeholders clearly in Swagger and README
Output Requirements
The generated backend must:
- Run via
node index.jsor equivalent - Expose Swagger UI at
/docs - Include
.env.exampleif any configuration is used - Include database migrations when PostgreSQL is used
- Include a README with setup instructions, env vars, and endpoint summary
Governing Contracts
This skill enforces the following principles (contracts override this file if conflicts arise):
- Architecture â clean separation of routes, services, repositories
- Database â safe query patterns, no raw string interpolation, parameterized queries
- Configuration â all secrets via environment variables, never hardcoded
- Migrations â versioned, reproducible, never destructive by default
- Code Quality â clarity over cleverness, no premature optimization
- Placeholders â stable interfaces, documented, deterministic
- Swagger â complete, accurate, every endpoint covered
- README â setup steps, env vars, how to run, how to test
Notes
- Do not add features not explicitly requested
- Do not introduce infrastructure implicitly
- Do not optimize prematurely
- Prefer clarity over cleverness
- This skill exists to build backends that can grow safely without forcing complexity