Agent skill

express-api-design

Express.js REST API design and implementation guide. Use when implementing REST API endpoints, creating Express routes, or setting up API project structure with MVC pattern.

Stars 88
Forks 14

Install this agent skill to your Project

npx add-skill https://github.com/revfactory/claude-code-harness/tree/main/experiments/results/case-001/harness/.claude/skills/express-api-design

SKILL.md

Express API Design

프로젝트 구조

src/
  app.js              - Express 앱 설정, 미들웨어 등록, 라우트 마운트
  routes/
    {resource}Routes.js  - 라우트 정의 (HTTP 메서드 + 경로)
  controllers/
    {resource}Controller.js - 비즈니스 로직
  models/
    {resource}Store.js   - 데이터 모델 및 CRUD 연산
  middleware/
    validate.js         - 입력 유효성 검사 미들웨어
    errorHandler.js     - 글로벌 에러 핸들링

REST 규칙

  • GET /resources - 목록 조회 -> 200
  • GET /resources/:id - 단건 조회 -> 200 / 404
  • POST /resources - 생성 -> 201 / 400
  • PUT /resources/:id - 수정 -> 200 / 400 / 404
  • DELETE /resources/:id - 삭제 -> 200 / 404

핵심 원칙

  1. 모든 라우트는 controllers를 통해 처리
  2. 에러는 글로벌 에러 핸들러로 전파 (컨트롤러에서 throw)
  3. 입력 유효성 검사는 미들웨어에서 처리하여 재사용
  4. 일관된 에러 응답 형식: { error: "메시지" }
  5. JSON 파싱 에러 별도 처리
  6. 데이터 모델은 클래스 기반 싱글턴 스토어로 구현
  7. 반환 시 스프레드 복사본 사용하여 불변성 보장
  8. 자동 ID 생성 (auto-increment) 및 createdAt 자동 설정

상세 코드 패턴은 references/patterns.md 참조.

Expand your agent's capabilities with these related and highly-rated skills.

revfactory/claude-code-harness

interpreter-design

Programming language interpreter design and implementation guide. Use when the user requests building an interpreter, parser, lexer, or language implementation — including Pratt parsing, AST evaluation, scope chains, and closures.

88 14
Explore
revfactory/claude-code-harness

query-engine-design

SQL query engine design and implementation guide. Use when the user requests building a SQL engine, query parser, query planner, or query executor — including in-memory storage, SQL parsing, and query optimization.

88 14
Explore
revfactory/claude-code-harness

api-documentation

Write accurate and complete library API documentation. Use when creating API docs, README files, or function reference documentation. Ensures all signatures, parameters, return types, and examples are precise.

88 14
Explore
revfactory/claude-code-harness

async-debugging

Analyze and fix race conditions and concurrency bugs in async code. Use when debugging async bugs, fixing race conditions, resolving concurrency issues, or when shared state is accessed by multiple async operations.

88 14
Explore
revfactory/claude-code-harness

reactive-spreadsheet-design

리액티브 스프레드시트 엔진 설계 가이드. 셀 수식 파싱, 의존성 그래프(DAG), 증분 재계산, 내장 함수 구현 시 사용한다.

88 14
Explore
revfactory/claude-code-harness

lsp-design

Language Server Protocol 서버 구현 가이드. LSP 서버, 증분 파싱, 자동완성, 진단, Go-to-Definition, 호버를 구현할 때 사용한다.

88 14
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results