{
  "package_name": "codeflash-internal-skills",
  "total_capabilities": 13,
  "capabilities": [
    {
      "id": 0,
      "name": "diagnose-request-validation-failure",
      "description": "Identify when an optimization or testgen request fails due to invalid schema fields (missing source_code, unsupported language, bad n_candidates)",
      "complexity": "basic",
      "api_elements": ["core/shared/optimizer_models.py", "OptimizeSchema", "Pydantic validation"]
    },
    {
      "id": 1,
      "name": "diagnose-router-dispatch-failure",
      "description": "Identify when router dispatch fails because a language is unsupported or a lazy import raises ImportError",
      "complexity": "basic",
      "api_elements": ["core/shared/optimizer_router.py", "core/shared/testgen_router.py", "data.language"]
    },
    {
      "id": 2,
      "name": "diagnose-llm-client-failure",
      "description": "Identify when LLM calls fail due to missing environment variables, None client, or API key issues",
      "complexity": "intermediate",
      "api_elements": ["aiservice/llm.py", "get_llm_client()", "AZURE_OPENAI_API_KEY", "ANTHROPIC_FOUNDRY_API_KEY"]
    },
    {
      "id": 3,
      "name": "diagnose-postprocessing-removal",
      "description": "Identify when all optimization candidates are removed by deduplication or equality checks in postprocessing",
      "complexity": "intermediate",
      "api_elements": ["core/languages/python/optimizer/postprocess.py", "deduplicate_optimizations()", "equality_check()"]
    },
    {
      "id": 4,
      "name": "diagnose-logging-discrepancy",
      "description": "Use optimization logging (optimizations_raw vs optimizations_post) to pinpoint where candidates are lost",
      "complexity": "basic",
      "api_elements": ["core/log_features/models.py", "OptimizationFeatures", "record_llm_call()"]
    },
    {
      "id": 5,
      "name": "create-language-directory-structure",
      "description": "Create the correct directory layout for a new language under core/languages/ with __init__.py, optimizer/, and testgen/ subdirectories",
      "complexity": "basic",
      "api_elements": ["core/languages/<lang>/", "core/languages/<lang>/optimizer/", "core/languages/<lang>/testgen/"]
    },
    {
      "id": 6,
      "name": "implement-language-handler",
      "description": "Implement a handler class with @register_handler decorator, correct supports_* flags, and protocol methods",
      "complexity": "intermediate",
      "api_elements": ["@register_handler", "LanguageHandler", "supports_testgen", "supports_optimizer", "core/protocols/base.py"]
    },
    {
      "id": 7,
      "name": "update-routers-for-language",
      "description": "Add lazy-import dispatch branches to optimizer_router.py and testgen_router.py for a new language",
      "complexity": "intermediate",
      "api_elements": ["core/shared/optimizer_router.py", "core/shared/testgen_router.py", "lazy import", "noqa: PLC0415"]
    },
    {
      "id": 8,
      "name": "add-aiservice-endpoint",
      "description": "Create a Django-Ninja endpoint with NinjaAPI router, ninja.Schema request/response types, async def handler, and AuthenticatedRequest",
      "complexity": "intermediate",
      "api_elements": ["NinjaAPI", "ninja.Schema", "AuthenticatedRequest", "aiservice/urls.py", "async def"]
    },
    {
      "id": 9,
      "name": "add-cfapi-express-endpoint",
      "description": "Create an Express endpoint in cf-api with correct route registration order (webhooks before body parser) and middleware",
      "complexity": "advanced",
      "api_elements": ["js/cf-api/endpoints/", "js/cf-api/routes/index.ts", "addAsync(Router())", "checkForValidAPIKey"]
    },
    {
      "id": 10,
      "name": "register-endpoint-urls",
      "description": "Register endpoints in aiservice/urls.py (path pattern ai/<kebab-case>) or cf-api routes/index.ts with correct middleware ordering",
      "complexity": "basic",
      "api_elements": ["aiservice/urls.py", "urlpatterns", "js/cf-api/routes/index.ts"]
    },
    {
      "id": 11,
      "name": "diagnose-testgen-prompt-failure",
      "description": "Identify when test generation fails due to empty or malformed prompts from Jinja2 template rendering issues",
      "complexity": "advanced",
      "api_elements": ["core/languages/python/testgen/testgen.py", "build_prompt()", "Jinja2 templates"]
    },
    {
      "id": 12,
      "name": "diagnose-testgen-instrumentation-failure",
      "description": "Identify when instrumented tests fail to compile due to import handling or device sync injection issues",
      "complexity": "advanced",
      "api_elements": ["core/languages/python/testgen/instrumentation/instrument_new_tests.py", "instrument_tests()", "detect_frameworks_from_code()", "_create_device_sync_precompute_statements()"]
    }
  ]
}
