agentleFS
akdevsaha-devakdevsaha-dev/factory-skills/skills/init-backend/SKILL.md

init-backend

Skill1 starsChanged 18 days agoMITView on GitHub

Initialize a production-oriented backend project using Node.js with TypeScript, Python with FastAPI and uv, or Go. Use when the user asks to initialize, scaffold, bootstrap, or set up a backend.

  • Reads credentials

The file

Show its rules and text

We split this skill into the rules it gives an agent

24 rules. About 0 are common, 17 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈17

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check whether a backend already exists.

    line 16
  2. Distinctive:

    Never overwrite existing code without explicit approval.

    line 17
  3. Distinctive:

    If an existing backend is found, ask whether to extend it or initialize a separate directory.

    line 18
  4. Distinctive:

    If the user has not specified a stack, ask:

    line 22
  5. Distinctive:

    Do not ask again if the user's request already specifies the stack.

    line 32
  6. Very specific:

    Always generate the backend inside a backend/ directory at the root of the current working directory, even if the current directory is …

    line 36
  7. Very specific:

    Create backend/ if it does not exist.

    line 38
  8. Very specific:

    Every file in the project structure (src/, tests/, package.json, pyproject.toml, go.mod, .env.example, etc.) goes inside backend/, never at …

    line 39
  9. Very specific:

    Run all install, build, test, and startup commands from inside backend/.

    line 40
  10. Very specific:

    Only deviate from backend/ when:

    line 42
  11. Very specific:

    If the current directory is itself already named backend, use it directly instead of nesting another backend/ inside it.

    line 47
  12. Distinctive:

    Ask only when the correct destination is genuinely ambiguous.

    line 49
  13. Very specific:

    Read the selected reference and references/code-quality.md before generating files.

    line 57
  14. Distinctive:

    Create a modular architecture with:

    line 63
  15. Distinctive:

    Do not create unnecessary abstractions or empty files merely to satisfy a directory structure.

    line 73
  16. Distinctive:

    Use the selected stack's recommended package manager.

    line 93
  17. Distinctive:

    Use compatible stable package versions.

    line 99
  18. Distinctive:

    Run all relevant checks:

    line 105
  19. Distinctive:

    Do not claim a command passed unless it actually ran successfully.

    line 116
  20. Distinctive:

    If network access or permissions prevent verification, report that explicitly.

    line 118
  21. Distinctive:

    Keep HTTP handlers thin.

    line 134
  22. Distinctive:

    Put business logic in services.

    line 135
  23. Distinctive:

    Use structured error responses.

    line 139
  24. Distinctive:

    Never describe a scaffold as production-ready without verification.

    line 142

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

Initialize Backend

You are a senior backend engineer responsible for creating a clean, maintainable, production-oriented backend foundation.

Step 1: Inspect the project

Before making changes:

  1. Inspect the current working directory.
  2. Identify existing files and project conventions.
  3. Check whether a backend already exists.
  4. Never overwrite existing code without explicit approval.
  5. If an existing backend is found, ask whether to extend it or initialize a separate directory.

Step 2: Choose the technology

If the user has not specified a stack, ask:

"Which backend stack would you like to initialize?"

Options:

  1. Node.js + TypeScript + Express
  2. Python + FastAPI + uv
  3. Go + standard library HTTP server

Do not ask again if the user's request already specifies the stack.

Step 3: Determine the project location

Always generate the backend inside a backend/ directory at the root of the current working directory, even if the current directory is empty.

  • Create backend/ if it does not exist.
  • Every file in the project structure (src/, tests/, package.json, pyproject.toml, go.mod, .env.example, etc.) goes inside backend/, never at the repository root.
  • Run all install, build, test, and startup commands from inside backend/.

Only deviate from backend/ when:

  1. The user explicitly names a different directory, or
  2. The repository already has an established backend directory convention (for example server/ or apps/api/). In that case, follow the existing convention.

If the current directory is itself already named backend, use it directly instead of nesting another backend/ inside it.

Ask only when the correct destination is genuinely ambiguous.

Step 4: Read the relevant instructions

  • Node.js: references/node.md
  • Python: references/python.md
  • Go: references/go.md

Read the selected reference and references/code-quality.md before generating files.

The stack reference decides the folder structure and files. references/code-quality.md decides how the code inside them is written. This scaffold becomes the template every later feature copies, so its code must be clean, idiomatic, and easy to understand at a glance.

Step 5: Generate the project

Create a modular architecture with:

  • routes: HTTP endpoint registration
  • handlers: request and response handling
  • services: business logic
  • validators: request validation
  • config: environment and application configuration
  • middleware: shared HTTP behavior
  • tests: automated tests

Do not create unnecessary abstractions or empty files merely to satisfy a directory structure.

Step 6: Health endpoint

Implement:

GET /health

Expected HTTP status: 200

Expected JSON:

{ "status": "ok" }

The server must listen on port 8080 by default, with an environment variable override.

Step 7: Install dependencies

Use the selected stack's recommended package manager.

  • Node.js: npm
  • Python: uv
  • Go: go modules

Use compatible stable package versions.

Generate the appropriate dependency and lock files.

Step 8: Verify

Run all relevant checks:

  1. Dependency installation
  2. Formatting
  3. Linting
  4. Type checking, where applicable
  5. Automated tests
  6. Application startup
  7. HTTP health endpoint smoke test
  8. Self-review: re-read every generated file against the review checklist in references/code-quality.md, simplify what you can, and rerun the checks after any change

Do not claim a command passed unless it actually ran successfully.

If network access or permissions prevent verification, report that explicitly.

Step 9: Completion report

Report:

  • Selected stack
  • Generated directory structure
  • Installed dependencies
  • Commands to run the backend
  • Health endpoint URL
  • Tests and checks executed
  • Any remaining limitations

Engineering principles

  • Keep HTTP handlers thin.
  • Put business logic in services.
  • Validate untrusted input at system boundaries.
  • Centralize configuration.
  • Never commit secrets.
  • Use structured error responses.
  • Handle graceful shutdown.
  • Preserve existing repository conventions.
  • Never describe a scaffold as production-ready without verification.

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.