بنقرة واحدة
forge-security
Checklist de seguranca por task/slice. Auto-invocada por keywords.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Checklist de seguranca por task/slice. Auto-invocada por keywords.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Executa o milestone inteiro de forma autonoma ate concluir.
Executa exatamente uma unidade de trabalho e para (step mode).
Task autonoma sem milestone — brainstorm, discuss, plan, execute.
Gerencia múltiplas contas Claude e troca entre elas (setup-token). Use ao esgotar a sessão de uma conta.
Qualidade do codebase — lint, nomenclatura. Flags: --fix, --paths.
Configuracoes do Forge — status line, hooks, MCPs.
| name | forge-security |
| description | Checklist de seguranca por task/slice. Auto-invocada por keywords. |
| allowed-tools | Read, Write, Bash, Glob, Grep, Skill, WebSearch, WebFetch |
<essential_principles>
<probe_autonomy>
Para controles de segurança onde o comportamento real sob ataque não é evidente por docs/código (ex: header de segurança realmente bloqueia o vetor X? rate limiter abre janela em edge case Y? token TTL é respeitado pelo cliente Z?), invoque Skill({ skill: "forge-probe", args: "<vetor como Given/When/Then>" }) para validar o controle num sandbox isolado.
Casos ideais (cobrir backend, API, dados, infra — não só frontend):
Backend / API
Banco de dados / ORM
$1 vs string interpolation em raw query)WHERE deleted_at IS NULLCrypto / secrets
Infra / transport
Content-Security-Policy bloqueia o vetor XSS específico da app (quando aplicável)credentials: includeTLS_RSA_WITH_AES_128_CBC_SHA e esperar handshake failure)X-Forwarded-*, X-Real-IP) para upstream públicoBudget: máximo 1 probe por análise de segurança. Escopo obrigatório: probe deve rodar no sandbox (.gsd/probes/NNN-name/), nunca contra infra de produção, nunca com credenciais reais — use tokens dummy, banco local/docker ephemero, fixtures, endpoints locais.
Finding do probe vira item de checklist concreto com evidência: "✓ ORM escapa payload via probe 003 — teste com '; DROP TABLE users;-- retornou 0 rows, não erro SQL" ou "✗ Rate limiter permite 50 req no burst window — exige ajuste de token bucket (probe 003)" ou "✗ RLS policy falha quando JWT claim é renomeado — probe 003 leu 3 rows de outro tenant".
</probe_autonomy>
Parse args: {M###} {S##} {T##} (task-level) or {M###} {S##} (slice-level).
{WORKING_DIR}/.gsd/milestones/{M###}/slices/{S##}/tasks/{T##}-PLAN.md{WORKING_DIR}/.gsd/milestones/{M###}/slices/{S##}/{S##}-PLAN.md.gsd/PROJECT.md for stack context (language, framework, ORM, auth library)Map plan content to domains. Only activate domains where the plan explicitly mentions relevant keywords or describes relevant functionality:
| Domain | Activation keywords / description |
|---|---|
| Authentication | auth, login, logout, jwt, oauth, session, token, credential, password, register, signup |
| Authorization | permission, role, rbac, acl, access control, admin, guard, middleware, policy |
| Data handling | encrypt, decrypt, hash, salt, crypto, sensitive data, pii, personal info, private key |
| Input validation | user input, form submission, query param, search, file upload, body parsing, sanitize |
| Secrets management | api key, secret, env var, .env, config, credential storage |
| Injection (SQL/NoSQL/cmd) | database query, raw sql, ORM bypass, exec, shell, subprocess, dynamic query |
| Frontend XSS | innerHTML, dangerouslySetInnerHTML, template rendering, user-generated content, markdown render |
| Transport / headers | http, cors, csp, security headers, certificate, tls, redirect |
Domains with zero keyword matches → exclude from output entirely.
For each active domain, generate items in two tiers:
Blocker tier — item directly triggered by a keyword or action explicitly named in the plan. Example: plan says "implement JWT refresh token rotation" → "Verify refresh token is invalidated on use (single-use)" is a Blocker.
Check tier — item implied by the domain but not directly named in the plan. These are high-value patterns for the domain that the executor should verify if applicable, but may not block completion if not relevant. Example: same plan → "Ensure token blacklist does not grow unbounded" might be a Check if the plan doesn't mention blacklisting.
Rule: if you're not sure which tier, default to Check. Fewer Blockers = checklist gets read. More Blockers = checklist gets ignored.
Save as:
{WORKING_DIR}/.gsd/milestones/{M###}/slices/{S##}/tasks/{T##}-SECURITY.md{WORKING_DIR}/.gsd/milestones/{M###}/slices/{S##}/{S##}-SECURITY.md# Security Checklist — {T## or S##}: {title}
**Domains in scope:** {comma-separated list of active domains}
**Generated:** {date}
**Risk level:** HIGH | MEDIUM | LOW
*(HIGH = auth/authz/crypto in scope; MEDIUM = input validation or secrets; LOW = transport/headers only)*
## Blockers — resolve before marking complete
*(Directly triggered by explicit plan content — cannot skip)*
### Authentication *(if active and has Blocker items)*
- [ ] {Item directly tied to something the plan builds}
### Authorization *(if active and has Blocker items)*
- [ ] {Item}
### Data Handling *(if active and has Blocker items)*
- [ ] {Item}
### Input Validation *(if active and has Blocker items)*
- [ ] {Item}
### Secrets Management *(if active and has Blocker items)*
- [ ] No secrets or API keys appear in source files or committed `.env`
- [ ] All secrets loaded from environment variables — verified before commit
### Injection *(if active and has Blocker items)*
- [ ] {Item based on the ORM/DB layer in PROJECT.md}
### Frontend XSS *(if active and has Blocker items)*
- [ ] {Item}
### Transport / Headers *(if active and has Blocker items)*
- [ ] {Item}
## Also verify *(if applicable)*
*(Good-practice checks for the active domains — document rationale if skipping)*
- [ ] {Check-tier item — domain: Authentication}
- [ ] {Check-tier item — domain: ...}
## Anti-Patterns to Avoid
{2-3 specific anti-patterns for the stack in PROJECT.md — e.g., "Express: never use `res.json(err)` — leaks stack traces"}
## If You Find a Violation
Record it in T##-SUMMARY.md under `## Security Flags` with: file, line, pattern, and fix applied.
Do NOT mark the task complete until all Blocker items are resolved.
If no domains are active: write:
# Security Checklist — {T##}: {title}
**Generated:** {date}
**Result:** No security-sensitive scope detected in this task. No checklist required.
<success_criteria>