Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问clear审计提醒

ln-772-error-handler-setupln 772 错误处理程序设置

Agent Skill

ln-772-error-handler-setup 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 Codex、Claude、Cursor、Gemini CLI 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

6,699

周安装

271

GitHub Stars

437

下载量

2,103
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ln-772-error-handler-setup(ln 772 错误处理程序设置)
来源仓库:https://github.com/levnikolaevich/claude-code-skills
仓库路径:skills/ln-772-error-handler-setup
安装命令:
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-772-error-handler-setup
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-772-error-handler-setup

简介

用于记录任务执行中的错误和经验缺口。

  • 适合让 Agent 持续沉淀问题和修正最佳实践。
  • 可结合来源仓库和原始 README 核验具体用法。
  • 安装前建议确认权限范围和维护状态。ln-772-error-handler-setup 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 注意是否会触发联网、命令执行或文件读写操作。

SKILL.md

ln-772-error-handler-setup

Type: L3 Worker Category: 7XX Project Bootstrap

Configures global error handling for.NET and Python backend applications.


Overview

AspectDetails
InputContext Store from ln-770
OutputException handling middleware and custom exceptions
Stacks.NET (ASP.NET Core Middleware), Python (FastAPI exception handlers)

Phase 1: Receive Context

Accept Context Store from coordinator.

Required Context:

  • STACK:.NET or Python
  • FRAMEWORK: ASP.NET Core or FastAPI
  • PROJECT_ROOT: Project directory path
  • ENVIRONMENT: Development or Production

Idempotency Check:

  • .NET: Grep for GlobalExceptionMiddleware or UseExceptionHandler
  • Python: Grep for @app.exception_handler or exception_handlers.py
  • If found: Return {"status": "skipped"}

Phase 2: Research Error Handling Patterns

Use MCP tools to get up-to-date documentation.

For.NET:

MCP ref: "ASP.NET Core global exception handling middleware"
Context7: /dotnet/aspnetcore

For Python:

MCP ref: "FastAPI exception handlers custom exceptions"
Context7: /tiangolo/fastapi

Key Patterns to Research:

  1. Middleware pipeline positioning
  2. Exception type mapping to HTTP status codes
  3. ProblemDetails (RFC 7807) format
  4. Development vs Production error details
  5. Logging integration

Phase 3: Decision Points

Q1: Error Response Format

OptionDescription
ProblemDetails (RFC 7807) (Recommended)Standardized format, widely adopted
Custom FormatProject-specific requirements

Q2: Error Detail Level

EnvironmentStack TraceInner ExceptionsRequest Details
Development✓ Show✓ Show✓ Show
Production✗ Hide✗ Hide✗ Hide

Q3: Error Taxonomy

Define standard error codes:

CodeHTTP StatusDescription
VALIDATION_ERROR400Invalid input data
UNAUTHORIZED401Authentication required
FORBIDDEN403Insufficient permissions
NOT_FOUND404Resource not found
CONFLICT409Resource state conflict
INTERNAL_ERROR500Unexpected server error

Phase 4: Generate Configuration

.NET Output Files

FilePurpose
Middleware/GlobalExceptionMiddleware.csException handling middleware
Exceptions/AppException.csBase exception class
Exceptions/ValidationException.csValidation errors
Exceptions/NotFoundException.csNot found errors
Models/ErrorResponse.csError response model

Generation Process:

  1. Use MCP ref to get current ASP.NET Core exception handling patterns
  2. Generate GlobalExceptionMiddleware with:

- Exception type to HTTP status mapping - Logging of exceptions - ProblemDetails response format - Environment-aware detail level

  1. Generate custom exception classes

Registration Code:

app.UseMiddleware<GlobalExceptionMiddleware>();

Python Output Files

FilePurpose
exceptions/app_exceptions.pyCustom exception classes
exceptions/handlers.pyFastAPI exception handlers
models/error_response.pyPydantic error models

Generation Process:

  1. Use MCP ref to get current FastAPI exception handling patterns
  2. Generate exception handlers with:

- HTTPException handling - Custom AppException handling - Validation error handling - Request validation error handling

  1. Generate custom exception classes

Registration Code:

app.add_exception_handler(AppException, app_exception_handler)
app.add_exception_handler(RequestValidationError, validation_exception_handler)

Phase 5: Validate

Validation Steps:

  1. Syntax check:

- .NET: dotnet build --no-restore - Python: python -m py_compile exceptions/handlers.py

  1. Test error handling:

- Create test endpoint that throws exception - Verify error response format - Check that stack trace hidden in Production

Expected Error Response (ProblemDetails):

{
  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
  "title": "Validation Error",
  "status": 400,
  "detail": "Invalid input data",
  "instance": "/api/users",
  "errors": [
    { "field": "email", "message": "Invalid email format" }
  ],
  "traceId": "abc-123-def-456"
}

Return to Coordinator

{
  "status": "success",
  "files_created": [
    "Middleware/GlobalExceptionMiddleware.cs",
    "Exceptions/AppException.cs",
    "Models/ErrorResponse.cs"
  ],
  "packages_added": [],
  "registration_code": "app.UseMiddleware<GlobalExceptionMiddleware>();",
  "message": "Configured global exception handling"
}

Reference Links


Critical Rules

  • Use ProblemDetails (RFC 7807) by default — standardized error response format
  • Hide stack traces in Production — environment-aware detail level is mandatory
  • Use MCP ref for current patterns — do not hardcode middleware from memory
  • Idempotent — if GlobalExceptionMiddleware or exception_handlers.py exists, return status: "skipped"
  • Map all custom exceptions to HTTP status codes — no unhandled exception types reaching the client

Definition of Done

  • Context Store received (stack, framework, environment)
  • Error handling patterns researched via MCP tools
  • GlobalExceptionMiddleware generated (.NET) or exception handlers generated (Python)
  • Custom exception classes created (AppException, ValidationException, NotFoundException)
  • Error response model created (ProblemDetails format)
  • Syntax validated (dotnet build or py_compile)
  • Structured JSON response returned to ln-770 coordinator

Version: 2.0.0 Last Updated: 2026-01-10

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.64%
按下载量换算602

Gemini CLI

22.72%
按下载量换算478

Codex

21.08%
按下载量换算443

OpenCode

14.53%
按下载量换算306

Antigravity

7.66%
按下载量换算161

windsurf

3.54%
按下载量换算74

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills