ワンクリックで
tenant
Scaffold multi-tenancy — tenant middleware, row-level security, per-tenant rate limiting, feature flags, and tenant admin API.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Scaffold multi-tenancy — tenant middleware, row-level security, per-tenant rate limiting, feature flags, and tenant admin API.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Switch model mid-session preserving thinking blocks. Used by /model command and by BRD §6.2 failover when the primary provider rate-limits or fails.
Six-phase ReAct loop (pre-check, thinking, self-critique, action, tool, post). Activates per-workflow via the thinking_level knob in config/workflows.yaml. Replaces standard ReAct for workflows where independent verification of the reasoning improves outcomes.
Mines completed sessions for repeating {tool sequence → outcome} tuples. Scores by frequency × success_rate × novelty. High-scoring tuples become "instincts" — candidate skill seeds — in instincts/pending/.
Walk-back algorithm for the Spec-Auditor subagent. Given a failure at phase N, identifies the earliest phase whose spec, if tightened, would have prevented the failure. Proposes a surgical amendment.
Sessions stored as trees (not lists). /fork creates a branch from any point; /tree navigates; /branch labels a path; /export produces HTML for review. All branches live in one session file under sessions/<project>/<session_id>.json.
Progressive context refinement for subagents. Don't dump everything; retrieve in passes. Start with a list of file paths and one-line abstracts; load full content only when the abstract proves insufficient.
| name | tenant |
| description | Scaffold multi-tenancy — tenant middleware, row-level security, per-tenant rate limiting, feature flags, and tenant admin API. |
Scaffold multi-tenancy infrastructure based on the architect's chosen tenancy model.
/tenant
Also invoked by the architect when the BRD describes multi-tenant requirements.
project-manifest.json exists with stack section populated.specs/design/.Read architect's design documents for:
Generate src/middleware/tenant.py (or .ts):
Generate src/types/tenant.py (or .ts):
Generate database migration for RLS (PostgreSQL):
SELECT where tenant_id = current_setting('app.current_tenant_id')INSERT where tenant_id = current_setting('app.current_tenant_id')UPDATE / DELETE similarly scopedcurrent_setting in connection middleware before each requestFor schema-per-tenant: generate schema creation and routing logic. For DB-per-tenant: generate connection pool management per tenant.
Generate src/services/rate_limiter.py (or .ts):
Generate feature flag support:
Generate admin endpoints:
Update all existing repository/data-access files:
| File | Description |
|---|---|
src/middleware/tenant.py | Tenant extraction and context middleware |
src/types/tenant.py | Tenant model and context types |
migrations/ (new migration) | RLS policies or schema setup |
src/services/rate_limiter.py | Per-tenant rate limiting |
| Updated repository files | Tenant-scoped data access |
| Admin API endpoints | Tenant management |