Implement or scaffold a requested API endpoint using verified local architecture and an explicit request, response, error, and authorization contract. Use for endpoint work, not an unrelated framework rewrite.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Scaffold Endpoint?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/random6913-scaffold-endpoint)
---
name: scaffold-endpoint
description: Implement or scaffold a requested API endpoint using verified local architecture and an explicit request, response, error, and authorization contract. Use for endpoint work, not an unrelated framework rewrite.
user-invocable: false
tokens: 1996
---
# Scaffold Endpoint
Deliver the endpoint the user requested using the project's actual patterns. An endpoint implementation includes required wiring and business behavior; an explicitly requested scaffold may leave named gaps but is not a working endpoint. A design or review request remains read-only.
## Context and contract
Read the task, applicable project instructions, relevant architecture/API documentation, manifests, and the closest existing endpoint. Discover the stack from evidence: for example, Go `go.mod`, Node `package.json`, Python requirements/`pyproject.toml`, or Rust `Cargo.toml`. Distinguish declared dependencies from verified installed/runtime versions; do not invent framework capabilities or API versions.
Locate the actual route registration, handlers, schemas/DTOs, middleware, domain logic, data access, tests, and API documentation. Follow the reference endpoint through its wiring and dependencies rather than copying an isolated handler. Document relevant working-tree changes and preserve others' edits.
Before creating files or registering a route, establish whether the task adds a new endpoint or changes an existing one. Inspect target paths and the composed method/path/group identity for existing definitions. Resolve unintended overwrite, duplicate or shadowing conflicts against the actual router contract before writing; an explicitly authorized modification of that endpoint is not itself a collision blocker.
Establish the method/path, path/query/body shape, validation, response shape/statuses, error cases, authn/authz and resource ownership, business effect, and persistence needs. Use explicit task requirements and verified project conventions; ask a focused question when an unresolved contract changes behavior or access. Do not guess privileged access, destructive semantics, or user-visible business rules.
For each authorized tool run that could write, compare repository-root snapshots immediately before and after it, separately from intentional edits. Use the AGENTS.md side-effect procedure: `git status --short -uall`, tracked and untracked content fingerprints, and `--ignored=matching` plus targeted content checks for relevant ignored outputs. Record changes or `Side effects: not checked` with the reason if comparison is incomplete. Preserve unexpected writes for the owner.
Compare verification against a pre-change baseline where it is available and relevant. Trace new errors in unchanged callers back to changed signatures. Check ambiguous routes using the router's actual method, normalized parameter names and precedence. For authorized checks prefer the project's installed local tools; Go uses `GOTOOLCHAIN=local GOPROXY=off GONOPROXY=none` and test compilation when a build omits test callers. Python syntax checks establish syntax only. For Cargo, verify the installed toolchain, disable auto-install and network, and use `--locked` only with a tracked lockfile. Report unavailable checks explicitly. Place a new handler alongside existing resource handlers if that is the actual ownership convention and existing behavior can be preserved.
## Implement within authority
Use only the layers the actual architecture and task require. A direct route handler can be sufficient; handler/service/repository interfaces or dependency injection are not mandatory. Follow suitable constructor, context/cancellation, validation, response, and error-mapping conventions. Preserve established external contracts unless the requested change explicitly includes their revision.
- Parse and validate the required inputs and map domain failures into the agreed response contract. Place domain logic where the project expects it, with real implementations for the requested behavior.
- Wire the route into the correct group and middleware chain, including applicable authentication, authorization/ownership, and rate limits. Verify that the new route is reachable through the actual application registration.
- Implement needed persistence using the verified query/ORM conventions, parameterized inputs, appropriate transaction boundaries, null/not-found handling, and error propagation. A close precedent is evidence of style, not permission to copy an auth bypass, injection flaw, or other known unsafe behavior. Report an unsafe dependency relevant to this endpoint and modify it only within the already authorized scope. Before editing shared code, resolve any genuinely missing scope or authority decision; do not request approval again for work already authorized. Report unrelated defects separately.
- Add or update request/response schemas and the project's actual API spec/documentation location when required. Do not assume a universal documentation filename.
- If schema changes are needed, inspect the project's migration tooling and rollout/recovery convention. Author only the authorized change; do not manufacture down migrations when the project does not support them or data cannot be safely restored. A destructive or ambiguous schema change needs a resolved scope/authority decision before authoring the dependent change. Applying migrations to shared/external systems, deploying, publishing, or other external writes requires task authorization distinct from creating local code.
Do not leave placeholder business logic, SQL, or validation and then report a completed endpoint. If the user requested only scaffolding, keep stubs explicitly identifiable and list the missing implementation and verification. If a prerequisite is unavailable, finish independent authorized work and report the exact dependency; the skill name does not grant further actions.
Scaffold-only gaps in required business, validation or access logic must fail closed through the project's established not-implemented/failure contract and prevent the guarded side effect. Do not return fabricated data, success or invented access rules to make the plumbing look complete. If no safe placeholder contract is established, leave the affected behavior unavailable and report that gap. This allowance for explicit scaffolds does not excuse stubs in a requested complete implementation.
## Verify the endpoint
Use project-compatible checks to cover the applicable request/response/error contract: valid requests, invalid input, authentication/authorization and ownership denial, and relevant persistence/failure behavior. Check route wiring and business/data flow as well as isolated handler behavior. Tests must avoid unintended external side effects; do not provision or mutate shared services without authorization.
Run relevant type/build/lint checks and mandatory project gates. Reuse evidence only when its command, result, relevant code, inputs, and environment are recorded and unchanged; repeat for a relevant change or concrete uncertainty. Distinguish mocked/local tests from real integration observations. If persistence or route reachability remains unverified, say so rather than treating compilation as end-to-end proof.
Stop when the requested implementation or scaffold scope is satisfied with appropriately bounded evidence, or a named contract, authorization, or capability gap prevents completion. Do not expand into framework reorganization or an unrelated security audit.
## Output
Report the outcome and mode (implemented / scaffold-only / advisory / incomplete), method/path and agreed contract, reference endpoint and evidence paths, changed files and decisions, checks with actual results, and unimplemented/unverified parts with the next action. A scaffold-only result must state that endpoint behavior is incomplete.
State independent worker versus inline/self-review execution. Follow explicit routing; report requested or labeled configured model/effort separately from observed runtime model/effort and evidence. Use UNSPECIFIED for an absent request/default and UNVERIFIED for unavailable runtime evidence. Lack of runtime identity is a reporting limitation, not a new delivery gate.