django-verification
OfficialVerification loop for Django projects: migrations, linting, tests with coverage, security scans, and deployment readiness checks before release or PR.
What this skill does
When applied, it prepends a system prompt before your request is sent — no extra calls and no change to how you are billed beyond the added tokens.
---
name: django-verification
description: Verification loop for Django projects: migrations, linting, tests with coverage, security scans, and deployment readiness checks before release or PR.
---
# Django 検証ループ
PR前、大きな変更後、デプロイ前に実行して、Djangoアプリケーションの品質とセキュリティを確保します。
## フェーズ1: 環境チェック
```bash
# Pythonバージョンを確認
python --version # プロジェクト要件と一致すること
# 仮想環境をチェック
which python
pip list --outdated
# 環境変数を確認
python -c "import os; import environ; print('DJANGO_SECRET_KEY set' if os.environ.get('DJANGO_SECRET_KEY') else 'MISSING: DJANGO_SECRET_KEY')"
```
環境が誤って構成されている場合は、停止して修正します。
## フェーズ2: コード品質とフォーマット
```bash
# 型チェック
mypy . --config-file pyproject.toml
# ruffでリンティング
ruff check . --fix
# blackでフォーマット
black . --check
black . # 自動修正
# インポートソート
isort . --check-only
isort . # 自動修正
# Django固有のチェック
python manage.py check --deploy
```
一般的な問題:
- パブリック関数の型ヒントの欠落
- PEP 8フォーマット違反
- ソートされていないインポート
- 本番構成に残されたデバッグ設定
## フェーズ3: マイグレーション
```bash
# 未適用のマイグレーションをチェック
python manage.py showmigrations
# 欠落しているマイグレーションを作成
python manage.py makemigrations --check
# マイグレーション適用のドライラン
python manage.py migrate --plan
# マイグレーションを適用(テスト環境)
python manage.py migrate
# マイグレーションの競合をチェック
python manage.py makemigrations --merge # 競合がある場合のみ
```
レポート:
- 保留中のマイグレーション数
- マイグレーションの競合
- マイグレーションのないモデルの変更
## フェーズ4: テスト + カバレッジ
```bash
# pytestですべてのテストを実行
pytest --cov=apps --cov-report=html --cov-report=term-missing --reuse-db
# 特定のアプリテストを実行
pytest apps/users/tests/
# マーカーで実行
pytest -m "not slow" # 遅いテストをスキップ
pytest -m integration # 統合テストのみ
# カバレッジレポート
open htmlcov/index.html
```
レポート:
- 合計テスト: X成功、Y失敗、Zスキップ
- 全体カバレッジ: XX%
- アプリごとのカバレッジ内訳
カバレッジ目標:
| コンポーネント | 目標 |
|-----------|--------|
| モデル | 90%+ |
| シリアライザー | 85%+ |
| ビュー | 80%+ |
| サービス | 90%+ |
| 全体 | 80%+ |
## フェーズ5: セキュリティスキャン
```bash
# 依存関係の脆弱性
pip-audit
safety check --full-report
# Djangoセキュリティチェック
python manage.py check --deploy
# Banditセキュリティリンター
bandit -r . -f json -o bandit-report.json
# シークレットスキャン(gitleaksがインストールされているUse this skill
Add a "skill" field with the skill’s ID to your chat completion request. It is applied server-side before your prompt is sent — no extra calls.
{
"model": "gpt-4o-mini",
"skill": "imp-78596560-1cf7-4b69-a290-5e29dba12f79",
"messages": [{ "role": "user", "content": "…" }]
}Install the skill, enable it in your dashboard and (optionally) limit it to specific models. It then applies automatically to every matching request — with no "skill" field to send each time.
Set it up in your dashboardMore skills
Delegate coding work to Codex, Claude Code, or OpenCode as background workers; not simple edits or read-only code lookup.
Create, edit, audit, tidy, validate, or restructure AgentSkills and SKILL.md files.
Search and analyze your own session logs (older/parent conversations) using jq.
Create, view, edit, delete, search, move, or export Apple Notes via the memo CLI on macOS.
Diagnose OpenClaw Android, iOS, or macOS node pairing, QR/setup code, route, auth, and connection failures.
Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.
List, add, edit, complete, or delete Apple Reminders and reminder lists via remindctl.
Create, search, and manage Bear notes via grizzly CLI.