一键导入
rulesgen-api-debugging
Use for FastAPI route, middleware, lifespan, dependency injection, or Problem Details response issues in Rulesgen.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use for FastAPI route, middleware, lifespan, dependency injection, or Problem Details response issues in Rulesgen.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when adding, renaming, reordering, or linking Rulesgen public docs that flow to the tdm-docs Docusaurus site and tdspora.ai. Covers the import pipeline, sidebar/.order mechanics, the "link locally until published" rule, and the lychee link-check and docs-contract validation battery.
Use for authoring or updating Rulesgen documentation — public docs (`docs/public/`), repo-root design docs, contributor docs, sample READMEs, and the glossary. Produces testable, glossary-aligned, link-integral docs.
Use for testing Rulesgen documentation — executes Markdown code fences via Sybil, validates link integrity, lints glossary usage, and cross-checks docs against Settings, schemas, and routes.
Use for authoring, reviewing, or correcting natural-language → Python generation DSL rules for Rulesgen.
Use for implementing production-grade Rulesgen features or non-trivial code changes.
Use for Pydantic v2 validation errors, DSL parser/validator rejections, and API request validation issues in Rulesgen.
| name | rulesgen-api-debugging |
| description | Use for FastAPI route, middleware, lifespan, dependency injection, or Problem Details response issues in Rulesgen. |
X-Request-ID, X-API-Key, Authorization, Content-Type), body, and full response (status, headers, body).TestClient in an integration test before changing production code:
from fastapi.testclient import TestClient
from rulesgen.main import create_app
client = TestClient(create_app())
rulesgen/schemas/; verify field types and required fields.ExceptionMappingMiddleware + handlers in rulesgen/api/exception_handlers.py. Trace from the raised domain exception (rulesgen/domain/exceptions.py) to the mapping.rulesgen/auth/resolver.py + dependency in rulesgen/api/dependencies.py.X-Request-ID correlation), then add an explicit mapping if appropriate.Settings.cors_allow_origins, Settings.trusted_hosts in rulesgen/core/config.py. Do not hardcode *.rulesgen/main.py:create_app:
ExceptionMappingMiddleware (outermost: maps exceptions to Problem Details)RequestContextMiddleware (request id, scoped state)TrustedHostMiddlewareCORSMiddleware (innermost)
Reordering changes observable behavior.tests/contract/.tests/integration/.HTTPException(detail="...") directly — emits JSON shape that is not Problem Details. Raise a domain exception instead.Settings injected via get_settings.app.state — use RequestContextMiddleware for request-scoped state, or lifespan for app-scoped state.