// META-SKILL ORCHESTRATOR - ALWAYS-ACTIVE. Orchestrates 100% Binora Backend workflows (Django 5.0+DRF 3.14+PostgreSQL multi-tenant) through 6-phase execution (Pre-Analysis, Request Analysis, Workflow Planning, Skill Coordination, Tool Optimization, Quality Assurance). Enforces P0 CRITICAL rules (NO manual tenant_id, service layer mandatory, YOLO comments). Selects optimal model (Sonnet/Haiku). MCP-first strategy (Context7/db/github/sequential-thinking). Target: 3-5x speedup, 95%+ P1 compliance, <500 token overhead.
ALWAYS-ACTIVE - Executes on EVERY request as the central orchestrator for Binora Backend workflows.
Orchestrate 100% of Binora Backend workflows (Django 5.0 + DRF 3.14 + PostgreSQL multi-tenant) through 6-phase systematic execution achieving 3-5x workflow speedup, 95%+ P1 compliance, optimal model selection (Sonnet/Haiku), and <500 token overhead.
ALWAYS execute FIRST - Determines workflow path:
Quick score (0-100):
Keyword detection (Auto-flag risk):
tenant_id, filter(tenant, .filter(company_idViewSet, business logic, Mock(), serializer.save()query, objects.all(), test, def test_comment, docstring, type hintRisk flagging:
django-architecture-enforcerdjango-query-optimizercode-style-enforcerModel pre-selection:
Auto-Check:
Execute when score <90 (from Phase 0):
Binora-specific scoring rubric (0-100):
Binora bonuses (+25):
apps/core/...)Enhancement patterns:
<task><context><expected_output>)Auto-Check:
ALWAYS execute - Determines execution strategy:
Task classification:
Complexity estimation:
Model selection matrix:
| Complexity | Risk Level | Model | Thinking Budget | Use Case |
|---|---|---|---|---|
| High | Any | Sonnet 4.5 | 8192 tokens | Architectural decisions, complex implementation, CRITICAL validation |
| Medium | HIGH/CRITICAL | Sonnet 4.5 | 4096 tokens | Standard implementation, refactoring |
| Medium | LOW/MEDIUM | Sonnet 4.5 | 2048 tokens | Simple implementation |
| Low | Any | Haiku 4.5 | 0 (disabled) | Exploration, simple queries, documentation |
/quick-audit, /check-tenant, /coveragedjango-test-generator (100% coverage), service-layer-generatorAuto-Check:
ALWAYS suggest relevant skills based on domain:
Priority-based skill activation:
P0 CRITICAL (ALWAYS active):
multi-tenant-guardian ⚠️ - Prevents manual tenant_id filteringdjango-architecture-enforcer ⚠️ - Enforces service layer delegationP1 HIGH (Activate on-demand):
django-query-optimizer - Enforces select_related/prefetch_related/order_bypostgresql-performance - Database indexes, migration safetydjango-testing-patterns - AAA pattern, 100% coverage, mocker.Mock()P2 MEDIUM (Suggest if relevant):
drf-serializer-patterns - Input/Output separation, validation-onlycode-style-enforcer - Type hints, YOLO comments, importsP3 LOW (Optional):
openapi-contract-validator - Match OpenAPI specopenapi-contract-editor - Create/update contractsAgent delegation (10 agents available):
feature-planner, django-codebase-auditor, performance-analyzer, contract-compliance-validatordjango-test-generator, service-layer-generatormulti-tenant-enforcer, security-auditor, pre-commit-guardian, deployment-checkerUse agents when: Complex multi-step (>5min), parallel work (2-5 optimal), 100% coverage generation Avoid agents when: Single skill sufficient (<5min), sequential dependencies
Auto-Check:
ALWAYS optimize tool usage for speed:
MCP-first priority order:
MCPs > Specialized tools > WebSearch
MCP decision matrix:
Context7("/django/django", "query optimization")db("SELECT column_name FROM information_schema.columns WHERE table_name='core_user'")github("git log -p apps/core/services.py")sequential-thinking(18 thoughts)Parallel execution:
Token budget monitoring:
190K (95%): 🔥 Critical, mandatory cleanup
Auto-Check:
ALWAYS validate before completion:
P0 CRITICAL gates (MUST pass - Fail immediately if violated):
⚠️ NO manual tenant_id filtering
User.objects.filter(tenant_id=company.id)User.objects.filter(email=email) (middleware adds tenant_id)⚠️ ALL business logic in services
.claude/core/architecture.md⚠️ NO Mock() without mocker fixture
from unittest.mock import Mockdef test_something(mocker): mock = mocker.Mock().claude/core/testing.mdP1 HIGH gates (SHOULD pass - Warning if violated):
P2 MEDIUM gates (NICE to pass - Info if violated):
Auto-Check:
Common mistakes to avoid:
Executing independent operations sequentially instead of in parallel (3-10x slower).
❌ WRONG:
Read apps/core/views/user.py # 2s
Read apps/core/services.py # 2s
Read apps/core/serializers/user.py # 2s
Total: 6s
✅ CORRECT:
Single message with:
- Read apps/core/views/user.py
- Read apps/core/services.py
- Read apps/core/serializers/user.py
Total: 2s (3x faster)
Using WebSearch instead of Context7 MCP for Django/DRF documentation (5-100x slower).
❌ WRONG:
WebSearch("Django select_related documentation") # 30s, rate-limited
✅ CORRECT:
Context7("/django/django", "select_related query optimization") # 6s
Skipping Phase 1 (Request Analysis) for low-scoring prompts, leading to incorrect assumptions.
❌ WRONG:
User: "fix the user thing"
Assistant: [Immediately starts without clarification]
✅ CORRECT:
Phase 0: Score = 25/100 (vague: no scope, no file, no success criteria)
Phase 1: Apply Cognitive Verifier
Enhanced: "Fix authentication bug in apps/core/views/user.py where email validation allows duplicates"
Not monitoring token usage at Phase 4, leading to emergency cleanup at 95%+.
❌ WRONG:
Context: 178K/200K tokens (89%)
Assistant: [Loads 20K token file without checking]
Result: 198K/200K - emergency cleanup needed
✅ CORRECT:
Context: 178K/200K tokens (89% - 🚨 ALERT)
Alternative: Use Context7 MCP (lower token cost) instead of Read
Using agents for <5min tasks when skills/commands sufficient (coordination overhead > benefit).
❌ WRONG:
User: "Check if this has tenant_id filtering"
Assistant: Launching multi-tenant-enforcer agent... # 3min + 15K tokens
✅ CORRECT:
User: "Check if this has tenant_id filtering"
Phase 3: Activate multi-tenant-guardian skill (auto-check) # Instant + 100 tokens
Priority-grouped validation (12 items):
tenant_id filtering in queries? (django-tenants pattern)Mock() imports without mocker fixture? (pytest-mock required)Binora Backend documentation:
| File/Resource | Purpose | Content |
|---|---|---|
| CLAUDE.md | Master index | 13 skills + 10 agents + 7 commands + architecture + FORBIDDEN rules |
| .claude/core/architecture.md | Multi-tenant architecture | Transparent isolation, service layer, DI, type hints, query optimization |
| .claude/core/forbidden.md | FORBIDDEN patterns | CRITICAL violations (tenant_id, business logic in views, Mock without mocker) |
| .claude/core/testing.md | Testing patterns | AAA pattern, pytest-django, mocker.Mock(), 100% coverage, NO docstrings |
| .claude/core/workflows.md | Workflows | Feature development, bug fixing, pre-PR checklist, parallel patterns |
| .claude/core/code-style.md | Code style guide | all, imports, naming, YOLO comments |
| apps/core/services.py | Service examples | AuthService with dependency injection |
| apps/core/views/user.py | ViewSet examples | Service delegation pattern (line 50-68) |
External references:
Keywords: ALWAYS-ACTIVE (no keywords required)
Context Triggers: EVERY request without exception
Explicit Invocation: Not required - skill auto-activates as meta-orchestrator
Output Format: 6-phase execution with section markers:
Phase 0: Pre-Analysis
Phase 1: Request Analysis
Phase 2: Workflow Planning
Phase 3: Skill Coordination
Phase 4: Tool Optimization
Phase 5: Quality Assurance
Last Updated: 2025-01-13 Target Quality: 95+/100 Specialization: Binora Backend (Django 5.0 + DRF 3.14 + PostgreSQL Multi-Tenant) Token Overhead: ~500 tokens (SKILL.md only, resources/ loaded on-demand)