wize-dev-kit 0.15.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 (232) hide show
  1. package/ARCH.md +24 -77
  2. package/CHANGELOG.md +9 -0
  3. package/DECISIONS.md +1 -27
  4. package/README.md +4 -0
  5. package/ROSTER.md +3 -11
  6. package/adapters/README.md +7 -8
  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 +15 -159
  78. package/tools/installer/setup-helpers.js +0 -1
  79. package/tools/installer/validators/run-all.js +2 -3
  80. package/tools/installer/wize-cli.js +70 -500
  81. package/AGENTS.md +0 -37
  82. package/README.es.md +0 -295
  83. package/README.pt-BR.md +0 -293
  84. package/adapters/hermes/README.md +0 -23
  85. package/adapters/hermes/adapter.yaml +0 -8
  86. package/adapters/hermes/render.js +0 -17
  87. package/docs/harnesses/antigravity.md +0 -20
  88. package/docs/harnesses/antigravity.pt-BR.md +0 -20
  89. package/docs/harnesses/claude-code.md +0 -23
  90. package/docs/harnesses/claude-code.pt-BR.md +0 -23
  91. package/docs/harnesses/codex.md +0 -21
  92. package/docs/harnesses/codex.pt-BR.md +0 -21
  93. package/docs/harnesses/continue.md +0 -21
  94. package/docs/harnesses/continue.pt-BR.md +0 -21
  95. package/docs/harnesses/cursor.md +0 -22
  96. package/docs/harnesses/cursor.pt-BR.md +0 -22
  97. package/docs/harnesses/generic.md +0 -20
  98. package/docs/harnesses/generic.pt-BR.md +0 -20
  99. package/docs/harnesses/hermes.md +0 -26
  100. package/docs/harnesses/hermes.pt-BR.md +0 -26
  101. package/docs/harnesses/kimi-code.md +0 -19
  102. package/docs/harnesses/kimi-code.pt-BR.md +0 -19
  103. package/docs/harnesses/opencode.md +0 -31
  104. package/docs/harnesses/opencode.pt-BR.md +0 -31
  105. package/docs/harnesses/windsurf.md +0 -22
  106. package/docs/harnesses/windsurf.pt-BR.md +0 -22
  107. package/src/core-skills/wize-customize/skill.md +0 -116
  108. package/src/core-skills/wize-editorial-review-prose/skill.md +0 -94
  109. package/src/core-skills/wize-editorial-review-structure/skill.md +0 -99
  110. package/src/core-skills/wize-grill/skill.md +0 -77
  111. package/src/core-skills/wize-index-docs/skill.md +0 -119
  112. package/src/core-skills/wize-pre-pr-check/skill.md +0 -134
  113. package/src/core-skills/wize-review-edge-case-hunter/skill.md +0 -115
  114. package/src/core-skills/wize-spec/assets/headless-schemas.md +0 -39
  115. package/src/core-skills/wize-spec/assets/spec-template.md +0 -40
  116. package/src/core-skills/wize-spec/customize.toml +0 -20
  117. package/src/core-skills/wize-spec/skill.md +0 -112
  118. package/src/method-skills/1-analysis/wize-document-project/documentation-requirements.csv +0 -12
  119. package/src/method-skills/1-analysis/wize-document-project/templates/api-contracts-template.md +0 -38
  120. package/src/method-skills/1-analysis/wize-document-project/templates/architecture-template.md +0 -54
  121. package/src/method-skills/1-analysis/wize-document-project/templates/component-inventory-template.md +0 -40
  122. package/src/method-skills/1-analysis/wize-document-project/templates/contribution-guide-template.md +0 -34
  123. package/src/method-skills/1-analysis/wize-document-project/templates/data-models-template.md +0 -36
  124. package/src/method-skills/1-analysis/wize-document-project/templates/deep-dive-template.md +0 -312
  125. package/src/method-skills/1-analysis/wize-document-project/templates/deployment-guide-template.md +0 -42
  126. package/src/method-skills/1-analysis/wize-document-project/templates/development-guide-template.md +0 -61
  127. package/src/method-skills/1-analysis/wize-document-project/templates/index-template.md +0 -185
  128. package/src/method-skills/1-analysis/wize-document-project/templates/project-overview-template.md +0 -110
  129. package/src/method-skills/1-analysis/wize-document-project/templates/project-scan-report-schema.json +0 -159
  130. package/src/method-skills/1-analysis/wize-document-project/templates/source-tree-template.md +0 -142
  131. package/src/method-skills/1-analysis/wize-domain-research/customize.toml +0 -14
  132. package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-01-init.md +0 -49
  133. package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-02-domain-analysis.md +0 -39
  134. package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-03-competitive-landscape.md +0 -39
  135. package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-04-regulatory-focus.md +0 -39
  136. package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-05-technical-trends.md +0 -39
  137. package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-06-research-synthesis.md +0 -43
  138. package/src/method-skills/1-analysis/wize-domain-research/research.template.md +0 -31
  139. package/src/method-skills/1-analysis/wize-domain-research/workflow.md +0 -58
  140. package/src/method-skills/1-analysis/wize-market-research/customize.toml +0 -14
  141. package/src/method-skills/1-analysis/wize-market-research/research.template.md +0 -31
  142. package/src/method-skills/1-analysis/wize-market-research/steps/step-01-init.md +0 -57
  143. package/src/method-skills/1-analysis/wize-market-research/steps/step-02-customer-behavior.md +0 -39
  144. package/src/method-skills/1-analysis/wize-market-research/steps/step-03-customer-pain-points.md +0 -37
  145. package/src/method-skills/1-analysis/wize-market-research/steps/step-04-customer-decisions.md +0 -39
  146. package/src/method-skills/1-analysis/wize-market-research/steps/step-05-competitive-analysis.md +0 -37
  147. package/src/method-skills/1-analysis/wize-market-research/steps/step-06-research-completion.md +0 -47
  148. package/src/method-skills/1-analysis/wize-market-research/workflow.md +0 -66
  149. package/src/method-skills/1-analysis/wize-refresh-knowledge/workflow.md +0 -129
  150. package/src/method-skills/1-analysis/wize-technical-research/customize.toml +0 -14
  151. package/src/method-skills/1-analysis/wize-technical-research/research.template.md +0 -31
  152. package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-01-init.md +0 -49
  153. package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-02-technical-overview.md +0 -45
  154. package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-03-integration-patterns.md +0 -39
  155. package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-04-architectural-patterns.md +0 -39
  156. package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-05-implementation-research.md +0 -42
  157. package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-06-research-synthesis.md +0 -46
  158. package/src/method-skills/1-analysis/wize-technical-research/workflow.md +0 -60
  159. package/src/method-skills/2-plan-workflows/wize-edit-prd/workflow.md +0 -110
  160. package/src/method-skills/3-solutioning/wize-create-architecture/architecture-decision-template.md +0 -41
  161. package/src/method-skills/3-solutioning/wize-create-architecture/customize.toml +0 -20
  162. package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-01-init.md +0 -95
  163. package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-01b-continue.md +0 -32
  164. package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-02-context.md +0 -126
  165. package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-03-starter.md +0 -110
  166. package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-04-decisions.md +0 -129
  167. package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-05-patterns.md +0 -109
  168. package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-06-structure.md +0 -97
  169. package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-07-validation.md +0 -124
  170. package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-08-complete.md +0 -59
  171. package/src/method-skills/3-solutioning/wize-project-context/workflow.md +0 -120
  172. package/src/method-skills/4-implementation/wize-changelog/workflow.md +0 -184
  173. package/src/method-skills/4-implementation/wize-checkpoint-preview/workflow.md +0 -117
  174. package/src/method-skills/4-implementation/wize-code-review/customize.toml +0 -21
  175. package/src/method-skills/4-implementation/wize-code-review/steps/step-01-gather-context.md +0 -64
  176. package/src/method-skills/4-implementation/wize-code-review/steps/step-02-review.md +0 -40
  177. package/src/method-skills/4-implementation/wize-code-review/steps/step-03-triage.md +0 -43
  178. package/src/method-skills/4-implementation/wize-code-review/steps/step-04-present.md +0 -100
  179. package/src/method-skills/4-implementation/wize-correct-course/workflow.md +0 -93
  180. package/src/method-skills/4-implementation/wize-investigate/workflow.md +0 -123
  181. package/src/method-skills/4-implementation/wize-release/workflow.md +0 -162
  182. package/src/orchestrator-skills/wize/skill.md +0 -164
  183. package/src/orchestrator-skills/wize-check/skill.md +0 -98
  184. package/src/security-overlay/_shared/allowlist.js +0 -154
  185. package/src/security-overlay/_shared/backlog.js +0 -169
  186. package/src/security-overlay/_shared/cli-runner.js +0 -87
  187. package/src/security-overlay/_shared/cvss.js +0 -108
  188. package/src/security-overlay/_shared/detect.js +0 -125
  189. package/src/security-overlay/_shared/install-script.js +0 -205
  190. package/src/security-overlay/_shared/invoke-phase.js +0 -86
  191. package/src/security-overlay/_shared/owasp.js +0 -56
  192. package/src/security-overlay/_shared/partial.js +0 -225
  193. package/src/security-overlay/_shared/preflight.js +0 -175
  194. package/src/security-overlay/_shared/scope-gate.js +0 -172
  195. package/src/security-overlay/_shared/scope-parser.js +0 -147
  196. package/src/security-overlay/agents/red-teamer/agent.yaml +0 -54
  197. package/src/security-overlay/agents/red-teamer/persona.md +0 -49
  198. package/src/security-overlay/data/common.txt +0 -115
  199. package/src/security-overlay/data/owasp-top10.json +0 -15
  200. package/src/security-overlay/data/tool-allowlist.json +0 -31
  201. package/src/security-overlay/skills/wize-sec-enumerate/scripts/run-enumerate.js +0 -180
  202. package/src/security-overlay/skills/wize-sec-enumerate/skill.md +0 -34
  203. package/src/security-overlay/skills/wize-sec-exploit/data/common.txt +0 -117
  204. package/src/security-overlay/skills/wize-sec-exploit/scripts/run-ffuf.js +0 -147
  205. package/src/security-overlay/skills/wize-sec-exploit/scripts/run-nikto.js +0 -145
  206. package/src/security-overlay/skills/wize-sec-exploit/scripts/run-nuclei.js +0 -176
  207. package/src/security-overlay/skills/wize-sec-exploit/scripts/run-sqlmap.js +0 -139
  208. package/src/security-overlay/skills/wize-sec-pentest/scripts/run-pipeline.js +0 -184
  209. package/src/security-overlay/skills/wize-sec-pentest/skill.md +0 -54
  210. package/src/security-overlay/skills/wize-sec-recon/scripts/run-gitleaks.js +0 -139
  211. package/src/security-overlay/skills/wize-sec-recon/scripts/run-osv.js +0 -227
  212. package/src/security-overlay/skills/wize-sec-recon/scripts/run-recon.js +0 -162
  213. package/src/security-overlay/skills/wize-sec-recon/skill.md +0 -37
  214. package/src/security-overlay/skills/wize-sec-report/scripts/render-report.js +0 -1033
  215. package/src/security-overlay/skills/wize-sec-scope/scripts/generate-scope.js +0 -106
  216. package/src/security-overlay/skills/wize-sec-scope/skill.md +0 -52
  217. package/src/tea-skills/wize-qa-generate-e2e-tests/workflow.md +0 -121
  218. package/tools/installer/baseline.js +0 -133
  219. package/tools/installer/commands/agent.js +0 -197
  220. package/tools/installer/commands/doctor.js +0 -320
  221. package/tools/installer/commands/document-project.js +0 -93
  222. package/tools/installer/commands/sync.js +0 -45
  223. package/tools/installer/commands/update.js +0 -172
  224. package/tools/installer/document-project/batch-scanner.js +0 -93
  225. package/tools/installer/document-project/classify.js +0 -170
  226. package/tools/installer/document-project/modes/deep-dive.js +0 -196
  227. package/tools/installer/document-project/modes/full-rescan.js +0 -15
  228. package/tools/installer/document-project/modes/initial-scan.js +0 -100
  229. package/tools/installer/document-project/modes/quick.js +0 -211
  230. package/tools/installer/document-project/render-index.js +0 -101
  231. package/tools/installer/document-project/state.js +0 -110
  232. package/tools/installer/version-check.js +0 -117
