원클릭으로
add-handler
Add a new command and handler for a use case. Use when adding business logic for an existing entity.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Add a new command and handler for a use case. Use when adding business logic for an existing entity.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Add a complete REST endpoint from command to controller route. Use when building new API endpoints.
Summarize the API interface changes made during THIS session for the frontend, then optionally spawn an agent to implement them in the frontend repo. Use after changing endpoints, request/response DTOs, or auth.
One-shot guided session — prunes unused code, scaffolds new entities/endpoints, updates project identity config, and replaces the init migration for a specific project.
Compress natural language memory files (CLAUDE.md, todos, preferences) into caveman format to save input tokens. Preserves all technical substance, code, URLs, and structure. Compressed version overwrites the original file. Human-readable backup saved as FILE.original.md. Trigger: /caveman-compress FILEPATH or "compress memory file"
Implement a change with a pipeline scaled to its complexity. Single entry point for all code changes — auto-detects effort or accepts small|mid|tuff override.
Run a Linear task end-to-end — creates an isolated tmux session + worktree, starts a Claude agent to implement it, opens a PR, and watches for review feedback automatically.
| name | add-handler |
| description | Add a new command and handler for a use case. Use when adding business logic for an existing entity. |
| argument-hint | <domain> <action> |
Create a Command + Handler pair for a use case.
$0 -- Domain name (e.g., users, auth, invoices)$1 -- Action name (e.g., create, archive, send, verify)!find backend/app/rest/v1/handlers -name "*.py" -not -name "__init__.py" -not -name "__pycache__" -not -path "*/base/*" 2>/dev/null | sort
File: backend/app/rest/v1/handlers/{domain}/{action}.py
from dataclasses import dataclass
from uuid import UUID
from backend.app.errors import NotFoundError
from backend.app.rest.v1 import dtos
from backend.app.rest.v1.handlers.base import Command, Handler, HandlerType
from backend.app.shared.db.database import Database
class {Action}{Entity}Command(Command):
{entity}_id: UUID
@dataclass
class {Action}{Entity}Handler(
Handler[{Action}{Entity}Command, dtos.{Entity}, None],
type_=HandlerType.WRITE,
):
db: Database
async def __call__(
self, cmd: {Action}{Entity}Command, _ctx: None = None
) -> dtos.{Entity}:
async with self.db:
entity = (await self.db.gateway.{entity}.get_by_id(cmd.{entity}_id)).some(
NotFoundError(message="{Entity} not found")
)
# ... business logic ...
entity = (await self.db.gateway.{entity}.update(entity)).some(
NotFoundError(message="{Entity} not found")
)
await self.db.commit()
return dtos.{Entity}.from_object(entity)
@dataclass
class SendInvoiceHandler(
Handler[SendInvoiceCommand, None, None],
type_=HandlerType.WRITE,
):
db: Database
dbus: DBus
email_sender: EmailSender # Port, not implementation
async def __call__(self, cmd: SendInvoiceCommand, _ctx: None = None) -> None:
async with self.db:
invoice = (await self.db.gateway.invoice.get_by_id(cmd.invoice_id)).some(
NotFoundError(message="Invoice not found")
)
# business logic
await self.dbus.publish(InvoiceSent(invoice_id=invoice.id))
await self.db.commit()
File: backend/app/rest/v1/handlers/{domain}/__init__.py
Add command and handler to imports and __all__.
If this is a new domain, create:
backend/app/rest/v1/handlers/{domain}/__init__.pybackend/app/rest/v1/handlers/__init__.pyRun just check. Handlers auto-register via __init_subclass__ and are auto-wired by create_handlers_provider() in ioc.py.