wize-dev-kit 0.14.0 → 0.16.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.
Files changed (226) hide show
  1. package/ARCH.md +24 -77
  2. package/CHANGELOG.md +24 -0
  3. package/DECISIONS.md +1 -27
  4. package/README.md +7 -2
  5. package/ROSTER.md +3 -11
  6. package/adapters/README.md +7 -7
  7. package/adapters/antigravity/README.md +5 -5
  8. package/adapters/claude-code/README.md +1 -1
  9. package/adapters/codex/README.md +5 -5
  10. package/adapters/codex/adapter.yaml +1 -1
  11. package/adapters/codex/render.js +1 -1
  12. package/adapters/continue/README.md +5 -5
  13. package/adapters/cursor/README.md +2 -2
  14. package/adapters/generic/README.md +1 -1
  15. package/adapters/kimi-code/README.md +5 -5
  16. package/adapters/kimi-code/render.js +2 -2
  17. package/adapters/opencode/README.md +3 -3
  18. package/adapters/opencode/render.js +1 -27
  19. package/adapters/windsurf/README.md +3 -3
  20. package/package.json +1 -1
  21. package/schemas/agent.schema.json +2 -2
  22. package/schemas/workflow.schema.json +1 -1
  23. package/src/app-overlay/wize-app-release-channels/workflow.md +0 -2
  24. package/src/app-overlay/wize-app-scaffold/workflow.md +0 -2
  25. package/src/app-overlay/wize-app-store-listing/workflow.md +0 -2
  26. package/src/builder-skills/wize-create-agent/workflow.md +0 -2
  27. package/src/builder-skills/wize-create-skill/workflow.md +0 -2
  28. package/src/builder-skills/wize-create-workflow/workflow.md +0 -2
  29. package/src/core-skills/module.yaml +3 -0
  30. package/src/core-skills/wize-advanced-elicitation/skill.md +0 -2
  31. package/src/core-skills/wize-brainstorming/skill.md +0 -2
  32. package/src/core-skills/wize-eli5/skill.md +72 -0
  33. package/src/core-skills/wize-review-adversarial/skill.md +0 -3
  34. package/src/core-skills/wize-shard-doc/skill.md +0 -2
  35. package/src/method-skills/1-analysis/wize-agent-analyst/agent.yaml +0 -3
  36. package/src/method-skills/1-analysis/wize-document-project/workflow.md +20 -213
  37. package/src/method-skills/1-analysis/wize-prfaq/workflow.md +11 -152
  38. package/src/method-skills/1-analysis/wize-product-brief/workflow.md +19 -92
  39. package/src/method-skills/1-analysis/wize-research/workflow.md +12 -39
  40. package/src/method-skills/1-analysis/wize-trigger-map/workflow.md +16 -82
  41. package/src/method-skills/2-plan-workflows/wize-create-prd/workflow.md +23 -135
  42. package/src/method-skills/2-plan-workflows/wize-ux-design/workflow.md +28 -134
  43. package/src/method-skills/2-plan-workflows/wize-ux-scenarios/workflow.md +15 -93
  44. package/src/method-skills/2-plan-workflows/wize-validate-prd/workflow.md +12 -108
  45. package/src/method-skills/3-solutioning/wize-check-implementation-readiness/workflow.md +11 -103
  46. package/src/method-skills/3-solutioning/wize-create-architecture/workflow.md +48 -55
  47. package/src/method-skills/3-solutioning/wize-create-epics-and-stories/workflow.md +15 -154
  48. package/src/method-skills/3-solutioning/wize-design-system/workflow.md +22 -184
  49. package/src/method-skills/3-solutioning/wize-nfr-principles/workflow.md +17 -145
  50. package/src/method-skills/3-solutioning/wize-tech-vision/workflow.md +22 -130
  51. package/src/method-skills/4-implementation/wize-agent-dev/persona.md +0 -12
  52. package/src/method-skills/4-implementation/wize-code-review/workflow.md +12 -54
  53. package/src/method-skills/4-implementation/wize-create-story/workflow.md +10 -154
  54. package/src/method-skills/4-implementation/wize-dev-story/workflow.md +17 -185
  55. package/src/method-skills/4-implementation/wize-quick-dev/workflow.md +18 -136
  56. package/src/method-skills/4-implementation/wize-retrospective/workflow.md +10 -114
  57. package/src/method-skills/4-implementation/wize-sprint-planning/workflow.md +11 -78
  58. package/src/method-skills/4-implementation/wize-sprint-status/workflow.md +11 -45
  59. package/src/method-skills/module.yaml +0 -28
  60. package/src/orchestrator-skills/module.yaml +1 -7
  61. package/src/orchestrator-skills/wize-help/skill.md +67 -227
  62. package/src/orchestrator-skills/wize-onboarding/workflow.md +14 -78
  63. package/src/orchestrator-skills/wize-orchestrator/agent.yaml +0 -2
  64. package/src/orchestrator-skills/wize-orchestrator/persona.md +3 -44
  65. package/src/orchestrator-skills/wize-party-mode/workflow.md +0 -2
  66. package/src/tea-skills/wize-tea-design/workflow.md +13 -107
  67. package/src/tea-skills/wize-tea-gate/workflow.md +25 -118
  68. package/src/tea-skills/wize-tea-nfr/workflow.md +14 -107
  69. package/src/tea-skills/wize-tea-review/workflow.md +13 -123
  70. package/src/tea-skills/wize-tea-risk/workflow.md +10 -113
  71. package/src/tea-skills/wize-tea-trace/workflow.md +12 -86
  72. package/src/web-overlay/wize-web-deploy/workflow.md +0 -2
  73. package/src/web-overlay/wize-web-scaffold/workflow.md +0 -2
  74. package/src/web-overlay/wize-web-seo-audit/workflow.md +0 -2
  75. package/tools/check-eli5-all-adapters.js +50 -0
  76. package/tools/installer/onboarding.js +20 -14
  77. package/tools/installer/render-shared.js +14 -158
  78. package/tools/installer/validators/run-all.js +2 -3
  79. package/tools/installer/wize-cli.js +70 -499
  80. package/AGENTS.md +0 -37
  81. package/README.es.md +0 -294
  82. package/README.pt-BR.md +0 -292
  83. package/docs/harnesses/antigravity.md +0 -20
  84. package/docs/harnesses/antigravity.pt-BR.md +0 -20
  85. package/docs/harnesses/claude-code.md +0 -23
  86. package/docs/harnesses/claude-code.pt-BR.md +0 -23
  87. package/docs/harnesses/codex.md +0 -21
  88. package/docs/harnesses/codex.pt-BR.md +0 -21
  89. package/docs/harnesses/continue.md +0 -21
  90. package/docs/harnesses/continue.pt-BR.md +0 -21
  91. package/docs/harnesses/cursor.md +0 -22
  92. package/docs/harnesses/cursor.pt-BR.md +0 -22
  93. package/docs/harnesses/generic.md +0 -20
  94. package/docs/harnesses/generic.pt-BR.md +0 -20
  95. package/docs/harnesses/kimi-code.md +0 -19
  96. package/docs/harnesses/kimi-code.pt-BR.md +0 -19
  97. package/docs/harnesses/opencode.md +0 -31
  98. package/docs/harnesses/opencode.pt-BR.md +0 -31
  99. package/docs/harnesses/windsurf.md +0 -22
  100. package/docs/harnesses/windsurf.pt-BR.md +0 -22
  101. package/src/core-skills/wize-customize/skill.md +0 -116
  102. package/src/core-skills/wize-editorial-review-prose/skill.md +0 -94
  103. package/src/core-skills/wize-editorial-review-structure/skill.md +0 -99
  104. package/src/core-skills/wize-grill/skill.md +0 -77
  105. package/src/core-skills/wize-index-docs/skill.md +0 -119
  106. package/src/core-skills/wize-pre-pr-check/skill.md +0 -134
  107. package/src/core-skills/wize-review-edge-case-hunter/skill.md +0 -115
  108. package/src/core-skills/wize-spec/assets/headless-schemas.md +0 -39
  109. package/src/core-skills/wize-spec/assets/spec-template.md +0 -40
  110. package/src/core-skills/wize-spec/customize.toml +0 -20
  111. package/src/core-skills/wize-spec/skill.md +0 -112
  112. package/src/method-skills/1-analysis/wize-document-project/documentation-requirements.csv +0 -12
  113. package/src/method-skills/1-analysis/wize-document-project/templates/api-contracts-template.md +0 -38
  114. package/src/method-skills/1-analysis/wize-document-project/templates/architecture-template.md +0 -54
  115. package/src/method-skills/1-analysis/wize-document-project/templates/component-inventory-template.md +0 -40
  116. package/src/method-skills/1-analysis/wize-document-project/templates/contribution-guide-template.md +0 -34
  117. package/src/method-skills/1-analysis/wize-document-project/templates/data-models-template.md +0 -36
  118. package/src/method-skills/1-analysis/wize-document-project/templates/deep-dive-template.md +0 -312
  119. package/src/method-skills/1-analysis/wize-document-project/templates/deployment-guide-template.md +0 -42
  120. package/src/method-skills/1-analysis/wize-document-project/templates/development-guide-template.md +0 -61
  121. package/src/method-skills/1-analysis/wize-document-project/templates/index-template.md +0 -185
  122. package/src/method-skills/1-analysis/wize-document-project/templates/project-overview-template.md +0 -110
  123. package/src/method-skills/1-analysis/wize-document-project/templates/project-scan-report-schema.json +0 -159
  124. package/src/method-skills/1-analysis/wize-document-project/templates/source-tree-template.md +0 -142
  125. package/src/method-skills/1-analysis/wize-domain-research/customize.toml +0 -14
  126. package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-01-init.md +0 -49
  127. package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-02-domain-analysis.md +0 -39
  128. package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-03-competitive-landscape.md +0 -39
  129. package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-04-regulatory-focus.md +0 -39
  130. package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-05-technical-trends.md +0 -39
  131. package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-06-research-synthesis.md +0 -43
  132. package/src/method-skills/1-analysis/wize-domain-research/research.template.md +0 -31
  133. package/src/method-skills/1-analysis/wize-domain-research/workflow.md +0 -58
  134. package/src/method-skills/1-analysis/wize-market-research/customize.toml +0 -14
  135. package/src/method-skills/1-analysis/wize-market-research/research.template.md +0 -31
  136. package/src/method-skills/1-analysis/wize-market-research/steps/step-01-init.md +0 -57
  137. package/src/method-skills/1-analysis/wize-market-research/steps/step-02-customer-behavior.md +0 -39
  138. package/src/method-skills/1-analysis/wize-market-research/steps/step-03-customer-pain-points.md +0 -37
  139. package/src/method-skills/1-analysis/wize-market-research/steps/step-04-customer-decisions.md +0 -39
  140. package/src/method-skills/1-analysis/wize-market-research/steps/step-05-competitive-analysis.md +0 -37
  141. package/src/method-skills/1-analysis/wize-market-research/steps/step-06-research-completion.md +0 -47
  142. package/src/method-skills/1-analysis/wize-market-research/workflow.md +0 -66
  143. package/src/method-skills/1-analysis/wize-refresh-knowledge/workflow.md +0 -129
  144. package/src/method-skills/1-analysis/wize-technical-research/customize.toml +0 -14
  145. package/src/method-skills/1-analysis/wize-technical-research/research.template.md +0 -31
  146. package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-01-init.md +0 -49
  147. package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-02-technical-overview.md +0 -45
  148. package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-03-integration-patterns.md +0 -39
  149. package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-04-architectural-patterns.md +0 -39
  150. package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-05-implementation-research.md +0 -42
  151. package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-06-research-synthesis.md +0 -46
  152. package/src/method-skills/1-analysis/wize-technical-research/workflow.md +0 -60
  153. package/src/method-skills/2-plan-workflows/wize-edit-prd/workflow.md +0 -110
  154. package/src/method-skills/3-solutioning/wize-create-architecture/architecture-decision-template.md +0 -41
  155. package/src/method-skills/3-solutioning/wize-create-architecture/customize.toml +0 -20
  156. package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-01-init.md +0 -95
  157. package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-01b-continue.md +0 -32
  158. package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-02-context.md +0 -126
  159. package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-03-starter.md +0 -110
  160. package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-04-decisions.md +0 -129
  161. package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-05-patterns.md +0 -109
  162. package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-06-structure.md +0 -97
  163. package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-07-validation.md +0 -124
  164. package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-08-complete.md +0 -59
  165. package/src/method-skills/3-solutioning/wize-project-context/workflow.md +0 -120
  166. package/src/method-skills/4-implementation/wize-changelog/workflow.md +0 -184
  167. package/src/method-skills/4-implementation/wize-checkpoint-preview/workflow.md +0 -117
  168. package/src/method-skills/4-implementation/wize-code-review/customize.toml +0 -21
  169. package/src/method-skills/4-implementation/wize-code-review/steps/step-01-gather-context.md +0 -64
  170. package/src/method-skills/4-implementation/wize-code-review/steps/step-02-review.md +0 -40
  171. package/src/method-skills/4-implementation/wize-code-review/steps/step-03-triage.md +0 -43
  172. package/src/method-skills/4-implementation/wize-code-review/steps/step-04-present.md +0 -100
  173. package/src/method-skills/4-implementation/wize-correct-course/workflow.md +0 -93
  174. package/src/method-skills/4-implementation/wize-investigate/workflow.md +0 -123
  175. package/src/method-skills/4-implementation/wize-release/workflow.md +0 -162
  176. package/src/orchestrator-skills/wize/skill.md +0 -164
  177. package/src/orchestrator-skills/wize-check/skill.md +0 -98
  178. package/src/security-overlay/_shared/allowlist.js +0 -154
  179. package/src/security-overlay/_shared/backlog.js +0 -169
  180. package/src/security-overlay/_shared/cli-runner.js +0 -87
  181. package/src/security-overlay/_shared/cvss.js +0 -108
  182. package/src/security-overlay/_shared/detect.js +0 -125
  183. package/src/security-overlay/_shared/install-script.js +0 -205
  184. package/src/security-overlay/_shared/invoke-phase.js +0 -86
  185. package/src/security-overlay/_shared/owasp.js +0 -56
  186. package/src/security-overlay/_shared/partial.js +0 -225
  187. package/src/security-overlay/_shared/preflight.js +0 -175
  188. package/src/security-overlay/_shared/scope-gate.js +0 -172
  189. package/src/security-overlay/_shared/scope-parser.js +0 -147
  190. package/src/security-overlay/agents/red-teamer/agent.yaml +0 -54
  191. package/src/security-overlay/agents/red-teamer/persona.md +0 -49
  192. package/src/security-overlay/data/common.txt +0 -115
  193. package/src/security-overlay/data/owasp-top10.json +0 -15
  194. package/src/security-overlay/data/tool-allowlist.json +0 -31
  195. package/src/security-overlay/skills/wize-sec-enumerate/scripts/run-enumerate.js +0 -180
  196. package/src/security-overlay/skills/wize-sec-enumerate/skill.md +0 -34
  197. package/src/security-overlay/skills/wize-sec-exploit/data/common.txt +0 -117
  198. package/src/security-overlay/skills/wize-sec-exploit/scripts/run-ffuf.js +0 -147
  199. package/src/security-overlay/skills/wize-sec-exploit/scripts/run-nikto.js +0 -145
  200. package/src/security-overlay/skills/wize-sec-exploit/scripts/run-nuclei.js +0 -176
  201. package/src/security-overlay/skills/wize-sec-exploit/scripts/run-sqlmap.js +0 -139
  202. package/src/security-overlay/skills/wize-sec-pentest/scripts/run-pipeline.js +0 -184
  203. package/src/security-overlay/skills/wize-sec-pentest/skill.md +0 -54
  204. package/src/security-overlay/skills/wize-sec-recon/scripts/run-gitleaks.js +0 -139
  205. package/src/security-overlay/skills/wize-sec-recon/scripts/run-osv.js +0 -227
  206. package/src/security-overlay/skills/wize-sec-recon/scripts/run-recon.js +0 -162
  207. package/src/security-overlay/skills/wize-sec-recon/skill.md +0 -37
  208. package/src/security-overlay/skills/wize-sec-report/scripts/render-report.js +0 -1033
  209. package/src/security-overlay/skills/wize-sec-scope/scripts/generate-scope.js +0 -106
  210. package/src/security-overlay/skills/wize-sec-scope/skill.md +0 -52
  211. package/src/tea-skills/wize-qa-generate-e2e-tests/workflow.md +0 -121
  212. package/tools/installer/baseline.js +0 -128
  213. package/tools/installer/commands/agent.js +0 -197
  214. package/tools/installer/commands/doctor.js +0 -319
  215. package/tools/installer/commands/document-project.js +0 -93
  216. package/tools/installer/commands/sync.js +0 -45
  217. package/tools/installer/commands/update.js +0 -172
  218. package/tools/installer/document-project/batch-scanner.js +0 -93
  219. package/tools/installer/document-project/classify.js +0 -170
  220. package/tools/installer/document-project/modes/deep-dive.js +0 -196
  221. package/tools/installer/document-project/modes/full-rescan.js +0 -15
  222. package/tools/installer/document-project/modes/initial-scan.js +0 -100
  223. package/tools/installer/document-project/modes/quick.js +0 -211
  224. package/tools/installer/document-project/render-index.js +0 -101
  225. package/tools/installer/document-project/state.js +0 -110
  226. package/tools/installer/version-check.js +0 -117
