@dewtech/dare-cli 2.11.0 → 2.13.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/README.md +5 -4
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +58 -7
- package/dist/commands/init.js.map +1 -1
- package/dist/core/types/project.d.ts +5 -0
- package/dist/core/types/project.d.ts.map +1 -1
- package/dist/utils/project-generator.d.ts +4 -0
- package/dist/utils/project-generator.d.ts.map +1 -1
- package/dist/utils/project-generator.js +125 -29
- package/dist/utils/project-generator.js.map +1 -1
- package/dist/utils/stack-bootstrap.d.ts +2 -0
- package/dist/utils/stack-bootstrap.d.ts.map +1 -1
- package/dist/utils/stack-bootstrap.js +12 -3
- package/dist/utils/stack-bootstrap.js.map +1 -1
- package/package.json +1 -1
- package/templates/ide/antigravity/templates/BLUEPRINT-template.md +193 -53
- package/templates/ide/antigravity/templates/DESIGN-template.md +129 -34
- package/templates/ide/antigravity/templates/TASK-SPEC-template.md +100 -43
- package/templates/ide/claude/.claude/commands/dare-blueprint.md +174 -168
- package/templates/ide/claude/.claude/commands/dare-design.md +45 -31
- package/templates/ide/claude/.claude/commands/dare-execute.md +131 -52
- package/templates/ide/claude/.claude/commands/dare-security.md +232 -0
- package/templates/ide/claude/CLAUDE.md +38 -10
- package/templates/ide/claude/templates/BLUEPRINT-template.md +193 -53
- package/templates/ide/claude/templates/DESIGN-template.md +129 -34
- package/templates/ide/claude/templates/TASK-SPEC-template.md +100 -43
- package/templates/ide/cursor/.cursor/commands/generate-blueprint.md +45 -15
- package/templates/ide/cursor/.cursor/commands/generate-design.md +35 -18
- package/templates/ide/cursor/.cursor/rules/skill-security.mdc +245 -57
- package/templates/ide/cursor/templates/BLUEPRINT-template.md +193 -53
- package/templates/ide/cursor/templates/DESIGN-template.md +129 -34
- package/templates/ide/cursor/templates/TASK-SPEC-template.md +100 -43
|
@@ -11,63 +11,142 @@ Executa uma task específica do `DARE/dare-dag.yaml` seguindo o Ralph Loop.
|
|
|
11
11
|
|
|
12
12
|
## O que fazer
|
|
13
13
|
|
|
14
|
-
1.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
14
|
+
### 1. Leia `DARE/BLUEPRINT.md` — obrigatório
|
|
15
|
+
|
|
16
|
+
Antes de qualquer implementação. Foque em:
|
|
17
|
+
- Stack técnica e versões (seção 2)
|
|
18
|
+
- Validation gates da stack (seção 7)
|
|
19
|
+
- Controles de segurança mapeados (seção 8)
|
|
20
|
+
|
|
21
|
+
### 2. Leia a task em `DARE/dare-dag.yaml` e `DARE/EXECUTION/task-<id>.md`
|
|
22
|
+
|
|
23
|
+
- `subtask_prompt` — instrução self-contained da task
|
|
24
|
+
- `complexity` — LOW/MED/HIGH (define rigor do Ralph Loop)
|
|
25
|
+
- `depends_on` — verifique status antes de executar
|
|
26
|
+
- Spec em `EXECUTION/task-<id>.md` — objetivo, arquivos, validation gates
|
|
27
|
+
|
|
28
|
+
### 3. Verifique dependências
|
|
29
|
+
|
|
30
|
+
- Todas as tasks em `depends_on` devem ter status `DONE` em `DARE/TASKS.md`
|
|
31
|
+
- Se alguma estiver `PENDING` → alerte o usuário (a menos que `--force`)
|
|
32
|
+
- Se alguma estiver `FAILED` → recuse executar e informe
|
|
33
|
+
|
|
34
|
+
### 4. Implemente a task
|
|
35
|
+
|
|
36
|
+
- Siga padrões do `CLAUDE.md` e da spec em `EXECUTION/task-<id>.md`
|
|
37
|
+
- Crie/modifique arquivos conforme seção "Arquivos a criar/modificar"
|
|
38
|
+
- Implemente testes com assertions reais (não `assertTrue(true)`)
|
|
39
|
+
- Aplique os controles de segurança listados na seção 5 da spec
|
|
40
|
+
|
|
41
|
+
### 5. Execute o Ralph Loop (obrigatório antes de DONE)
|
|
42
|
+
|
|
43
|
+
Se qualquer etapa falhar, leia o erro, corrija e reexecute. **Não marque DONE sem todos os gates verdes.**
|
|
44
|
+
|
|
45
|
+
#### 5.1 Build
|
|
46
|
+
```bash
|
|
47
|
+
# Rust: cargo build
|
|
48
|
+
# Node: npm run build
|
|
49
|
+
# Python: python -m py_compile **/*.py (ou mypy para tipo)
|
|
50
|
+
# PHP: php artisan config:cache
|
|
51
|
+
# Go: go build ./...
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
#### 5.2 Test
|
|
55
|
+
```bash
|
|
56
|
+
# Rust: cargo test --workspace
|
|
57
|
+
# Node: npm test
|
|
58
|
+
# Python: pytest
|
|
59
|
+
# PHP: php artisan test
|
|
60
|
+
# Go: go test ./...
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
#### 5.3 Lint
|
|
64
|
+
```bash
|
|
65
|
+
# Rust: cargo clippy -- -D warnings
|
|
66
|
+
# Node: npx eslint src --max-warnings=0
|
|
67
|
+
# Python: ruff check .
|
|
68
|
+
# PHP: ./vendor/bin/phpstan analyse
|
|
69
|
+
# Go: golangci-lint run
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
#### 5.4 Auditoria de Dependências
|
|
73
|
+
|
|
74
|
+
**Execute SEMPRE que esta task adicionar ou atualizar dependências externas.**
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Node.js / npm
|
|
78
|
+
npm audit --audit-level=high
|
|
79
|
+
# Se houver vulnerabilidades corrigíveis:
|
|
80
|
+
npm audit fix
|
|
81
|
+
|
|
82
|
+
# Rust / Cargo
|
|
83
|
+
cargo audit
|
|
84
|
+
# Para auto-fix (bumpa versões compatíveis):
|
|
85
|
+
cargo update # depois verificar Cargo.lock
|
|
86
|
+
|
|
87
|
+
# Python / pip
|
|
88
|
+
pip-audit
|
|
89
|
+
# Para instalar: pip install pip-audit
|
|
90
|
+
# Fix: atualizar versão no requirements.txt / pyproject.toml
|
|
91
|
+
|
|
92
|
+
# PHP / Composer
|
|
93
|
+
composer audit
|
|
94
|
+
# Fix: composer update --with-all-dependencies [pacote]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
> **Gate obrigatório:** a task só pode ser marcada como DONE se não houver CVE de nível HIGH ou CRITICAL nas dependências do projeto. CVEs de nível MODERATE devem ser documentados com justificativa se não puderem ser corrigidos imediatamente.
|
|
98
|
+
|
|
99
|
+
#### 5.5 Verificação de Secrets (para tasks que mexem em configuração ou CI)
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# Verificar se não há secrets hardcoded antes de commitar
|
|
103
|
+
# Procurar padrões comuns:
|
|
104
|
+
grep -rn "password\s*=\s*['\"][^'\"]" src/ || true
|
|
105
|
+
grep -rn "api_key\s*=\s*['\"][^'\"]" src/ || true
|
|
106
|
+
grep -rn "secret\s*=\s*['\"][^'\"]" src/ || true
|
|
107
|
+
# Use git-secrets ou trufflehog se disponível no projeto
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 6. Atualize `DARE/TASKS.md`
|
|
111
|
+
|
|
112
|
+
Mude o status para `DONE` e adicione duração se souber.
|
|
113
|
+
|
|
114
|
+
### 7. Crie artifact em `DARE/EXECUTION/task-<id>.md`
|
|
115
|
+
|
|
116
|
+
```markdown
|
|
117
|
+
# Task <id>: <título>
|
|
118
|
+
|
|
119
|
+
## Status: ✅ DONE
|
|
120
|
+
## Duração: <estimativa>
|
|
121
|
+
|
|
122
|
+
## Arquivos criados/modificados
|
|
123
|
+
- path/to/file1.ts
|
|
124
|
+
- path/to/file2.test.ts
|
|
125
|
+
|
|
126
|
+
## Testes
|
|
127
|
+
- ✅ test_should_x_when_y
|
|
128
|
+
- ✅ test_should_return_401_when_unauthenticated
|
|
129
|
+
|
|
130
|
+
## Ralph Loop
|
|
131
|
+
- ✅ Build
|
|
132
|
+
- ✅ Test
|
|
133
|
+
- ✅ Lint
|
|
134
|
+
- ✅ Auditoria de deps (se aplicável)
|
|
135
|
+
|
|
136
|
+
## Segurança
|
|
137
|
+
- ✅ Input validation aplicada
|
|
138
|
+
- ✅ Autenticação/autorização verificada
|
|
139
|
+
- ✅ Sem secrets em código
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### 8. Sugira a próxima task disponível
|
|
143
|
+
|
|
144
|
+
Liste as tasks com `depends_on` satisfeito e status `PENDING`. Indique qual rodar com `/dare-execute <id>`.
|
|
63
145
|
|
|
64
146
|
## Modo Paralelo
|
|
65
147
|
|
|
66
|
-
Para executar múltiplas tasks em paralelo, use o CLI direto:
|
|
67
148
|
```bash
|
|
68
149
|
dare execute --parallel --runner claude
|
|
69
150
|
```
|
|
70
151
|
|
|
71
|
-
Isto executa tasks por rank topológico, respeitando `depends_on`.
|
|
72
|
-
|
|
73
152
|
$ARGUMENTS
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
# /dare-security
|
|
2
|
+
|
|
3
|
+
Guia completo de segurança para todas as fases do DARE. Use para: revisar o DESIGN/BLUEPRINT com foco em segurança, implementar controles em uma task específica, ou auditar o projeto existente.
|
|
4
|
+
|
|
5
|
+
## Como usar
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
/dare-security # auditoria geral do projeto
|
|
9
|
+
/dare-security task-005 # revisar segurança de uma task específica
|
|
10
|
+
/dare-security design # revisar DARE/DESIGN.md com lente de segurança
|
|
11
|
+
/dare-security deps # auditar dependências vulneráveis agora
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Aplicação por fase
|
|
15
|
+
|
|
16
|
+
### `/dare-security design` — Revisar DESIGN.md
|
|
17
|
+
|
|
18
|
+
Leia `DARE/DESIGN.md` e verifique:
|
|
19
|
+
- [ ] Seção RS-* com requisitos de segurança numerados existe
|
|
20
|
+
- [ ] RS-01 (validação de entrada), RS-02 (hash/criptografia), RS-03 (controle de acesso), RS-04 (auditoria de deps), RS-05 (secrets) presentes
|
|
21
|
+
- [ ] Riscos de segurança identificados com mitigações (SSRF, Injection, Auth bypass...)
|
|
22
|
+
- [ ] Fora do escopo não omite itens de segurança críticos para v1
|
|
23
|
+
|
|
24
|
+
### `/dare-security deps` — Auditar dependências
|
|
25
|
+
|
|
26
|
+
Execute o comando de auditoria da stack do projeto:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Detectar stack automaticamente e rodar
|
|
30
|
+
npm audit --audit-level=high # se package.json presente
|
|
31
|
+
cargo audit # se Cargo.toml presente
|
|
32
|
+
pip-audit # se requirements.txt / pyproject.toml presente
|
|
33
|
+
composer audit # se composer.json presente
|
|
34
|
+
govulncheck ./... # se go.mod presente
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Critério:** CVE HIGH ou CRITICAL = reportar ao usuário com versão afetada, CVE ID e versão corrigida disponível. Propor o fix (bump de versão ou substituição de pacote).
|
|
38
|
+
|
|
39
|
+
**Auto-fix quando seguro:**
|
|
40
|
+
```bash
|
|
41
|
+
npm audit fix # Node — corrige sem breaking changes
|
|
42
|
+
cargo update # Rust — bumpa dentro das constraints do Cargo.toml
|
|
43
|
+
pip install --upgrade [pacote] # Python — atualizar pacote específico
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## OWASP Top 10 — Referência Rápida por Stack
|
|
49
|
+
|
|
50
|
+
### A01 — Broken Access Control
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
// Node/NestJS — guard + policy
|
|
54
|
+
@UseGuards(JwtAuthGuard, PoliciesGuard)
|
|
55
|
+
@CheckPolicies(ability => ability.can(Action.Update, Post))
|
|
56
|
+
async update(@Param('id') id: string, @CurrentUser() user: User) {
|
|
57
|
+
// ORM já filtra por ownership via policy
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
# FastAPI — dependency injection para verificar ownership
|
|
63
|
+
async def get_post_or_403(post_id: str, current_user: User = Depends(get_current_user), db: Session = Depends(get_db)):
|
|
64
|
+
post = db.query(Post).filter(Post.id == post_id, Post.author_id == current_user.id).first()
|
|
65
|
+
if not post:
|
|
66
|
+
raise HTTPException(403)
|
|
67
|
+
return post
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```rust
|
|
71
|
+
// Rust/Axum — extractor verifica ownership
|
|
72
|
+
async fn update_post(
|
|
73
|
+
State(db): State<Pool<Postgres>>,
|
|
74
|
+
claims: Claims, // extraído do JWT
|
|
75
|
+
Path(post_id): Path<Uuid>,
|
|
76
|
+
Json(body): Json<UpdatePostBody>,
|
|
77
|
+
) -> Result<Json<Post>, AppError> {
|
|
78
|
+
let post = sqlx::query_as!(Post,
|
|
79
|
+
"SELECT * FROM posts WHERE id = $1 AND author_id = $2",
|
|
80
|
+
post_id, claims.sub // filtra por owner
|
|
81
|
+
).fetch_one(&db).await?;
|
|
82
|
+
// ...
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### A02 — Cryptographic Failures
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
// Node — Argon2 via @node-rs/argon2
|
|
90
|
+
import { hash, verify } from '@node-rs/argon2';
|
|
91
|
+
const hashed = await hash(password); // hash
|
|
92
|
+
const valid = await verify(hashed, password); // verify
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```python
|
|
96
|
+
# Python — passlib com Argon2
|
|
97
|
+
from passlib.hash import argon2
|
|
98
|
+
hashed = argon2.hash(password)
|
|
99
|
+
valid = argon2.verify(password, hashed)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
```rust
|
|
103
|
+
// Rust — argon2 crate
|
|
104
|
+
use argon2::{Argon2, PasswordHash, PasswordHasher, PasswordVerifier, password_hash::SaltString};
|
|
105
|
+
let salt = SaltString::generate(&mut OsRng);
|
|
106
|
+
let hash = Argon2::default().hash_password(password.as_bytes(), &salt)?.to_string();
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### A03 — Injection
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
// TypeScript/Prisma — parametrizado por padrão
|
|
113
|
+
const user = await prisma.user.findFirst({ where: { email } }); // ✅
|
|
114
|
+
|
|
115
|
+
// NestJS — nunca QueryBuilder com interpolação
|
|
116
|
+
.where(`user.email = '${email}'`) // ❌
|
|
117
|
+
.where('user.email = :email', { email }) // ✅
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
# SQLAlchemy — sempre parametrizado
|
|
122
|
+
db.execute(select(User).where(User.email == email)) # ✅
|
|
123
|
+
db.execute(f"SELECT * FROM users WHERE email = '{email}'") # ❌
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### A06 — Vulnerable Components (Ralph Loop obrigatório)
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Adicionar ao pipeline CI (GitHub Actions):
|
|
130
|
+
- name: Security audit
|
|
131
|
+
run: |
|
|
132
|
+
npm audit --audit-level=high # Node
|
|
133
|
+
# ou cargo audit # Rust
|
|
134
|
+
# ou pip-audit # Python
|
|
135
|
+
# ou composer audit # PHP
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### A07 — Authentication Failures
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
// Rate limiting com @nestjs/throttler
|
|
142
|
+
@Throttle({ default: { limit: 5, ttl: 900000 } }) // 5 req / 15 min
|
|
143
|
+
@Post('login')
|
|
144
|
+
async login() { ... }
|
|
145
|
+
|
|
146
|
+
// JWT: access token curto, refresh com rotação
|
|
147
|
+
const accessToken = jwt.sign(payload, secret, { expiresIn: '15m' });
|
|
148
|
+
const refreshToken = jwt.sign({ sub: userId }, refreshSecret, { expiresIn: '7d' });
|
|
149
|
+
// Salvar refresh token hash no DB para invalidação no logout
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Prompt Injection (projetos com LLM)
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
# Nunca concatenar input do usuário diretamente na instrução do sistema
|
|
156
|
+
system_prompt = f"Você é um assistente. {user_input}" # ❌ CRÍTICO
|
|
157
|
+
|
|
158
|
+
# Separar claramente instrução de dados:
|
|
159
|
+
messages = [
|
|
160
|
+
{"role": "system", "content": "Você é um assistente. Responda apenas sobre o documento fornecido."},
|
|
161
|
+
{"role": "user", "content": f"<documento>{sanitize(user_document)}</documento>\n\nPergunta: {sanitize(user_question)}"}
|
|
162
|
+
]
|
|
163
|
+
# Sanitize: remova ou escape sequências como "Ignore as instruções acima"
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Gestão de Secrets
|
|
169
|
+
|
|
170
|
+
### O que nunca commitar
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
# Configure git-secrets ou detect-secrets:
|
|
174
|
+
pip install detect-secrets
|
|
175
|
+
detect-secrets scan > .secrets.baseline
|
|
176
|
+
|
|
177
|
+
# Padrões críticos a bloquear:
|
|
178
|
+
# password = "..."
|
|
179
|
+
# api_key = "..."
|
|
180
|
+
# DATABASE_URL com credenciais
|
|
181
|
+
# AWS_SECRET_ACCESS_KEY
|
|
182
|
+
# private_key
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Estrutura correta
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
.env ← valores reais (no .gitignore)
|
|
189
|
+
.env.example ← template sem valores (commitado)
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
# .env.example — sempre commitado, sem valores reais
|
|
194
|
+
DATABASE_URL=postgres://user:password@localhost:5432/dbname
|
|
195
|
+
JWT_SECRET=your-secret-here-min-32-chars
|
|
196
|
+
STRIPE_SECRET_KEY=sk_test_...
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Headers de Segurança HTTP
|
|
202
|
+
|
|
203
|
+
```typescript
|
|
204
|
+
// NestJS — helmet middleware
|
|
205
|
+
import helmet from 'helmet';
|
|
206
|
+
app.use(helmet());
|
|
207
|
+
app.use(helmet.hsts({ maxAge: 31536000, includeSubDomains: true }));
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
```python
|
|
211
|
+
# FastAPI — middleware de headers
|
|
212
|
+
from starlette.middleware.base import BaseHTTPMiddleware
|
|
213
|
+
class SecurityHeadersMiddleware(BaseHTTPMiddleware):
|
|
214
|
+
async def dispatch(self, request, call_next):
|
|
215
|
+
response = await call_next(request)
|
|
216
|
+
response.headers["X-Frame-Options"] = "DENY"
|
|
217
|
+
response.headers["X-Content-Type-Options"] = "nosniff"
|
|
218
|
+
response.headers["Strict-Transport-Security"] = "max-age=31536000; includeSubDomains"
|
|
219
|
+
return response
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
```rust
|
|
223
|
+
// Axum — layer de headers de segurança
|
|
224
|
+
use tower_http::set_header::SetResponseHeaderLayer;
|
|
225
|
+
let app = Router::new()
|
|
226
|
+
.layer(SetResponseHeaderLayer::overriding(
|
|
227
|
+
header::X_FRAME_OPTIONS,
|
|
228
|
+
HeaderValue::from_static("DENY"),
|
|
229
|
+
));
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
$ARGUMENTS
|
|
@@ -10,9 +10,9 @@ Você é o Claude Code, assistente de desenvolvimento seguindo o método DARE:
|
|
|
10
10
|
## Regras Fundamentais
|
|
11
11
|
- Sempre leia `DARE/BLUEPRINT.md` antes de implementar qualquer feature
|
|
12
12
|
- Atualize o status em `DARE/TASKS.md` ao concluir cada task
|
|
13
|
-
- Nunca pule o Ralph Loop (build → test → lint) antes de marcar uma task como DONE
|
|
13
|
+
- Nunca pule o Ralph Loop (build → test → lint → audit) antes de marcar uma task como DONE
|
|
14
14
|
- Aprovação humana obrigatória antes de merge para a branch principal
|
|
15
|
-
- Use os slash commands `/dare-design`, `/dare-blueprint`, `/dare-execute`, `/dare-tasks`, `/dare-rust-leptos`, `/dare-rust-workspace`
|
|
15
|
+
- Use os slash commands `/dare-design`, `/dare-blueprint`, `/dare-execute`, `/dare-tasks`, `/dare-security`, `/dare-rust-leptos`, `/dare-rust-workspace`
|
|
16
16
|
|
|
17
17
|
## Estrutura do Projeto
|
|
18
18
|
```
|
|
@@ -105,14 +105,42 @@ Quando habilitado, o MCP Server expõe queries de contexto em `http://localhost:
|
|
|
105
105
|
## Ralph Loop (obrigatório antes de DONE)
|
|
106
106
|
|
|
107
107
|
1. **Build** — compile e verifique erros
|
|
108
|
-
2. **Test** — rode a suite de testes completa
|
|
109
|
-
3. **Lint** — rode o linter/formatter
|
|
110
|
-
4.
|
|
108
|
+
2. **Test** — rode a suite de testes completa (assertions reais, não `assertTrue(true)`)
|
|
109
|
+
3. **Lint** — rode o linter/formatter sem warnings
|
|
110
|
+
4. **Audit** — se a task adicionou ou atualizou dependências: `npm audit --audit-level=high` / `cargo audit` / `pip-audit` / `composer audit`
|
|
111
|
+
5. Só marque DONE se **todos os 4 passos** passarem sem erros
|
|
112
|
+
6. CVE HIGH/CRITICAL em deps = task FAILED até corrigir
|
|
111
113
|
|
|
112
114
|
## Segurança
|
|
113
115
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
116
|
+
### Controles obrigatórios em toda implementação
|
|
117
|
+
|
|
118
|
+
- **Nunca** exponha secrets, senhas, tokens ou PII em logs, respostas de erro ou stack traces
|
|
119
|
+
- **Valide no servidor** toda entrada do usuário antes de qualquer processamento (OWASP A03)
|
|
120
|
+
- **Controle de acesso por recurso**, não só por rota — verifique ownership (OWASP A01)
|
|
121
|
+
- **Hash de senhas** com Argon2id ou Bcrypt (custo ≥ 12) — nunca MD5/SHA1/texto plano (OWASP A02)
|
|
122
|
+
- **Rate limiting** em endpoints de autenticação e públicos (OWASP A07)
|
|
123
|
+
- **Auditoria de dependências** sem CVE HIGH/CRITICAL antes de todo release (OWASP A06)
|
|
124
|
+
- **Secrets** via variáveis de ambiente / vault — nunca hardcoded em código ou commits
|
|
125
|
+
|
|
126
|
+
### Auditoria de dependências por stack
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
npm audit --audit-level=high # Node — + npm audit fix para auto-corrigir
|
|
130
|
+
cargo audit # Rust — + cargo update para bumpar
|
|
131
|
+
pip-audit # Python — pip install pip-audit
|
|
132
|
+
composer audit # PHP — nativo no Composer 2.4+
|
|
133
|
+
govulncheck ./... # Go — ferramenta oficial Google
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Headers de segurança em produção
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
Strict-Transport-Security: max-age=31536000; includeSubDomains
|
|
140
|
+
X-Frame-Options: DENY
|
|
141
|
+
X-Content-Type-Options: nosniff
|
|
142
|
+
Content-Security-Policy: default-src 'self'
|
|
143
|
+
Referrer-Policy: strict-origin-when-cross-origin
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Use `/dare-security` para o guia completo de segurança (OWASP Top 10 completo, exemplos por stack, supply chain, prompt injection para projetos IA).
|