agentleFS
madeincartelmadeincartel/claude-code-framework/skills/infrastructure-setup/SKILL.md

infrastructure-setup

Skill1 starsChanged 9 months agoMITView on GitHub

Sets up dev infrastructure for new projects: framework init, folder structure, Docker, pre-commit hooks (gitleaks), testing infrastructure, .gitignore.

  • Reads credentials

3 other projects use a version of this, 2 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. 2 are common, 1 is distinctive, and 5 are very specific to this project.

  • 2

    Common

    Most of the 3 edited versions we read keep these.

  • 1

    Distinctive

    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
  • could be automatic: a setting could enforce it
  1. Distinctive:

    If files lack needed info, search other project-knowledge references — info may exist under different names.

    line 20
  2. Very specific:

    Add src/prompts/ if project uses LLM prompts.

    line 43
  3. Very specific:

    Add framework-specific patterns from architecture.md.

    line 66
  4. Very specific:

    Create .env.example with required variable names (no values).

    line 67
  5. Very specific:

    Checkpoint: commit a file containing AKIA1234567890EXAMPLE — gitleaks blocks it.

    line 82
  6. Common:

    Checkpoint: test command passes.

    line 88
  7. Common:

    Update project-knowledge references (append, don't overwrite):

    line 92
  8. Very specific:

    Verify before commit: git status shows no .env files (only .env.example).

    line 108

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “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

Infrastructure Setup

Gathering Project Context

Read project-knowledge references:

  • .claude/skills/project-knowledge/references/architecture.md — tech stack, framework
  • .claude/skills/project-knowledge/references/patterns.md — code conventions, branching strategy, testing
  • .claude/skills/project-knowledge/references/deployment.md — deployment strategy

If files lack needed info, search other project-knowledge references — info may exist under different names. If missing entirely, ask the user and immediately update the relevant doc.

Autonomous decisions (based on project-knowledge):

  • Framework init commands, folder structure, test framework, .gitignore patterns

Ask user:

  • Docker: needed? Local dev, production, or both?
  • Pre-commit strictness: gitleaks only, or add lint/format?

Phase 1: Framework Initialization

Init framework from architecture.md. Use Context7 for up-to-date init commands and flags. Verify it starts.

Checkpoint: dev server starts successfully.

Phase 2: Folder Structure

Convention — separate concerns by purpose:

  • Web Apps: src/{components, services, lib, config} + tests/{unit, integration, e2e}
  • APIs: src/{routes, services, models, middleware, config} + tests/{unit, integration}
  • CLI tools: src/{commands, services, config} + tests/{unit, integration}

Add src/prompts/ if project uses LLM prompts. Add src/messages/ if project uses i18n.

Checkpoint: structure created, matches project type.

Phase 3: Docker (conditional)

Set up only if specified in project-knowledge or user confirms.

Checkpoint: docker build succeeds, container starts.

Phase 4: .gitignore

Security patterns (always add):

.env
.env.*
!.env.example
*.key
*.pem
credentials.json
secrets/

Add framework-specific patterns from architecture.md. Create .env.example with required variable names (no values).

Checkpoint: git check-ignore .env returns .env.

Phase 5: Pre-commit Hooks

Convention: gitleaks for secret scanning. Target: total pre-commit time under 10 seconds.

Pre-commit scope (fast, staged files only):

  • gitleaks (~2-5 seconds)
  • Lint staged files
  • Format check

Full test suites, integration tests, builds belong in CI.

Checkpoint: commit a file containing AKIA1234567890EXAMPLE — gitleaks blocks it.

Phase 6: Testing Infrastructure

Set up test framework, create smoke test: 1-2 tests verifying setup works (import main module, check environment).

Checkpoint: test command passes.

Phase 7: Documentation & Commit

Update project-knowledge references (append, don't overwrite):

  • deployment.md — required environment variables
  • patterns.md (Git Workflow section) — pre-commit hooks and what they check

Commit:

chore: setup project infrastructure

- Initialize [framework] project
- Setup pre-commit hooks (gitleaks)
- Create folder structure
- Add testing infrastructure
- Configure .gitignore and .env.example
[- Setup Docker (if applicable)]

Verify before commit: git status shows no .env files (only .env.example).

Final Validation

  • Framework runs locally
  • Folder structure matches convention
  • gitleaks blocks test secret
  • .gitignore covers .env, *.key, secrets
  • .env.example exists (if project uses env vars)
  • Smoke test passes
  • Documentation updated
  • All infrastructure committed
  • Docker works (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.