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,164 +0,0 @@
1
- ---
2
-
3
- code: wize
4
- description: "Use quando o usuário invocar /wize — alias canônico para /wize-help com o mesmo comportamento."
5
- name: Wizer
6
- module: orchestrator
7
- owner: wize-orchestrator
8
- status: ready
9
- aliases: [wize-help]
10
- ---
11
-
12
- # Wizer · `/wize`
13
-
14
- You are **Wizer**, the orchestrator. The user invoked `/wize` (canonical alias: `/wize-help`). Don't dump a menu — read the project's state and give a short, actionable answer in the user's voice.
15
-
16
- This is a thin alias for `/wize-help`. Delegate all behavior to the `wize-help` skill. The two invocations are identical in every way.
17
-
18
- ## Modes
19
-
20
- | Invocation | What to do |
21
- |---|---|
22
- | `/wize` (no argument) | Greeting + project snapshot + the **single best next step**. |
23
- | `/wize next` | Just the next step. Skip the snapshot. |
24
- | `/wize status` | Snapshot only. For full sprint detail, route `/wize-sprint-status` (Maria Hill). |
25
- | `/wize personas` | List only the personas relevant to the active profiles. |
26
- | `/wize mission` | Emit a filled **mission contract** for the current demand, drawn from project state, ready to hand to the executing persona. |
27
-
28
- ## Step 1 — read project state
29
-
30
- Read these if they exist (absence is information too):
31
-
32
- | Path | Tells you |
33
- |---|---|
34
- | `.wize/config/project.toml` | Active profiles, IDE targets, languages, project name, `kit_version`. |
35
- | `.wize/config/user.toml` | `[user] name` to greet by name; `[preferences] communication` overrides language. |
36
- | `.wize/config/tea.toml` | TEA gate policy (advisory vs enforcing). |
37
- | `.wize/planning/brief.md`, `ux/trigger-map.md` | Phase 1 (Pepper) progress. |
38
- | `.wize/planning/prd.md` (`validated:` in frontmatter) | Phase 2 PRD + whether it passed `wize-validate-prd`. |
39
- | `.wize/planning/ux/ux-scenarios.md`, `ux/ux-design/**` | Whether Mantis ran UX. |
40
- | `.wize/planning/tech-vision.md`, `nfr-principles.md` | Whether Fury set strategy. |
41
- | `.wize/solutioning/architecture.md`, `stories/**/*.md`, `readiness-*.md` | Phase 3 artifacts + the readiness gate. |
42
- | `.wize/implementation/tea/risk-profile.md`, `tea/**/gate.md` | Risk profile + last gate per story. |
43
- | `.wize/implementation/sprint-status.yaml` | **Canonical** active-sprint state (NOT `.md`). |
44
- | `.wize/knowledge/document-project/` | Brownfield baseline (if missing on a brownfield repo, baseline first). |
45
- | `.wize/security/scope.md`, `report.md` | Security overlay: authorized scope + last pentest. |
46
-
47
- ## Step 2 — route
48
-
49
- **First, classify the demand — this is a contract decision, not a shortcut.**
50
-
51
- | Class | When | Route |
52
- |---|---|---|
53
- | **Quick Dev** | Small, predictable, trivially scoped, and touches **no** new feature, architecture, UX, or security surface — bug fix, copy edit, small refactor, dep bump, hotfix, brownfield maintenance. | **Shuri / `wize-quick-dev`** (light TEA) — skip the phase heuristic below. |
54
- | **Full Lifecycle** | Anything else: new value, cross-cutting change, ACs to agree, security/auth/payments, or "could surprise a user." | Apply routing below: intent first, phase heuristic as fallback. |
55
-
56
- Never pick Quick Dev to dodge writing artifacts. If the demand needs an AC, it is Full Lifecycle. When unsure, ask one question rather than guess the class.
57
-
58
- ### Step 2a — intent-based routing (check first)
59
-
60
- When the user's message contains a clear intent phrase, route directly to the matching skill. The intent table maps user language to skills. Match is case-insensitive and substring-based — "quero pesquisar concorrência" matches `wize-market-research` because "pesquisar concorrência" is in the table.
61
-
62
- If multiple intents match, pick the most specific (longest phrase match). If still ambiguous, ask one clarifying question. In text-only harnesses, ask that question. In rich-UI harnesses, offer a menu of the matching options.
63
-
64
- **Fuzzy demand → suggest a grill.** When the route lands on an authoring step (brief, PRD, epics/stories, architecture, plan) and the demand still carries unresolved decisions, append one line: *"Want me to grill you first (`wize-grill`)? Sharper answers, sharper {artifact}."* Suggest, never force — and never for Quick Dev.
65
-
66
- ### Step 2b — phase heuristic (fallback)
67
-
68
- When intent is ambiguous or no intent phrase matches, apply this heuristic top-down; stop at the first match:
69
-
70
- | # | State | Next step |
71
- |---|---|---|
72
- | 1 | No `.wize/` folder | Kit not installed → `npx wize-dev-kit install` |
73
- | 2 | Brownfield repo, no `knowledge/document-project/` | **Pepper / `wize-document-project`** (baseline first) |
74
- | 3 | No `brief.md` | **Pepper / `wize-product-brief`** |
75
- | 4 | `brief.md`, no `trigger-map.md` | **Pepper / `wize-trigger-map`** |
76
- | 5 | No `prd.md` | **Maria Hill / `wize-create-prd`** |
77
- | 6 | `prd.md` lacks `validated: true` | **Maria Hill / `wize-validate-prd`** (Plan→Solution gate) |
78
- | 7 | No `ux-scenarios.md` | **Mantis / `wize-ux-scenarios`** |
79
- | 8 | `ux-design/` empty | **Mantis / `wize-ux-design`** |
80
- | 9 | No `tech-vision.md`/`nfr-principles.md` | **Fury / `wize-tech-vision`** → `wize-nfr-principles` |
81
- | 10 | No `architecture.md` | **Tony / `wize-create-architecture`** |
82
- | 11 | Web/App overlay active, greenfield, no code scaffold | **Shuri / `wize-web-scaffold`** or `wize-app-scaffold` |
83
- | 12 | No `stories/**/*.md` | **Tony / `wize-create-epics-and-stories`** |
84
- | 13 | No `readiness-*.md` | **Tony / `wize-check-implementation-readiness`** (Phase 3 gate) |
85
- | 14 | No `tea/risk-profile.md` | **Hawkeye / `wize-tea-risk`** |
86
- | 15 | Stories exist, `sprint-status.yaml` shows no active sprint | **Maria Hill / `wize-sprint-planning`** |
87
- | 16 | Active sprint, oldest in-flight story has no `tea/.../design.md` | **Hawkeye / `wize-tea-design`** |
88
- | 17 | In-flight story, no implementation commits | **Shuri / `wize-dev-story`** |
89
- | 18 | Story has code, no `gate.md` | **Hawkeye / `wize-tea-trace` → `wize-tea-review` → `wize-tea-gate`** |
90
- | 19 | A story gated **FAIL**, or sprint drifting (blocked/overdue) | **Shuri fix + Maria Hill / `wize-correct-course`** |
91
- | 20 | All stories gated PASS/CONCERNS, no `ready-for-dev` left | Sprint ended → **Wizer / `wize-retrospective`** + **Pepper+Peggy / `wize-refresh-knowledge`** |
92
- | 21 | All gated, no new epic pulled | Plan next epic (Tony + Maria Hill), or a roadmap session |
93
-
94
- **Overlay ship stages** (when the profile is active): web-overlay adds `wize-web-deploy` / `wize-web-seo-audit`; app-overlay adds `wize-app-release-channels` / `wize-app-store-listing`; security-overlay adds `wize-sec-pentest` (recon → enumerate → SAST → DAST → report, gated by `.wize/security/scope.md`).
95
-
96
- ### Intent routing table
97
-
98
- See the full intent routing table in `wize-help/skill.md` (Step 2a). The same table applies to `/wize` — intent-based routing is checked first, phase heuristic is the fallback.
99
-
100
- ## Step 2.5 — version skew (proactive)
101
-
102
- Compare `kit_version` (project.toml) vs the installed kit vs (if you have a terminal, 2s timeout) `npm view wize-dev-kit version`:
103
-
104
- | Condition | Suggest |
105
- |---|---|
106
- | installed > project.toml | `npx wize-dev-kit update` |
107
- | registry > installed | `npx wize-dev-kit@latest update` |
108
- | all match | nothing |
109
-
110
- Phrase as one short line, not a banner. If the user agrees and you have Bash, run it in the project root.
111
-
112
- ## Step 3 — respond
113
-
114
- Default shape (3 lines; greet by `user.name` when present):
115
-
116
- ```
117
- Welcome back, [name]. {project} — {profiles}.
118
- You're at: {phase + last artifact}.
119
- Next: /{workflow} ({persona}).
120
- ```
121
-
122
- For `status`, return a table (Phase / Profiles / Last TEA gate / In-flight stories / Active sprint / TEA policy).
123
-
124
- For `personas`, list only personas whose role applies. Always include Wizer, Pepper, Peggy, Maria Hill, Mantis, Fury, Tony, Hawkeye, Shuri. If **web-overlay** active: Mantis has the WCAG/responsive playbook, Hawkeye has Playwright/Vitest. If **app-overlay** active: HIG/Material 3 for Mantis, Detox/Maestro for Hawkeye. If **security-overlay** active: add **Natasha Romanoff** (red-teamer; offensive pipeline recon → enumerate → exploit → report; only runs against targets authorized in `.wize/security/scope.md`).
125
-
126
- For `mission`, emit the filled **Mission contract** (see the section below) from the Step-2 class + current project state — nothing else.
127
-
128
- ## Step 4 — offer to act
129
-
130
- End with one of: "Want me to call {persona}?" · "Want me to baseline the repo first?" (brownfield, no document-project) · "Want me to convene party-mode with {p1} + {p2}?" (cross-cutting decision) · "Want me to grill you first (`wize-grill`)?" (fuzzy demand heading into an authoring step).
131
-
132
- ## Mission contract (`/wize mission`)
133
-
134
- When asked for a mission, fill this from project state and hand it to the executing persona. It is a contract, not a spec dump — each field is the minimum that makes the work traceable. Leave a field blank only when the project genuinely has no answer, and say so. If Objective, Scope, or ACs can't be filled from project state, offer a `wize-grill` pass before emitting a hollow contract.
135
-
136
- ```
137
- MISSION CONTRACT — {demand in one line}
138
- Class: Quick Dev | Full Lifecycle (see Step 2 classification)
139
- Objective: what changes, for whom, which problem, the observable success result.
140
- Sources of truth (read first, expand by dependency):
141
- AGENTS.md · .wize/config/project.toml · knowledge/document-project/* ·
142
- prd.md · architecture.md · design-system · epic + story · TEA test contract ·
143
- related code + tests. Don't load unrelated files for padding.
144
- Scope & limits: included / out of scope / protected behaviors / compatibility / security constraints.
145
- Log recommended extras separately — no silent scope creep.
146
- Acceptance criteria: AC-01… (verifiable, traceable AC → code → test → commit → gate).
147
- Execution contract: inspect before editing · reuse ladder before new code · test-first when applicable ·
148
- smallest sufficient change · run real commands · no success claim without evidence · never stop at planning.
149
- Validation contract: the exact checks required (unit/integration/e2e, lint, format, type-check, build,
150
- security when applicable). If a command couldn't run, name it and why.
151
- Persistence in .wize/: Full Lifecycle → story status, AC→test map, TEA artifacts, sprint status,
152
- ADR if architectural, knowledge axes. Quick Dev → one line in implementation/quick-dev-log.md.
153
- Subagents (if the skill fans out): match model tier to task —
154
- lightweight for mechanical work, standard for implementation/review, high-capability only for
155
- architecture / critical decisions / final adversarial review.
156
- ```
157
-
158
- For Quick Dev, collapse to Objective + Scope & limits + Validation contract + the one-line log — the rest is Full-Lifecycle machinery it doesn't need.
159
-
160
- ## Style
161
-
162
- - Speak the user's `communication` language.
163
- - One sharp question beats three sentences of advice.
164
- - `/wize next` → just the next step, one line. `/wize status` → the table, no actions. `/wize mission` → the filled Mission contract only.
@@ -1,98 +0,0 @@
1
- ---
2
-
3
- code: wize-check
4
- description: "Use quando o usuário pedir clareza de acompanhamento no meio do trabalho — um checklist de onde estamos, o que já foi feito, o que falta e o que trava, até a condição de pronto."
5
- name: Check (Wizer)
6
- module: orchestrator
7
- owner: wize-orchestrator
8
- status: ready
9
- aliases: []
10
- ---
11
-
12
- # Wizer · `/wize-check`
13
-
14
- **Goal.** In under 60 seconds, return a **progress checklist** for the demand in flight: what the objective is, where we are, what is already done (with evidence), what is in progress, what is left until the done condition, and what is waiting on the user.
15
-
16
- This is a **read-only interruption**. It does not edit code, does not advance the task, does not re-plan. After answering, **resume exactly the work that was in flight**, at the step where it stopped.
17
-
18
- ## Modes
19
-
20
- | Invocation | What to do |
21
- |---|---|
22
- | `/wize-check` | Full checklist for the demand in flight. |
23
- | `/wize-check now` | Two lines only: what I'm doing right now + the next step. |
24
- | `/wize-check {topic}` | Narrow the checklist to one scope (a story, a PR, a bug, a document). |
25
- | `/wize-check save` | Same checklist, plus write it to `.wize/implementation/checks/{YYYY-MM-DD-HHmm}.md`. |
26
-
27
- ## Step 1 — reconstruct the state (in this order)
28
-
29
- 1. **The session itself** — the original request, the decisions already taken, the files edited, the commands run and what they returned. This is the primary source.
30
- 2. **Work still in flight** — background commands, pending subagents, a PR awaiting review, CI running. It goes under *in progress*, never under *done*.
31
- 3. **Kit artifacts** (when they exist): `.wize/implementation/sprint-status.yaml`, the story in flight under `.wize/solutioning/stories/**`, the latest `.wize/implementation/tea/**/gate.md`.
32
- 4. **Git** (if this is a repository): current branch, `git status`, commits since the base, open PR.
33
- 5. **Project memory / pointers** — only to recall the stated objective, never as proof of execution.
34
-
35
- ## Step 2 — evidence rule (non-negotiable)
36
-
37
- An item only reaches **Done** with verifiable proof: a file and line, a commit, a command that ran and passed, a recorded gate, a merged PR.
38
-
39
- - No proof → **In progress** or **Unverified**, said out loud.
40
- - Intent, a plan, or "I implemented it" are not evidence.
41
- - If something was written but not validated, the item is `[~]` with the missing validation named next to it.
42
-
43
- Overstating progress is the one serious failure mode of this skill.
44
-
45
- ## Step 3 — the done condition (the "until we get to…")
46
-
47
- Before building the list, write in one line **where this demand ends** — the observable result that closes it.
48
-
49
- - If it is explicit in the session or in the artifacts, quote it.
50
- - If it is not, **state the criterion you assumed** and ask for confirmation in one line. Never invent a destination silently.
51
-
52
- ## Step 4 — build the checklist
53
-
54
- ```markdown
55
- ## Checklist — {demand in one line}
56
-
57
- **Objective:** {done condition — the observable result}
58
- **Where we are:** {phase} · step {X} of {Y}
59
-
60
- ### Done
61
- - [x] {item} — {evidence: commit / file:line / command that passed}
62
-
63
- ### In progress
64
- - [~] {item} — {what is missing to close it}
65
-
66
- ### Left
67
- - [ ] {item} — {who executes: skill or person}
68
-
69
- ### Blocked / waiting on you
70
- - {decision, credential, approval — or "nothing"}
71
-
72
- **Progress:** {n}/{total} · **Next step:** {one action, one line}
73
- ```
74
-
75
- ### Shape rules
76
-
77
- - At most ~12 items total. Group; do not list micro-steps.
78
- - Order **Left** by dependency, not by importance.
79
- - One single next step. If two candidates tie, pick one and say why in half a line.
80
- - No preamble, no closing summary, no praise for the progress.
81
- - If a section is empty, write "—" and move on. Never invent an item to fill it.
82
- - If an item **regressed** (broke, was reverted, gate flipped to FAIL), it goes back to *In progress* with the cause next to it.
83
-
84
- ## Step 5 — resume
85
-
86
- After the checklist, return to the interrupted work without asking permission and without reopening the plan — unless the checklist itself surfaced a blocker that needs a decision from the user. In that case, stop and ask.
87
-
88
- ## When NOT to use
89
-
90
- - Full sprint detail (stories, capacity, priorities) → `wize-sprint-status`.
91
- - A continue / pivot / stop decision mid-story → `wize-checkpoint-preview`.
92
- - Sprint off the rails, needs re-planning → `wize-correct-course`.
93
-
94
- `wize-check` only reports. If the checklist shows the plan is wrong, say so in one line and point at the skill above — do not re-plan here.
95
-
96
- ## Hand-off
97
-
98
- > Checklist delivered. Resuming: {next step}.
@@ -1,154 +0,0 @@
1
- 'use strict';
2
-
3
- // allowlist.js — gate that filters arguments for an external pentest tool
4
- // before they are passed to child_process.execFile. The list of allowed
5
- // flags per tool lives in src/security-overlay/data/tool-allowlist.json.
6
- //
7
- // Schema (per tool, array of strings):
8
- // "-foo" switch with no value
9
- // "-foo:" switch that consumes the next argv as its value
10
- // "-foo=bar" switch with a fixed value (only the literal "bar" is allowed)
11
- // "--flag=" switch that consumes a value joined by '=' (e.g. --level=1)
12
- //
13
- // Invariant: args NOT in the allowlist (or args that look like values for
14
- // flags not in the allowlist) are dropped. Positional args (targets, URLs)
15
- // pass through unchanged.
16
-
17
- const fs = require('node:fs');
18
- const path = require('node:path');
19
-
20
- class UnknownToolError extends Error {
21
- constructor(tool) {
22
- super(`Unknown tool "${tool}" — not in tool-allowlist.json. Refusing to invoke.`);
23
- this.name = 'UnknownToolError';
24
- this.tool = tool;
25
- }
26
- }
27
-
28
- const DEFAULT_ALLOWLIST_PATH = path.join(__dirname, '..', 'data', 'tool-allowlist.json');
29
-
30
- let _cache = null;
31
- function _loadDefault() {
32
- if (_cache) return _cache;
33
- const raw = fs.readFileSync(DEFAULT_ALLOWLIST_PATH, 'utf8');
34
- _cache = JSON.parse(raw);
35
- return _cache;
36
- }
37
-
38
- function loadAllowlist(filePath) {
39
- const fp = filePath || DEFAULT_ALLOWLIST_PATH;
40
- return JSON.parse(fs.readFileSync(fp, 'utf8'));
41
- }
42
-
43
- // Heuristic for "is this arg a flag?": starts with '-' and is more than 1 char
44
- // (a bare "-" is sometimes used as stdin, treat as positional).
45
- function isFlag(arg) {
46
- return typeof arg === 'string' && arg.length > 1 && arg[0] === '-';
47
- }
48
-
49
- // Classify one allowlist token into one of:
50
- // { kind: 'switch' } — no value
51
- // { kind: 'colon', prefix: '-foo' } — consumes next argv (e.g. -f path)
52
- // { kind: 'equals', prefix: '--flag=' } — consumes value joined by '=' (e.g. --level=1)
53
- // { kind: 'literal', full: '-foo=bar' } — only the exact form is allowed
54
- //
55
- // When matching an arg, we try in order: literal, then colon (exact prefix
56
- // match, e.g. arg === '-u'), then equals (arg starts with prefix, e.g.
57
- // arg === '--level=1'), then switch (exact equality).
58
- function classify(token) {
59
- if (token.endsWith(':')) {
60
- return { kind: 'colon', prefix: token.slice(0, -1) };
61
- }
62
- if (token.endsWith('=') && token.startsWith('--')) {
63
- return { kind: 'equals', prefix: token };
64
- }
65
- if (token.includes('=') && !token.endsWith('=')) {
66
- return { kind: 'literal', full: token };
67
- }
68
- return { kind: 'switch' };
69
- }
70
-
71
- // Given a flag arg, find the first allowlist token that matches it.
72
- function matchFlag(toolData, arg) {
73
- // Literal first (most specific).
74
- for (const tok of toolData) {
75
- if (classify(tok).kind === 'literal' && arg === tok) return { consumeNext: false };
76
- }
77
- // Then colon (exact prefix match) — e.g. arg === '-u'.
78
- for (const tok of toolData) {
79
- if (classify(tok).kind === 'colon' && arg === classify(tok).prefix) return { consumeNext: true };
80
- }
81
- // Then equals — e.g. arg starts with '--level='.
82
- for (const tok of toolData) {
83
- if (classify(tok).kind === 'equals' && arg.startsWith(classify(tok).prefix)) return { consumeNext: false };
84
- }
85
- // Then switch.
86
- for (const tok of toolData) {
87
- if (classify(tok).kind === 'switch' && tok === arg) return { consumeNext: false };
88
- }
89
- return null;
90
- }
91
-
92
- // filterArgs(tool, args, allowlist) — keep only args allowed by the tool's
93
- // allowlist, handling value-bearing flags correctly.
94
- function filterArgs(tool, args, allowlist) {
95
- const data = allowlist || _loadDefault();
96
- if (!Object.prototype.hasOwnProperty.call(data, tool)) {
97
- throw new UnknownToolError(tool);
98
- }
99
- const toolData = data[tool];
100
-
101
- const out = [];
102
- let i = 0;
103
- const list = args || [];
104
- while (i < list.length) {
105
- const arg = list[i];
106
- if (!isFlag(arg)) {
107
- // Positional: target, URL, output path.
108
- out.push(arg);
109
- i++;
110
- continue;
111
- }
112
- const m = matchFlag(toolData, arg);
113
- if (!m) {
114
- // Unknown flag — drop the flag. We do NOT also drop the next arg,
115
- // because a positional after a stripped flag is still a positional
116
- // (caller may have intended both to pass). However, common patterns
117
- // are value-bearing: e.g. `--script vuln` — if the flag is dropped,
118
- // "vuln" is also dropped to avoid leaking. This is the safe default.
119
- if (looksLikeValueArg(list[i + 1])) {
120
- // Consume the next arg as part of the dropped flag's expected value.
121
- i += 2;
122
- } else {
123
- i++;
124
- }
125
- continue;
126
- }
127
- out.push(arg);
128
- if (m.consumeNext) {
129
- // Value-bearing: the next argv is the value. Pass it through.
130
- if (i + 1 < list.length) {
131
- out.push(list[i + 1]);
132
- i += 2;
133
- } else {
134
- i++;
135
- }
136
- } else {
137
- i++;
138
- }
139
- }
140
- return out;
141
- }
142
-
143
- // A value arg is one that does NOT start with '-' (or is the bare "-").
144
- function looksLikeValueArg(arg) {
145
- return arg !== undefined && (typeof arg !== 'string' || arg.length === 0 || arg[0] !== '-');
146
- }
147
-
148
- module.exports = {
149
- filterArgs,
150
- loadAllowlist,
151
- UnknownToolError,
152
- classify,
153
- matchFlag
154
- };
@@ -1,169 +0,0 @@
1
- 'use strict';
2
-
3
- // backlog.js — turns classified security findings into a remediation
4
- // backlog (epics + stories) that wize-create-epics-and-stories can consume.
5
- //
6
- // Design (per brief-post-scan):
7
- // - Group findings by theme/section, NOT 1-story-per-finding (97 secrets
8
- // => 1 "rotate secrets" story, not 97).
9
- // - Priority P0/P1/P2 derived from the worst severity in the group.
10
- // - Each story keeps traceability to the source findings + scope hash.
11
- // - Seed epics from the AI action plan (ai-insights.json) when present.
12
- // - Zero-dep, file-first. The overlay never invokes a skill — it prints
13
- // a clear CTA command for the user/agent to run.
14
-
15
- const CTA_COMMAND = '/wize-create-epics-and-stories --from .wize/security/security-backlog.md';
16
-
17
- // Severity -> remediation priority.
18
- function priorityFor(severity) {
19
- switch (severity) {
20
- case 'Critical':
21
- case 'High':
22
- return 'P0';
23
- case 'Medium':
24
- return 'P1';
25
- default:
26
- return 'P2'; // Low, Info-surface, None, unknown
27
- }
28
- }
29
-
30
- // Human label + remediation intent per section.
31
- const SECTION_THEME = {
32
- secrets: { theme: 'Rotacionar e remover segredos expostos', owasp: 'A07:2021' },
33
- deps: { theme: 'Atualizar dependências vulneráveis', owasp: 'A06:2021' },
34
- nuclei: { theme: 'Corrigir vulnerabilidades detectadas (nuclei)', owasp: null },
35
- nikto: { theme: 'Hardening de servidor web (nikto)', owasp: 'A05:2021' },
36
- sqlmap: { theme: 'Corrigir injeção SQL', owasp: 'A03:2021' },
37
- ffuf: { theme: 'Revisar endpoints/arquivos descobertos', owasp: 'A05:2021' },
38
- tech: { theme: 'Hardening: ocultar fingerprinting de versões', owasp: 'A05:2021' },
39
- open_ports: { theme: 'Revisar exposição de portas/serviços', owasp: 'A05:2021' },
40
- surface: { theme: 'Revisar superfície HTTP exposta', owasp: 'A05:2021' }
41
- };
42
-
43
- // Severity rank for "worst in group".
44
- const SEV_RANK = { Critical: 5, High: 4, Medium: 3, Low: 2, 'Info-surface': 1, None: 0, unknown: 0 };
45
-
46
- // groupFindings(findings) -> [{ section, theme, owasp, count, priority,
47
- // worstSeverity, findings: [...] }] sorted by priority then count.
48
- function groupFindings(findings) {
49
- const bySection = {};
50
- for (const f of findings || []) {
51
- const s = f.section || 'unknown';
52
- if (!bySection[s]) bySection[s] = [];
53
- bySection[s].push(f);
54
- }
55
- const groups = [];
56
- for (const [section, fs] of Object.entries(bySection)) {
57
- let worst = 'unknown';
58
- for (const f of fs) {
59
- if ((SEV_RANK[f.severity] || 0) > (SEV_RANK[worst] || 0)) worst = f.severity;
60
- }
61
- const theme = (SECTION_THEME[section] && SECTION_THEME[section].theme) || `Revisar findings de ${section}`;
62
- const owasp = SECTION_THEME[section] && SECTION_THEME[section].owasp;
63
- groups.push({
64
- section,
65
- theme,
66
- owasp,
67
- count: fs.length,
68
- worstSeverity: worst,
69
- priority: priorityFor(worst),
70
- findings: fs
71
- });
72
- }
73
- // Order: P0 first, then by count desc.
74
- const pOrder = { P0: 0, P1: 1, P2: 2 };
75
- groups.sort((a, b) => (pOrder[a.priority] - pOrder[b.priority]) || (b.count - a.count));
76
- return groups;
77
- }
78
-
79
- function escapeMd(s) {
80
- return String(s == null ? '' : s);
81
- }
82
-
83
- // buildBacklog({ findings, actionPlan, scopeSha, generatedAt }) -> markdown.
84
- function buildBacklog({ findings = [], actionPlan = [], scopeSha = '', generatedAt = '' } = {}) {
85
- const groups = groupFindings(findings);
86
- const lines = [];
87
-
88
- lines.push('---');
89
- lines.push('kind: security-remediation-backlog');
90
- lines.push('owner: Natasha Romanoff (red-teamer)');
91
- lines.push(`source_scope_sha256: ${escapeMd(scopeSha)}`);
92
- lines.push(`generated_at: ${escapeMd(generatedAt)}`);
93
- lines.push('consumed_by: wize-create-epics-and-stories');
94
- lines.push('---');
95
- lines.push('');
96
- lines.push('# Security Remediation Backlog');
97
- lines.push('');
98
- lines.push('Backlog de correção derivado do scan de segurança. Cada epic agrupa findings por tema; cada story rastreia os findings de origem. Prioridade vem da severidade (P0 = Critical/High, P1 = Medium, P2 = Low/informativo).');
99
- lines.push('');
100
- lines.push(`> **Próximo passo:** rode \`${CTA_COMMAND}\` para transformar este backlog em stories formais.`);
101
- lines.push('');
102
-
103
- // Action plan summary (from AI insights) — the executive framing.
104
- if (actionPlan && actionPlan.length) {
105
- lines.push('## Plano de ação (resumo)');
106
- lines.push('');
107
- for (const a of actionPlan) {
108
- lines.push(`- **[${escapeMd(a.priority)}] ${escapeMd(a.title)}** — ${escapeMd(a.detail)}`);
109
- }
110
- lines.push('');
111
- }
112
-
113
- // Build a lookup from action plan title keywords to attach detail to epics.
114
- const planByTheme = {};
115
- for (const a of (actionPlan || [])) planByTheme[(a.title || '').toLowerCase()] = a;
116
-
117
- if (groups.length === 0) {
118
- lines.push('## (sem itens)');
119
- lines.push('');
120
- lines.push('_Nenhum finding acionável neste scan — no actionable findings._');
121
- return lines.join('\n');
122
- }
123
-
124
- // One epic per group.
125
- let epicN = 0;
126
- for (const g of groups) {
127
- epicN++;
128
- // Find a matching action-plan detail by theme keyword overlap.
129
- let planDetail = '';
130
- for (const [title, a] of Object.entries(planByTheme)) {
131
- const key = g.section;
132
- if (title.includes(key) || (key === 'secrets' && title.includes('segredo')) ||
133
- (key === 'deps' && (title.includes('depend') || title.includes('dep'))) ||
134
- (key === 'tech' && title.includes('fingerprint'))) {
135
- planDetail = a.detail; break;
136
- }
137
- }
138
- lines.push(`## Epic ${String(epicN).padStart(2, '0')}: ${g.theme} [${g.priority}]`);
139
- lines.push('');
140
- lines.push(`- **Prioridade:** ${g.priority} (pior severidade: ${g.worstSeverity})`);
141
- lines.push(`- **Findings cobertos:** ${g.count}`);
142
- if (g.owasp) lines.push(`- **OWASP:** ${g.owasp}`);
143
- if (planDetail) lines.push(`- **Como corrigir:** ${planDetail}`);
144
- lines.push('');
145
- lines.push('### Stories');
146
- lines.push('');
147
- // For large groups, a single remediation story + a verification story.
148
- lines.push(`- **${g.theme}** (${g.priority}) — corrigir os ${g.count} finding(s) de \`${g.section}\`. _Origem: ${g.section} (${g.count} findings, ${g.worstSeverity})._`);
149
- lines.push(`- **Verificar correção de ${g.section}** (${g.priority}) — re-rodar \`/wize-sec-pentest\` e confirmar que os findings de \`${g.section}\` sumiram (DoD).`);
150
- lines.push('');
151
- // Sample of source findings for traceability (cap at 5).
152
- const sample = g.findings.slice(0, 5);
153
- lines.push('<details><summary>Findings de origem (amostra)</summary>');
154
- lines.push('');
155
- for (const f of sample) {
156
- lines.push(`- ${escapeMd(f.raw)}`);
157
- }
158
- if (g.findings.length > sample.length) {
159
- lines.push(`- _… e mais ${g.findings.length - sample.length}._`);
160
- }
161
- lines.push('');
162
- lines.push('</details>');
163
- lines.push('');
164
- }
165
-
166
- return lines.join('\n');
167
- }
168
-
169
- module.exports = { buildBacklog, priorityFor, groupFindings, CTA_COMMAND };
@@ -1,87 +0,0 @@
1
- 'use strict';
2
-
3
- // cli-runner.js — small helper so each phase script can be invoked
4
- // either as a module (import + call) or as a CLI (with --securityDir /
5
- // --scope / --active argv). The invoke-phase helper spawns the script
6
- // as a Node subprocess; this module bridges that to the per-phase
7
- // `runX` function exported by each script.
8
- //
9
- // Usage from a script:
10
- // const { runX } = require('./run-x');
11
- // module.exports = { runX };
12
- // if (require.main === module) {
13
- // require('../../../_shared/cli-runner.js').runFromArgv({
14
- // fn: runX,
15
- // argMap: { securityDir: 'securityDir', scopePath: 'scopePath', active: 'active' }
16
- // });
17
- // }
18
- //
19
- // argv shape: --securityDir=PATH --scope=PATH --active [script-specific]
20
- // The function `fn` is called with the parsed object spread.
21
-
22
- function parseArgv(argv) {
23
- const out = {};
24
- for (let i = 0; i < (argv || []).length; i++) {
25
- const a = argv[i];
26
- if (a === '--active') { out.active = true; continue; }
27
- const eq = a.indexOf('=');
28
- if (eq > 0) {
29
- const key = a.slice(0, eq).replace(/^--/, '');
30
- const val = a.slice(eq + 1);
31
- out[camel(key)] = val;
32
- continue;
33
- }
34
- if (a.startsWith('--') && i + 1 < argv.length && !argv[i + 1].startsWith('--')) {
35
- out[camel(a.slice(2))] = argv[i + 1];
36
- i++;
37
- }
38
- }
39
- return out;
40
- }
41
-
42
- function camel(s) {
43
- return s.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
44
- }
45
-
46
- async function runFromArgv({ fn, argMap = {} }) {
47
- const argv = process.argv.slice(2);
48
- const parsed = parseArgv(argv);
49
- // Map --securityDir -> securityDir, --scope -> scopePath, etc.
50
- const opts = {};
51
- for (const [cliKey, optKey] of Object.entries(argMap)) {
52
- if (cliKey in parsed) opts[optKey] = parsed[cliKey];
53
- }
54
- // Also accept any unprefixed camelCase keys directly.
55
- for (const [k, v] of Object.entries(parsed)) {
56
- if (!(k in opts)) opts[k] = v;
57
- }
58
- if (!('active' in opts)) opts.active = false;
59
- // The phase script may also export its own CLI flags (--target for recon).
60
- // We forward remaining --flags as a target-agnostic extraArgs-style list.
61
- const extras = {};
62
- for (const a of argv) {
63
- if (a === '--active') continue;
64
- const m = a.match(/^--([a-z0-9-]+)/);
65
- if (m && !argMap[m[1]] && !argMap[camel(m[1])]) {
66
- // Stash any flag the script might want to read itself.
67
- extras[m[1]] = a.includes('=') ? a.slice(a.indexOf('=') + 1) : true;
68
- }
69
- }
70
- Object.assign(opts, extras);
71
- try {
72
- const r = await fn(opts);
73
- if (r && typeof r === 'object') {
74
- // Print a one-line summary the orchestrator can show in its summary.
75
- const summary = r.partialStatus
76
- ? `${process.argv[1].split('/').pop().replace(/\.js$/, '')}: partial_status=${r.partialStatus} mode=${r.mode || 'passive'}`
77
- : '';
78
- if (summary) process.stdout.write(summary + '\n');
79
- }
80
- process.exit(0);
81
- } catch (e) {
82
- process.stderr.write(`✖ ${process.argv[1]}: ${e && e.message ? e.message : e}\n`);
83
- process.exit(2);
84
- }
85
- }
86
-
87
- module.exports = { parseArgv, runFromArgv };