.claude/skills/ln-773-cors-configurator/SKILL.md
Configures CORS policy for development and production
npx skillsauth add cbbkrd-tech/jl-finishes ln-773-cors-configuratorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Type: L3 Worker Category: 7XX Project Bootstrap Parent: ln-770-crosscutting-setup
Configures Cross-Origin Resource Sharing (CORS) policy with security-first approach.
| Aspect | Details | |--------|---------| | Input | Context Store from ln-770 | | Output | CORS configuration with environment-specific policies | | Stacks | .NET (ASP.NET Core CORS), Python (FastAPI CORSMiddleware) |
Accept Context Store from coordinator.
Required Context:
STACK: .NET or PythonPROJECT_ROOT: Project directory pathENVIRONMENT: Development or ProductionIdempotency Check:
AddCors or UseCorsCORSMiddleware{ "status": "skipped" }Determine frontend configuration.
Detection Steps:
/frontend, /client, /web).env or appsettings.json for CORS_ORIGINSDetected Frontend Origins:
| Framework | Default Port | Origin | |-----------|--------------|--------| | React (CRA) | 3000 | http://localhost:3000 | | Vite | 5173 | http://localhost:5173 | | Angular | 4200 | http://localhost:4200 | | Next.js | 3000 | http://localhost:3000 |
| Environment | Strategy | |-------------|----------| | Development | Allow localhost origins (configurable) | | Production | Explicit origins from environment variables only |
Security Warning: Never use * (wildcard) with credentials.
| Method | Default | Notes | |--------|---------|-------| | GET | ✓ Yes | Read operations | | POST | ✓ Yes | Create operations | | PUT | ✓ Yes | Update operations | | DELETE | ✓ Yes | Delete operations | | PATCH | Optional | Partial updates | | OPTIONS | ✓ Yes | Preflight requests (automatic) |
| Scenario | AllowCredentials | Notes | |----------|------------------|-------| | Cookie-based auth | ✓ Yes | Required for cookies | | JWT in header | ✗ No | Not needed | | OAuth2 | Depends | Check documentation |
Warning: AllowCredentials = true prohibits * origin.
| Environment | MaxAge | Rationale | |-------------|--------|-----------| | Development | 0 | Immediate config changes | | Production | 86400 (24h) | Reduce preflight requests |
| File | Purpose |
|------|---------|
| Extensions/CorsExtensions.cs | CORS service registration |
| appsettings.json (update) | Origins configuration |
| appsettings.Development.json (update) | Dev origins |
Generation Process:
Registration Code:
builder.Services.AddCorsPolicy(builder.Configuration);
// ...
app.UseCors(builder.Environment.IsDevelopment() ? "Development" : "Production");
| File | Purpose |
|------|---------|
| middleware/cors_config.py | CORS middleware configuration |
| .env (update) | CORS_ORIGINS variable |
Generation Process:
Registration Code:
from middleware.cors_config import configure_cors
configure_cors(app)
Validation Steps:
Syntax check:
dotnet build --no-restorepython -m py_compile middleware/cors_config.pyCORS test:
# Test preflight request
curl -X OPTIONS http://localhost:5000/api/test \
-H "Origin: http://localhost:3000" \
-H "Access-Control-Request-Method: POST" \
-v
Verify headers:
Access-Control-Allow-Origin: Should match request originAccess-Control-Allow-Methods: Should list allowed methodsAccess-Control-Allow-Credentials: true (if enabled)Access-Control-Max-Age: Cache durationBefore completing, verify:
* origin in productionAllowAnyMethod in prod){
"status": "success",
"files_created": [
"Extensions/CorsExtensions.cs"
],
"packages_added": [],
"registration_code": "builder.Services.AddCorsPolicy(configuration);",
"message": "Configured CORS with Development and Production policies"
}
* origin with credentials — security violation per CORS specAddCors/UseCors or CORSMiddleware exists, return status: "skipped"dotnet build or py_compile)Version: 2.0.0 Last Updated: 2026-01-10
testing
When the user wants to plan a content strategy, decide what content to create, or figure out what topics to cover. Also use when the user mentions "content strategy," "what should I write about," "content ideas," "blog strategy," "topic clusters," or "content planning." For writing individual pieces, see copywriting. For SEO-specific audits, see seo-audit.
development
When the user wants to create competitor comparison or alternative pages for SEO and sales enablement. Also use when the user mentions 'alternative page,' 'vs page,' 'competitor comparison,' 'comparison page,' '[Product] vs [Product],' '[Product] alternative,' or 'competitive landing pages.' Covers four formats: singular alternative, plural alternatives, you vs competitor, and competitor vs competitor. Emphasizes deep research, modular content architecture, and varied section types beyond feature tables.
development
Write B2B cold emails and follow-up sequences that get replies. Use when the user wants to write cold outreach emails, prospecting emails, cold email campaigns, sales development emails, or SDR emails. Covers subject lines, opening lines, body copy, CTAs, personalization, and multi-touch follow-up sequences.
development
When the user wants to reduce churn, build cancellation flows, set up save offers, recover failed payments, or implement retention strategies. Also use when the user mentions 'churn,' 'cancel flow,' 'offboarding,' 'save offer,' 'dunning,' 'failed payment recovery,' 'win-back,' 'retention,' 'exit survey,' 'pause subscription,' or 'involuntary churn.' This skill covers voluntary churn (cancel flows, save offers, exit surveys) and involuntary churn (dunning, payment recovery). For post-cancel win-back email sequences, see email-sequence. For in-app upgrade paywalls, see paywall-upgrade-cro.