From vthink-agent-toolkit
Generate a complete CRUD endpoint for a new resource. Auto-detects project structure (routes, models, test framework) and adapts to Express, Fastify, Flask, and similar frameworks. Use when asked to generate or scaffold a new API endpoint.
npx claudepluginhub vthinkdeveloper/vthink-agent-toolkit --plugin vthink-toolkitThis skill uses the workspace's default tool permissions.
Generate a complete CRUD endpoint for a new resource, adapting to the project's existing structure and conventions.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Generate a complete CRUD endpoint for a new resource, adapting to the project's existing structure and conventions.
Before generating anything, explore the project to understand how it's organized:
Search for common patterns:
Glob: src/routes/*.js, app/routes/*.py, routes/*.js, controllers/*.js
Grep: "router.get\|app.get\|@app.route\|@router.get"
Glob: src/db.js, src/models/*.js, db/*.js, models/*.py, prisma/schema.prisma
Grep: "CREATE TABLE\|sequelize.define\|mongoose.model\|db.prepare"
Glob: tests/*.test.js, __tests__/*.js, test_*.py, spec/**/*.js
Read package.json or requirements.txt to identify the framework and test runner.
Ask the user:
src/app.js, src/routes/)"src/db.js, src/models/)"Ask the user:
products, orders)id and created_at?Example prompt:
"I'll generate a CRUD endpoint for
products. What fields does a product have? For example:name (text),price (decimal),in_stock (boolean). I'll includeidandcreated_atautomatically."
Read 1-2 existing route handlers and db functions to understand the conventions:
{ data: [...] } or flat arrays?getAllProducts vs fetchProducts vs list_products?Follow the patterns you find. Do not introduce new patterns.
Generate the following, adapted to the detected framework and conventions:
Add CRUD functions for the new resource:
getAll<Resource>() — fetch all recordsget<Resource>ById(id) — fetch single recordcreate<Resource>(data) — insert new recordupdate<Resource>(id, data) — update existing recorddelete<Resource>(id) — delete recordIf using SQL, include table creation (IF NOT EXISTS). If using an ORM, define the model/schema.
Add RESTful routes:
GET /api/<resource> — list allGET /api/<resource>/:id — get by IDPOST /api/<resource> — createPUT /api/<resource>/:id — updateDELETE /api/<resource>/:id — deleteInclude appropriate status codes and error handling matching the project's existing pattern.
Add tests for all CRUD operations following the project's existing test style:
Edit the relevant files directly. Do not create separate files unless the project uses one-file-per-resource patterns.
After applying changes, summarize what was added:
curl examples or test command)