devsquad 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +117 -0
- package/bin/devsquad.js +42 -0
- package/package.json +42 -0
- package/src/init.js +119 -0
- package/templates/.claude/agents/fullcycle-software-architect.md +291 -0
- package/templates/.claude/skills/clickup/SKILL.md +75 -0
- package/templates/.claude/skills/database/SKILL.md +124 -0
- package/templates/.claude/skills/docs/SKILL.md +74 -0
- package/templates/.claude/skills/docs/templates.md +117 -0
- package/templates/.claude/skills/figma/SKILL.md +72 -0
- package/templates/.claude/skills/git/SKILL.md +92 -0
- package/templates/.claude/skills/nestjs/SKILL.md +35 -0
- package/templates/.claude/skills/nestjs/auth.md +187 -0
- package/templates/.claude/skills/nestjs/modules.md +110 -0
- package/templates/.claude/skills/nestjs/security.md +42 -0
- package/templates/.claude/skills/nestjs/setup.md +162 -0
- package/templates/.claude/skills/postman/SKILL.md +82 -0
- package/templates/.claude/skills/react/SKILL.md +53 -0
- package/templates/.claude/skills/react/setup.md +153 -0
- package/templates/.claude/skills/react-native/SKILL.md +82 -0
- package/templates/.claude/skills/react-native/setup.md +150 -0
- package/templates/.claude/skills/security/SKILL.md +80 -0
- package/templates/.claude/skills/security/owasp-full.md +66 -0
- package/templates/CLAUDE.md +65 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: clickup-tasks
|
|
3
|
+
description: Organização de projetos e criação de tasks no ClickUp vinculadas ao desenvolvimento. Use quando o desenvolvedor precisar estruturar o backlog, criar tasks para um novo projeto, definir sprints ou entender como nomear branches vinculadas a tasks.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# ClickUp — Gestão de Projetos
|
|
7
|
+
|
|
8
|
+
## Estrutura padrão por projeto
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
Space: [Nome do Projeto]
|
|
12
|
+
├── Lista: 🔧 Setup & Infraestrutura
|
|
13
|
+
├── Lista: 🔐 Autenticação
|
|
14
|
+
├── Lista: 👥 [Módulo principal]
|
|
15
|
+
├── Lista: 🎨 Frontend
|
|
16
|
+
├── Lista: 📱 Mobile (se aplicável)
|
|
17
|
+
├── Lista: 📝 Documentação
|
|
18
|
+
└── Lista: 🐛 Bugs
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Tasks do Sprint 1 — sempre as mesmas
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
🔧 Setup & Infraestrutura
|
|
25
|
+
├── [ ] Inicializar repositório Git (DevSquad) → chore/initial-setup
|
|
26
|
+
├── [ ] Configurar banco de dados → chore/database-setup
|
|
27
|
+
├── [ ] Criar .env.example → chore/environment-setup
|
|
28
|
+
└── [ ] Configurar GitHub Actions básico → ci/setup-actions
|
|
29
|
+
|
|
30
|
+
🔐 Autenticação
|
|
31
|
+
├── [ ] Implementar registro de usuário → feature/CK-{id}-user-register
|
|
32
|
+
├── [ ] Implementar login com JWT → feature/CK-{id}-jwt-login
|
|
33
|
+
├── [ ] Implementar refresh token → feature/CK-{id}-refresh-token
|
|
34
|
+
└── [ ] Implementar logout → feature/CK-{id}-logout
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Padrão de task
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
TÍTULO: [verbo infinitivo] [objeto]
|
|
41
|
+
Ex: "Implementar login com JWT"
|
|
42
|
+
|
|
43
|
+
DESCRIÇÃO:
|
|
44
|
+
## Contexto
|
|
45
|
+
[Por que essa task existe]
|
|
46
|
+
|
|
47
|
+
## Critérios de Aceitação
|
|
48
|
+
- [ ] [critério verificável]
|
|
49
|
+
- [ ] [critério verificável]
|
|
50
|
+
|
|
51
|
+
## Branch Git
|
|
52
|
+
feature/CK-{id}-{slug}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Status do fluxo
|
|
56
|
+
|
|
57
|
+
| Status | Significado |
|
|
58
|
+
|--------|-------------|
|
|
59
|
+
| Backlog | Definida, não iniciada |
|
|
60
|
+
| Em andamento | Branch criada |
|
|
61
|
+
| Em revisão | PR aberto |
|
|
62
|
+
| Bloqueada | Dependência pendente |
|
|
63
|
+
| Concluída | PR mergeado em develop |
|
|
64
|
+
|
|
65
|
+
## Vinculação Git ↔ ClickUp
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Branch com ID da task
|
|
69
|
+
git checkout -b feature/CK-42-autenticacao-jwt
|
|
70
|
+
|
|
71
|
+
# Commit que fecha a task automaticamente
|
|
72
|
+
git commit -m "feat(auth): implementar JWT login
|
|
73
|
+
|
|
74
|
+
Closes CK-42"
|
|
75
|
+
```
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: database-prisma
|
|
3
|
+
description: Modelagem, migrations e boas práticas com Prisma + PostgreSQL. Use quando o desenvolvedor precisar criar ou alterar o schema, escrever queries, criar migrations, configurar seed, implementar paginação ou soft delete.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Database — Prisma + PostgreSQL
|
|
7
|
+
|
|
8
|
+
## Schema base
|
|
9
|
+
|
|
10
|
+
```prisma
|
|
11
|
+
generator client {
|
|
12
|
+
provider = "prisma-client-js"
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
datasource db {
|
|
16
|
+
provider = "postgresql"
|
|
17
|
+
url = env("DATABASE_URL")
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
model User {
|
|
21
|
+
id String @id @default(uuid()) // UUID — não sequencial (OWASP A01)
|
|
22
|
+
email String @unique
|
|
23
|
+
password String
|
|
24
|
+
name String
|
|
25
|
+
role Role @default(USER)
|
|
26
|
+
createdAt DateTime @default(now())
|
|
27
|
+
updatedAt DateTime @updatedAt
|
|
28
|
+
deletedAt DateTime? // Soft delete
|
|
29
|
+
|
|
30
|
+
@@map("users")
|
|
31
|
+
@@index([email])
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
enum Role { ADMIN USER }
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Comandos essenciais
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx prisma migrate dev --name descricao-da-mudanca # desenvolvimento
|
|
41
|
+
npx prisma migrate deploy # produção
|
|
42
|
+
npx prisma db seed # popular banco
|
|
43
|
+
npx prisma studio # interface visual
|
|
44
|
+
npx prisma generate # regenerar client
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
> ⚠️ Nunca use `migrate dev` em produção — use `migrate deploy`.
|
|
48
|
+
|
|
49
|
+
## Padrões de query
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
// Paginação — nunca retorne findMany() sem limite
|
|
53
|
+
async findAll(page = 1, limit = 20) {
|
|
54
|
+
const [data, total] = await this.prisma.$transaction([
|
|
55
|
+
this.prisma.user.findMany({
|
|
56
|
+
skip: (page - 1) * limit,
|
|
57
|
+
take: limit,
|
|
58
|
+
where: { deletedAt: null },
|
|
59
|
+
select: { id: true, name: true, email: true, role: true },
|
|
60
|
+
orderBy: { createdAt: 'desc' },
|
|
61
|
+
}),
|
|
62
|
+
this.prisma.user.count({ where: { deletedAt: null } }),
|
|
63
|
+
]);
|
|
64
|
+
return { data, meta: { total, page, limit, totalPages: Math.ceil(total / limit) } };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Soft delete — nunca apague dados em produção
|
|
68
|
+
async remove(id: string) {
|
|
69
|
+
return this.prisma.user.update({
|
|
70
|
+
where: { id },
|
|
71
|
+
data: { deletedAt: new Date() },
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Transaction — operações atômicas
|
|
76
|
+
async createWithProfile(dto: CreateUserDto) {
|
|
77
|
+
return this.prisma.$transaction(async (tx) => {
|
|
78
|
+
const user = await tx.user.create({ data: dto });
|
|
79
|
+
await tx.profile.create({ data: { userId: user.id } });
|
|
80
|
+
return user;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Seed padrão
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
// prisma/seed.ts
|
|
89
|
+
import { PrismaClient } from '@prisma/client';
|
|
90
|
+
import * as bcrypt from 'bcrypt';
|
|
91
|
+
const prisma = new PrismaClient();
|
|
92
|
+
|
|
93
|
+
async function main() {
|
|
94
|
+
await prisma.user.upsert({
|
|
95
|
+
where: { email: 'admin@sistema.com' },
|
|
96
|
+
update: {},
|
|
97
|
+
create: {
|
|
98
|
+
email: 'admin@sistema.com',
|
|
99
|
+
password: await bcrypt.hash('Admin@123', 12),
|
|
100
|
+
name: 'Administrador',
|
|
101
|
+
role: 'ADMIN',
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
console.log('✅ Seed executado');
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
main().catch(console.error).finally(() => prisma.$disconnect());
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
```json
|
|
111
|
+
// package.json
|
|
112
|
+
{ "prisma": { "seed": "ts-node prisma/seed.ts" } }
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Checklist
|
|
116
|
+
|
|
117
|
+
- [ ] UUIDs em todos os `@id`
|
|
118
|
+
- [ ] `@@map()` com snake_case em todas as tabelas
|
|
119
|
+
- [ ] `deletedAt` nas entidades principais
|
|
120
|
+
- [ ] `createdAt` e `updatedAt` em todos os models
|
|
121
|
+
- [ ] `PrismaModule` com `@Global()` configurado
|
|
122
|
+
- [ ] Paginação em todos os `findMany()`
|
|
123
|
+
- [ ] Seed com `upsert` (idempotente)
|
|
124
|
+
- [ ] Índices nas colunas de busca frequente
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: project-docs
|
|
3
|
+
description: Templates e guias para documentação profissional de projetos. Use quando o desenvolvedor precisar criar ou atualizar README, ARCHITECTURE, CONTRIBUTING, SECURITY, PR template ou qualquer documentação do projeto.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Documentação de Projetos
|
|
7
|
+
|
|
8
|
+
## Arquivos obrigatórios por projeto
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
README.md ← Porta de entrada
|
|
12
|
+
.env.example ← Variáveis (sem valores reais)
|
|
13
|
+
docs/
|
|
14
|
+
├── ARCHITECTURE.md ← Decisões técnicas (ADRs)
|
|
15
|
+
├── CONTRIBUTING.md ← Fluxo de trabalho
|
|
16
|
+
└── SECURITY.md ← Práticas de segurança
|
|
17
|
+
.github/
|
|
18
|
+
└── pull_request_template.md ← Template de PR
|
|
19
|
+
postman/
|
|
20
|
+
└── collection.json ← Collection exportada
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## README.md — estrutura mínima
|
|
24
|
+
|
|
25
|
+
```markdown
|
|
26
|
+
# 🚀 [Nome]
|
|
27
|
+
> [Uma frase: o que faz e para quem]
|
|
28
|
+
|
|
29
|
+
## Stack
|
|
30
|
+
Backend: NestJS + Prisma + PostgreSQL
|
|
31
|
+
Frontend: React + TypeScript + TailwindCSS
|
|
32
|
+
|
|
33
|
+
## Instalação
|
|
34
|
+
[passos testados e funcionando]
|
|
35
|
+
|
|
36
|
+
## API
|
|
37
|
+
Swagger: http://localhost:3000/api/docs
|
|
38
|
+
Postman: postman/collection.json
|
|
39
|
+
|
|
40
|
+
## Licença
|
|
41
|
+
MIT © [Nome] [Ano]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## ARCHITECTURE.md — ADR padrão
|
|
45
|
+
|
|
46
|
+
```markdown
|
|
47
|
+
### ADR-001: [Título da decisão]
|
|
48
|
+
**Contexto:** [Por que foi necessário decidir]
|
|
49
|
+
**Decisão:** [O que foi decidido]
|
|
50
|
+
**Consequências:** [Ganhos e trade-offs]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## PR Template (.github/pull_request_template.md)
|
|
54
|
+
|
|
55
|
+
```markdown
|
|
56
|
+
## O que essa PR faz?
|
|
57
|
+
[Descrição objetiva]
|
|
58
|
+
|
|
59
|
+
## Task relacionada
|
|
60
|
+
Closes CK-
|
|
61
|
+
|
|
62
|
+
## Checklist
|
|
63
|
+
- [ ] Testes passando
|
|
64
|
+
- [ ] Lint sem erros
|
|
65
|
+
- [ ] .env.example atualizado (se adicionou variáveis)
|
|
66
|
+
- [ ] Postman Collection atualizada (se adicionou endpoints)
|
|
67
|
+
- [ ] Nenhum secret no código
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Arquivos detalhados desta skill
|
|
71
|
+
|
|
72
|
+
- **templates.md** — Templates completos de README, ARCHITECTURE, CONTRIBUTING, SECURITY
|
|
73
|
+
|
|
74
|
+
Leia `templates.md` para copiar os templates prontos.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Templates de documentação (copiar para o projeto)
|
|
2
|
+
|
|
3
|
+
Estes blocos são **gerados no repositório do app** (não fazem parte do pacote DevSquad). Ajuste nomes, URLs e stack.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## README.md (completo)
|
|
8
|
+
|
|
9
|
+
```markdown
|
|
10
|
+
# Nome do projeto
|
|
11
|
+
|
|
12
|
+
> Uma linha: o que o sistema faz e para quem.
|
|
13
|
+
|
|
14
|
+
## Stack
|
|
15
|
+
|
|
16
|
+
- Backend: NestJS + Prisma + PostgreSQL
|
|
17
|
+
- Frontend: React + TypeScript + Vite + TailwindCSS
|
|
18
|
+
- Auth: JWT (access + refresh)
|
|
19
|
+
|
|
20
|
+
## Pré-requisitos
|
|
21
|
+
|
|
22
|
+
- Node.js LTS
|
|
23
|
+
- PostgreSQL
|
|
24
|
+
- Variáveis: copie `.env.example` para `.env`
|
|
25
|
+
|
|
26
|
+
## Instalação
|
|
27
|
+
|
|
28
|
+
\`\`\`bash
|
|
29
|
+
# backend
|
|
30
|
+
cd backend && npm ci && npx prisma migrate dev
|
|
31
|
+
|
|
32
|
+
# frontend
|
|
33
|
+
cd frontend && npm ci && npm run dev
|
|
34
|
+
\`\`\`
|
|
35
|
+
|
|
36
|
+
## Documentação da API
|
|
37
|
+
|
|
38
|
+
- Swagger: `http://localhost:3000/api/docs`
|
|
39
|
+
- Postman: `postman/collection.json`
|
|
40
|
+
|
|
41
|
+
## Licença
|
|
42
|
+
|
|
43
|
+
MIT
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## docs/CONTRIBUTING.md
|
|
49
|
+
|
|
50
|
+
```markdown
|
|
51
|
+
# Contribuindo
|
|
52
|
+
|
|
53
|
+
## Branches
|
|
54
|
+
|
|
55
|
+
- `main` — produção
|
|
56
|
+
- `develop` — integração
|
|
57
|
+
- `feature/*`, `fix/*`, `hotfix/*` — Git Flow
|
|
58
|
+
|
|
59
|
+
## Commits
|
|
60
|
+
|
|
61
|
+
Conventional Commits: `feat:`, `fix:`, `docs:`, `chore:`.
|
|
62
|
+
|
|
63
|
+
## PR
|
|
64
|
+
|
|
65
|
+
- Descreva o que mudou e como testar
|
|
66
|
+
- Link da task (ClickUp/Jira)
|
|
67
|
+
- Sem secrets; `.env.example` atualizado se houver novas variáveis
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## docs/SECURITY.md
|
|
73
|
+
|
|
74
|
+
```markdown
|
|
75
|
+
# Segurança
|
|
76
|
+
|
|
77
|
+
- Reporte vulnerabilidades por [canal privado / email].
|
|
78
|
+
- Não abra issue pública com detalhes de exploit.
|
|
79
|
+
- Seguimos OWASP Top 10; revisões em releases importantes.
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## docs/ARCHITECTURE.md (exemplo ADR)
|
|
85
|
+
|
|
86
|
+
```markdown
|
|
87
|
+
# Arquitetura
|
|
88
|
+
|
|
89
|
+
## ADR-001: API versionada em /api/v1
|
|
90
|
+
|
|
91
|
+
**Contexto:** Precisamos evoluir contratos sem quebrar clientes legados.
|
|
92
|
+
|
|
93
|
+
**Decisão:** Prefixo global `api/v1` no NestJS; breaking changes em `/v2` no futuro.
|
|
94
|
+
|
|
95
|
+
**Consequências:** URLs mais longas; migrações de versão documentadas.
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## .github/pull_request_template.md
|
|
101
|
+
|
|
102
|
+
```markdown
|
|
103
|
+
## O que essa PR faz?
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## Task relacionada
|
|
107
|
+
|
|
108
|
+
Closes
|
|
109
|
+
|
|
110
|
+
## Checklist
|
|
111
|
+
|
|
112
|
+
- [ ] Testes passando
|
|
113
|
+
- [ ] Lint sem erros
|
|
114
|
+
- [ ] `.env.example` atualizado (se novas variáveis)
|
|
115
|
+
- [ ] Postman atualizado (se novos endpoints)
|
|
116
|
+
- [ ] Nenhum secret no código
|
|
117
|
+
```
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: figma-design
|
|
3
|
+
description: Vinculação de protótipos Figma ao desenvolvimento e extração de tokens de design para TailwindCSS. Use quando o desenvolvedor precisar conectar o design ao código, extrair cores/tipografia/espaçamentos do Figma ou estruturar um arquivo de design para um novo projeto.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Figma — Design para Desenvolvimento
|
|
7
|
+
|
|
8
|
+
## Vincular Figma ao projeto
|
|
9
|
+
|
|
10
|
+
```markdown
|
|
11
|
+
<!-- Sempre documente no README.md -->
|
|
12
|
+
## 🎨 Design
|
|
13
|
+
- Figma: [link para o arquivo]
|
|
14
|
+
- Protótipo: [link para o protótipo interativo]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Tokens de design → tailwind.config.js
|
|
18
|
+
|
|
19
|
+
```javascript
|
|
20
|
+
// Copie as cores exatas do Figma
|
|
21
|
+
module.exports = {
|
|
22
|
+
theme: {
|
|
23
|
+
extend: {
|
|
24
|
+
colors: {
|
|
25
|
+
primary: {
|
|
26
|
+
500: '#3b82f6', // cor principal
|
|
27
|
+
600: '#2563eb', // hover
|
|
28
|
+
},
|
|
29
|
+
success: '#22c55e',
|
|
30
|
+
error: '#ef4444',
|
|
31
|
+
warning: '#f59e0b',
|
|
32
|
+
},
|
|
33
|
+
fontFamily: {
|
|
34
|
+
sans: ['Inter', 'sans-serif'], // fonte do Figma
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
> 📖 Espelhar cores do Figma no Tailwind significa que quando o designer muda a paleta, você atualiza em um lugar e todos os componentes refletem a mudança.
|
|
42
|
+
|
|
43
|
+
## Tradução Figma → Tailwind
|
|
44
|
+
|
|
45
|
+
| Figma | Tailwind |
|
|
46
|
+
|-------|----------|
|
|
47
|
+
| Padding 16px | `p-4` |
|
|
48
|
+
| Padding 16px 24px | `py-4 px-6` |
|
|
49
|
+
| Gap 8px | `gap-2` |
|
|
50
|
+
| Border radius 8px | `rounded-lg` |
|
|
51
|
+
| Border radius 12px | `rounded-xl` |
|
|
52
|
+
| Font size 14px | `text-sm` |
|
|
53
|
+
| Font weight 600 | `font-semibold` |
|
|
54
|
+
|
|
55
|
+
## Checklist handoff design → código
|
|
56
|
+
|
|
57
|
+
Antes de iniciar o desenvolvimento de uma tela:
|
|
58
|
+
- [ ] Tela finalizada no Figma (não wireframe)
|
|
59
|
+
- [ ] Cores usando variáveis do Design System
|
|
60
|
+
- [ ] Estados documentados (hover, active, disabled, error, loading)
|
|
61
|
+
- [ ] Versão mobile definida (se responsivo)
|
|
62
|
+
- [ ] Link do Figma no README
|
|
63
|
+
|
|
64
|
+
## Organização do arquivo Figma
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
📄 Cover ← Thumbnail
|
|
68
|
+
📄 Design System ← Cores, tipografia, componentes
|
|
69
|
+
📄 UI — Auth ← Login, registro, recuperação
|
|
70
|
+
📄 UI — [Módulo] ← Telas de cada módulo
|
|
71
|
+
📄 Protótipo ← Fluxo interativo
|
|
72
|
+
```
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-flow
|
|
3
|
+
description: Git Flow profissional com commits semânticos, branching strategy e configuração de Husky + Commitlint. Use quando o desenvolvedor precisar inicializar o versionamento de um projeto, criar branches, fazer commits, configurar proteção de branches ou entender o fluxo de trabalho com Git.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Git Flow + Commits Semânticos
|
|
7
|
+
|
|
8
|
+
## Estrutura de branches
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
main ← produção. Nunca commite direto aqui.
|
|
12
|
+
develop ← integração. Base de todo desenvolvimento.
|
|
13
|
+
feature/* ← novas funcionalidades
|
|
14
|
+
fix/* ← correções em develop
|
|
15
|
+
hotfix/* ← urgência direto da main
|
|
16
|
+
release/* ← preparação de versão (em equipe)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Nomenclatura de branches
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
feature/CK-42-autenticacao-jwt # Com ClickUp
|
|
23
|
+
fix/CK-50-validacao-cpf # Correção
|
|
24
|
+
hotfix/CK-99-token-expirado # Urgência em produção
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Tipos de commit
|
|
28
|
+
|
|
29
|
+
| Tipo | Uso |
|
|
30
|
+
|------|-----|
|
|
31
|
+
| `feat` | Nova funcionalidade |
|
|
32
|
+
| `fix` | Correção de bug |
|
|
33
|
+
| `docs` | Documentação |
|
|
34
|
+
| `refactor` | Refatoração sem mudança de comportamento |
|
|
35
|
+
| `test` | Testes |
|
|
36
|
+
| `chore` | Manutenção, deps, configs |
|
|
37
|
+
| `ci` | CI/CD |
|
|
38
|
+
| `perf` | Performance |
|
|
39
|
+
|
|
40
|
+
## Setup inicial de um projeto
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git init
|
|
44
|
+
git add .
|
|
45
|
+
git commit -m "chore: initial project setup"
|
|
46
|
+
git checkout -b develop
|
|
47
|
+
git push -u origin develop
|
|
48
|
+
# Defina 'develop' como branch padrão no GitHub (Settings > Branches)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Husky + Commitlint (garante padrão em equipe)
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm install --save-dev @commitlint/config-conventional @commitlint/cli husky
|
|
55
|
+
npx husky init
|
|
56
|
+
echo "npx --no -- commitlint --edit \$1" > .husky/commit-msg
|
|
57
|
+
echo '{ "extends": ["@commitlint/config-conventional"] }' > commitlint.config.json
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Fluxo dia a dia
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Iniciar feature
|
|
64
|
+
git checkout develop && git pull origin develop
|
|
65
|
+
git checkout -b feature/CK-42-nome-da-feature
|
|
66
|
+
|
|
67
|
+
# Finalizar e abrir PR
|
|
68
|
+
git rebase develop
|
|
69
|
+
git push origin feature/CK-42-nome-da-feature
|
|
70
|
+
# Abre PR no GitHub targeting 'develop'
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## .gitignore essencial
|
|
74
|
+
|
|
75
|
+
```gitignore
|
|
76
|
+
node_modules/
|
|
77
|
+
dist/
|
|
78
|
+
build/
|
|
79
|
+
.env
|
|
80
|
+
.env.local
|
|
81
|
+
*.log
|
|
82
|
+
.DS_Store
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Checklist Git
|
|
86
|
+
|
|
87
|
+
- [ ] Repositório com commit inicial `chore: initial project setup`
|
|
88
|
+
- [ ] Branch `develop` criada e definida como padrão no GitHub
|
|
89
|
+
- [ ] `.gitignore` configurado (`.env` incluído)
|
|
90
|
+
- [ ] Husky + Commitlint instalados
|
|
91
|
+
- [ ] Proteção de `main` e `develop` ativa (Settings > Branch protection rules)
|
|
92
|
+
- [ ] PR template em `.github/pull_request_template.md`
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nestjs-backend
|
|
3
|
+
description: Setup e arquitetura de backend com NestJS + Prisma + PostgreSQL + JWT. Use quando o desenvolvedor precisar inicializar ou trabalhar no backend, configurar autenticação, criar módulos, guards, DTOs, ou qualquer estrutura NestJS.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# NestJS Backend
|
|
7
|
+
|
|
8
|
+
Stack: NestJS + Prisma + PostgreSQL + JWT + class-validator + helmet
|
|
9
|
+
|
|
10
|
+
## Setup rápido
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm i -g @nestjs/cli && nest new nome-do-projeto
|
|
14
|
+
cd nome-do-projeto
|
|
15
|
+
npm install prisma @prisma/client class-validator class-transformer @nestjs/config @nestjs/jwt @nestjs/passport passport passport-jwt bcrypt helmet @nestjs/throttler
|
|
16
|
+
npm install -D @types/passport-jwt @types/bcrypt
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Decisões que impactam a estrutura
|
|
20
|
+
|
|
21
|
+
| Resposta do onboarding | O que muda |
|
|
22
|
+
|------------------------|-----------|
|
|
23
|
+
| Auth social = sim | Adicionar `passport-google-oauth20` |
|
|
24
|
+
| Upload = sim | Adicionar módulo S3/Cloudinary |
|
|
25
|
+
| Pagamentos = sim | Adicionar módulo Stripe/Pagar.me |
|
|
26
|
+
| Notificações = sim | Adicionar `@nestjs-modules/mailer` |
|
|
27
|
+
|
|
28
|
+
## Arquivos detalhados desta skill
|
|
29
|
+
|
|
30
|
+
- **setup.md** — `main.ts`, `app.module.ts`, `configuration.ts` prontos
|
|
31
|
+
- **auth.md** — JWT strategy, guards, refresh token rotation, RBAC
|
|
32
|
+
- **modules.md** — padrão DDD de módulo completo (controller, service, dto, entity)
|
|
33
|
+
- **security.md** — checklist OWASP aplicado ao NestJS
|
|
34
|
+
|
|
35
|
+
Leia o arquivo correspondente à tarefa em andamento.
|