agentleFS
fpindejfpindej/netrock/.claude/skills/new-endpoint/SKILL.md

new-endpoint

Skill234 starsChanged 3 months agoMITView on GitHub

Add an API endpoint to an existing feature controller

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use these as starting points - fill in the specifics from context:

    line 12
  2. Distinctive:

    Check FILEMAP.md for downstream impact if modifying existing endpoints

    line 19
  3. Very specific:

    Add method to Application/Features/{Feature}/I{Feature}Service.cs

    line 24
  4. Very specific:

    Add mapper methods to WebApi/Features/{Feature}/{Feature}Mapper.cs

    line 27
  5. Very specific:

    Add controller action - include /// <summary>, [ProducesResponseType], CancellationToken

    line 28
  6. Distinctive:

    Add FluentValidation validator co-located with request DTO

    line 29
  7. Very specific:

    If a string path parameter needs format validation, add a route constraint: follow the existing IRouteConstraint implementations in …

    line 30
  8. Distinctive:

    Write tests: component test for service, API integration test for endpoint, validator test

    line 31
  9. Very specific:

    If a new project was added that WebApi references, add its .csproj COPY line to the Dockerfile restore layer - otherwise dotnet restore …

    line 35
  10. Distinctive:

    Commit type changes if applicable

    line 43

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Adds an API endpoint to an existing feature.

Infers the feature, operation, HTTP method, route, shapes, and auth from context. Asks only if multiple valid approaches exist and the tradeoffs matter.

Templates

Use these as starting points - fill in the specifics from context:

  • Controller action template
  • Validator template

Steps

  1. Determine: feature, operation name, HTTP method, route, request/response shape, auth requirements
  2. Check FILEMAP.md for downstream impact if modifying existing endpoints

Create files (match existing feature patterns - read them first):

  1. Application DTOs (if new): Application/Features/{Feature}/Dtos/{Operation}Input.cs / {Entity}Output.cs
  2. Add method to Application/Features/{Feature}/I{Feature}Service.cs
  3. Implement in Infrastructure/Features/{Feature}/Services/{Feature}Service.cs
  4. WebApi request/response DTOs (if new): WebApi/Features/{Feature}/Dtos/{Operation}/
  5. Add mapper methods to WebApi/Features/{Feature}/{Feature}Mapper.cs
  6. Add controller action - include /// <summary>, [ProducesResponseType], CancellationToken
  7. Add FluentValidation validator co-located with request DTO
    • If a string path parameter needs format validation, add a route constraint: follow the existing IRouteConstraint implementations in src/backend/MyProject.WebApi/Routing/ and register in Program.cs (options.ConstraintMap)
  8. Write tests: component test for service, API integration test for endpoint, validator test

Dockerfile:

  1. If a new project was added that WebApi references, add its .csproj COPY line to the Dockerfile restore layer - otherwise dotnet restore fails in Docker builds.

Verify and commit:

  1. dotnet build src/backend/MyProject.slnx - fix errors, loop until green
  2. dotnet test src/backend/MyProject.slnx -c Release - fix failures, loop until green
  3. Commit: feat({feature}): add {operation} endpoint
  4. Regenerate frontend types: cd src/frontend && pnpm run api:generate - fix any type errors
  5. Commit type changes if applicable

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.