Token导航 LogoToken导航TokenDH.com
前端设计敏感数据github未标认证来源可访问clear审计通过

ln-773-cors-configuratorln 773 cors 配置器

Agent Skill

ln-773-cors-configurator 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

6,309

周安装

271

GitHub Stars

437

下载量

2,211
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-773-cors-configurator

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合围绕仓库状态、代码变更或协作事项进行整理。
  • 可结合来源仓库和原始 README 核验具体用法。
  • 安装前建议确认权限范围和维护状态。ln-773-cors-configurator 属于前端设计类 Skill,可作为该场景下的辅助能力补充。
  • 注意是否会触发联网、命令执行或文件读写操作。

SKILL.md

ln-773-cors-configurator

Type: L3 Worker Category: 7XX Project Bootstrap

Configures Cross-Origin Resource Sharing (CORS) policy with security-first approach.


Overview

AspectDetails
InputContext Store from ln-770
OutputCORS configuration with environment-specific policies
Stacks.NET (ASP.NET Core CORS), Python (FastAPI CORSMiddleware)

Phase 1: Receive Context

Accept Context Store from coordinator.

Required Context:

  • STACK:.NET or Python
  • PROJECT_ROOT: Project directory path
  • ENVIRONMENT: Development or Production

Idempotency Check:

  • .NET: Grep for AddCors or UseCors
  • Python: Grep for CORSMiddleware
  • If found: Return {"status": "skipped"}

Phase 2: Analyze Project Structure

Determine frontend configuration.

Detection Steps:

  1. Check for frontend in same repository (/frontend, /client, /web)
  2. Read .env or appsettings.json for CORS_ORIGINS
  3. Identify common frontend ports (3000, 5173, 4200)

Detected Frontend Origins:

FrameworkDefault PortOrigin
React (CRA)3000http://localhost:3000
Vite5173http://localhost:5173
Angular4200http://localhost:4200
Next.js3000http://localhost:3000

Phase 3: Decision Points

Q1: Allowed Origins

EnvironmentStrategy
DevelopmentAllow localhost origins (configurable)
ProductionExplicit origins from environment variables only

Security Warning: Never use * (wildcard) with credentials.

Q2: Allowed Methods

MethodDefaultNotes
GET✓ YesRead operations
POST✓ YesCreate operations
PUT✓ YesUpdate operations
DELETE✓ YesDelete operations
PATCHOptionalPartial updates
OPTIONS✓ YesPreflight requests (automatic)

Q3: Credentials Support

ScenarioAllowCredentialsNotes
Cookie-based auth✓ YesRequired for cookies
JWT in header✗ NoNot needed
OAuth2DependsCheck documentation

Warning: AllowCredentials = true prohibits * origin.

Q4: Preflight Cache Duration

EnvironmentMaxAgeRationale
Development0Immediate config changes
Production86400 (24h)Reduce preflight requests

Phase 4: Generate Configuration

.NET Output Files

FilePurpose
Extensions/CorsExtensions.csCORS service registration
appsettings.json (update)Origins configuration
appsettings.Development.json (update)Dev origins

Generation Process:

  1. Use MCP ref for current ASP.NET Core CORS API
  2. Generate CorsExtensions with:

- Development policy (permissive) - Production policy (restrictive) - Environment-based policy selection

  1. Update appsettings with CORS:Origins

Registration Code:

builder.Services.AddCorsPolicy(builder.Configuration);
// ...
app.UseCors(builder.Environment.IsDevelopment() ? "Development" : "Production");

Python Output Files

FilePurpose
middleware/cors_config.pyCORS middleware configuration
.env (update)CORS_ORIGINS variable

Generation Process:

  1. Use MCP ref for FastAPI CORSMiddleware
  2. Generate cors_config.py with:

- Origin parsing from environment - Method and header configuration - Credentials handling

  1. Update.env with CORS_ORIGINS

Registration Code:

from middleware.cors_config import configure_cors
configure_cors(app)

Phase 5: Validate

Validation Steps:

  1. Syntax check:

- .NET: dotnet build --no-restore - Python: python -m py_compile middleware/cors_config.py

  1. CORS test: # Test preflight request curl -X OPTIONS http://localhost:5000/api/test \ -H "Origin: http://localhost:3000" \ -H "Access-Control-Request-Method: POST" \ -v
  2. Verify headers:

- Access-Control-Allow-Origin: Should match request origin - Access-Control-Allow-Methods: Should list allowed methods - Access-Control-Allow-Credentials: true (if enabled) - Access-Control-Max-Age: Cache duration


Security Checklist

Before completing, verify:

  • No wildcard * origin in production
  • Explicit allowed methods (not AllowAnyMethod in prod)
  • Credentials only if needed
  • Origins from environment variables in production
  • Preflight caching enabled in production

Return to Coordinator

{
  "status": "success",
  "files_created": [
    "Extensions/CorsExtensions.cs"
  ],
  "packages_added": [],
  "registration_code": "builder.Services.AddCorsPolicy(configuration);",
  "message": "Configured CORS with Development and Production policies"
}

Reference Links


Critical Rules

  • **Never use wildcard * origin with credentials** — security violation per CORS spec
  • Production origins from environment variables only — no hardcoded URLs in code
  • Separate Development and Production policies — permissive locally, restrictive in production
  • Idempotent — if AddCors/UseCors or CORSMiddleware exists, return status: "skipped"
  • Enable preflight caching in Production — MaxAge 86400 (24h) to reduce OPTIONS requests

Definition of Done

  • Context Store received (stack, project root, environment)
  • Frontend origins detected (port/framework auto-detection)
  • User decisions collected (origins, methods, credentials, cache duration)
  • CORS configuration generated with environment-specific policies
  • Security checklist verified (no wildcard + credentials, explicit methods, env-based origins)
  • 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

30.59%
按下载量换算676

Gemini CLI

24.31%
按下载量换算537

OpenCode

16.66%
按下载量换算368

Antigravity

12.86%
按下载量换算284

Codex

7.18%
按下载量换算159

Cursor

3.12%
按下载量换算69

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills