ワンクリックで
add-repository
Add a new repository protocol and implementation with gateway registration. Use after creating a new entity.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Add a new repository protocol and implementation with gateway registration. Use after creating a new 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-repository |
| description | Add a new repository protocol and implementation with gateway registration. Use after creating a new entity. |
| argument-hint | <entity-name> |
Create a repository Protocol (port) and its PostgreSQL implementation (adapter), then wire into the gateway.
$0 -- Entity name in PascalCase (e.g., Invoice)Protocol interfaces:
!find backend/domain/repos -name "*.py" -not -name "__init__.py" -not -name "__pycache__" -not -name "base.py" -not -name "gateway.py" -not -name "database.py" 2>/dev/null | sort
Implementations:
!find backend/infra/database/psql/repos -name "*.py" -not -name "__init__.py" -not -name "__pycache__" -not -name "base.py" -not -name "gateway.py" -not -name "database.py" 2>/dev/null | sort
File: backend/domain/repos/{name}.py
from abc import abstractmethod
from typing import Protocol
from backend.domain.entities.{name} import {Name}
from backend.domain.repos.base import CRUDSupported
from backend.internal import Option
class {Name}Repo(CRUDSupported[{Name}], Protocol):
@abstractmethod
async def get_by_slug(self, slug: str) -> Option[{Name}]: ...
File: backend/domain/repos/gateway.py
from .{name} import {Name}Repo
class RepoGateway(Protocol):
# ... existing properties ...
@property
@abstractmethod
def {name}(self) -> {Name}Repo: ...
File: backend/infra/database/psql/repos/{name}.py
from typing import final
from sqlalchemy import select
from backend.domain.entities.{name} import {Name}
from backend.domain.repos.{name} import {Name}Repo
from backend.infra.database.psql.repos.base import ImplCRUDSupported
from backend.internal import Option
@final
class Impl{Name}Repo(ImplCRUDSupported[{Name}], {Name}Repo):
__slots__ = ()
async def get_by_slug(self, slug: str) -> Option[{Name}]:
result = await self._session.execute(
select({Name}).where({Name}.slug == slug)
)
return Option(result.scalar_one_or_none())
File: backend/infra/database/psql/repos/gateway.py
from .{name} import Impl{Name}Repo
@final
class ImplRepoGateway(RepoGateway):
# ... existing properties ...
@cached_property
def {name}(self) -> Impl{Name}Repo:
return Impl{Name}Repo(self._session)
Add to backend/domain/repos/__init__.py and backend/infra/database/psql/repos/__init__.py.
Run just check.