@@ -1,139 +0,0 @@
1
- 'use strict';
2
-
3
- // run-sqlmap.js — DAST sqlmap. GATED by --active (ADR-004). Without
4
- // --active, sqlmap is NOT invoked even if the tool is installed.
5
- // filterArgs() blocks --dump and --os-shell (exfiltration / shell) —
6
- // they're not in the allowlist.
7
-
8
- const path = require('node:path');
9
- const fs = require('node:fs');
10
- const { execFileSync } = require('node:child_process');
11
-
12
- const { assertTargetInScope } = require('../../../_shared/scope-gate.js');
13
- const { filterArgs } = require('../../../_shared/allowlist.js');
14
- const { writePartial, loadPartial } = require('../../../_shared/partial.js');
15
- const { tagOwasp } = require('../../../_shared/owasp.js');
16
-
17
- const TIMEOUT_MS = 5 * 60 * 1000;
18
-
19
- function defaultArgs(targetUrl) {
20
- // Conservative defaults. filterArgs() drops --dump, --os-shell, --level>1,
21
- // --risk>1, etc. — they're not in the allowlist.
22
- return ['-u', targetUrl, '--batch', '--level=1', '--risk=1', '--threads=2', '--timeout=10', '--retries=1', '--random-agent'];
23
- }
24
-
25
- // Parse a slice of sqlmap stdout into findings. Sqlmap's output is fairly
26
- // free-form; we use a relaxed parser that looks for the canonical
27
- // "Parameter: <name> ... Type: ..." block.
28
- function parseSqlmapStdout(stdout) {
29
- const findings = [];
30
- const lines = String(stdout || '').split('\n');
31
- let current = null;
32
- for (const line of lines) {
33
- const pm = line.match(/Parameter:\s*(\S+).*Type:\s*(\S+)/i);
34
- if (pm) {
35
- if (current) findings.push(current);
36
- current = { parameter: pm[1], type: pm[2] };
37
- continue;
38
- }
39
- const dm = line.match(/DBMS:\s*(.+?)\s*$/i);
40
- if (dm && current) current.dbms = dm[1];
41
- const pm2 = line.match(/Payload:\s*(.+?)\s*$/i);
42
- if (pm2 && current) current.payload = pm2[1];
43
- const reqm = line.match(/^\s*Type:\s*UNION.*query/i);
44
- if (reqm && current) current.kind = 'union';
45
- }
46
- if (current) findings.push(current);
47
- return findings;
48
- }
49
-
50
- async function runSqlmap(opts = {}) {
51
- const sec = opts.securityDir;
52
- const scope = opts.scope;
53
- const active = opts.active === true;
54
-
55
- const execFn = opts.execFn || ((bin, args) => {
56
- return execFileSync(bin, args, { encoding: 'utf8', timeout: TIMEOUT_MS });
57
- });
58
- const detectFn = opts.detectFn || require('../../../_shared/detect.js').detectTools;
59
-
60
- const tools = detectFn(['sqlmap'], { cacheDir: sec });
61
- const present = !!(tools.sqlmap && tools.sqlmap.present);
62
-
63
- // Resolve dast_target.url.
64
- let targetUrl = null;
65
- for (const line of (scope.body || '').split('\n')) {
66
- const m = line.match(/^url:\s*(.+?)\s*$/);
67
- if (m && line.indexOf('url') === 0) { targetUrl = m[1]; break; }
68
- }
69
-
70
- function mergeDast(sections, status) {
71
- const existing = loadPartial({ securityDir: sec, phase: 'dast' });
72
- const merged = {};
73
- if (existing && existing.body) {
74
- const re = /## ([a-z_]+)\n\n([\s\S]*?)(?=\n## |$)/g;
75
- let m;
76
- while ((m = re.exec(existing.body)) !== null) {
77
- merged[m[1]] = m[2].trim();
78
- }
79
- }
80
- Object.assign(merged, sections);
81
- const finalStatus = merged.degraded_checks ? 'incomplete' : status;
82
- writePartial({
83
- securityDir: sec, phase: 'dast', mode: active ? 'active' : 'passive',
84
- scope, status: finalStatus, tools, sections: merged
85
- });
86
- }
87
-
88
- // 1. Not active -> degraded with [sqlmap-pasive].
89
- if (!active) {
90
- mergeDast({ degraded_checks: '- sqlmap-pasive: --active ausente — sqlmap não é invocado sem opt-in explícito.' }, 'incomplete');
91
- return { ok: true, partialStatus: 'incomplete' };
92
- }
93
-
94
- if (!targetUrl) {
95
- mergeDast({ degraded_checks: '- sqlmap: dast_target.url ausente' }, 'incomplete');
96
- return { ok: true, partialStatus: 'incomplete' };
97
- }
98
-
99
- // 2. Gate first.
100
- const urlObj = new URL(targetUrl);
101
- const inScope = assertTargetInScope(scope, { host: urlObj.hostname, url: targetUrl }, { refusalsDir: sec });
102
- if (!inScope) {
103
- mergeDast({ degraded_checks: `- sqlmap: target ${targetUrl} recusado pelo gate` }, 'incomplete');
104
- return { ok: false, partialStatus: 'incomplete' };
105
- }
106
-
107
- // 3. Missing tool.
108
- if (!present) {
109
- mergeDast({ degraded_checks: '- sqlmap: sqlmap ausente — instale sqlmap e re-rode com --active.' }, 'incomplete');
110
- return { ok: true, partialStatus: 'incomplete' };
111
- }
112
-
113
- // 4. happy path (active + present + in scope).
114
- const rawArgs = defaultArgs(targetUrl);
115
- const args = filterArgs('sqlmap', rawArgs);
116
- const r = execFn('sqlmap', args, { timeout: TIMEOUT_MS });
117
- const stdout = r && r.stdout ? r.stdout : '';
118
- const findings = parseSqlmapStdout(stdout);
119
- const findingsWithOwasp = findings.map(f => ({ ...f, owasp: tagOwasp({ rule: f.type || 'sqlmap' }) }));
120
- const body = findingsWithOwasp.length
121
- ? findingsWithOwasp.map(f => `- **${f.parameter || '?'}** (\`${f.type || '?'}\`) dbms=\`${f.dbms || '?'}\` owasp=\`${f.owasp}\` payload: ${f.payload || 'n/a'}`).join('\n')
122
- : '_(nenhum finding do sqlmap)_';
123
-
124
- mergeDast({ sqlmap: body }, findingsWithOwasp.length ? 'complete' : 'incomplete');
125
- return { ok: true, partialStatus: findingsWithOwasp.length ? 'complete' : 'incomplete' };
126
- }
127
-
128
- module.exports = { runSqlmap, defaultArgs, parseSqlmapStdout };
129
-
130
- if (require.main === module) {
131
- require('../../../_shared/cli-runner.js').runFromArgv({
132
- fn: ({ securityDir, scopePath, active, target } = {}) => {
133
- const { loadScope } = require('../../../_shared/scope-gate.js');
134
- const scope = loadScope(scopePath);
135
- return runSqlmap({ securityDir, scope, active, target });
136
- },
137
- argMap: { 'securityDir': 'securityDir', 'scope': 'scopePath', 'active': 'active', 'target': 'target' }
138
- });
139
- }
@@ -1,184 +0,0 @@
1
- 'use strict';
2
-
3
- // run-pipeline.js — the orchestrator for the security-overlay. Chains
4
- // the four phase skills (recon -> enumerate -> exploit -> report) and
5
- // propagates --active. This module exposes a `runPipeline(opts)` function
6
- // so the test suite can drive it directly; the SKILL.md entrypoint
7
- // (wize-sec-pentest) is a thin wrapper that just calls runPipeline with
8
- // argv-derived options.
9
-
10
- const path = require('node:path');
11
- const fs = require('node:fs');
12
-
13
- // Default kit root when running from the kit itself. Tests inject their own.
14
- const DEFAULT_KIT_ROOT = path.resolve(__dirname, '..', '..', '..', '..', '..');
15
-
16
- const PHASES = ['wize-sec-recon', 'wize-sec-enumerate', 'wize-sec-exploit', 'wize-sec-report'];
17
-
18
- // Per-phase script manifests. Each phase can run one or more scripts.
19
- // Scripts in the same phase run sequentially and any failure (or skip)
20
- // marks the phase as incomplete, but does not abort the pipeline.
21
- const PHASE_SCRIPTS = {
22
- 'wize-sec-recon': ['recon', 'gitleaks', 'osv'],
23
- 'wize-sec-enumerate': ['enumerate'],
24
- 'wize-sec-exploit': ['nuclei', 'nikto', 'sqlmap', 'ffuf'],
25
- 'wize-sec-report': ['report']
26
- };
27
-
28
- function parseArgv(argv) {
29
- const out = { active: false, scopePath: null, kitRoot: DEFAULT_KIT_ROOT, signScope: false };
30
- for (let i = 0; i < (argv || []).length; i++) {
31
- const a = argv[i];
32
- if (a === '--active') out.active = true;
33
- else if (a === '--sign-scope') out.signScope = true;
34
- else if (a === '--scope' && argv[i + 1]) { out.scopePath = argv[i + 1]; i++; }
35
- else if (a.startsWith('--scope=')) out.scopePath = a.slice('--scope='.length);
36
- }
37
- if (!out.scopePath) out.scopePath = path.join(process.cwd(), '.wize', 'security', 'scope.md');
38
- return out;
39
- }
40
-
41
- // runPipeline({ scopePath, active, kitRoot?, loadScopeFn?, invokePhase? })
42
- // - loadScopeFn defaults to the real scope-gate loadScope.
43
- // - invokePhase defaults to the real invokePhase (subprocess).
44
- // Both are injectable for testing. We resolve the defaults lazily via a
45
- // small indirection (a getter) so a test that mutates the real module's
46
- // exports before loading this file sees the mocked value.
47
- async function runPipeline(opts = {}) {
48
- const scopePath = opts.scopePath;
49
- const active = opts.active === true;
50
- const kitRoot = opts.kitRoot || DEFAULT_KIT_ROOT;
51
- const securityDir = opts.securityDir || path.join(process.cwd(), '.wize', 'security');
52
-
53
- // Lazy default resolution — must read at call time, not destructured at
54
- // module load, so a test that swaps the real module's exports is honored.
55
- const loadScopeFn = opts.loadScopeFn
56
- || require('../../../_shared/scope-gate.js').loadScope;
57
- const invokePhase = opts.invokePhase
58
- || require('../../../_shared/invoke-phase.js').invokePhase;
59
-
60
- // 0. Preflight (permissive — always continues, but writes the install
61
- // script if anything is missing). In test mode the env vars short-
62
- // circuit the real probes so the result is deterministic.
63
- const preflight = opts.preflight
64
- || require('../../../_shared/preflight.js').runPreflight({ kitRoot });
65
- if (preflight.missing.length > 0 && opts.writeInstallScript !== false) {
66
- const { generateInstallScript } = require('../../../_shared/install-script.js');
67
- const script = generateInstallScript(preflight);
68
- try {
69
- const scriptPath = path.join(securityDir, 'install-pentest-tools.sh');
70
- // Don't clobber a user-edited script.
71
- if (!fs.existsSync(scriptPath)) {
72
- fs.mkdirSync(securityDir, { recursive: true });
73
- fs.writeFileSync(scriptPath, script, 'utf8');
74
- try { fs.chmodSync(scriptPath, 0o755); } catch (_) { /* best-effort */ }
75
- }
76
- } catch (_) { /* best-effort: a write failure here does not block the pipeline */ }
77
- }
78
-
79
- // 1. Gate first — if the scope is invalid, abort the whole pipeline.
80
- const scope = loadScopeFn(scopePath);
81
-
82
- const results = {};
83
- const skipped = [];
84
-
85
- for (const phase of PHASES) {
86
- const scripts = PHASE_SCRIPTS[phase] || [phase.split('-').pop()];
87
- const phaseResults = [];
88
- for (const sub of scripts) {
89
- // Naming convention: scripts in the skill dir are run-<sub>.js, except
90
- // for the report phase which is render-report.js.
91
- const baseName = phase === 'wize-sec-report' ? `render-${sub}` : `run-${sub}`;
92
- const scriptName = baseName.endsWith('.js') ? baseName : baseName + '.js';
93
- try {
94
- const r = await invokePhase(phase, { kitRoot, active, securityDir, scopePath, scriptName });
95
- phaseResults.push({ sub, ...r });
96
- if (!r.ok) skipped.push(`${phase}/${sub}`);
97
- } catch (_) {
98
- phaseResults.push({ sub, ok: false, code: -1, stdout: '', stderr: '', error: 'invoke-threw' });
99
- skipped.push(`${phase}/${sub}`);
100
- }
101
- }
102
- // Phase is OK if at least one sub-script succeeded.
103
- const anyOk = phaseResults.some(r => r && r.ok);
104
- results[phase] = { ok: anyOk, subs: phaseResults };
105
- }
106
-
107
- const anyOk = Object.values(results).some(r => r && r.ok);
108
- return {
109
- ok: anyOk,
110
- scopePath,
111
- active,
112
- preflight,
113
- results,
114
- skipped
115
- };
116
- }
117
-
118
- // Entry point when invoked as a subprocess (the SKILL.md frontmatter
119
- // declares commands: [run-pipeline.js]). The harness's adapter renders
120
- // this file as the skill body and runs `node run-pipeline.js` when the
121
- // user invokes `/wize-sec-pentest`.
122
- async function main() {
123
- const args = parseArgv(process.argv.slice(2));
124
-
125
- // --sign-scope: recompute SHA-256 and exit (no pipeline run).
126
- if (args.signScope) {
127
- try {
128
- const { signScope } = require('../../../_shared/scope-parser.js');
129
- const result = signScope(args.scopePath);
130
- console.log(`✓ Scope re-assinado. SHA-256: ${result.sha256}`);
131
- console.log(` aceite por: ${result.accepted_by}`);
132
- console.log(` arquivo: ${result.path}`);
133
- process.exit(0);
134
- } catch (err) {
135
- console.error('✖ sign-scope falhou:', err && err.message ? err.message : err);
136
- process.exit(2);
137
- }
138
- }
139
-
140
- let result;
141
- try {
142
- // Derive the securityDir from the scopePath's parent (the .wize/security
143
- // directory) so the preflight's install script lands next to the scope.
144
- const secDir = path.dirname(args.scopePath);
145
- result = await runPipeline({
146
- scopePath: args.scopePath,
147
- active: args.active,
148
- kitRoot: args.kitRoot,
149
- securityDir: secDir
150
- });
151
- } catch (err) {
152
- console.error('✖ wize-sec-pentest aborted:', err && err.message ? err.message : err);
153
- process.exit(2);
154
- }
155
-
156
- // Minimal stdout surface — the partials already carry detail.
157
- for (const phase of PHASES) {
158
- const r = result.results[phase];
159
- if (!r) { console.log(`= ${phase}: (no result)`); continue; }
160
- const mark = r.ok ? '✓' : '✗';
161
- const subs = (r.subs || []).map(s => `${s.sub}:${s.ok ? 'ok' : 'fail'}`).join(',');
162
- console.log(`${mark} ${phase}: ${subs}`);
163
- }
164
- if (result.skipped.length) {
165
- console.log(`! skipped: ${result.skipped.join(', ')}`);
166
- }
167
- // Next-step CTA: turn the findings into a remediation sprint. The overlay
168
- // never invokes a skill itself (zero runtime própio) — it prints the exact
169
- // command for the user/agent to run.
170
- try {
171
- const { CTA_COMMAND } = require('../../../_shared/backlog.js');
172
- console.log('');
173
- console.log('→ Backlog de correção gerado em .wize/security/security-backlog.md');
174
- console.log('→ Próximo passo — planejar a sprint de correção, rode:');
175
- console.log(` ${CTA_COMMAND}`);
176
- } catch (_) { /* backlog module optional */ }
177
- process.exit(result.ok ? 0 : 1);
178
- }
179
-
180
- if (require.main === module) {
181
- main();
182
- }
183
-
184
- module.exports = { runPipeline, parseArgv, PHASES };
@@ -1,54 +0,0 @@
1
- ---
2
-
3
- code: wize-sec-pentest
4
- description: "Use quando o scope de segurança estiver definido e precisar executar o pipeline completo de pentest (recon → enumerate → exploit → report)."
5
- name: wize-sec-pentest
6
- overlay: security
7
- module: security-overlay
8
- owner: wize-sec-red-teamer # Natasha Romanoff
9
- status: ready
10
- ---
11
-
12
- # wize-sec-pentest — Orchestrator (Security Overlay)
13
-
14
- End-to-end security pipeline. Chains **recon → enumerate → sast → dast → report** through the four phase skills (`wize-sec-recon`, `wize-sec-enumerate`, `wize-sec-exploit`, `wize-sec-report`). Loads `.wize/security/scope.md` first; aborts the whole pipeline if the scope is missing or invalid.
15
-
16
- ## Usage
17
-
18
- ```bash
19
- # Default (passive — read-only checks only)
20
- /wize-sec-pentest
21
-
22
- # Active exploitation (sqlmap, ffuf active fuzzing) — requires scope acceptance
23
- /wize-sec-pentest --active
24
-
25
- # Custom scope path (default: .wize/security/scope.md)
26
- /wize-sec-pentest --scope=/path/to/scope.md
27
- ```
28
-
29
- ## Phases (in order)
30
-
31
- 1. **recon** — nmap (passive) → `recon.md`
32
- 2. **enumerate** — nuclei passive, HTTP probing → `enumerate.md`
33
- 3. **sast** — gitleaks (secrets) + osv-scanner/grype (deps) → `sast.md` (run inside `wize-sec-recon` per the architecture decision)
34
- 4. **dast** — nuclei + nikto (passive) + sqlmap/ffuf (gated by `--active`) → `dast.md`
35
- 5. **report** — render `report.md` + `report.html` from all partials
36
-
37
- Each phase produces a partial. The report phase consumes them. A phase that fails is marked `partial_status: skipped` and the pipeline continues with the next one.
38
-
39
- ## Gate
40
-
41
- Before any phase, the orchestrator calls `loadScope()` (the shared gate). An invalid scope aborts the whole pipeline with the error code from `ScopeError`. The gate is the single source of truth — phases do not re-validate.
42
-
43
- ## Propagation
44
-
45
- `--active` is read from argv and passed to every phase invocation. Each phase that supports active checks (currently `wize-sec-exploit`) decides what changes in active mode.
46
-
47
- ## Output
48
-
49
- - `recon.md`, `enumerate.md`, `sast.md`, `dast.md` — partials (one per phase)
50
- - `report.md`, `report.html` — final consolidated report
51
- - `.refusals.log` — audit trail of out-of-scope refusals
52
- - `.tools.json` — detection cache for the toolchain
53
-
54
- Exits 0 if at least one phase ran; 1 if all phases failed; 2 if the scope gate aborted.
@@ -1,139 +0,0 @@
1
- 'use strict';
2
-
3
- // run-gitleaks.js — SAST secrets via gitleaks. Runs inside the
4
- // wize-sec-recon skill (per the architecture decision that recon hosts
5
- // the no-app-running checks). Writes a redaction into sast.md and stores
6
- // the full gitleaks report in the security dir for the user to inspect.
7
-
8
- const path = require('node:path');
9
- const fs = require('node:fs');
10
- const { execFileSync } = require('node:child_process');
11
-
12
- const { filterArgs } = require('../../../_shared/allowlist.js');
13
- const { writePartial, loadPartial } = require('../../../_shared/partial.js');
14
-
15
- const REDACTED = '***REDACTED***';
16
-
17
- // runGitleaks({ securityDir, scope, active, execFn?, detectFn?, reportFilename? })
18
- // -> { ok, partialStatus, findingsCount }
19
- async function runGitleaks(opts = {}) {
20
- const sec = opts.securityDir;
21
- const scope = opts.scope;
22
- const active = opts.active === true;
23
- const reportFilename = opts.reportFilename || 'gitleaks-report.json';
24
- // The project to scan is the parent of `.wize/security/`. The scripts run
25
- // with cwd = the kit, so we MUST point gitleaks at the target repo, not '.'.
26
- const projectRoot = opts.projectRoot || (sec ? path.resolve(sec, '..', '..') : process.cwd());
27
-
28
- const execFn = opts.execFn || ((bin, args) => {
29
- return execFileSync(bin, args, { encoding: 'utf8', timeout: 5 * 60 * 1000 });
30
- });
31
- const detectFn = opts.detectFn || require('../../../_shared/detect.js').detectTools;
32
-
33
- const tools = detectFn(['gitleaks'], { cacheDir: sec });
34
- const present = !!(tools.gitleaks && tools.gitleaks.present);
35
-
36
- if (!present) {
37
- // Update or create sast.md with the degraded_checks entry.
38
- mergeSast(sec, scope, active, tools, {
39
- degraded: '- secrets: gitleaks ausente — instale gitleaks e re-rode para scan completo.'
40
- });
41
- return { ok: true, partialStatus: 'incomplete', findingsCount: 0 };
42
- }
43
-
44
- const reportPath = path.join(sec, reportFilename);
45
- // gitleaks 8.18: `-s/--source` is the scan path, `-f/--report-format` is
46
- // the output format (json), `-r/--report-path` is the file. (Earlier
47
- // versions used `-f` for the path — do NOT use that here.)
48
- const args = filterArgs('gitleaks', [
49
- 'detect', '--no-banner', '-s', projectRoot, '-f', 'json', '-r', reportPath, '--exit-code', '0'
50
- ]);
51
- // gitleaks exits non-zero when it FINDS leaks (default exit-code 1). That
52
- // is the success path for us, not an error — so we pass --exit-code 0 and
53
- // also swallow any non-zero status defensively (we read the JSON report
54
- // regardless).
55
- try {
56
- execFn('gitleaks', args, { timeout: 5 * 60 * 1000 });
57
- } catch (_) {
58
- // Leaks found (or gitleaks returned non-zero) — the report file is still
59
- // written; we parse it below.
60
- }
61
-
62
- // Read the JSON report gitleaks wrote. It is an array of findings.
63
- let findings = [];
64
- if (fs.existsSync(reportPath)) {
65
- try {
66
- findings = JSON.parse(fs.readFileSync(reportPath, 'utf8'));
67
- } catch (_) {
68
- findings = [];
69
- }
70
- }
71
-
72
- // Build the secrets section from findings — ONLY redacted values.
73
- const secretLines = findings.map(f => {
74
- const file = f.File || f.file || '<unknown>';
75
- const line = f.StartLine || f.startLine || '?';
76
- const rule = f.RuleID || f.ruleID || 'unknown';
77
- return `- **${file}** line ${line} rule \`${rule}\` — redacted_value: \`${REDACTED}\``;
78
- });
79
-
80
- // Merge into existing sast.md (preserve other sections like deps from E05-S02).
81
- mergeSast(sec, scope, active, tools, {
82
- secrets: secretLines.length ? secretLines.join('\n') : '_(nenhum secret encontrado)_'
83
- });
84
- return { ok: true, partialStatus: secretLines.length ? 'complete' : 'incomplete', findingsCount: secretLines.length };
85
- }
86
-
87
- // Helper: load existing sast.md, update the relevant section, and write back.
88
- // Preserves sections that other SAST scripts (e.g. run-osv) added.
89
- function mergeSast(sec, scope, active, tools, update) {
90
- const existing = loadPartial({ securityDir: sec, phase: 'sast' });
91
- const sections = {};
92
- let mergedTools = Object.assign({}, tools);
93
- if (existing) {
94
- if (existing.body) {
95
- // Extract known section bodies from the existing partial.
96
- const re = /## ([a-z_]+)\n\n([\s\S]*?)(?=\n## |$)/g;
97
- let m;
98
- while ((m = re.exec(existing.body)) !== null) {
99
- sections[m[1]] = m[2].trim();
100
- }
101
- }
102
- // Preserve tools detected by sibling SAST scripts (gitleaks + osv each
103
- // run separately; neither should clobber the other's tools block).
104
- if (existing.frontmatter && existing.frontmatter.tools) {
105
- mergedTools = Object.assign({}, existing.frontmatter.tools, tools);
106
- }
107
- }
108
- // Apply updates.
109
- if (update.degraded) {
110
- // Append to degraded_checks if present, else create.
111
- if (sections.degraded_checks) sections.degraded_checks += '\n' + update.degraded;
112
- else sections.degraded_checks = update.degraded;
113
- }
114
- if (update.secrets !== undefined) sections.secrets = update.secrets;
115
-
116
- const status = sections.degraded_checks ? 'incomplete' : 'complete';
117
- writePartial({
118
- securityDir: sec,
119
- phase: 'sast',
120
- mode: active ? 'active' : 'passive',
121
- scope,
122
- status,
123
- tools: mergedTools,
124
- sections
125
- });
126
- }
127
-
128
- module.exports = { runGitleaks, mergeSast, REDACTED };
129
-
130
- if (require.main === module) {
131
- require('../../../_shared/cli-runner.js').runFromArgv({
132
- fn: ({ securityDir, scopePath, active, reportFilename } = {}) => {
133
- const { loadScope } = require('../../../_shared/scope-gate.js');
134
- const scope = loadScope(scopePath);
135
- return runGitleaks({ securityDir, scope, active, reportFilename });
136
- },
137
- argMap: { 'securityDir': 'securityDir', 'scope': 'scopePath', 'active': 'active', 'reportFilename': 'reportFilename' }
138
- });
139
- }