api-gen
/api-gen - API Generation Command
Section titled “/api-gen - API Generation Command”Purpose
Section titled “Purpose”Generate API endpoints, documentation, or client code from specifications.
/api-gen [resource name or OpenAPI spec path]Generate API for: $ARGUMENTS
Workflow
Section titled “Workflow”Step 1: Define Resource
Section titled “Step 1: Define Resource”- Identify resource properties
- Define relationships
- Determine operations
Step 2: Generate
Section titled “Step 2: Generate”- Create model/schema
- Create routes/endpoints
- Add validation
- Generate tests
Step 3: Document
Section titled “Step 3: Document”- Create OpenAPI spec
- Add examples
- Document errors
Output
Section titled “Output”## API Generated
### Endpoints| Method | Path | Description ||--------|------|-------------|| GET | /resources | List all || POST | /resources | Create || GET | /resources/:id | Get one |
### Files Created- `src/models/resource.ts`- `src/routes/resource.ts`- `tests/resource.test.ts`- `docs/api/resource.md`Gap Analysis Rule
Section titled “Gap Analysis Rule”Always identify gaps and suggest next steps to users. In case there is no gaps anymore, then AI should clearly state that there is no gap left.