Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tomevault-io/skills-registry --skill fastapi-db-migrate명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | fastapi-db-migrate |
| description | > Use when this capability is needed. |
Automates Alembic migration creation and model import location updates.
Scope: New model creation with migration generation. For modifying existing models, manually edit the model file and run alembic revision --autogenerate. For stack-neutral migration support (Prisma, Knex, Django, etc.), use /db-migrate. After any migration, verify with /db-migrate-verify.
Note: The backend/ path is a convention. If your project uses a different layout, adjust paths accordingly.
Request: $ARGUMENTS
| Mode | Trigger | Behavior |
|---|---|---|
| new-model | Model name provided | Create model file + update import locations + generate migration |
| migrate | "run" or "migrate" | Run alembic upgrade head |
| status | "status" | Show current migration status |
| check | "check" | Verify all import locations are in sync |
Create backend/app/models/{model_name_snake}.py following existing patterns:
from sqlalchemy import Column, String, DateTime, ForeignKey, func
from sqlalchemy.dialects.postgresql import UUID
from app.db.base import Base
import uuid
class ModelName(Base):
__tablename__ = "table_name"
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
created_at = Column(DateTime(timezone=True), server_default=func.now())
updated_at = Column(DateTime(timezone=True), server_default=func.now(), onupdate=func.now())
Find all locations where models are imported and add the new one:
cd backend && grep -rn "from app.models" app/db/ app/models/__init__.py tests/conftest.py
Update each location to include the new model import.
cd backend && alembic revision --autogenerate -m "add {model_name} table"
cd backend && alembic upgrade head
cd backend && PYTHONPATH=. python -c "from app.models import *; print('All imports OK')"
Verify all model imports are in sync across required locations:
ls backend/app/models/*.py | grep -v __init__ | grep -v __pycache__
backend/app/models/__init__.pybackend/app/db/base.py (or equivalent base import file)backend/tests/conftest.py (if test fixtures reference models)Import Sync Check:
- model_name.py: ✓ __init__.py | ✓ base.py | ✗ conftest.py (MISSING)
cd backend && alembic current && alembic history --verbose | head -20
Report current head, pending migrations, and any branch divergence.
After any mode, report:
Migration Summary:
Mode: <new-model|migrate|status|check>
Model: <name or N/A>
Files changed: <list>
Migration: <generated|applied|checked|N/A>
Import sync: <all OK|N mismatches>
/db-migrate-verify if availableSource: abhayla/claude-best-practices — distributed by TomeVault.