Tpl situacao setup inicial projeto

From artubss/SKILLS-CLAUDE-CODE · View interactive version

Tpl situacao setup inicial projeto is an AI agent skill from the GitHub repository artubss/SKILLS-CLAUDE-CODE. Template do pack (situacao/07-setup-inicial-projeto.md). Orienta o agente em tarefas situacionais como debug, seguranca e refactor alinhado a esse contexto.

How to use this skill

Skill file

SITUATION: New Project Setup from Scratch

Skill gerado a partir do pack templates-claude-code. Arquivo de origem: situacao/07-setup-inicial-projeto.md. Use como baseline e adapte ao projeto antes de mudancas grandes.

Conteudo do template

CONTEXT

Use this configuration when initializing a new software project — before writing any business logic. The first days of a project set patterns that persist for years. Skipping linting, testing infrastructure, or CI setup "to move faster" guarantees slower development within weeks. This session is about building the foundation correctly.

OBJECTIVES

APPROACH RULES

  1. Infrastructure before features. CI pipeline, linting, testing setup, and environment variables must be in place before any business code is committed. If CI is added later, it will keep failing until someone fixes it.
  1. Automate code style — never debate it. Choose a formatter (Prettier, Black, gofmt). Configure it. Add a pre-commit hook. The team should never spend a PR comment on formatting.
  1. 12-factor app from day one. No hardcoded configuration. Everything configurable goes in environment variables. .env.example contains keys without values. .env is gitignored forever.
  1. Git conventions from the first commit. Choose a commit message convention (Conventional Commits recommended) and enforce it with a commit-msg hook. The first commit is a great first test of the convention.
  1. Test infrastructure must run before business tests can be written. npm test / pytest / go test should run and report "0 tests, 0 failures" before you've written business tests. Blank slate, no errors.
  1. Dependency management is day-one work. Lock files committed, exact versions pinned (not ^), Renovate/Dependabot configured for automated updates.
  1. The README is the contract. A new developer should be able to read the README and have a running local environment within 30 minutes. Any step that takes longer needs documentation or automation.

ROUTING TABLE

| If you encounter | Then |

|-----------------|------|

| Missing .gitignore | Add it before any other commit. Use gitignore.io for the stack. Include: .env, node_modules/, dist/, *.log, IDE files |

| Environment config in code | Extract to .env. Create .env.example with all keys and empty values. Document each key in a comment |

| No linter configured | Add ESLint/Biome (JS/TS), Pylint/Ruff (Python), golangci-lint (Go). Run on CI. Fail build on errors. |

| No formatter configured | Add Prettier (JS/TS), Black/Ruff (Python), gofmt (Go). Add pre-commit hook. Add CI check. |

| No test runner configured | Initialize: jest --init / pytest --co / go test ./.... Confirm it runs with zero tests. |

| No CI pipeline | Create .github/workflows/ci.yml with at minimum: lint, type-check, test on push to main and on PRs |

| No pre-commit hooks | Use Husky + lint-staged (Node) or pre-commit framework (Python). Block: bad commits, failing tests |

| Secrets committed accidentally | git-filter-repo or BFG to purge. Rotate ALL secrets that touched git. Add to pre-commit hook. |

| Missing CONTRIBUTING.md | Create it with: how to set up dev environment, branch naming, commit message format, PR process |

| No logging setup | Initialize structured logger (winston, pino, structlog) from day one. Never use console.log in production. |

Project Setup Checklist

Version Control

Code Quality

Testing

Configuration & Secrets

CI/CD

Dependencies

Documentation

DO NOT

OUTPUT FORMAT

At the end of project setup, produce a Project Setup Summary:

## Project Setup Complete

### Stack
- Runtime: Node.js 20 / TypeScript 5.3
- Framework: Fastify 4
- Database: PostgreSQL 15 + Prisma ORM
- Testing: Vitest + Supertest
- Linting: ESLint + Prettier
- CI: GitHub Actions

### How to Start
1. cp .env.example .env && fill in values
2. npm install
3. npm run db:migrate
4. npm run dev → http://localhost:3000

### Conventions
- Branches: feat/, fix/, chore/, docs/
- Commits: Conventional Commits (enforced by commitlint)
- PRs: require 1 approval + all CI checks green

### What's NOT set up yet
- [ ] Staging environment
- [ ] Production deployment pipeline
- [ ] Error monitoring (Sentry)

QUALITY GATES

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.