Index of every page on this site: llms.txt
All skills
akdevsaha-dev avatar

/implement-feature

@ce26f0a
Run it yourself

Implement a feature or behavior change in an existing codebase like a senior engineer. Inspects similar code first, reuses what exists, follows project conventions, adds meaningful tests, runs the project's checks, and reviews its own diff. Use when asked to implement, add, build, or extend a feature, endpoint, page, component, or workflow in an existing project.

Use this Skill: https://skilld.dev/gh/akdevsaha-dev/factory-skills/implement-feature

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencessecurity.md

≈1.6k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Security and reliability

Read this when the feature touches a trust boundary. Apply only the sections the feature needs, in proportion to the risk. Use the project's existing mechanisms (validation library, auth middleware, rate limiter, error handler) rather than building new ones.

To add authentication to a project that has none, use the init-auth skill if it is available.

Which sections apply

If the feature... Read
Accepts input from users, clients, files, webhooks, or other services Input
Reads or changes data that belongs to a user or tenant Authorization, Data access
Writes several related records, or can run concurrently Data access
Returns data or errors to a client Output and errors
Handles secrets, tokens, or personal data Secrets and personal data
Calls external services, or receives webhooks External services
Moves money, sends messages, or performs other actions that must not repeat External services, Data access
Accepts uploads or reads files by name Files
Renders user-provided content or redirects users Frontend and redirects
Exposes expensive or abuse-prone operations Abuse

Input

  • Treat everything from outside the process as untrusted: request bodies, query strings, path parameters, headers, cookies, files, webhooks, messages from queues, and responses from other services.
  • Validate at the boundary with the project's validation library. Check type, format, length, range, and allowed values.
  • Reject unknown fields where the project's validation allows it, so fields such as role, ownerId, or isAdmin cannot be mass-assigned.
  • Never build SQL, shell commands, file paths, regular expressions, or HTML by concatenating input. Use parameterized queries, argument arrays, and the framework's escaping.

Authorization

  • Enforce authorization on the server for every entry point the feature adds: routes, server actions, RPC methods, background jobs, and webhooks. Hiding a button is not access control.
  • Get the current user and tenant from the verified session or token, never from the request body or query.
  • Scope queries by owner or tenant in the query itself (WHERE id = $1 AND owner_id = $2), not by fetching and comparing afterwards. This prevents IDOR.
  • Follow the project's convention for denied access: 404 for resources the caller should not know exist, 403 for actions they may not perform.
  • Use the existing permission helpers. Do not invent a parallel permission system.

Data access

  • Use parameterized queries or the ORM's query builder. Raw SQL only with bound parameters.
  • Wrap related writes in a transaction, so a partial failure cannot leave inconsistent data.
  • Avoid check-then-act races (read, check, then write). Use a unique constraint, a conditional update (UPDATE ... WHERE status = 'pending'), an upsert, or a row lock, and handle the conflict.
  • Paginate or limit queries that can return unbounded results.
  • Avoid N+1 queries in lists. Use the ORM's eager loading or a batched query.

Output and errors

  • Return only the fields the client needs. Do not serialize ORM entities or internal objects directly when they include sensitive fields.
  • Never expose stack traces, SQL errors, internal IDs that should be hidden, or third-party error messages. Log them on the server and return the project's generic error format.
  • Keep responses for "not found" and "not allowed" consistent with the project's convention, so they do not leak which records exist.

Secrets and personal data

  • Secrets come from the project's config module, never hard-coded, and never in client-exposed environment variables (NEXT_PUBLIC_, VITE_, and similar).
  • Never log secrets, tokens, passwords, full card numbers, or authorization headers. Log personal data only as far as the project already does.
  • Do not put tokens or personal data in URLs; they end up in logs and browser history.
  • Add new environment variables to the config validation and to .env.example with placeholder values.

External services

  • Set timeouts on every outbound call. Use the project's HTTP client if it has one.
  • Retry only idempotent operations, with a bounded number of attempts and backoff. Never retry a non-idempotent write blindly.
  • For payments, emails, and other actions that must not repeat, use idempotency keys or a stored record of completed work, so a retry or a double click does not repeat the action.
  • Verify webhook signatures with the provider's documented method before trusting the payload, and handle duplicate and out-of-order deliveries.
  • Decide what the user sees when the service is down, and handle that state.

Files

  • Validate size and type on the server. Do not trust the client's file name or MIME type.
  • Never build a file path from user input without normalizing it and confirming it stays inside the intended directory.
  • Store uploads outside the web root or in object storage, with generated names.

Frontend and redirects

  • Do not render untrusted HTML (dangerouslySetInnerHTML, v-html, innerHTML) unless it is sanitized with a maintained sanitizer.
  • Validate redirect targets from input against an allow-list or same-origin paths, to prevent open redirects.
  • Keep authorization decisions on the server; client checks are only for user experience.

Abuse

  • Apply the project's rate limiting to endpoints that send email or SMS, call paid services, perform expensive work, or accept login-like guesses.
  • Bound the size of inputs that drive work (batch sizes, page sizes, upload sizes).

Review checklist

Use this in the self-review when this file applied:

  • Every new entry point validates input and checks authorization on the server
  • Data queries are scoped to the caller's user or tenant
  • No string-built SQL, shell commands, paths, or HTML from input
  • Related writes are transactional; concurrent requests cannot corrupt state
  • Responses and errors expose nothing internal or sensitive
  • No secrets or sensitive data in code, logs, URLs, or client bundles
  • External calls have timeouts; retries are safe; repeated actions are idempotent

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts9d3 checks · Risk SAFE
  • Gen Agent Trust Hub9d

    The skill provides a structured workflow for implementing features in codebases, including comprehensive security and quality guidelines for the agent to follow. The primary security concern is a surface for indirect prompt injection, as the skill explicitly instructs the agent to follow instructions found within the target codebase (e.g., AGENTS.md), which could be used to override the agent's behavior if the codebase is malicious. It also executes shell commands defined by the project's own configuration for testing and building.

  • Socket9d

    No alerts

  • Snyk9d

    Risk: LOW · No issues

Signed by skilld at ce26f0a. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 2 weeks ago

README badge

README badge for akdevsaha-dev/factory-skills/implement-feature