Skip to content
ln-770-crosscutting-setup logo

Ln 770 Crosscutting Setup

ln-770-crosscutting-setup

Sets up logging, error handling, CORS, health checks, and API docs. Use when adding cross-cutting concerns to backend projects.

SKILL.md

Full skill instructions

Paths: File paths (shared/, references/, ../​ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. If shared/ is missing, fetch files via WebFetch from https://raw.githubusercontent.com/​levnikolaevich/​claude-code-skills/​master/​skills/​{path}.

ln-770-crosscutting-setup

Type: L2 Domain Coordinator Category: 7XX Project Bootstrap Parent: ln-700-project-bootstrap

Coordinates cross-cutting concerns configuration for .NET and Python projects.


Overview

AspectDetails
InputProject root directory
OutputConfigured logging, error handling, CORS, health checks, API docs
Workersln-771 to ln-775
Stacks.NET (ASP.NET Core), Python (FastAPI)

Phase 1: Detect Project Stack

Determine the technology stack by scanning project files.

Detection Rules:

File PatternStackFramework
*.csproj.NETASP.NET Core
pyproject.toml or requirements.txt + FastAPIPythonFastAPI

Actions:

  1. Glob for *.csproj files
  2. If not found, Glob for pyproject.toml or requirements.txt
  3. If Python, check for FastAPI in dependencies
  4. Store detected stack in Context Store

Context Store Initial:

{
  "STACK": ".NET" | "Python",
  "FRAMEWORK": "ASP.NET Core" | "FastAPI",
  "PROJECT_ROOT": "/​path/​to/​project",
  "FRAMEWORK_VERSION": "8.0" | "0.109.0"
}

Phase 2: Check Existing Configuration

Scan for already configured cross-cutting concerns.

Detection Patterns:

Concern.NET PatternPython Pattern
LoggingSerilog in *.csproj, UseSerilog in Program.csstructlog in requirements, logging config
Error HandlingGlobalExceptionMiddleware, UseExceptionHandler@app.exception_handler, exception_handlers.py
CORSAddCors, UseCorsCORSMiddleware
Health ChecksAddHealthChecks, MapHealthChecks/​health routes
API DocsAddSwaggerGen, UseSwaggerFastAPI auto-generates

Actions:

  1. Grep for each pattern
  2. Mark configured concerns as skip: true
  3. Update Context Store with findings

Context Store Updated:

{
  "concerns": {
    "logging": { "configured": false },
    "errorHandling": { "configured": false },
    "cors": { "configured": true, "skip": true },
    "healthChecks": { "configured": false },
    "apiDocs": { "configured": false }
  }
}

Phase 3: Invoke Workers (Conditional)

Delegate to workers only for unconfigured concerns.

Worker Invocation Order:

OrderWorkerConditionSkill Call
1ln-771-logging-configuratorlogging.configured == false/​skill ln-771-logging-configurator
2ln-772-error-handler-setuperrorHandling.configured == false/​skill ln-772-error-handler-setup
3ln-773-cors-configuratorcors.configured == false/​skill ln-773-cors-configurator
4ln-774-healthcheck-setuphealthChecks.configured == false/​skill ln-774-healthcheck-setup
5ln-775-api-docs-generatorapiDocs.configured == false/​skill ln-775-api-docs-generator

Invocations (conditional — skip if concern already configured):

Skill(skill: "ln-771-logging-configurator", args: "{STACK} {FRAMEWORK}")
Skill(skill: "ln-772-error-handler-setup", args: "{STACK} {FRAMEWORK}")
Skill(skill: "ln-773-cors-configurator", args: "{STACK} {FRAMEWORK}")
Skill(skill: "ln-774-healthcheck-setup", args: "{STACK} {FRAMEWORK}")
Skill(skill: "ln-775-api-docs-generator", args: "{STACK} {FRAMEWORK}")

Pass Context Store to each worker.

Worker Response Format:

{
  "status": "success" | "skipped" | "error",
  "files_created": ["path/​to/​file.cs"],
  "packages_added": ["Serilog.AspNetCore"],
  "message": "Configured structured logging with Serilog"
}

Phase 4: Generate Aggregation File

Create a single entry point for all cross-cutting services.

.NET: Extensions/​ServiceExtensions.cs

Generate based on configured workers:

// Structure only - actual code generated via MCP ref
public static class ServiceExtensions
{
    public static IServiceCollection AddCrosscuttingServices(
        this IServiceCollection services,
        IConfiguration configuration)
    {
        // Calls added based on configured workers:
        // services.AddLogging(configuration);      // if ln-771 ran
        // services.AddCorsPolicy(configuration);   // if ln-773 ran
        // services.AddHealthChecks();              // if ln-774 ran
        // services.AddSwaggerServices();           // if ln-775 ran
        return services;
    }
}

Python: middleware/​__init__.py

Generate based on configured workers:

# Structure only - actual code generated via MCP ref
def configure_middleware(app):
    # Middleware added based on configured workers:
    # configure_logging(app)        # if ln-771 ran
    # configure_error_handlers(app) # if ln-772 ran
    # configure_cors(app)           # if ln-773 ran
    # configure_health_routes(app)  # if ln-774 ran
    pass

Phase 5: Summary Report

Display summary of all configured concerns.

Output Format:

Cross-cutting Setup Complete
============================
Stack: .NET (ASP.NET Core 8.0)

Configured:
  ✓ Logging (Serilog) - Extensions/​LoggingExtensions.cs
  ✓ Error Handling - Middleware/​GlobalExceptionMiddleware.cs
  ✓ CORS - Extensions/​CorsExtensions.cs
  ✓ Health Checks - Extensions/​HealthCheckExtensions.cs
  ✓ API Docs (Swagger) - Extensions/​SwaggerExtensions.cs

Skipped (already configured):
  - None

Entry Point: Extensions/​ServiceExtensions.cs
  Add to Program.cs: builder.Services.AddCrosscuttingServices(builder.Configuration);

Packages to Install:
  dotnet add package Serilog.AspNetCore
  dotnet add package Swashbuckle.AspNetCore

Workers

WorkerPurposeStacks
ln-771-logging-configuratorStructured logging.NET (Serilog), Python (structlog)
ln-772-error-handler-setupGlobal exception middleware.NET, Python
ln-773-cors-configuratorCORS policy configuration.NET, Python
ln-774-healthcheck-setup/​health endpoints.NET, Python
ln-775-api-docs-generatorSwagger/​OpenAPI.NET (Swashbuckle), Python (FastAPI built-in)

Context Store Interface

Workers receive and return via Context Store:

Input to Workers:

{
  "STACK": ".NET",
  "FRAMEWORK": "ASP.NET Core",
  "FRAMEWORK_VERSION": "8.0",
  "PROJECT_ROOT": "/​path/​to/​project",
  "ENVIRONMENT": "Development"
}

Output from Workers:

{
  "status": "success",
  "files_created": [],
  "packages_added": [],
  "registration_code": "services.AddLogging(configuration);"
}

Idempotency

This skill is idempotent:

  • Phase 2 detects existing configuration
  • Workers skip if already configured
  • Aggregation file preserves existing entries

Critical Rules

  • Skip already configured concerns — Phase 2 detection must gate worker invocation (set skip: true)
  • Pass Context Store to every worker — workers depend on STACK, FRAMEWORK, PROJECT_ROOT
  • Generate aggregation file only for workers that ran — do not add registration calls for skipped concerns
  • Support only .NET and Python — detect via *.csproj or pyproject.toml/requirements.txt + FastAPI
  • Idempotent execution — re-running must not duplicate configs or break existing setup

TodoWrite format (mandatory):

- Detect project stack (in_progress)
- Check existing configuration (pending)
- Invoke ln-771-logging-configurator (pending)
- Invoke ln-772-error-handler-setup (pending)
- Invoke ln-773-cors-configurator (pending)
- Invoke ln-774-healthcheck-setup (pending)
- Invoke ln-775-api-docs-generator (pending)
- Generate aggregation file (pending)
- Summary report (pending)

Worker Invocation (MANDATORY)

PhaseWorkerContext
3ln-771-logging-configuratorShared (Skill tool) — structured logging setup
3ln-772-error-handler-setupShared (Skill tool) — global exception middleware
3ln-773-cors-configuratorShared (Skill tool) — CORS policy configuration
3ln-774-healthcheck-setupShared (Skill tool) — /​health endpoints
3ln-775-api-docs-generatorShared (Skill tool) — Swagger/​OpenAPI docs

All workers: Invoke via Skill tool — workers see coordinator context.

Definition of Done

  • Project stack detected and stored in Context Store
  • Existing configurations detected (Phase 2 complete)
  • All unconfigured concerns delegated to workers (ln-771 through ln-775)
  • Aggregation entry point generated (ServiceExtensions.cs or middleware/​__init__.py)
  • Summary report displayed with configured/​skipped concerns and package install commands

Reference Files

  • Worker skills: ln-771-logging-configurator/​SKILL.md through ln-775-api-docs-generator/​SKILL.md
  • references/​logging_patterns.md — structured logging patterns per stack (passed to ln-771)
  • references/​error_handling_patterns.md — global exception handling patterns (passed to ln-772)
  • references/​cors_configuration.md — CORS dev/​prod policies per stack (passed to ln-773)

Phase 6: Meta-Analysis

MANDATORY READ: Load shared/​references/​meta_analysis_protocol.md

Skill type: execution-orchestrator. Run after all phases complete. Output to chat using the execution-orchestrator format.


Version: 2.0.0 Last Updated: 2026-01-10

More skills from boisenoise

database-cloud-optimization-cost-optimize logo
boisenoise/skills-collections

database-cloud-optimization-cost-optimize

You are a cloud cost optimization expert specializing in reducing infrastructure expenses while maintaining performance and reliability. Analyze cloud spending, identify savings opportunities, and implement cost-effective architectures across AWS, Azure, and GCP.

10 0
View
postmark-automation logo
boisenoise/skills-collections

postmark-automation

Automate Postmark email delivery tasks via Rube MCP (Composio): send templated emails, manage templates, monitor delivery stats and bounces. Always search tools first for current schemas.

10 0
View
game-development logo
boisenoise/skills-collections

game-development

Game development orchestrator. Routes to platform-specific skills based on project needs.

10 0
View
test-fixing logo
boisenoise/skills-collections

test-fixing

Systematically identify and fix all failing tests using smart grouping strategies. Use when explicitly asks to fix tests (\"fix these tests\", \"make tests pass\"), reports test failures (\"tests are failing\", \"test suite is broken\"), or completes implementation and wants tests passing.

10 0
View
notebooklm logo
boisenoise/skills-collections

notebooklm

Interact with Google NotebookLM to query documentation with Gemini's source-grounded answers. Each question opens a fresh browser session, retrieves the answer exclusively from your uploaded documents, and closes.

10 0
View
agent-evaluation logo
boisenoise/skills-collections

agent-evaluation

Testing and benchmarking LLM agents including behavioral testing,

10 0
View
clickup-automation logo
boisenoise/skills-collections

clickup-automation

Automate ClickUp project management including tasks, spaces, folders, lists, comments, and team operations via Rube MCP (Composio). Always search tools first for current schemas.

10 0
View
wordpress-penetration-testing logo
boisenoise/skills-collections

wordpress-penetration-testing

Assess WordPress installations for common vulnerabilities and WordPress 7.0 attack surfaces.

10 0
View
ln-761-secret-scanner logo
boisenoise/skills-collections

ln-761-secret-scanner

Scans codebase for hardcoded secrets with severity classification and remediation guidance. Use when auditing a project for leaked credentials.

10 0
View
azure-monitor-ingestion-java logo
boisenoise/skills-collections

azure-monitor-ingestion-java

Azure Monitor Ingestion SDK for Java. Send custom logs to Azure Monitor via Data Collection Rules (DCR) and Data Collection Endpoints (DCE).

10 0
View
ln-513-agent-reviewer logo
boisenoise/skills-collections

ln-513-agent-reviewer

Runs parallel external agent reviews (Codex + Gemini) on code changes. Process-as-arrive, critical verification with debate. Returns filtered suggestions.

10 0
View
drip-jobs-automation logo
boisenoise/skills-collections

drip-jobs-automation

Automate Drip Jobs tasks via Rube MCP (Composio). Always search tools first for current schemas.

10 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View