@@ -1,211 +0,0 @@
1
- // Quick baseline mode for `wize-dev-kit document-project`.
2
- //
3
- // Produces the 6 lightweight baseline files. Does not read source files.
4
-
5
- 'use strict';
6
-
7
- const fs = require('node:fs');
8
- const path = require('node:path');
9
-
10
- const BASELINE_FILES = {
11
- 'overview.md': overviewMarkdown,
12
- 'architecture-snapshot.md': architectureMarkdown,
13
- 'conventions.md': conventionsMarkdown,
14
- 'dependencies.md': dependenciesMarkdown,
15
- 'risk-spots.md': riskMarkdown,
16
- 'open-questions.md': questionsMarkdown
17
- };
18
-
19
- function now() {
20
- return new Date().toISOString().slice(0, 10);
21
- }
22
-
23
- function readPackage(root) {
24
- try {
25
- return JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf-8'));
26
- } catch {
27
- return {};
28
- }
29
- }
30
-
31
- function countLines(root) {
32
- let total = 0;
33
- const dirs = ['src', 'tools', 'adapters', 'schemas', 'test'];
34
- for (const dir of dirs) {
35
- const full = path.join(root, dir);
36
- if (!fs.existsSync(full)) continue;
37
- total += walkLines(full);
38
- }
39
- return total;
40
- }
41
-
42
- function walkLines(dir) {
43
- let total = 0;
44
- const entries = fs.readdirSync(dir, { withFileTypes: true });
45
- for (const e of entries) {
46
- const full = path.join(dir, e.name);
47
- if (e.isDirectory()) total += walkLines(full);
48
- else if (e.isFile() && /\.(js|md|yaml|json)$/.test(e.name)) {
49
- const content = fs.readFileSync(full, 'utf-8');
50
- total += content.split('\n').length;
51
- }
52
- }
53
- return total;
54
- }
55
-
56
- function recentCommitCount(root) {
57
- // Avoid shelling out; return 0 if not a git repo or git unavailable.
58
- // Caller can overlay a real count from CLI.
59
- return 0;
60
- }
61
-
62
- function overviewMarkdown(root, pkg) {
63
- return `---
64
- status: baseline
65
- owner: Pepper Potts + Peggy Carter
66
- created: ${now()}
67
- last_refreshed: ${now()}
68
- ---
69
-
70
- # Overview
71
-
72
- **Project:** ${pkg.name || path.basename(root)}
73
- **What it is:** ${pkg.description || 'Project documented by Wize Dev Kit.'}
74
- **Current version:** ${pkg.version || 'unknown'}
75
-
76
- ## Size
77
-
78
- - Source lines of code: ~${countLines(root)} LOC.
79
- - Runtime dependencies: ${Object.keys(pkg.dependencies || {}).length}.
80
- - Dev dependencies: ${Object.keys(pkg.devDependencies || {}).length}.
81
-
82
- ## What it ships
83
-
84
- - See architecture-snapshot.md for components and entry points.
85
- - See conventions.md for coding patterns.
86
- - See dependencies.md for runtime and dev dependency roles.
87
- `;
88
- }
89
-
90
- function architectureMarkdown() {
91
- return `---
92
- status: baseline
93
- owner: Pepper Potts + Tony Stark
94
- created: ${now()}
95
- last_refreshed: ${now()}
96
- ---
97
-
98
- # Architecture Snapshot
99
-
100
- ## Entry points
101
-
102
- - Documented after a deeper scan (initial_scan mode).
103
-
104
- ## Components
105
-
106
- - Run \`wize-dev-kit document-project initial_scan deep\` for component-level detail.
107
-
108
- ## Integration surface
109
-
110
- - See dependencies.md for external integrations.
111
- `;
112
- }
113
-
114
- function conventionsMarkdown() {
115
- return `---
116
- status: baseline
117
- owner: Peggy Carter
118
- created: ${now()}
119
- last_refreshed: ${now()}
120
- sampled: "pending deeper scan"
121
- ---
122
-
123
- # Conventions (observed, not prescribed)
124
-
125
- ## Quick notes
126
-
127
- - Run \`wize-dev-kit document-project initial_scan deep\` to sample files and fill this doc.
128
- `;
129
- }
130
-
131
- function dependenciesMarkdown(root, pkg) {
132
- const runtime = Object.entries(pkg.dependencies || {})
133
- .map(([name, version]) => `| ${name} | ${version} | | |`).join('\n');
134
- const dev = Object.entries(pkg.devDependencies || {})
135
- .map(([name, version]) => `| ${name} | ${version} | | |`).join('\n');
136
-
137
- return `---
138
- status: baseline
139
- owner: Pepper Potts
140
- created: ${now()}
141
- last_refreshed: ${now()}
142
- ---
143
-
144
- # Dependencies
145
-
146
- ## Runtime
147
-
148
- | Name | Version | Role in this repo | Load-bearing? |
149
- |---|---|---|---|
150
- ${runtime || '| — | — | — | — |'}
151
-
152
- ## Dev / bundled
153
-
154
- | Name | Version | Role in this repo | Load-bearing? |
155
- |---|---|---|---|
156
- ${dev || '| — | — | — | — |'}
157
- `;
158
- }
159
-
160
- function riskMarkdown() {
161
- return `---
162
- status: baseline
163
- owner: Pepper Potts + Tony Stark
164
- created: ${now()}
165
- last_refreshed: ${now()}
166
- ---
167
-
168
- # Risk Spots
169
-
170
- | Area | Symptom | Likely cause | Confidence |
171
- |---|---|---|---|
172
- | | | | |
173
-
174
- Run \`wize-dev-kit document-project initial_scan deep\` to populate risk spots.
175
- `;
176
- }
177
-
178
- function questionsMarkdown() {
179
- return `---
180
- status: baseline
181
- owner: Pepper Potts + Peggy Carter
182
- created: ${now()}
183
- last_refreshed: ${now()}
184
- ---
185
-
186
- # Open Questions
187
-
188
- | Question | Why it matters | Owner to ask |
189
- |---|---|---|
190
- | | | |
191
- `;
192
- }
193
-
194
- function runQuick(projectRoot, opts = {}) {
195
- const pkg = readPackage(projectRoot);
196
- const dir = path.join(projectRoot, '.wize', 'knowledge', 'document-project');
197
- fs.mkdirSync(dir, { recursive: true });
198
-
199
- const written = [];
200
- for (const [name, factory] of Object.entries(BASELINE_FILES)) {
201
- const file = path.join(dir, name);
202
- const content = factory(projectRoot, pkg);
203
- fs.writeFileSync(file, content, 'utf-8');
204
- written.push(name);
205
- }
206
-
207
- if (opts.log) opts.log(`Quick baseline written to ${dir}`);
208
- return { changed: true, mode: 'quick', written };
209
- }
210
-
211
- module.exports = { runQuick, BASELINE_FILES, countLines };
@@ -1,101 +0,0 @@
1
- // Master index renderer for `wize-dev-kit document-project`.
2
- //
3
- // Generates `.wize/knowledge/document-project/index.md` linking all docs.
4
-
5
- 'use strict';
6
-
7
- const fs = require('node:fs');
8
- const path = require('node:path');
9
-
10
- function link(name, file) {
11
- return `- [${name}](./${file})`;
12
- }
13
-
14
- function linkWithMarker(name, file, exists) {
15
- const base = link(name, file);
16
- return exists ? base : `${base} _(To be generated)_`;
17
- }
18
-
19
- function renderIndex(projectRoot, { projectTypes = [], parts = [], generated = [], existing = [], deepDiveFiles = [] } = {}) {
20
- const dir = path.join(projectRoot, '.wize', 'knowledge', 'document-project');
21
- fs.mkdirSync(dir, { recursive: true });
22
-
23
- const generatedSet = new Set(generated.map(g => path.basename(g)));
24
- const existingSet = new Set(existing.map(e => path.basename(e)));
25
- const has = name => generatedSet.has(name) || existingSet.has(name);
26
-
27
- const isMultiPart = parts.length >= 2;
28
- const primaryType = projectTypes[0] || 'unknown';
29
-
30
- const lines = [
31
- '---',
32
- 'status: baseline',
33
- 'owner: Pepper Potts + Peggy Carter',
34
- `created: ${new Date().toISOString().slice(0, 10)}`,
35
- `last_refreshed: ${new Date().toISOString().slice(0, 10)}`,
36
- '---',
37
- '',
38
- '# Project Documentation Index',
39
- '',
40
- `**Type:** ${isMultiPart ? 'multi-part' : primaryType}`,
41
- `**Primary project type(s):** ${projectTypes.join(', ') || 'unknown'}`,
42
- '',
43
- '## Generated Documentation',
44
- '',
45
- link('Project Overview', 'project-overview.md'),
46
- linkWithMarker('Source Tree Analysis', 'source-tree-analysis.md', has('source-tree-analysis.md')),
47
- ];
48
-
49
- if (isMultiPart) {
50
- for (const part of parts) {
51
- const suffix = part.part_id === 'root' ? '' : `-${part.part_id}`;
52
- lines.push(linkWithMarker(`Architecture — ${part.part_id || 'root'}`, `architecture${suffix}.md`, has(`architecture${suffix}.md`)));
53
- lines.push(linkWithMarker(`Development Guide — ${part.part_id || 'root'}`, `development-guide${suffix}.md`, has(`development-guide${suffix}.md`)));
54
- lines.push(linkWithMarker(`Component Inventory — ${part.part_id || 'root'}`, `component-inventory${suffix}.md`, has(`component-inventory${suffix}.md`)));
55
- lines.push(linkWithMarker(`API Contracts — ${part.part_id || 'root'}`, `api-contracts${suffix}.md`, has(`api-contracts${suffix}.md`)));
56
- lines.push(linkWithMarker(`Data Models — ${part.part_id || 'root'}`, `data-models${suffix}.md`, has(`data-models${suffix}.md`)));
57
- }
58
- lines.push(linkWithMarker('Integration Architecture', 'integration-architecture.md', has('integration-architecture.md')));
59
- } else {
60
- lines.push(linkWithMarker('Architecture', 'architecture.md', has('architecture.md')));
61
- lines.push(linkWithMarker('Development Guide', 'development-guide.md', has('development-guide.md')));
62
- lines.push(linkWithMarker('Component Inventory', 'component-inventory.md', has('component-inventory.md')));
63
- lines.push(linkWithMarker('API Contracts', 'api-contracts.md', has('api-contracts.md')));
64
- lines.push(linkWithMarker('Data Models', 'data-models.md', has('data-models.md')));
65
- }
66
-
67
- lines.push(linkWithMarker('Deployment Guide', 'deployment-guide.md', has('deployment-guide.md')));
68
- lines.push(linkWithMarker('Contribution Guide', 'contribution-guide.md', has('contribution-guide.md')));
69
- if (deepDiveFiles.length) {
70
- lines.push('', '## Deep-Dive Docs', '');
71
- for (const f of deepDiveFiles) {
72
- lines.push(link(f.replace(/^deep-dive-/, '').replace(/\.md$/, ''), f));
73
- }
74
- } else {
75
- lines.push(linkWithMarker('Deep-Dive Docs', 'deep-dive/', false)); // directory marker
76
- }
77
-
78
- if (existing.length) {
79
- lines.push('', '## Existing Documentation', '');
80
- for (const doc of existing) {
81
- const rel = path.relative(dir, doc);
82
- lines.push(`- [${path.basename(doc)}](./${rel})`);
83
- }
84
- }
85
-
86
- lines.push('', '## Brownfield Baseline', '');
87
- lines.push(link('Overview', 'overview.md'));
88
- lines.push(link('Architecture Snapshot', 'architecture-snapshot.md'));
89
- lines.push(link('Conventions', 'conventions.md'));
90
- lines.push(link('Dependencies', 'dependencies.md'));
91
- lines.push(link('Risk Spots', 'risk-spots.md'));
92
- lines.push(link('Open Questions', 'open-questions.md'));
93
-
94
- lines.push('', '---', '', '_Generated by `wize-document-project`._', '');
95
-
96
- const file = path.join(dir, 'index.md');
97
- fs.writeFileSync(file, lines.join('\n'), 'utf-8');
98
- return { changed: true, written: ['index.md'] };
99
- }
100
-
101
- module.exports = { renderIndex, link, linkWithMarker };
@@ -1,110 +0,0 @@
1
- // State file management for `wize-dev-kit document-project`.
2
- //
3
- // Tracks scan progress so long-running deep/exhaustive scans can resume.
4
-
5
- 'use strict';
6
-
7
- const fs = require('node:fs');
8
- const path = require('node:path');
9
-
10
- const WORKFLOW_VERSION = '0.3.1';
11
- const STATE_FILE = 'project-scan-report.json';
12
- const ARCHIVE_DIR = '_archive';
13
-
14
- function nowIso() {
15
- return new Date().toISOString();
16
- }
17
-
18
- function statePath(projectRoot) {
19
- return path.join(projectRoot, '.wize', 'knowledge', 'document-project', STATE_FILE);
20
- }
21
-
22
- function archivePath(projectRoot, timestamp) {
23
- const dir = path.join(projectRoot, '.wize', 'knowledge', 'document-project', ARCHIVE_DIR);
24
- fs.mkdirSync(dir, { recursive: true });
25
- const safe = timestamp.replace(/[:.]/g, '-');
26
- return path.join(dir, `project-scan-report-${safe}.json`);
27
- }
28
-
29
- function initState(projectRoot, mode, scanLevel) {
30
- const state = {
31
- workflow_version: WORKFLOW_VERSION,
32
- timestamps: { started: nowIso(), last_updated: nowIso() },
33
- mode,
34
- scan_level: scanLevel,
35
- project_root: projectRoot,
36
- project_knowledge: path.join(projectRoot, '.wize', 'knowledge', 'document-project'),
37
- completed_steps: [],
38
- current_step: 'step_1',
39
- findings: {},
40
- outputs_generated: [STATE_FILE],
41
- resume_instructions: `Starting ${mode} (${scanLevel}) from step_1`
42
- };
43
- writeState(projectRoot, state);
44
- return state;
45
- }
46
-
47
- function loadState(projectRoot) {
48
- const p = statePath(projectRoot);
49
- if (!fs.existsSync(p)) return null;
50
- try {
51
- const content = fs.readFileSync(p, 'utf-8');
52
- const state = JSON.parse(content);
53
- if (!state.workflow_version || !state.timestamps || !state.mode || !state.scan_level) {
54
- return null;
55
- }
56
- return state;
57
- } catch {
58
- return null;
59
- }
60
- }
61
-
62
- function writeState(projectRoot, state) {
63
- const p = statePath(projectRoot);
64
- fs.mkdirSync(path.dirname(p), { recursive: true });
65
- state.timestamps.last_updated = nowIso();
66
- fs.writeFileSync(p, JSON.stringify(state, null, 2), 'utf-8');
67
- }
68
-
69
- function updateState(projectRoot, patch) {
70
- const state = loadState(projectRoot) || initState(projectRoot, 'quick', 'quick');
71
- for (const key of Object.keys(patch)) {
72
- const val = patch[key];
73
- if (Array.isArray(val) && Array.isArray(state[key])) {
74
- state[key].push(...val);
75
- } else if (typeof val === 'object' && val !== null && !Array.isArray(val)) {
76
- state[key] = { ...(state[key] || {}), ...val };
77
- } else {
78
- state[key] = val;
79
- }
80
- }
81
- writeState(projectRoot, state);
82
- return state;
83
- }
84
-
85
- function archiveOldState(projectRoot) {
86
- const p = statePath(projectRoot);
87
- if (!fs.existsSync(p)) return false;
88
- const content = fs.readFileSync(p, 'utf-8');
89
- const archived = archivePath(projectRoot, nowIso());
90
- fs.writeFileSync(archived, content, 'utf-8');
91
- fs.rmSync(p);
92
- return true;
93
- }
94
-
95
- function stateAgeDays(state) {
96
- if (!state || !state.timestamps || !state.timestamps.last_updated) return null;
97
- const then = Date.parse(state.timestamps.last_updated);
98
- if (Number.isNaN(then)) return null;
99
- return Math.floor((Date.now() - then) / (24 * 3600 * 1000));
100
- }
101
-
102
- module.exports = {
103
- statePath,
104
- initState,
105
- loadState,
106
- updateState,
107
- archiveOldState,
108
- stateAgeDays,
109
- WORKFLOW_VERSION
110
- };
@@ -1,117 +0,0 @@
1
- // Best-effort, non-blocking npm registry check for "is there a newer wize-dev-kit
2
- // version than the one I'm running?". Designed so the CLI can call it from
3
- // `list` / `agent list` / `help` and print a single hint at the top, without
4
- // ever blocking the command if the network is slow, the user is offline, or
5
- // the registry is misbehaving.
6
- //
7
- // Strategy:
8
- // - Cache the registry answer in $XDG_CACHE_HOME (or ~/.cache) for 1 hour.
9
- // - Resolve via fetch with a 1.5s timeout. Failure is silent.
10
- // - Compare with the kit version baked into the running CLI.
11
- // - Expose a `printUpdateHintIfAny(currentVersion)` helper for the CLI.
12
-
13
- 'use strict';
14
-
15
- const fs = require('node:fs');
16
- const os = require('node:os');
17
- const path = require('node:path');
18
-
19
- const CACHE_TTL_MS = 60 * 60 * 1000; // 1h
20
- const NETWORK_TIMEOUT_MS = 1500;
21
-
22
- function cacheFile() {
23
- const base = process.env.XDG_CACHE_HOME || path.join(os.homedir(), '.cache');
24
- return path.join(base, 'wize-dev-kit', 'registry-version.json');
25
- }
26
-
27
- function readCache() {
28
- const f = cacheFile();
29
- try {
30
- const stat = fs.statSync(f);
31
- if (Date.now() - stat.mtimeMs > CACHE_TTL_MS) return null;
32
- return JSON.parse(fs.readFileSync(f, 'utf-8'));
33
- } catch (_) {
34
- return null;
35
- }
36
- }
37
-
38
- function writeCache(payload) {
39
- const f = cacheFile();
40
- try {
41
- fs.mkdirSync(path.dirname(f), { recursive: true });
42
- fs.writeFileSync(f, JSON.stringify(payload), 'utf-8');
43
- } catch (_) { /* cache failure is harmless */ }
44
- }
45
-
46
- async function fetchLatestFromRegistry() {
47
- const ctrl = new AbortController();
48
- const timer = setTimeout(() => ctrl.abort(), NETWORK_TIMEOUT_MS);
49
- try {
50
- const res = await fetch('https://registry.npmjs.org/wize-dev-kit', {
51
- signal: ctrl.signal,
52
- headers: { Accept: 'application/vnd.npm.install-v1+json' }
53
- });
54
- if (!res.ok) return null;
55
- const body = await res.json();
56
- const latest = body && body['dist-tags'] && body['dist-tags'].latest;
57
- return typeof latest === 'string' ? latest : null;
58
- } catch (_) {
59
- return null; // any error → silent fallback
60
- } finally {
61
- clearTimeout(timer);
62
- }
63
- }
64
-
65
- // Returns the registry-latest version, hitting the cache first. Never throws,
66
- // never blocks meaningfully (network call is capped + abortable).
67
- async function getLatestVersion({ skipCache = false } = {}) {
68
- if (!skipCache) {
69
- const c = readCache();
70
- if (c && c.version) return c.version;
71
- }
72
- const fresh = await fetchLatestFromRegistry();
73
- if (fresh) writeCache({ version: fresh, fetched_at: Date.now() });
74
- return fresh;
75
- }
76
-
77
- function semverGreater(a, b) {
78
- const pa = String(a).split('.').map(n => parseInt(n, 10) || 0);
79
- const pb = String(b).split('.').map(n => parseInt(n, 10) || 0);
80
- for (let i = 0; i < 3; i++) {
81
- if ((pa[i] || 0) > (pb[i] || 0)) return true;
82
- if ((pa[i] || 0) < (pb[i] || 0)) return false;
83
- }
84
- return false;
85
- }
86
-
87
- // Prints a one-line hint when a newer version is available. Silent otherwise.
88
- // Designed to be awaited near the top of a CLI command; if anything is slow
89
- // or off, it just returns.
90
- async function printUpdateHintIfAny(currentVersion, { log = console.log, isTTY = process.stdout.isTTY } = {}) {
91
- if (process.env.WIZE_DISABLE_UPDATE_CHECK === '1') return;
92
- if (!isTTY) return; // don't spam pipes
93
- try {
94
- const latest = await getLatestVersion();
95
- if (!latest) return;
96
- if (semverGreater(latest, currentVersion)) {
97
- log('');
98
- log(` ↑ Update available: wize-dev-kit ${currentVersion} → ${latest}`);
99
- log(` Run \`npx wize-dev-kit@latest update\` in your project to refresh adapters.`);
100
- log('');
101
- }
102
- } catch (_) {
103
- /* total fallback — never block the command */
104
- }
105
- }
106
-
107
- module.exports = {
108
- CACHE_TTL_MS,
109
- NETWORK_TIMEOUT_MS,
110
- cacheFile,
111
- readCache,
112
- writeCache,
113
- fetchLatestFromRegistry,
114
- getLatestVersion,
115
- semverGreater,
116
- printUpdateHintIfAny
117
- };