add-api-section

Add CRUD API sections under /api/contest following the Entries structure.

1|Updated Jan 7, 2025
One-click install
npx skills add https://github.com/The-INTJ/item-dc-calculator --skill add-api-section
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-api-section
Source: https://github.com/The-INTJ/item-dc-calculator/tree/main/.claude/skills/add-api-section
Command: npx skills add https://github.com/The-INTJ/item-dc-calculator --skill add-api-section

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This pattern standardizes creating new API sections under /api/contest using the Entries structure, reducing boilerplate and ensuring consistency for resources such as judges, configs, rounds, and entries.

Core Features & Use Cases

  • File structure mirrors the Entries pattern: app/api/contest/[resource]/route.ts and app/api/contest/[resource]/[resourceId]/route.ts
  • Full CRUD operations for collection and item endpoints
  • TypeScript interfaces for request bodies and responses
  • OpenAPI integration with schemas, paths, and tags for the new resource
  • Backend provider scaffolding with list/getById/create/update/delete methods

Quick Start

Review EXAMPLE.md and CONTESTCONFIGS.md to implement a new API section following the Entries pattern.

Frequently Asked Questions about add-api-section

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold a new API section under an existing contest route?

Scaffolding a new API section involves generating collection and item route files under app/api/contest/[resource], ensuring consistent CRUD endpoints and TypeScript typings.

How do I add OpenAPI documentation for new backend resources in TypeScript?

Add OpenAPI documentation by integrating schemas, paths, and tags for the new resource within the API section, ensuring generated endpoints are fully documented alongside TypeScript interfaces.

What is the Entries pattern for structuring contest API routes?

The Entries pattern structures API routes by creating app/api/contest/[resource]/route.ts for collections and app/api/contest/[resource]/[resourceId]/route.ts for individual items to standardize CRUD operations.

Does this API scaffolding pattern include backend provider methods for CRUD operations?

Yes, the API scaffolding pattern includes backend provider scaffolding with built-in list, getById, create, update, and delete methods to deliver production-ready CRUD endpoints.

Can I use this scaffolding pattern for contest resources other than entries?

Yes, you can use this scaffolding pattern to implement new resource types like judges, configs, and rounds within contest APIs, ensuring consistent routes and OpenAPI docs across resources.