@brunosps00/dev-workflow 2.1.0 → 2.3.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/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +118 -0
- package/README.md +17 -6
- package/lib/constants.js +24 -20
- package/lib/init.js +34 -0
- package/lib/instruction-health.js +38 -0
- package/lib/post-update.js +2 -1
- package/lib/validate.js +3 -1
- package/package.json +1 -1
- package/scaffold/config/routing.json +61 -23
- package/scaffold/en/agent-instructions.md +31 -135
- package/scaffold/en/commands/dw-analyze-project.md +2 -0
- package/scaffold/en/commands/dw-autopilot.md +22 -243
- package/scaffold/en/commands/dw-bugfix.md +9 -35
- package/scaffold/en/commands/dw-claude-run.md +29 -45
- package/scaffold/en/commands/dw-codex-run.md +30 -45
- package/scaffold/en/commands/dw-context-budget.md +6 -14
- package/scaffold/en/commands/dw-copilot-run.md +29 -41
- package/scaffold/en/commands/dw-generate-pr.md +2 -2
- package/scaffold/en/commands/dw-goal.md +11 -5
- package/scaffold/en/commands/dw-harness-audit.md +2 -0
- package/scaffold/en/commands/dw-help.md +8 -4
- package/scaffold/en/commands/dw-pause.md +1 -0
- package/scaffold/en/commands/dw-plan.md +14 -7
- package/scaffold/en/commands/dw-qa.md +2 -0
- package/scaffold/en/commands/dw-report.md +169 -0
- package/scaffold/en/commands/dw-resume.md +5 -11
- package/scaffold/en/commands/dw-review.md +4 -3
- package/scaffold/en/commands/dw-run.md +19 -165
- package/scaffold/en/commands/dw-skill-health.md +7 -0
- package/scaffold/en/commands/dw-update.md +18 -4
- package/scaffold/en/commands/dw-worktree.md +100 -0
- package/scaffold/en/references/command-routing.md +53 -0
- package/scaffold/en/references/execution-contract.md +55 -0
- package/scaffold/en/templates/frontend-quality-template.md +43 -0
- package/scaffold/en/templates/task-template.md +20 -40
- package/scaffold/en/templates/tasks-template.md +9 -6
- package/scaffold/en/templates/techspec-template.md +4 -0
- package/scaffold/pt-br/agent-instructions.md +31 -135
- package/scaffold/pt-br/commands/dw-analyze-project.md +2 -0
- package/scaffold/pt-br/commands/dw-autopilot.md +22 -243
- package/scaffold/pt-br/commands/dw-bugfix.md +9 -35
- package/scaffold/pt-br/commands/dw-claude-run.md +29 -46
- package/scaffold/pt-br/commands/dw-codex-run.md +30 -45
- package/scaffold/pt-br/commands/dw-context-budget.md +6 -14
- package/scaffold/pt-br/commands/dw-copilot-run.md +29 -43
- package/scaffold/pt-br/commands/dw-generate-pr.md +2 -2
- package/scaffold/pt-br/commands/dw-goal.md +11 -5
- package/scaffold/pt-br/commands/dw-harness-audit.md +2 -0
- package/scaffold/pt-br/commands/dw-help.md +8 -4
- package/scaffold/pt-br/commands/dw-pause.md +1 -0
- package/scaffold/pt-br/commands/dw-plan.md +14 -7
- package/scaffold/pt-br/commands/dw-qa.md +2 -0
- package/scaffold/pt-br/commands/dw-report.md +169 -0
- package/scaffold/pt-br/commands/dw-resume.md +7 -11
- package/scaffold/pt-br/commands/dw-review.md +4 -3
- package/scaffold/pt-br/commands/dw-run.md +19 -165
- package/scaffold/pt-br/commands/dw-skill-health.md +7 -0
- package/scaffold/pt-br/commands/dw-update.md +18 -4
- package/scaffold/pt-br/commands/dw-worktree.md +100 -0
- package/scaffold/pt-br/references/command-routing.md +53 -0
- package/scaffold/pt-br/references/execution-contract.md +55 -0
- package/scaffold/pt-br/templates/frontend-quality-template.md +43 -0
- package/scaffold/pt-br/templates/task-template.md +20 -40
- package/scaffold/pt-br/templates/tasks-template.md +9 -6
- package/scaffold/pt-br/templates/techspec-template.md +4 -0
- package/scaffold/scripts/hooks/git-guardrails.mjs +1 -0
- package/scaffold/scripts/lib/workflow-contract.mjs +101 -0
- package/scaffold/scripts/lib/worktree-gc.mjs +460 -0
- package/scaffold/skill-registry.json +23 -23
- package/scaffold/skills/dw-cli-run/SKILL.md +33 -208
- package/scaffold/skills/dw-cli-run/references/dispatch-tuning.md +14 -72
- package/scaffold/skills/dw-codebase-intel/SKILL.md +5 -39
- package/scaffold/skills/dw-codebase-intel/agents/intel-updater.md +1 -1
- package/scaffold/skills/dw-codebase-intel/references/agents-detail.md +7 -0
- package/scaffold/skills/dw-codebase-intel/references/files-in-dw-intel-detail.md +16 -0
- package/scaffold/skills/dw-codebase-intel/references/how-dw-intel-reads-this-detail.md +12 -0
- package/scaffold/skills/dw-codebase-intel/references/how-to-compose-the-typical-flow-detail.md +11 -0
- package/scaffold/skills/dw-council/SKILL.md +2 -17
- package/scaffold/skills/dw-council/references/integration-with-other-dw-commands-detail.md +7 -0
- package/scaffold/skills/dw-council/references/phase-2-tensions-and-rebuttals-detail.md +15 -0
- package/scaffold/skills/dw-domain-modeling/SKILL.md +1 -1
- package/scaffold/skills/dw-execute-phase/SKILL.md +12 -32
- package/scaffold/skills/dw-execute-phase/agents/executor.md +15 -252
- package/scaffold/skills/dw-execute-phase/agents/plan-checker.md +4 -207
- package/scaffold/skills/dw-execute-phase/references/atomic-commits.md +8 -18
- package/scaffold/skills/dw-execute-phase/references/de-sloppify-pass-optional-cleanup-task-detail.md +12 -0
- package/scaffold/skills/dw-execute-phase/references/deviation-rules-during-execution-detail.md +8 -0
- package/scaffold/skills/dw-execute-phase/references/how-the-two-agents-compose-detail.md +7 -0
- package/scaffold/skills/dw-execute-phase/references/plan-verification.md +9 -155
- package/scaffold/skills/dw-execute-phase/references/wave-coordination.md +6 -97
- package/scaffold/skills/dw-git-discipline/SKILL.md +2 -2
- package/scaffold/skills/dw-grilling/SKILL.md +1 -1
- package/scaffold/skills/dw-incident-response/SKILL.md +1 -64
- package/scaffold/skills/dw-incident-response/references/the-five-phases-detail.md +66 -0
- package/scaffold/skills/dw-llm-eval/SKILL.md +5 -53
- package/scaffold/skills/dw-llm-eval/references/agent-tool-use-evaluation-detail.md +23 -0
- package/scaffold/skills/dw-llm-eval/references/anti-patterns-will-block-in-dw-review-code-only-detail.md +9 -0
- package/scaffold/skills/dw-llm-eval/references/consistency-run-to-run-stability-detail.md +10 -0
- package/scaffold/skills/dw-llm-eval/references/integration-with-dev-workflow-commands-detail.md +6 -0
- package/scaffold/skills/dw-llm-eval/references/the-oracle-ladder-detail.md +15 -0
- package/scaffold/skills/dw-memory/SKILL.md +4 -50
- package/scaffold/skills/dw-memory/references/context-budget.md +8 -56
- package/scaffold/skills/dw-memory/references/promotion-decision-test-detail.md +30 -0
- package/scaffold/skills/dw-minimalism/SKILL.md +4 -5
- package/scaffold/skills/dw-review-rigor/SKILL.md +1 -54
- package/scaffold/skills/dw-review-rigor/references/the-five-rules-detail.md +56 -0
- package/scaffold/skills/dw-simplification/SKILL.md +2 -55
- package/scaffold/skills/dw-simplification/references/pattern-recognition-detail.md +11 -0
- package/scaffold/skills/dw-simplification/references/the-five-rules-detail.md +48 -0
- package/scaffold/skills/dw-source-grounding/SKILL.md +1 -56
- package/scaffold/skills/dw-source-grounding/references/the-protocol-detect-fetch-implement-cite-detail.md +58 -0
- package/scaffold/skills/dw-testing-discipline/SKILL.md +25 -177
- package/scaffold/skills/dw-testing-discipline/references/agent-guardrails.md +9 -167
- package/scaffold/skills/dw-testing-discipline/references/core-rules.md +3 -3
- package/scaffold/skills/dw-testing-discipline/references/mutation-testing.md +19 -0
- package/scaffold/skills/dw-testing-discipline/references/patterns.md +3 -12
- package/scaffold/skills/dw-ui-discipline/SKILL.md +2 -59
- package/scaffold/skills/dw-ui-discipline/references/frontend-engineering.md +46 -0
- package/scaffold/skills/dw-ui-discipline/references/the-four-grounding-questions-detail.md +61 -0
- package/scaffold/skills/dw-verify/SKILL.md +26 -148
- package/scaffold/skills/dw-verify/references/verification-discovery-and-attribution.md +2 -2
- package/scaffold/skills/humanizer/SKILL.md +2 -1
- package/scaffold/skills/security-review/SKILL.md +3 -183
- package/scaffold/skills/security-review/references/do-not-flag-detail.md +49 -0
- package/scaffold/skills/security-review/references/quick-patterns-reference-detail.md +56 -0
- package/scaffold/skills/security-review/references/review-process-detail.md +84 -0
- package/scaffold/skills/vercel-react-best-practices/SKILL.md +1 -90
- package/scaffold/skills/vercel-react-best-practices/references/quick-reference-detail.md +92 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Frontend engineering controls
|
|
2
|
+
|
|
3
|
+
Read when planning frontend architecture, auditing a frontend module, or reviewing changes to its data flow, dependencies or quality tooling. A visual/copy-only edit needs only the relevant UI checks. This reference can be used directly without running visual grounding for an API client or CI configuration change.
|
|
4
|
+
|
|
5
|
+
## Discover before changing
|
|
6
|
+
|
|
7
|
+
Inspect the target workspace's scripts, lockfile, framework, compiler, API source, lint configuration, entry points and CI. Reuse working controls. Record observed configuration separately from proposed policy; an absent tool is not a failed check. Installation of dev-workflow does not authorize replacing consumer tooling.
|
|
8
|
+
|
|
9
|
+
For a project audit, use the installed `frontend-quality-template.md` in `.dw/templates/` to document the baseline in the module's existing rules file. For a feature, include only affected decisions in its TechSpec. Read those decisions during implementation and review. A request to analyze produces findings and proposals; an authorized implementation may add compatible scripts/configuration and validate them.
|
|
10
|
+
|
|
11
|
+
When using this skill standalone without the scaffold template, record the same compact control fields from the adoption section below in the project's existing document; no template installation is required.
|
|
12
|
+
|
|
13
|
+
## Contract and type boundaries
|
|
14
|
+
|
|
15
|
+
- Identify the authoritative API schema and its owner/revision before introducing response fields. If generation is used, record the generator version, command and output paths. Review contract changes, regenerate reproducibly and inspect drift; correct the source or generator rather than editing generated output.
|
|
16
|
+
- When there is no maintained schema, derive a narrow boundary from verified backend code or documented responses and test it; label unresolved assumptions. Do not invent an OpenAPI specification from frontend guesses.
|
|
17
|
+
- Runtime data still needs validation at relevant trust boundaries. Generating a validator is insufficient unless the actual response path calls it and handles failure. [Hey API's Zod integration](https://heyapi.dev/docs/openapi/typescript/plugins/zod) is one option when compatible with the existing client.
|
|
18
|
+
- For TypeScript, inspect effective inherited configuration. Consider [`strict`](https://www.typescriptlang.org/tsconfig/strict.html), [`noUncheckedIndexedAccess`](https://www.typescriptlang.org/tsconfig/noUncheckedIndexedAccess.html) and [`exactOptionalPropertyTypes`](https://www.typescriptlang.org/tsconfig/exactOptionalPropertyTypes.html). Migrate by package or a coherent project boundary; passing filenames to a compiler invocation must not accidentally bypass project settings. Do not hide migration errors behind casts, `any` or non-null assertions.
|
|
19
|
+
|
|
20
|
+
## Architecture and lint feedback
|
|
21
|
+
|
|
22
|
+
Derive allowed imports from the project's architecture, including framework-specific server/client boundaries. Reuse an existing graph checker; [eslint-plugin-boundaries](https://github.com/javierbrea/eslint-plugin-boundaries) is an option for JS/TS. Verify aliases, workspace packages, type imports and legitimate framework entry points. A rejected dependency should identify its source, forbidden destination and the intended placement. Do not impose a universal folder layout.
|
|
23
|
+
|
|
24
|
+
Choose lint rules against concrete failure modes and the installed runner: missing assertion awaits, accidentally focused tests, unsafe type escapes and inaccessible JSX. For React state changes, check whether an Effect actually synchronizes an external system; derived values and event responses often belong in rendering or handlers. Preserve legitimate synchronization. See [React's Effect guidance](https://react.dev/learn/you-might-not-need-an-effect).
|
|
25
|
+
|
|
26
|
+
For a recurring repository-specific defect, prefer an existing rule. A custom detector needs a documented failure mode, an actionable diagnostic and valid/invalid fixtures. Exercise aliases, exclusions and unsupported syntax; an unresolved import is an analysis limitation, not proof of safety. Use an AST or the framework's parser when syntax matters. [ESLint's RuleTester workflow](https://eslint.org/docs/latest/extend/custom-rule-tutorial) supports rule validation. Avoid adding a regex-based import graph when the existing tool already models it.
|
|
27
|
+
|
|
28
|
+
## Code that should disappear
|
|
29
|
+
|
|
30
|
+
Evaluate dead-code findings against runtime reachability and public exports before deletion. Configure framework/plugin entry points, generated sources and workspace aliases. Tests alone can keep otherwise unused production code appearing live: [Knip production mode](https://knip.dev/features/production-mode) provides a separate view of shipped code and does not replace its normal analysis. Validate a newly configured detector with an intentionally unused fixture and a legitimately reachable fixture in an isolated workspace.
|
|
31
|
+
|
|
32
|
+
Use textual duplication reports such as [jscpd](https://github.com/kucherenko/jscpd) as candidates for inspection. Apply different policies to repeated markup/fixtures and business calculations. Search for semantic duplicates too. Consolidate only when copies represent the same rule and should evolve together; a shared abstraction must preserve callers' behavior. Record exclusions with a reason and review trigger, instead of growing blanket ignores to make a report green.
|
|
33
|
+
|
|
34
|
+
## Tests and adoption
|
|
35
|
+
|
|
36
|
+
When critical logic changes or existing tests appear weak, use the testing skill's `references/mutation-testing.md` if available. Mutation testing complements contract and user-flow tests; neither coverage nor a diagnostic score establishes acceptance.
|
|
37
|
+
|
|
38
|
+
For each adopted control record: risk, configuration, exact workspace command, scope, baseline, enforcement status, evidence and owner/review trigger. Use `required`, `advisory`, `deferred` or `not_applicable`; record actual execution separately (`passed`, `failed`, `not_run`). Start noisy new controls as advisory, triage findings, then promote demonstrated checks. Existing required gates remain required. Typechecking, builds and dependency graphs often need the whole affected project even when lint or mutation analysis can target a diff.
|
|
39
|
+
|
|
40
|
+
Local hooks may shorten feedback, but CI must execute required checks independently of editor or agent hooks. Keep failures identifiable; verify that deployment depends on successful required jobs and that repository rules actually require the intended status checks. Do not claim a workflow file alone establishes branch protection. Advisory mutation runs may publish findings without a score threshold; report execution failures explicitly. Never hide a required check behind `continue-on-error`, an empty selection or a silently skipped job.
|
|
41
|
+
|
|
42
|
+
Record command, inputs, environment and analysis scope through `dw-verify` when available. Treat new ignores, disabled rules, changed generation/configuration and lost CI coverage as reviewable changes. Delivery still requires checking product behavior, architecture and accessibility; automated findings reduce review work without replacing that judgment.
|
|
43
|
+
|
|
44
|
+
## Attribution
|
|
45
|
+
|
|
46
|
+
Workflow adaptation prompted by Yuri Mikhin's [Evil Martians article](https://evilmartians.com/chronicles/ten-anti-ai-slop-moves-for-frontend-projects-going-faster-than-humans-can-review), September 1, 2026. Procedures are independently written for dev-workflow and supported by the primary documentation linked above (checked September 9, 2026). No article text, source code or third-party tool is bundled here.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
## The four grounding questions
|
|
2
|
+
|
|
3
|
+
Answer all four before proposing colors, layouts, components, or any visual decision.
|
|
4
|
+
|
|
5
|
+
### 1. Where do design decisions come from?
|
|
6
|
+
|
|
7
|
+
Find the project's design source-of-truth in this order:
|
|
8
|
+
1. `.dw/rules/<frontend-module>.md` design system section.
|
|
9
|
+
2. `DESIGN.md`, `BRAND.md`, `STYLE_GUIDE.md` at project root.
|
|
10
|
+
3. Design token config — Tailwind theme, CSS variables in `theme.css`/`globals.css`, MUI/Chakra theme.
|
|
11
|
+
4. Component library config — `components.json` for shadcn, theme exports.
|
|
12
|
+
5. Storybook stories (implicit canonical components).
|
|
13
|
+
|
|
14
|
+
**Stop at the first match** in this list — that source is the authority; defer to it and do not override it with a lower rung or a training-data default. If a needed token is missing (e.g., a danger-secondary color), propose adding it to the authority FIRST, not inline.
|
|
15
|
+
|
|
16
|
+
If **none exists**: read `curated-defaults.md` and pick one of the 10 neutral palettes + one of the 10 font pairings shipped there. Mark the choice in the techspec/PR description: "Design source: no project authority found; using curated default `<name>`; recommend establishing `DESIGN.md`."
|
|
17
|
+
|
|
18
|
+
**Anti-patterns at this question:**
|
|
19
|
+
- Inventing color hex values inline (`bg-[#FF6B35]`).
|
|
20
|
+
- "I'll use Tailwind defaults" — that's training-data defaults, not project authority.
|
|
21
|
+
- Copying values from "a site I like" without understanding what it solved.
|
|
22
|
+
|
|
23
|
+
### 2. What does this surface help the user do?
|
|
24
|
+
|
|
25
|
+
Write one sentence: **"This surface helps the user `<verb-phrase>` so that `<outcome>`."**
|
|
26
|
+
|
|
27
|
+
Good examples:
|
|
28
|
+
- "...helps the user filter overdue invoices so they can chase late payers in under 30 seconds."
|
|
29
|
+
- "...helps the on-call engineer diagnose which deploy caused the spike so they can roll back without paging the team."
|
|
30
|
+
- "...helps the manager approve or reject expense reports without leaving Slack."
|
|
31
|
+
|
|
32
|
+
Bad examples:
|
|
33
|
+
- "This surface displays invoice data." (no user, no outcome)
|
|
34
|
+
- "Settings page for managing the account." (vague, no specificity)
|
|
35
|
+
- "Dashboard." (one word)
|
|
36
|
+
|
|
37
|
+
If you can't write the sentence, the requirements are unclear. Stop and clarify before proceeding.
|
|
38
|
+
|
|
39
|
+
### 3. What states does the surface have?
|
|
40
|
+
|
|
41
|
+
Enumerate all states before designing the happy path. Minimum nine, plus domain-specific ones — see `state-matrix.md`:
|
|
42
|
+
|
|
43
|
+
`default`, `hover`, `active`, `focus-visible`, `disabled`, `loading`, `empty`, `error`, `success` plus any domain states (read/unread, online/offline, stale/fresh, pending/approved/rejected, draft/saved/dirty, partial/complete, etc.).
|
|
44
|
+
|
|
45
|
+
Missing a state at design time = production bug later. The "we'll add empty state later" trap is real.
|
|
46
|
+
|
|
47
|
+
### 4. Who uses this surface, where, and in what mood?
|
|
48
|
+
|
|
49
|
+
One sentence: **"`<Who>` uses this on `<where>` in `<what light>` while `<what mood>`."**
|
|
50
|
+
|
|
51
|
+
Good examples:
|
|
52
|
+
- "An on-call engineer uses this on a dark-room laptop at 3am while troubleshooting a fire."
|
|
53
|
+
- "A field nurse uses this on a phone in bright outdoor light while juggling clipboards."
|
|
54
|
+
- "A receptionist uses this on a 24″ monitor at a busy front desk while talking to a visitor."
|
|
55
|
+
|
|
56
|
+
Decisions cascade from the answer:
|
|
57
|
+
- 3am dark room → dark mode, high contrast, no flashing animations.
|
|
58
|
+
- Bright outdoor → minimum 7:1 contrast, larger touch targets, no thin fonts.
|
|
59
|
+
- Busy front desk → glanceable info, no nested menus, large numbers.
|
|
60
|
+
|
|
61
|
+
Without this sentence, defaults take over: light mode, default contrasts, animations, regular touch targets. Production users hate it; you can't articulate why.
|
|
@@ -1,173 +1,51 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dw-verify
|
|
3
|
-
description:
|
|
3
|
+
description: Validate completion, commit or PR claims against acceptance criteria and applicable project checks, reusing evidence only while its inputs remain valid.
|
|
4
4
|
allowed-tools:
|
|
5
|
-
- Bash
|
|
6
5
|
- Read
|
|
6
|
+
- Bash
|
|
7
7
|
- Grep
|
|
8
|
+
- Glob
|
|
8
9
|
---
|
|
9
10
|
|
|
10
|
-
#
|
|
11
|
-
|
|
12
|
-
## Overview
|
|
13
|
-
|
|
14
|
-
Claiming work is complete without verification is dishonesty, not efficiency.
|
|
15
|
-
|
|
16
|
-
**Core principle:** Evidence before claims, always.
|
|
17
|
-
|
|
18
|
-
**Violating the letter of this rule is violating the spirit of this rule.**
|
|
19
|
-
|
|
20
|
-
## The Iron Law
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
If the verification command has not been run in the current message, the result cannot be claimed.
|
|
27
|
-
|
|
28
|
-
## The Gate Function
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
BEFORE claiming any status or expressing satisfaction:
|
|
32
|
-
|
|
33
|
-
1. IDENTIFY: What command proves this claim?
|
|
34
|
-
2. RUN: Execute the FULL command (fresh, complete)
|
|
35
|
-
3. READ: Full output, check exit code, count failures
|
|
36
|
-
4. VERIFY: Does output confirm the claim?
|
|
37
|
-
- If NO: State actual status with evidence
|
|
38
|
-
- If YES: State claim WITH evidence
|
|
39
|
-
5. ONLY THEN: Make the claim
|
|
40
|
-
|
|
41
|
-
Skip any step = lying, not verifying
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Scope of Verification
|
|
45
|
-
|
|
46
|
-
Match the verification scope to the claim scope.
|
|
47
|
-
|
|
48
|
-
- **Narrow claim** (e.g., "this test passes"): run the specific test.
|
|
49
|
-
- **Broad claim** (e.g., "task complete", "ready to commit"): run the full verification pipeline — formatting, linting, all tests, and build. If the project defines a single gate command (e.g., `npm test`, `make verify`, `pnpm check`), run that.
|
|
50
|
-
|
|
51
|
-
A narrow verification does not support a broad claim. Running one test alone does not justify "task complete." The verification scope must be equal to or broader than the claim scope.
|
|
52
|
-
|
|
53
|
-
**If in doubt, run the full pipeline.** Over-verification wastes minutes. Under-verification wastes hours.
|
|
54
|
-
|
|
55
|
-
**Passing pipeline ≠ meeting requirements.** A green build proves the code compiles, lints, and passes existing tests. It does not prove the implementation matches the PRD. For "task complete" or "requirements met" claims, also verify deliverables against the task's acceptance criteria and the PRD — line by line, not by assumption.
|
|
56
|
-
|
|
57
|
-
## Common Failures
|
|
58
|
-
|
|
59
|
-
| Claim | Requires | Not Sufficient |
|
|
60
|
-
| --------------------- | -------------------------------- | ------------------------------- |
|
|
61
|
-
| Tests pass | Test command output: 0 failures | Previous run, "should pass" |
|
|
62
|
-
| Linter clean | Linter output: 0 errors | Partial check, extrapolation |
|
|
63
|
-
| Build succeeds | Build command: exit 0 | Linter passing, logs look good |
|
|
64
|
-
| Bug fixed | Test original symptom: passes | Code changed, assumed fixed |
|
|
65
|
-
| Regression test works | Red-green cycle verified | Test passes once |
|
|
66
|
-
| Task complete | Acceptance criteria cross-check | Tests passing |
|
|
67
|
-
| Requirements met | Line-by-line PRD checklist | Tests passing |
|
|
68
|
-
|
|
69
|
-
## Red Flags
|
|
70
|
-
|
|
71
|
-
If you catch yourself using any of these, STOP and run verification:
|
|
72
|
-
|
|
73
|
-
- "should", "probably", "seems to", "I'm confident"
|
|
74
|
-
- Expressing satisfaction before verification
|
|
75
|
-
- About to commit, push, or open a PR without verification
|
|
76
|
-
- Trusting another agent's success report
|
|
77
|
-
- Relying on partial verification
|
|
78
|
-
- "Just this once"
|
|
79
|
-
|
|
80
|
-
## Rationalization Prevention
|
|
81
|
-
|
|
82
|
-
| Excuse | Reality |
|
|
83
|
-
| --------------------------------------- | ---------------------- |
|
|
84
|
-
| "Should work now" | Run the verification |
|
|
85
|
-
| "I'm confident" | Confidence ≠ evidence |
|
|
86
|
-
| "Just this once" | No exceptions |
|
|
87
|
-
| "Linter passed" | Linter ≠ compiler |
|
|
88
|
-
| "Agent said success" | Verify independently |
|
|
89
|
-
| "I'm tired" | Exhaustion ≠ excuse |
|
|
90
|
-
| "Partial check is enough" | Partial proves nothing |
|
|
91
|
-
| "Different words so rule doesn't apply" | Spirit over letter |
|
|
92
|
-
|
|
93
|
-
## When To Apply
|
|
94
|
-
|
|
95
|
-
Apply this skill before:
|
|
96
|
-
|
|
97
|
-
- any success or completion claim
|
|
98
|
-
- any expression of satisfaction with the implementation state
|
|
99
|
-
- any commit or PR creation
|
|
100
|
-
- any handoff that implies correctness
|
|
101
|
-
- moving to the next task based on completion
|
|
102
|
-
|
|
103
|
-
## Pre-Commit and Pre-PR Gate
|
|
104
|
-
|
|
105
|
-
Commits and PRs are permanent artifacts. They require the highest verification standard.
|
|
106
|
-
|
|
107
|
-
**Before `git commit`:**
|
|
108
|
-
1. Run the full verification pipeline. Not a subset. The full pipeline.
|
|
109
|
-
2. Confirm zero errors, zero warnings, zero test failures in the output.
|
|
110
|
-
3. Produce a Verification Report (template below) with verdict PASS.
|
|
111
|
-
4. Only then run `git commit`.
|
|
11
|
+
# Verification grounded in evidence
|
|
112
12
|
|
|
113
|
-
|
|
114
|
-
1. All of the above, plus:
|
|
115
|
-
2. Verify the diff matches the intended changes (`git diff` review).
|
|
116
|
-
3. Confirm no unrelated files are staged.
|
|
13
|
+
A claim must match observed evidence. Inspect output and acceptance criteria; do not infer success from code edits, confidence, a worker's self-score, or a green build alone.
|
|
117
14
|
|
|
118
|
-
|
|
15
|
+
## Select checks
|
|
119
16
|
|
|
120
|
-
|
|
17
|
+
Follow required project gates from applicable instructions, package scripts and CI. Use focused tests while implementing or correcting defects, then complete the project's required delivery checks. Run lint/build only when applicable or required; do not invent absent scripts or demand zero pre-existing warnings when the project does not.
|
|
121
18
|
|
|
122
|
-
|
|
19
|
+
For frontend changes, consult the module's documented quality baseline or TechSpec: distinguish required checks from advisory diagnostics and deferred proposals. Check generation drift, typechecking, architecture and test evidence where applicable. Tool presence, a high score or an empty analysis scope is not a passing result. A local hook does not prove CI enforcement or branch protection.
|
|
123
20
|
|
|
124
|
-
|
|
21
|
+
For behavior changes, verify relevant acceptance criteria and meaningful failure cases. For a small prose/config edit, use an appropriate inspection or validator; lack of a test runner alone does not block that claim. Report limits honestly. New tests should detect a plausible defect, not mirror implementation or language behavior. Explicit TDD requests retain their red/green contract.
|
|
125
22
|
|
|
126
|
-
|
|
127
|
-
VERIFICATION REPORT
|
|
128
|
-
-------------------
|
|
129
|
-
Claim: [What is being claimed — e.g., "tests pass", "build succeeds", "task complete"]
|
|
130
|
-
Command: [Exact command run — e.g., `npm test`, `pnpm verify`]
|
|
131
|
-
Executed: [Timestamp or "just now, after all changes"]
|
|
132
|
-
Exit code: [0 or non-zero]
|
|
133
|
-
Output summary: [Key lines from output — pass count, error count, build result]
|
|
134
|
-
Warnings: [Any warnings, or "none"]
|
|
135
|
-
Errors: [Any errors, or "none"]
|
|
136
|
-
Verdict: PASS or FAIL
|
|
137
|
-
```
|
|
23
|
+
## Evidence validity
|
|
138
24
|
|
|
139
|
-
|
|
25
|
+
For every check record command, exit code, output/log path, time, revision and relevant diff/input fingerprint, environment fingerprint and scope covered. Include relevant untracked/generated files, dependencies/lockfiles, tool configuration, runtime and external fixtures. The fingerprint must represent actual inputs; a timestamp or HEAD alone is insufficient when the worktree is dirty.
|
|
140
26
|
|
|
141
|
-
|
|
27
|
+
Reuse a passing record when command, inputs, environment and claim scope remain equivalent and its output can be inspected. A new message, review stage or bookkeeping-only commit does not by itself invalidate checks. Unknown fingerprints/environment, changed inputs, new findings or broader claims require appropriate fresh checks. If uncertain which inputs matter, rerun the required check instead of inventing validity.
|
|
142
28
|
|
|
143
|
-
|
|
29
|
+
The installed helper `.dw/scripts/lib/workflow-contract.mjs` exports `reusableEvidence(record, current)` for comparing known fingerprints and scopes; callers still gather the actual evidence. Store records in execution-state.json for planned tasks, or the existing verification/QA report for standalone work.
|
|
144
30
|
|
|
145
|
-
|
|
31
|
+
## Failures and delivery
|
|
146
32
|
|
|
147
|
-
|
|
148
|
-
2. **Diagnose the root cause.** Read the error. Trace it to the source. If multiple things failed, address them one at a time, starting with the first failure.
|
|
149
|
-
3. **Fix the root cause.** Apply the minimal change that addresses the actual error. No workarounds, no suppressions, no skipped checks.
|
|
150
|
-
4. **Re-verify from scratch.** Run the full verification command again. Do not assume the fix worked. Do not run only the previously-failing subset.
|
|
151
|
-
5. **Report with evidence.** Use the Verification Report Template. If it passes, the claim may proceed. If it fails again, return to step 1.
|
|
33
|
+
Read failures and diagnose production behavior before changing tests. Correct failures caused by the requested change; rerun affected checks, then any invalidated required delivery gates. Do not weaken assertions, hide blocking findings, or claim a skipped check passed. Unrelated failures are reported with attribution and handled under project policy.
|
|
152
34
|
|
|
153
|
-
|
|
154
|
-
- Claim partial success ("3 of 4 checks pass, close enough")
|
|
155
|
-
- Skip re-verification after a fix
|
|
156
|
-
- Blame the tooling without evidence of a false positive
|
|
157
|
-
- Move on while verification is still failing
|
|
35
|
+
Before commit/PR, inspect the scoped diff and acceptance criteria and confirm all applicable required checks have valid passing evidence. Reuse a verified worker/CI result under the same validity rules; independently inspect the delivery, not blindly trust a summary. Security and constitution gates remain in force. A passing pipeline does not itself authorize commit, merge or publication.
|
|
158
36
|
|
|
159
|
-
##
|
|
37
|
+
## Verification report
|
|
160
38
|
|
|
161
|
-
|
|
39
|
+
Record a compact VERIFICATION REPORT with Claim, Command, Executed, Revision/inputs, Environment, Scope, Exit code, Output summary/log, Warnings, Errors and Verdict (`PASS`, `FAIL`, or `NOT_APPLICABLE`). Say which evidence was reused and why. The user-facing response may summarize these records with links; full logs need not be pasted into every message.
|
|
162
40
|
|
|
163
|
-
|
|
41
|
+
Read `references/verification-discovery-and-attribution.md` when project gate discovery or attribution is needed. Read `references/pre-check-and-status.md` only for diff-hygiene checks or polling format.
|
|
164
42
|
|
|
165
43
|
## Structured Return
|
|
166
44
|
|
|
167
|
-
- **Status:** `PASS`
|
|
168
|
-
- **Scope:** claim, files,
|
|
169
|
-
- **Evidence:** commands, exit codes,
|
|
170
|
-
- **Artifacts:** report,
|
|
171
|
-
- **Decisions:** selected
|
|
172
|
-
- **Risks:**
|
|
173
|
-
- **Next Step:**
|
|
45
|
+
- **Status:** `PASS` valid evidence supports the claim; `FINDINGS` failed/incomplete checks; `BLOCKED` a required check cannot run; `NOT_APPLICABLE` no verification claim.
|
|
46
|
+
- **Scope:** claim, relevant files/inputs, checks and environment.
|
|
47
|
+
- **Evidence:** commands, exit codes, inspectable logs, fingerprints and acceptance criteria.
|
|
48
|
+
- **Artifacts:** verification report, task state, screenshots or CI link.
|
|
49
|
+
- **Decisions:** selected checks, evidence reused and reasons for inapplicable checks.
|
|
50
|
+
- **Risks:** unknown environment, stale inputs, missing checks or uncovered behavior.
|
|
51
|
+
- **Next Step:** fix, required check, or validated handoff.
|
|
@@ -7,7 +7,7 @@ dev-workflow does not hardcode a verification command. Discover it from the proj
|
|
|
7
7
|
3. Check for `Makefile`/`make verify`, `pyproject.toml`/`just verify`, etc.
|
|
8
8
|
4. If none is explicit, run the documented test + lint + build sequence.
|
|
9
9
|
|
|
10
|
-
If no
|
|
10
|
+
If no automated command applies, document the appropriate inspection and its limits. A missing required check blocks its claim; a prose-only task does not require an invented test runner.
|
|
11
11
|
|
|
12
12
|
## Integration With Other dev-workflow Commands
|
|
13
13
|
|
|
@@ -18,7 +18,7 @@ This skill is invoked transparently from:
|
|
|
18
18
|
- `/dw-qa --fix` — before marking a bug as resolved in `QA/bugs.md`
|
|
19
19
|
- `/dw-bugfix` — before claiming the bug is fixed (original symptom no longer reproduces)
|
|
20
20
|
- `/dw-review --code-only` — before emitting an APPROVED verdict
|
|
21
|
-
- `/dw-generate-pr` —
|
|
21
|
+
- `/dw-generate-pr` — requires valid passing evidence for the current inputs, environment and scope
|
|
22
22
|
|
|
23
23
|
Callers should mention this skill in their "Skills Complementares" section so the user sees the dependency.
|
|
24
24
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: humanizer
|
|
3
|
-
|
|
3
|
+
metadata:
|
|
4
|
+
version: "2.2.0"
|
|
4
5
|
description: Use when editing AI-generated text. Detects 24 'signs of AI writing' (em-dashes, rule-of-three, AI vocab, vague attributions). Triggers on docs, READMEs, blog posts, captions, marketing copy.
|
|
5
6
|
allowed-tools:
|
|
6
7
|
- Read
|
|
@@ -58,138 +58,11 @@ rotated, not argued away (only committed `.gitleaks.toml` allowlist entries for
|
|
|
58
58
|
|
|
59
59
|
## Do Not Flag
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
- Test files (unless explicitly reviewing test security)
|
|
63
|
-
- Dead code, commented code, documentation strings
|
|
64
|
-
- Patterns using **constants** or **server-controlled configuration**
|
|
65
|
-
- Code paths that require prior authentication to reach (note the auth requirement instead)
|
|
66
|
-
|
|
67
|
-
### Server-Controlled Values (NOT Attacker-Controlled)
|
|
68
|
-
|
|
69
|
-
These are configured by operators, not controlled by attackers:
|
|
70
|
-
|
|
71
|
-
| Source | Example | Why It's Safe |
|
|
72
|
-
|--------|---------|---------------|
|
|
73
|
-
| Django settings | `settings.API_URL`, `settings.ALLOWED_HOSTS` | Set via config/env at deployment |
|
|
74
|
-
| Environment variables | `os.environ.get('DATABASE_URL')` | Deployment configuration |
|
|
75
|
-
| Config files | `config.yaml`, `app.config['KEY']` | Server-side files |
|
|
76
|
-
| Framework constants | `django.conf.settings.*` | Not user-modifiable |
|
|
77
|
-
| Hardcoded values | `BASE_URL = "https://api.internal"` | Compile-time constants |
|
|
78
|
-
|
|
79
|
-
**SSRF Example - NOT a vulnerability:**
|
|
80
|
-
```python
|
|
81
|
-
# SAFE: URL comes from Django settings (server-controlled)
|
|
82
|
-
response = requests.get(f"{settings.SEER_AUTOFIX_URL}{path}")
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
**SSRF Example - IS a vulnerability:**
|
|
86
|
-
```python
|
|
87
|
-
# VULNERABLE: URL comes from request (attacker-controlled)
|
|
88
|
-
response = requests.get(request.GET.get('url'))
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Framework-Mitigated Patterns
|
|
92
|
-
Check language guides before flagging. Common false positives:
|
|
93
|
-
|
|
94
|
-
| Pattern | Why It's Usually Safe |
|
|
95
|
-
|---------|----------------------|
|
|
96
|
-
| Django `{{ variable }}` | Auto-escaped by default |
|
|
97
|
-
| React `{variable}` | Auto-escaped by default |
|
|
98
|
-
| Vue `{{ variable }}` | Auto-escaped by default |
|
|
99
|
-
| `User.objects.filter(id=input)` | ORM parameterizes queries |
|
|
100
|
-
| `cursor.execute("...%s", (input,))` | Parameterized query |
|
|
101
|
-
| `innerHTML = "<b>Loading...</b>"` | Constant string, no user input |
|
|
102
|
-
|
|
103
|
-
**Only flag these when:**
|
|
104
|
-
- Django: `{{ var|safe }}`, `{% autoescape off %}`, `mark_safe(user_input)`
|
|
105
|
-
- React: `dangerouslySetInnerHTML={{__html: userInput}}`
|
|
106
|
-
- Vue: `v-html="userInput"`
|
|
107
|
-
- ORM: `.raw()`, `.extra()`, `RawSQL()` with string interpolation
|
|
61
|
+
For do not flag, read `references/do-not-flag-detail.md`. Load only when this part of the task applies.
|
|
108
62
|
|
|
109
63
|
## Review Process
|
|
110
64
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
What type of code am I reviewing?
|
|
114
|
-
|
|
115
|
-
| Code Type | Load These References |
|
|
116
|
-
|-----------|----------------------|
|
|
117
|
-
| API endpoints, routes | `authorization.md`, `authentication.md`, `injection.md` |
|
|
118
|
-
| Frontend, templates | `xss.md`, `csrf.md` |
|
|
119
|
-
| File handling, uploads | `file-security.md` |
|
|
120
|
-
| Crypto, secrets, tokens | `cryptography.md`, `data-protection.md` |
|
|
121
|
-
| Data serialization | `deserialization.md` |
|
|
122
|
-
| External requests | `ssrf.md` |
|
|
123
|
-
| Business workflows | `business-logic.md` |
|
|
124
|
-
| GraphQL, REST design | `api-security.md` |
|
|
125
|
-
| Config, headers, CORS | `misconfiguration.md` |
|
|
126
|
-
| CI/CD, dependencies | `supply-chain.md` |
|
|
127
|
-
| Error handling | `error-handling.md` |
|
|
128
|
-
| Audit, logging | `logging.md` |
|
|
129
|
-
|
|
130
|
-
### 2. Load Language Guide
|
|
131
|
-
|
|
132
|
-
Based on file extension or imports:
|
|
133
|
-
|
|
134
|
-
| Indicators | Guide |
|
|
135
|
-
|------------|-------|
|
|
136
|
-
| `.py`, `django`, `flask`, `fastapi` | `languages/python.md` |
|
|
137
|
-
| `.js`, `.ts`, `express`, `react`, `vue`, `next` | `languages/javascript.md` |
|
|
138
|
-
| `.go`, `go.mod` | `languages/go.md` |
|
|
139
|
-
| `.rs`, `Cargo.toml` | `languages/rust.md` |
|
|
140
|
-
| `.java`, `spring`, `@Controller` | `languages/java.md` |
|
|
141
|
-
|
|
142
|
-
### 3. Load Infrastructure Guide (if applicable)
|
|
143
|
-
|
|
144
|
-
| File Type | Guide |
|
|
145
|
-
|-----------|-------|
|
|
146
|
-
| `Dockerfile`, `.dockerignore` | `infrastructure/docker.md` |
|
|
147
|
-
| K8s manifests, Helm charts | `infrastructure/kubernetes.md` |
|
|
148
|
-
| `.tf`, Terraform | `infrastructure/terraform.md` |
|
|
149
|
-
| GitHub Actions, `.gitlab-ci.yml` | `infrastructure/ci-cd.md` |
|
|
150
|
-
| AWS/GCP/Azure configs, IAM | `infrastructure/cloud.md` |
|
|
151
|
-
|
|
152
|
-
### 4. Research Before Flagging
|
|
153
|
-
|
|
154
|
-
**For each potential issue, research the codebase to build confidence:**
|
|
155
|
-
|
|
156
|
-
- Where does this value actually come from? Trace the data flow.
|
|
157
|
-
- Is it configured at deployment (settings, env vars) or from user input?
|
|
158
|
-
- Is there validation, sanitization, or allowlisting elsewhere?
|
|
159
|
-
- What framework protections apply?
|
|
160
|
-
|
|
161
|
-
Only report issues where you have HIGH confidence after understanding the broader context.
|
|
162
|
-
|
|
163
|
-
### 5. Verify Exploitability
|
|
164
|
-
|
|
165
|
-
For each potential finding, confirm:
|
|
166
|
-
|
|
167
|
-
**Is the input attacker-controlled?**
|
|
168
|
-
|
|
169
|
-
| Attacker-Controlled (Investigate) | Server-Controlled (Usually Safe) |
|
|
170
|
-
|-----------------------------------|----------------------------------|
|
|
171
|
-
| `request.GET`, `request.POST`, `request.args` | `settings.X`, `app.config['X']` |
|
|
172
|
-
| `request.json`, `request.data`, `request.body` | `os.environ.get('X')` |
|
|
173
|
-
| `request.headers` (most headers) | Hardcoded constants |
|
|
174
|
-
| `request.cookies` (unsigned) | Internal service URLs from config |
|
|
175
|
-
| URL path segments: `/users/<id>/` | Database content from admin/system |
|
|
176
|
-
| File uploads (content and names) | Signed session data |
|
|
177
|
-
| Database content from other users | Framework settings |
|
|
178
|
-
| WebSocket messages | |
|
|
179
|
-
|
|
180
|
-
**Does the framework mitigate this?**
|
|
181
|
-
- Check language guide for auto-escaping, parameterization
|
|
182
|
-
- Check for middleware/decorators that sanitize
|
|
183
|
-
|
|
184
|
-
**Is there validation upstream?**
|
|
185
|
-
- Input validation before this code
|
|
186
|
-
- Sanitization libraries (DOMPurify, bleach, etc.)
|
|
187
|
-
|
|
188
|
-
### 6. Report HIGH Confidence Only
|
|
189
|
-
|
|
190
|
-
Skip theoretical issues. Report only what you've confirmed is exploitable after research.
|
|
191
|
-
|
|
192
|
-
---
|
|
65
|
+
For review process, read `references/review-process-detail.md`. Load only when this part of the task applies.
|
|
193
66
|
|
|
194
67
|
## Severity Classification
|
|
195
68
|
|
|
@@ -204,60 +77,7 @@ Skip theoretical issues. Report only what you've confirmed is exploitable after
|
|
|
204
77
|
|
|
205
78
|
## Quick Patterns Reference
|
|
206
79
|
|
|
207
|
-
|
|
208
|
-
```
|
|
209
|
-
eval(user_input) # Any language
|
|
210
|
-
exec(user_input) # Any language
|
|
211
|
-
pickle.loads(user_data) # Python
|
|
212
|
-
yaml.load(user_data) # Python (not safe_load)
|
|
213
|
-
unserialize($user_data) # PHP
|
|
214
|
-
deserialize(user_data) # Java ObjectInputStream
|
|
215
|
-
shell=True + user_input # Python subprocess
|
|
216
|
-
child_process.exec(user) # Node.js
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
### Always Flag (High)
|
|
220
|
-
```
|
|
221
|
-
innerHTML = userInput # DOM XSS
|
|
222
|
-
dangerouslySetInnerHTML={user} # React XSS
|
|
223
|
-
v-html="userInput" # Vue XSS
|
|
224
|
-
f"SELECT * FROM x WHERE {user}" # SQL injection
|
|
225
|
-
`SELECT * FROM x WHERE ${user}` # SQL injection
|
|
226
|
-
os.system(f"cmd {user_input}") # Command injection
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
### Always Flag (Secrets)
|
|
230
|
-
```
|
|
231
|
-
password = "hardcoded"
|
|
232
|
-
api_key = "sk-..."
|
|
233
|
-
AWS_SECRET_ACCESS_KEY = "..."
|
|
234
|
-
private_key = "-----BEGIN"
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
### Check Context First (MUST Investigate Before Flagging)
|
|
238
|
-
```
|
|
239
|
-
# SSRF - ONLY if URL is from user input, NOT from settings/config
|
|
240
|
-
requests.get(request.GET['url']) # FLAG: User-controlled URL
|
|
241
|
-
requests.get(settings.API_URL) # SAFE: Server-controlled config
|
|
242
|
-
requests.get(f"{settings.BASE}/{x}") # CHECK: Is 'x' user input?
|
|
243
|
-
|
|
244
|
-
# Path traversal - ONLY if path is from user input
|
|
245
|
-
open(request.GET['file']) # FLAG: User-controlled path
|
|
246
|
-
open(settings.LOG_PATH) # SAFE: Server-controlled config
|
|
247
|
-
open(f"{BASE_DIR}/{filename}") # CHECK: Is 'filename' user input?
|
|
248
|
-
|
|
249
|
-
# Open redirect - ONLY if URL is from user input
|
|
250
|
-
redirect(request.GET['next']) # FLAG: User-controlled redirect
|
|
251
|
-
redirect(settings.LOGIN_URL) # SAFE: Server-controlled config
|
|
252
|
-
|
|
253
|
-
# Weak crypto - ONLY if used for security purposes
|
|
254
|
-
hashlib.md5(file_content) # SAFE: File checksums, caching
|
|
255
|
-
hashlib.md5(password) # FLAG: Password hashing
|
|
256
|
-
random.random() # SAFE: Non-security uses (UI, sampling)
|
|
257
|
-
random.random() for token # FLAG: Security tokens need secrets module
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
---
|
|
80
|
+
For quick patterns reference, read `references/quick-patterns-reference-detail.md`. Load only when this part of the task applies.
|
|
261
81
|
|
|
262
82
|
## Output Format
|
|
263
83
|
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
## Do Not Flag
|
|
2
|
+
|
|
3
|
+
### General Rules
|
|
4
|
+
- Test files (unless explicitly reviewing test security)
|
|
5
|
+
- Dead code, commented code, documentation strings
|
|
6
|
+
- Patterns using **constants** or **server-controlled configuration**
|
|
7
|
+
- Code paths that require prior authentication to reach (note the auth requirement instead)
|
|
8
|
+
|
|
9
|
+
### Server-Controlled Values (NOT Attacker-Controlled)
|
|
10
|
+
|
|
11
|
+
These are configured by operators, not controlled by attackers:
|
|
12
|
+
|
|
13
|
+
| Source | Example | Why It's Safe |
|
|
14
|
+
|--------|---------|---------------|
|
|
15
|
+
| Django settings | `settings.API_URL`, `settings.ALLOWED_HOSTS` | Set via config/env at deployment |
|
|
16
|
+
| Environment variables | `os.environ.get('DATABASE_URL')` | Deployment configuration |
|
|
17
|
+
| Config files | `config.yaml`, `app.config['KEY']` | Server-side files |
|
|
18
|
+
| Framework constants | `django.conf.settings.*` | Not user-modifiable |
|
|
19
|
+
| Hardcoded values | `BASE_URL = "https://api.internal"` | Compile-time constants |
|
|
20
|
+
|
|
21
|
+
**SSRF Example - NOT a vulnerability:**
|
|
22
|
+
```python
|
|
23
|
+
# SAFE: URL comes from Django settings (server-controlled)
|
|
24
|
+
response = requests.get(f"{settings.SEER_AUTOFIX_URL}{path}")
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**SSRF Example - IS a vulnerability:**
|
|
28
|
+
```python
|
|
29
|
+
# VULNERABLE: URL comes from request (attacker-controlled)
|
|
30
|
+
response = requests.get(request.GET.get('url'))
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Framework-Mitigated Patterns
|
|
34
|
+
Check language guides before flagging. Common false positives:
|
|
35
|
+
|
|
36
|
+
| Pattern | Why It's Usually Safe |
|
|
37
|
+
|---------|----------------------|
|
|
38
|
+
| Django `{{ variable }}` | Auto-escaped by default |
|
|
39
|
+
| React `{variable}` | Auto-escaped by default |
|
|
40
|
+
| Vue `{{ variable }}` | Auto-escaped by default |
|
|
41
|
+
| `User.objects.filter(id=input)` | ORM parameterizes queries |
|
|
42
|
+
| `cursor.execute("...%s", (input,))` | Parameterized query |
|
|
43
|
+
| `innerHTML = "<b>Loading...</b>"` | Constant string, no user input |
|
|
44
|
+
|
|
45
|
+
**Only flag these when:**
|
|
46
|
+
- Django: `{{ var|safe }}`, `{% autoescape off %}`, `mark_safe(user_input)`
|
|
47
|
+
- React: `dangerouslySetInnerHTML={{__html: userInput}}`
|
|
48
|
+
- Vue: `v-html="userInput"`
|
|
49
|
+
- ORM: `.raw()`, `.extra()`, `RawSQL()` with string interpolation
|