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.
- package/ARCH.md +24 -77
- package/CHANGELOG.md +9 -0
- package/DECISIONS.md +1 -27
- package/README.md +4 -0
- package/ROSTER.md +3 -11
- package/adapters/README.md +7 -8
- package/adapters/antigravity/README.md +5 -5
- package/adapters/claude-code/README.md +1 -1
- package/adapters/codex/README.md +5 -5
- package/adapters/codex/adapter.yaml +1 -1
- package/adapters/codex/render.js +1 -1
- package/adapters/continue/README.md +5 -5
- package/adapters/cursor/README.md +2 -2
- package/adapters/generic/README.md +1 -1
- package/adapters/kimi-code/README.md +5 -5
- package/adapters/kimi-code/render.js +2 -2
- package/adapters/opencode/README.md +3 -3
- package/adapters/opencode/render.js +1 -27
- package/adapters/windsurf/README.md +3 -3
- package/package.json +1 -1
- package/schemas/agent.schema.json +2 -2
- package/schemas/workflow.schema.json +1 -1
- package/src/app-overlay/wize-app-release-channels/workflow.md +0 -2
- package/src/app-overlay/wize-app-scaffold/workflow.md +0 -2
- package/src/app-overlay/wize-app-store-listing/workflow.md +0 -2
- package/src/builder-skills/wize-create-agent/workflow.md +0 -2
- package/src/builder-skills/wize-create-skill/workflow.md +0 -2
- package/src/builder-skills/wize-create-workflow/workflow.md +0 -2
- package/src/core-skills/module.yaml +3 -0
- package/src/core-skills/wize-advanced-elicitation/skill.md +0 -2
- package/src/core-skills/wize-brainstorming/skill.md +0 -2
- package/src/core-skills/wize-eli5/skill.md +72 -0
- package/src/core-skills/wize-review-adversarial/skill.md +0 -3
- package/src/core-skills/wize-shard-doc/skill.md +0 -2
- package/src/method-skills/1-analysis/wize-agent-analyst/agent.yaml +0 -3
- package/src/method-skills/1-analysis/wize-document-project/workflow.md +20 -213
- package/src/method-skills/1-analysis/wize-prfaq/workflow.md +11 -152
- package/src/method-skills/1-analysis/wize-product-brief/workflow.md +19 -92
- package/src/method-skills/1-analysis/wize-research/workflow.md +12 -39
- package/src/method-skills/1-analysis/wize-trigger-map/workflow.md +16 -82
- package/src/method-skills/2-plan-workflows/wize-create-prd/workflow.md +23 -135
- package/src/method-skills/2-plan-workflows/wize-ux-design/workflow.md +28 -134
- package/src/method-skills/2-plan-workflows/wize-ux-scenarios/workflow.md +15 -93
- package/src/method-skills/2-plan-workflows/wize-validate-prd/workflow.md +12 -108
- package/src/method-skills/3-solutioning/wize-check-implementation-readiness/workflow.md +11 -103
- package/src/method-skills/3-solutioning/wize-create-architecture/workflow.md +48 -55
- package/src/method-skills/3-solutioning/wize-create-epics-and-stories/workflow.md +15 -154
- package/src/method-skills/3-solutioning/wize-design-system/workflow.md +22 -184
- package/src/method-skills/3-solutioning/wize-nfr-principles/workflow.md +17 -145
- package/src/method-skills/3-solutioning/wize-tech-vision/workflow.md +22 -130
- package/src/method-skills/4-implementation/wize-agent-dev/persona.md +0 -12
- package/src/method-skills/4-implementation/wize-code-review/workflow.md +12 -54
- package/src/method-skills/4-implementation/wize-create-story/workflow.md +10 -154
- package/src/method-skills/4-implementation/wize-dev-story/workflow.md +17 -185
- package/src/method-skills/4-implementation/wize-quick-dev/workflow.md +18 -136
- package/src/method-skills/4-implementation/wize-retrospective/workflow.md +10 -114
- package/src/method-skills/4-implementation/wize-sprint-planning/workflow.md +11 -78
- package/src/method-skills/4-implementation/wize-sprint-status/workflow.md +11 -45
- package/src/method-skills/module.yaml +0 -28
- package/src/orchestrator-skills/module.yaml +1 -7
- package/src/orchestrator-skills/wize-help/skill.md +67 -227
- package/src/orchestrator-skills/wize-onboarding/workflow.md +14 -78
- package/src/orchestrator-skills/wize-orchestrator/agent.yaml +0 -2
- package/src/orchestrator-skills/wize-orchestrator/persona.md +3 -44
- package/src/orchestrator-skills/wize-party-mode/workflow.md +0 -2
- package/src/tea-skills/wize-tea-design/workflow.md +13 -107
- package/src/tea-skills/wize-tea-gate/workflow.md +25 -118
- package/src/tea-skills/wize-tea-nfr/workflow.md +14 -107
- package/src/tea-skills/wize-tea-review/workflow.md +13 -123
- package/src/tea-skills/wize-tea-risk/workflow.md +10 -113
- package/src/tea-skills/wize-tea-trace/workflow.md +12 -86
- package/src/web-overlay/wize-web-deploy/workflow.md +0 -2
- package/src/web-overlay/wize-web-scaffold/workflow.md +0 -2
- package/src/web-overlay/wize-web-seo-audit/workflow.md +0 -2
- package/tools/check-eli5-all-adapters.js +50 -0
- package/tools/installer/onboarding.js +20 -14
- package/tools/installer/render-shared.js +15 -159
- package/tools/installer/setup-helpers.js +0 -1
- package/tools/installer/validators/run-all.js +2 -3
- package/tools/installer/wize-cli.js +70 -500
- package/AGENTS.md +0 -37
- package/README.es.md +0 -295
- package/README.pt-BR.md +0 -293
- package/adapters/hermes/README.md +0 -23
- package/adapters/hermes/adapter.yaml +0 -8
- package/adapters/hermes/render.js +0 -17
- package/docs/harnesses/antigravity.md +0 -20
- package/docs/harnesses/antigravity.pt-BR.md +0 -20
- package/docs/harnesses/claude-code.md +0 -23
- package/docs/harnesses/claude-code.pt-BR.md +0 -23
- package/docs/harnesses/codex.md +0 -21
- package/docs/harnesses/codex.pt-BR.md +0 -21
- package/docs/harnesses/continue.md +0 -21
- package/docs/harnesses/continue.pt-BR.md +0 -21
- package/docs/harnesses/cursor.md +0 -22
- package/docs/harnesses/cursor.pt-BR.md +0 -22
- package/docs/harnesses/generic.md +0 -20
- package/docs/harnesses/generic.pt-BR.md +0 -20
- package/docs/harnesses/hermes.md +0 -26
- package/docs/harnesses/hermes.pt-BR.md +0 -26
- package/docs/harnesses/kimi-code.md +0 -19
- package/docs/harnesses/kimi-code.pt-BR.md +0 -19
- package/docs/harnesses/opencode.md +0 -31
- package/docs/harnesses/opencode.pt-BR.md +0 -31
- package/docs/harnesses/windsurf.md +0 -22
- package/docs/harnesses/windsurf.pt-BR.md +0 -22
- package/src/core-skills/wize-customize/skill.md +0 -116
- package/src/core-skills/wize-editorial-review-prose/skill.md +0 -94
- package/src/core-skills/wize-editorial-review-structure/skill.md +0 -99
- package/src/core-skills/wize-grill/skill.md +0 -77
- package/src/core-skills/wize-index-docs/skill.md +0 -119
- package/src/core-skills/wize-pre-pr-check/skill.md +0 -134
- package/src/core-skills/wize-review-edge-case-hunter/skill.md +0 -115
- package/src/core-skills/wize-spec/assets/headless-schemas.md +0 -39
- package/src/core-skills/wize-spec/assets/spec-template.md +0 -40
- package/src/core-skills/wize-spec/customize.toml +0 -20
- package/src/core-skills/wize-spec/skill.md +0 -112
- package/src/method-skills/1-analysis/wize-document-project/documentation-requirements.csv +0 -12
- package/src/method-skills/1-analysis/wize-document-project/templates/api-contracts-template.md +0 -38
- package/src/method-skills/1-analysis/wize-document-project/templates/architecture-template.md +0 -54
- package/src/method-skills/1-analysis/wize-document-project/templates/component-inventory-template.md +0 -40
- package/src/method-skills/1-analysis/wize-document-project/templates/contribution-guide-template.md +0 -34
- package/src/method-skills/1-analysis/wize-document-project/templates/data-models-template.md +0 -36
- package/src/method-skills/1-analysis/wize-document-project/templates/deep-dive-template.md +0 -312
- package/src/method-skills/1-analysis/wize-document-project/templates/deployment-guide-template.md +0 -42
- package/src/method-skills/1-analysis/wize-document-project/templates/development-guide-template.md +0 -61
- package/src/method-skills/1-analysis/wize-document-project/templates/index-template.md +0 -185
- package/src/method-skills/1-analysis/wize-document-project/templates/project-overview-template.md +0 -110
- package/src/method-skills/1-analysis/wize-document-project/templates/project-scan-report-schema.json +0 -159
- package/src/method-skills/1-analysis/wize-document-project/templates/source-tree-template.md +0 -142
- package/src/method-skills/1-analysis/wize-domain-research/customize.toml +0 -14
- package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-01-init.md +0 -49
- package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-02-domain-analysis.md +0 -39
- package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-03-competitive-landscape.md +0 -39
- package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-04-regulatory-focus.md +0 -39
- package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-05-technical-trends.md +0 -39
- package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-06-research-synthesis.md +0 -43
- package/src/method-skills/1-analysis/wize-domain-research/research.template.md +0 -31
- package/src/method-skills/1-analysis/wize-domain-research/workflow.md +0 -58
- package/src/method-skills/1-analysis/wize-market-research/customize.toml +0 -14
- package/src/method-skills/1-analysis/wize-market-research/research.template.md +0 -31
- package/src/method-skills/1-analysis/wize-market-research/steps/step-01-init.md +0 -57
- package/src/method-skills/1-analysis/wize-market-research/steps/step-02-customer-behavior.md +0 -39
- package/src/method-skills/1-analysis/wize-market-research/steps/step-03-customer-pain-points.md +0 -37
- package/src/method-skills/1-analysis/wize-market-research/steps/step-04-customer-decisions.md +0 -39
- package/src/method-skills/1-analysis/wize-market-research/steps/step-05-competitive-analysis.md +0 -37
- package/src/method-skills/1-analysis/wize-market-research/steps/step-06-research-completion.md +0 -47
- package/src/method-skills/1-analysis/wize-market-research/workflow.md +0 -66
- package/src/method-skills/1-analysis/wize-refresh-knowledge/workflow.md +0 -129
- package/src/method-skills/1-analysis/wize-technical-research/customize.toml +0 -14
- package/src/method-skills/1-analysis/wize-technical-research/research.template.md +0 -31
- package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-01-init.md +0 -49
- package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-02-technical-overview.md +0 -45
- package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-03-integration-patterns.md +0 -39
- package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-04-architectural-patterns.md +0 -39
- package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-05-implementation-research.md +0 -42
- package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-06-research-synthesis.md +0 -46
- package/src/method-skills/1-analysis/wize-technical-research/workflow.md +0 -60
- package/src/method-skills/2-plan-workflows/wize-edit-prd/workflow.md +0 -110
- package/src/method-skills/3-solutioning/wize-create-architecture/architecture-decision-template.md +0 -41
- package/src/method-skills/3-solutioning/wize-create-architecture/customize.toml +0 -20
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-01-init.md +0 -95
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-01b-continue.md +0 -32
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-02-context.md +0 -126
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-03-starter.md +0 -110
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-04-decisions.md +0 -129
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-05-patterns.md +0 -109
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-06-structure.md +0 -97
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-07-validation.md +0 -124
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-08-complete.md +0 -59
- package/src/method-skills/3-solutioning/wize-project-context/workflow.md +0 -120
- package/src/method-skills/4-implementation/wize-changelog/workflow.md +0 -184
- package/src/method-skills/4-implementation/wize-checkpoint-preview/workflow.md +0 -117
- package/src/method-skills/4-implementation/wize-code-review/customize.toml +0 -21
- package/src/method-skills/4-implementation/wize-code-review/steps/step-01-gather-context.md +0 -64
- package/src/method-skills/4-implementation/wize-code-review/steps/step-02-review.md +0 -40
- package/src/method-skills/4-implementation/wize-code-review/steps/step-03-triage.md +0 -43
- package/src/method-skills/4-implementation/wize-code-review/steps/step-04-present.md +0 -100
- package/src/method-skills/4-implementation/wize-correct-course/workflow.md +0 -93
- package/src/method-skills/4-implementation/wize-investigate/workflow.md +0 -123
- package/src/method-skills/4-implementation/wize-release/workflow.md +0 -162
- package/src/orchestrator-skills/wize/skill.md +0 -164
- package/src/orchestrator-skills/wize-check/skill.md +0 -98
- package/src/security-overlay/_shared/allowlist.js +0 -154
- package/src/security-overlay/_shared/backlog.js +0 -169
- package/src/security-overlay/_shared/cli-runner.js +0 -87
- package/src/security-overlay/_shared/cvss.js +0 -108
- package/src/security-overlay/_shared/detect.js +0 -125
- package/src/security-overlay/_shared/install-script.js +0 -205
- package/src/security-overlay/_shared/invoke-phase.js +0 -86
- package/src/security-overlay/_shared/owasp.js +0 -56
- package/src/security-overlay/_shared/partial.js +0 -225
- package/src/security-overlay/_shared/preflight.js +0 -175
- package/src/security-overlay/_shared/scope-gate.js +0 -172
- package/src/security-overlay/_shared/scope-parser.js +0 -147
- package/src/security-overlay/agents/red-teamer/agent.yaml +0 -54
- package/src/security-overlay/agents/red-teamer/persona.md +0 -49
- package/src/security-overlay/data/common.txt +0 -115
- package/src/security-overlay/data/owasp-top10.json +0 -15
- package/src/security-overlay/data/tool-allowlist.json +0 -31
- package/src/security-overlay/skills/wize-sec-enumerate/scripts/run-enumerate.js +0 -180
- package/src/security-overlay/skills/wize-sec-enumerate/skill.md +0 -34
- package/src/security-overlay/skills/wize-sec-exploit/data/common.txt +0 -117
- package/src/security-overlay/skills/wize-sec-exploit/scripts/run-ffuf.js +0 -147
- package/src/security-overlay/skills/wize-sec-exploit/scripts/run-nikto.js +0 -145
- package/src/security-overlay/skills/wize-sec-exploit/scripts/run-nuclei.js +0 -176
- package/src/security-overlay/skills/wize-sec-exploit/scripts/run-sqlmap.js +0 -139
- package/src/security-overlay/skills/wize-sec-pentest/scripts/run-pipeline.js +0 -184
- package/src/security-overlay/skills/wize-sec-pentest/skill.md +0 -54
- package/src/security-overlay/skills/wize-sec-recon/scripts/run-gitleaks.js +0 -139
- package/src/security-overlay/skills/wize-sec-recon/scripts/run-osv.js +0 -227
- package/src/security-overlay/skills/wize-sec-recon/scripts/run-recon.js +0 -162
- package/src/security-overlay/skills/wize-sec-recon/skill.md +0 -37
- package/src/security-overlay/skills/wize-sec-report/scripts/render-report.js +0 -1033
- package/src/security-overlay/skills/wize-sec-scope/scripts/generate-scope.js +0 -106
- package/src/security-overlay/skills/wize-sec-scope/skill.md +0 -52
- package/src/tea-skills/wize-qa-generate-e2e-tests/workflow.md +0 -121
- package/tools/installer/baseline.js +0 -133
- package/tools/installer/commands/agent.js +0 -197
- package/tools/installer/commands/doctor.js +0 -320
- package/tools/installer/commands/document-project.js +0 -93
- package/tools/installer/commands/sync.js +0 -45
- package/tools/installer/commands/update.js +0 -172
- package/tools/installer/document-project/batch-scanner.js +0 -93
- package/tools/installer/document-project/classify.js +0 -170
- package/tools/installer/document-project/modes/deep-dive.js +0 -196
- package/tools/installer/document-project/modes/full-rescan.js +0 -15
- package/tools/installer/document-project/modes/initial-scan.js +0 -100
- package/tools/installer/document-project/modes/quick.js +0 -211
- package/tools/installer/document-project/render-index.js +0 -101
- package/tools/installer/document-project/state.js +0 -110
- package/tools/installer/version-check.js +0 -117
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// generate-scope.js — creates a valid .wize/security/scope.md from CLI args.
|
|
4
|
-
// Zero-dep. Computes scope_sha256 from the body (including the leading newline
|
|
5
|
-
// separator, matching parseScope's convention).
|
|
6
|
-
|
|
7
|
-
const fs = require('node:fs');
|
|
8
|
-
const path = require('node:path');
|
|
9
|
-
const crypto = require('node:crypto');
|
|
10
|
-
|
|
11
|
-
function parseArgv(argv) {
|
|
12
|
-
const out = { url: null, hosts: [], paths: [], acceptedBy: null, outPath: null };
|
|
13
|
-
for (let i = 0; i < (argv || []).length; i++) {
|
|
14
|
-
const a = argv[i];
|
|
15
|
-
if (a === '--url' && argv[i + 1]) { out.url = argv[i + 1]; i++; }
|
|
16
|
-
else if (a.startsWith('--url=')) out.url = a.slice('--url='.length);
|
|
17
|
-
else if (a === '--hosts' && argv[i + 1]) { out.hosts = argv[i + 1].split(',').map(s => s.trim()).filter(Boolean); i++; }
|
|
18
|
-
else if (a.startsWith('--hosts=')) out.hosts = a.slice('--hosts='.length).split(',').map(s => s.trim()).filter(Boolean);
|
|
19
|
-
else if (a === '--paths' && argv[i + 1]) { out.paths = argv[i + 1].split(',').map(s => s.trim()).filter(Boolean); i++; }
|
|
20
|
-
else if (a.startsWith('--paths=')) out.paths = a.slice('--paths='.length).split(',').map(s => s.trim()).filter(Boolean);
|
|
21
|
-
else if (a === '--accepted-by' && argv[i + 1]) { out.acceptedBy = argv[i + 1]; i++; }
|
|
22
|
-
else if (a.startsWith('--accepted-by=')) out.acceptedBy = a.slice('--accepted-by='.length);
|
|
23
|
-
else if (a === '--out' && argv[i + 1]) { out.outPath = argv[i + 1]; i++; }
|
|
24
|
-
else if (a.startsWith('--out=')) out.outPath = a.slice('--out='.length);
|
|
25
|
-
}
|
|
26
|
-
if (!out.outPath) out.outPath = path.join(process.cwd(), '.wize', 'security', 'scope.md');
|
|
27
|
-
return out;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function buildBody({ url, hosts, paths }) {
|
|
31
|
-
const lines = [];
|
|
32
|
-
|
|
33
|
-
lines.push('## allowlist');
|
|
34
|
-
|
|
35
|
-
lines.push('hosts:');
|
|
36
|
-
for (const h of hosts) lines.push(` - ${h}`);
|
|
37
|
-
|
|
38
|
-
lines.push('urls:');
|
|
39
|
-
if (url) lines.push(` - ${url.replace(/\/+$/, '')}/`);
|
|
40
|
-
|
|
41
|
-
lines.push('paths:');
|
|
42
|
-
if (paths.length > 0) {
|
|
43
|
-
for (const p of paths) lines.push(` - ${p}`);
|
|
44
|
-
} else {
|
|
45
|
-
lines.push(' - /');
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
lines.push('');
|
|
49
|
-
lines.push('## dast_target');
|
|
50
|
-
if (url) lines.push(`url: ${url}`);
|
|
51
|
-
lines.push('');
|
|
52
|
-
lines.push('## notes');
|
|
53
|
-
lines.push(`Scope gerado por wize-sec-scope em ${new Date().toISOString()}.`);
|
|
54
|
-
lines.push('');
|
|
55
|
-
|
|
56
|
-
return lines.join('\n');
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function generateScope({ url, hosts, paths, acceptedBy, outPath }) {
|
|
60
|
-
const body = buildBody({ url, hosts, paths });
|
|
61
|
-
|
|
62
|
-
// The hash is computed on the body as parseScope returns it: with the
|
|
63
|
-
// leading newline separator between the closing --- and the body.
|
|
64
|
-
const signedBody = '\n' + body;
|
|
65
|
-
const scopeSha256 = crypto.createHash('sha256').update(signedBody, 'utf8').digest('hex');
|
|
66
|
-
const acceptedAt = new Date().toISOString();
|
|
67
|
-
|
|
68
|
-
const fm = [
|
|
69
|
-
`accepted_by: ${acceptedBy || 'unknown'}`,
|
|
70
|
-
`accepted_at: ${acceptedAt}`,
|
|
71
|
-
`scope_sha256: ${scopeSha256}`
|
|
72
|
-
].join('\n');
|
|
73
|
-
|
|
74
|
-
const content = `---\n${fm}\n---\n${signedBody}`;
|
|
75
|
-
|
|
76
|
-
const dir = path.dirname(outPath);
|
|
77
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
78
|
-
fs.writeFileSync(outPath, content, 'utf8');
|
|
79
|
-
|
|
80
|
-
return { path: outPath, sha256: scopeSha256, acceptedBy, acceptedAt };
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function main() {
|
|
84
|
-
const args = parseArgv(process.argv.slice(2));
|
|
85
|
-
|
|
86
|
-
if (!args.url) {
|
|
87
|
-
console.error('✖ --url é obrigatório (ex: --url=http://localhost:8080)');
|
|
88
|
-
process.exit(2);
|
|
89
|
-
}
|
|
90
|
-
if (!args.acceptedBy) {
|
|
91
|
-
console.error('✖ --accepted-by é obrigatório (ex: --accepted-by="Seu Nome")');
|
|
92
|
-
process.exit(2);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const result = generateScope(args);
|
|
96
|
-
console.log(`✓ scope.md gerado em ${result.path}`);
|
|
97
|
-
console.log(` SHA-256: ${result.sha256}`);
|
|
98
|
-
console.log(` aceite por: ${result.acceptedBy}`);
|
|
99
|
-
console.log(` aceite em: ${result.acceptedAt}`);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (require.main === module) {
|
|
103
|
-
main();
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
module.exports = { generateScope, buildBody, parseArgv };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
|
|
3
|
-
code: wize-sec-scope
|
|
4
|
-
description: "Use para criar ou re-assinar o scope.md de segurança. Guia o usuário com perguntas e gera o arquivo com hash SHA-256."
|
|
5
|
-
name: wize-sec-scope
|
|
6
|
-
overlay: security
|
|
7
|
-
module: security-overlay
|
|
8
|
-
owner: wize-sec-red-teamer # Natasha Romanoff
|
|
9
|
-
status: ready
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
# wize-sec-scope — Criação guiada de scope.md
|
|
13
|
-
|
|
14
|
-
Cria o arquivo `.wize/security/scope.md` a partir de perguntas interativas. Gera o frontmatter com `accepted_by`, `accepted_at`, e `scope_sha256` (SHA-256 do corpo). O arquivo gerado passa na validação do `loadScope()` sem intervenção manual.
|
|
15
|
-
|
|
16
|
-
## Uso
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
/wize-sec-scope
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Fluxo guiado
|
|
23
|
-
|
|
24
|
-
O agente faz uma pergunta por vez:
|
|
25
|
-
|
|
26
|
-
1. **URL base do alvo** — ex: `http://localhost:8080`
|
|
27
|
-
2. **Hosts adicionais no escopo** — um por linha, Enter para pular
|
|
28
|
-
3. **Paths no escopo** — ex: `/api/*`, Enter para todos (`/`)
|
|
29
|
-
4. **Nome para o aceite** — quem está autorizando o pentest
|
|
30
|
-
|
|
31
|
-
Ao final, gera `scope.md` com:
|
|
32
|
-
|
|
33
|
-
- Frontmatter: `accepted_by`, `accepted_at` (ISO-8601), `scope_sha256`
|
|
34
|
-
- Corpo: `## allowlist` com hosts, urls e paths
|
|
35
|
-
- `## dast_target` com a URL base
|
|
36
|
-
- `## notes` com o timestamp de criação
|
|
37
|
-
|
|
38
|
-
## Re-assinatura
|
|
39
|
-
|
|
40
|
-
Se o `scope.md` já existe e foi editado, use `--sign-scope` para recomputar o hash:
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
/wize-sec-pentest --sign-scope
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Script
|
|
47
|
-
|
|
48
|
-
`scripts/generate-scope.js` — gera o arquivo programaticamente (usado pelo agente ou chamado diretamente).
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
node scripts/generate-scope.js --url=http://localhost:8080 --hosts=localhost,127.0.0.1 --paths=/api,/admin --accepted-by="Seu Nome"
|
|
52
|
-
```
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
|
|
3
|
-
code: wize-qa-generate-e2e-tests
|
|
4
|
-
description: "Use quando o UX design e PRD estiverem validados e precisar gerar casos de teste E2E a partir das telas e ACs."
|
|
5
|
-
name: Generate E2E Tests
|
|
6
|
-
owner: wize-agent-test-architect # Hawkeye
|
|
7
|
-
status: ready
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Generate E2E Tests
|
|
11
|
-
|
|
12
|
-
**Goal.** Translate UX screens + PRD ACs into concrete E2E test cases. Hawkeye produces the cases (names, steps, selectors, expected outcome); the user (or Shuri) writes the actual test bodies in the chosen framework.
|
|
13
|
-
|
|
14
|
-
Hawkeye drives. Mantis confirms UX fidelity. Shuri confirms selectors match the design system.
|
|
15
|
-
|
|
16
|
-
## When to run
|
|
17
|
-
|
|
18
|
-
- After `wize-ux-design` and `wize-create-prd` are validated.
|
|
19
|
-
- Before a story enters `in-progress` if the ACs are E2E-heavy.
|
|
20
|
-
- When the team adopts a new E2E framework and needs a baseline.
|
|
21
|
-
|
|
22
|
-
## When NOT to run
|
|
23
|
-
|
|
24
|
-
- Before UX design is ready (no screens = no cases).
|
|
25
|
-
- For unit tests (covered by `wize-tea-design`).
|
|
26
|
-
- For visual / a11y (separate audit, out of scope here).
|
|
27
|
-
|
|
28
|
-
## Inputs
|
|
29
|
-
|
|
30
|
-
- `.wize/planning/ux/ux-design/{screen}.md` — page specs.
|
|
31
|
-
- `.wize/planning/prd.md` — ACs.
|
|
32
|
-
- `.wize/solutioning/design-system/` — component + testid names.
|
|
33
|
-
- The active profile (web-overlay → Playwright; app-overlay → Detox; core-only → propose and let user pick).
|
|
34
|
-
|
|
35
|
-
## Output
|
|
36
|
-
|
|
37
|
-
- `.wize/implementation/tea/e2e-cases/{screen}.md` — one file per screen with the test cases.
|
|
38
|
-
|
|
39
|
-
## Steps
|
|
40
|
-
|
|
41
|
-
### 1. Map (UX screen → ACs)
|
|
42
|
-
|
|
43
|
-
For each screen, list the ACs that touch it. Cross-reference the PRD. If a screen has no ACs, flag it (gap).
|
|
44
|
-
|
|
45
|
-
### 2. Cases (3-10 per screen)
|
|
46
|
-
|
|
47
|
-
For each screen, generate 3-10 cases. For each case:
|
|
48
|
-
- **Name:** verb-led, in 1 line.
|
|
49
|
-
- **Pre-conditions:** setup (logged in, on screen X, etc.).
|
|
50
|
-
- **Steps:** numbered, observable actions.
|
|
51
|
-
- **Selectors:** `data-testid` values from the design system. If none exist, propose new ones.
|
|
52
|
-
- **Expected outcome:** what the test asserts.
|
|
53
|
-
- **Priority:** P0 (must pass before release) / P1 (should pass) / P2 (nice to have).
|
|
54
|
-
|
|
55
|
-
### 3. Selectors
|
|
56
|
-
|
|
57
|
-
Derive selectors from `design-system/` tokens + story notes. If a story has a `data-testid` map, prefer that. New selectors go into a "proposed testids" section; Mantis signs off in the next design-system sync.
|
|
58
|
-
|
|
59
|
-
### 4. Triage
|
|
60
|
-
|
|
61
|
-
Mark each case P0/P1/P2. P0 is the minimum viable E2E coverage. P1 expands happy paths. P2 covers edge cases.
|
|
62
|
-
|
|
63
|
-
### 5. Hand off
|
|
64
|
-
|
|
65
|
-
Notify the next workflow:
|
|
66
|
-
- Shuri → implement the P0 cases first.
|
|
67
|
-
- Mantis → sign off on the new testids.
|
|
68
|
-
- The user → confirm the framework choice if it is ambiguous.
|
|
69
|
-
|
|
70
|
-
## Output template
|
|
71
|
-
|
|
72
|
-
```markdown
|
|
73
|
-
---
|
|
74
|
-
screen: sign-in
|
|
75
|
-
generated: 2026-06-16
|
|
76
|
-
linked_acs: [AC-01-1, AC-01-2]
|
|
77
|
-
framework: playwright
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
# E2E cases — sign-in
|
|
81
|
-
|
|
82
|
-
## Map
|
|
83
|
-
- AC-01-1: user enters valid email + password
|
|
84
|
-
- AC-01-2: user enters invalid email → error message
|
|
85
|
-
|
|
86
|
-
## Cases
|
|
87
|
-
|
|
88
|
-
### P0 — happy path
|
|
89
|
-
- **Name:** Sign in with valid credentials
|
|
90
|
-
- **Pre-conditions:** not signed in; on /signin
|
|
91
|
-
- **Steps:** enter email; enter password; click "Sign in"
|
|
92
|
-
- **Selectors:** data-testid="email-input", data-testid="password-input", data-testid="signin-cta"
|
|
93
|
-
- **Expected outcome:** redirect to /dashboard; token in localStorage
|
|
94
|
-
|
|
95
|
-
### P0 — invalid email
|
|
96
|
-
- **Name:** Sign in with invalid email
|
|
97
|
-
- **Pre-conditions:** not signed in; on /signin
|
|
98
|
-
- **Steps:** enter "not-an-email"; enter password; click "Sign in"
|
|
99
|
-
- **Selectors:** data-testid="email-input", data-testid="email-error"
|
|
100
|
-
- **Expected outcome:** error text appears within 200ms; no redirect
|
|
101
|
-
|
|
102
|
-
## Proposed testids
|
|
103
|
-
- (none — using existing design system)
|
|
104
|
-
|
|
105
|
-
## Triage summary
|
|
106
|
-
- P0: 2
|
|
107
|
-
- P1: 0
|
|
108
|
-
- P2: 0
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
## Anti-patterns Hawkeye rejects
|
|
112
|
-
|
|
113
|
-
- Generating 50 cases per screen. (Cap at 10; surface the rest as out-of-scope.)
|
|
114
|
-
- Skipping the priority. (P0 is the contract; the rest is optional.)
|
|
115
|
-
- Inventing selectors not present in the design system. (Propose them, but flag for Mantis.)
|
|
116
|
-
- Auto-writing Playwright code. (Hawkeye proposes cases; the human writes the bodies.)
|
|
117
|
-
- Skipping the screen-to-AC mapping. (Coverage gap = bug.)
|
|
118
|
-
|
|
119
|
-
## Hand-off
|
|
120
|
-
|
|
121
|
-
> "E2E cases generated for {N} screens. {N0} P0, {N1} P1, {N2} P2. Files at `.wize/implementation/tea/e2e-cases/`. Next: implement P0 (Shuri), sign off new testids (Mantis)."
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
// Brownfield baseline runner — detects AI harness CLIs available on PATH and,
|
|
2
|
-
// when authorized, executes `/wize-document-project` headlessly to populate
|
|
3
|
-
// .wize/knowledge/document-project/. Falls back to printed instructions when
|
|
4
|
-
// no harness is present or the user opts out.
|
|
5
|
-
//
|
|
6
|
-
// Harness priority is:
|
|
7
|
-
// 1. user's selected IDE targets (from .wize/config/project.toml), highest first
|
|
8
|
-
// 2. claude > codex > opencode > hermes (universal fallback)
|
|
9
|
-
//
|
|
10
|
-
// Set WIZE_SKIP_BASELINE=1 in the environment to disable any execution (the
|
|
11
|
-
// install still suggests the next step). Useful for CI and unattended setups.
|
|
12
|
-
|
|
13
|
-
'use strict';
|
|
14
|
-
|
|
15
|
-
const fs = require('node:fs');
|
|
16
|
-
const path = require('node:path');
|
|
17
|
-
const { spawnSync } = require('node:child_process');
|
|
18
|
-
|
|
19
|
-
// Harness registry — for each supported CLI we know:
|
|
20
|
-
// binary : the executable name to find on PATH
|
|
21
|
-
// ideCode : the matching `ide_targets` code in project.toml (so we can prioritize)
|
|
22
|
-
// buildCmd: returns the spawnSync args (binary + arg list) for a headless run
|
|
23
|
-
const HARNESSES = [
|
|
24
|
-
{
|
|
25
|
-
code: 'claude-code',
|
|
26
|
-
binary: 'claude',
|
|
27
|
-
buildCmd: (prompt) => ({ cmd: 'claude', args: ['-p', prompt] })
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
code: 'codex',
|
|
31
|
-
binary: 'codex',
|
|
32
|
-
buildCmd: (prompt) => ({ cmd: 'codex', args: ['exec', '--', prompt] })
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
code: 'opencode',
|
|
36
|
-
binary: 'opencode',
|
|
37
|
-
buildCmd: (prompt) => ({ cmd: 'opencode', args: ['run', prompt] })
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
code: 'hermes',
|
|
41
|
-
binary: 'hermes',
|
|
42
|
-
buildCmd: (prompt) => ({ cmd: 'hermes', args: ['-z', prompt] })
|
|
43
|
-
}
|
|
44
|
-
];
|
|
45
|
-
|
|
46
|
-
function whichSync(bin) {
|
|
47
|
-
// Manual PATH walk — more predictable than shelling out to `which`/`where`,
|
|
48
|
-
// honors PATH overrides set by callers (and our tests), and stays portable.
|
|
49
|
-
const PATH = process.env.PATH || '';
|
|
50
|
-
const sep = process.platform === 'win32' ? ';' : ':';
|
|
51
|
-
const exts = process.platform === 'win32'
|
|
52
|
-
? (process.env.PATHEXT || '.EXE;.CMD;.BAT').split(';')
|
|
53
|
-
: [''];
|
|
54
|
-
for (const dir of PATH.split(sep).filter(Boolean)) {
|
|
55
|
-
for (const ext of exts) {
|
|
56
|
-
const candidate = path.join(dir, bin + ext);
|
|
57
|
-
try {
|
|
58
|
-
const st = fs.statSync(candidate);
|
|
59
|
-
if (st.isFile() && (process.platform === 'win32' || (st.mode & 0o111))) {
|
|
60
|
-
return candidate;
|
|
61
|
-
}
|
|
62
|
-
} catch (_) { /* not here, keep looking */ }
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Returns an ordered list of harnesses present on PATH. When `preferIde`
|
|
69
|
-
// includes a harness's `code`, it floats to the top of the result.
|
|
70
|
-
function detectHarnessCli({ preferIde = [] } = {}) {
|
|
71
|
-
const found = [];
|
|
72
|
-
for (const h of HARNESSES) {
|
|
73
|
-
const p = whichSync(h.binary);
|
|
74
|
-
if (p) found.push({ ...h, path: p });
|
|
75
|
-
}
|
|
76
|
-
// Float preferred IDE targets to the top, keep relative order otherwise.
|
|
77
|
-
return found.sort((a, b) => {
|
|
78
|
-
const ai = preferIde.indexOf(a.code);
|
|
79
|
-
const bi = preferIde.indexOf(b.code);
|
|
80
|
-
if (ai === -1 && bi === -1) return 0;
|
|
81
|
-
if (ai === -1) return 1;
|
|
82
|
-
if (bi === -1) return -1;
|
|
83
|
-
return ai - bi;
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Run the harness headless with the document-project prompt. Returns
|
|
88
|
-
// { ok: boolean, exitCode, stdout, stderr }.
|
|
89
|
-
function runHeadlessBaseline({ harness, projectRoot, prompt, log = console.log }) {
|
|
90
|
-
if (process.env.WIZE_SKIP_BASELINE === '1') {
|
|
91
|
-
log('WIZE_SKIP_BASELINE=1 — not running the baseline; you can do it later in your IDE.');
|
|
92
|
-
return { ok: false, skipped: true };
|
|
93
|
-
}
|
|
94
|
-
const { cmd, args } = harness.buildCmd(prompt);
|
|
95
|
-
log(`Running ${cmd} ${args.map(a => /\s/.test(a) ? '"' + a + '"' : a).join(' ')}\n`);
|
|
96
|
-
const r = spawnSync(cmd, args, { cwd: projectRoot, stdio: 'inherit' });
|
|
97
|
-
return { ok: r.status === 0, exitCode: r.status, signal: r.signal };
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function manualInstructions(harness) {
|
|
101
|
-
if (!harness) {
|
|
102
|
-
return [
|
|
103
|
-
'',
|
|
104
|
-
'No AI harness CLI was detected on PATH (claude / codex / opencode / hermes).',
|
|
105
|
-
'Open your IDE in this repo and run:',
|
|
106
|
-
' /wize-document-project',
|
|
107
|
-
''
|
|
108
|
-
].join('\n');
|
|
109
|
-
}
|
|
110
|
-
const { cmd, args } = harness.buildCmd('/wize-document-project');
|
|
111
|
-
const shown = `${cmd} ${args.map(a => /\s/.test(a) ? '"' + a + '"' : a).join(' ')}`;
|
|
112
|
-
return [
|
|
113
|
-
'',
|
|
114
|
-
`Skipping the headless run. When you're ready, run from this folder:`,
|
|
115
|
-
` ${shown}`,
|
|
116
|
-
'',
|
|
117
|
-
`Or open your IDE and type: /wize-document-project`,
|
|
118
|
-
''
|
|
119
|
-
].join('\n');
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function defaultPrompt() {
|
|
123
|
-
return 'Activate the wize-document-project skill and execute it on this repository. Follow the steps in .claude/skills/wize-document-project/SKILL.md (or the equivalent path for your IDE). Output the baseline docs under .wize/knowledge/document-project/.';
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
module.exports = {
|
|
127
|
-
HARNESSES,
|
|
128
|
-
whichSync,
|
|
129
|
-
detectHarnessCli,
|
|
130
|
-
runHeadlessBaseline,
|
|
131
|
-
manualInstructions,
|
|
132
|
-
defaultPrompt
|
|
133
|
-
};
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
// `wize-dev-kit agent <subcommand>` — manage built-in and custom agents.
|
|
2
|
-
//
|
|
3
|
-
// list - show every agent the active install resolves (built-in + custom)
|
|
4
|
-
// create - scaffold a brand-new custom agent in .wize/custom/agents/{code}/
|
|
5
|
-
// edit <code> - override an existing built-in via .wize/custom/agents/{code}/customize.toml
|
|
6
|
-
//
|
|
7
|
-
// All write operations validate the result against schemas/agent.schema.json
|
|
8
|
-
// (lite parser — no dependency on Ajv yet) and do a smoke dry-run before
|
|
9
|
-
// persisting, matching the contract `wize-create-agent` describes.
|
|
10
|
-
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
const fs = require('node:fs');
|
|
14
|
-
const path = require('node:path');
|
|
15
|
-
const prompts = require('prompts');
|
|
16
|
-
const { collectAssets } = require('../render-shared.js');
|
|
17
|
-
|
|
18
|
-
const VALID_CODE = /^wize-(agent|orchestrator)(?:-[a-z0-9-]+)?$/;
|
|
19
|
-
const VALID_MODULES = ['orchestrator', 'method', 'tea', 'builder', 'core', 'web-overlay', 'app-overlay', 'custom'];
|
|
20
|
-
|
|
21
|
-
function ensureDir(p) { fs.mkdirSync(p, { recursive: true }); }
|
|
22
|
-
|
|
23
|
-
function listAgents(kitRoot, projectRoot) {
|
|
24
|
-
const builtIn = collectAssets(kitRoot, { profiles: ['core', 'web-overlay', 'app-overlay'] })
|
|
25
|
-
.filter(a => a.kind === 'agent')
|
|
26
|
-
.map(a => ({ code: a.code, name: a.name, title: a.title, source: 'built-in' }));
|
|
27
|
-
const customDir = path.join(projectRoot, '.wize/custom/agents');
|
|
28
|
-
const custom = [];
|
|
29
|
-
if (fs.existsSync(customDir)) {
|
|
30
|
-
for (const entry of fs.readdirSync(customDir, { withFileTypes: true })) {
|
|
31
|
-
if (!entry.isDirectory()) continue;
|
|
32
|
-
const yamlPath = path.join(customDir, entry.name, 'agent.yaml');
|
|
33
|
-
const customizePath = path.join(customDir, entry.name, 'customize.toml');
|
|
34
|
-
if (fs.existsSync(yamlPath)) {
|
|
35
|
-
const yaml = fs.readFileSync(yamlPath, 'utf-8');
|
|
36
|
-
const name = (yaml.match(/^name:\s*(.+)$/m) || [])[1] || entry.name;
|
|
37
|
-
const title = (yaml.match(/^title:\s*(.+)$/m) || [])[1] || '';
|
|
38
|
-
custom.push({ code: entry.name, name: name.trim(), title: title.trim(), source: 'custom' });
|
|
39
|
-
} else if (fs.existsSync(customizePath)) {
|
|
40
|
-
custom.push({ code: entry.name, name: '(override)', title: '', source: 'override' });
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return { builtIn, custom };
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function cmdAgentList({ kitRoot, projectRoot, log = console.log } = {}) {
|
|
48
|
-
const { builtIn, custom } = listAgents(kitRoot, projectRoot);
|
|
49
|
-
log('Built-in agents:');
|
|
50
|
-
for (const a of builtIn) log(` ${a.code.padEnd(36)} ${a.name}${a.title ? ' — ' + a.title : ''}`);
|
|
51
|
-
if (custom.length) {
|
|
52
|
-
log('\nCustom / override agents (from .wize/custom/agents/):');
|
|
53
|
-
for (const a of custom) log(` ${a.code.padEnd(36)} ${a.name}${a.title ? ' — ' + a.title : ''} [${a.source}]`);
|
|
54
|
-
} else {
|
|
55
|
-
log('\nCustom / override agents: (none yet — use `wize-dev-kit agent create`)');
|
|
56
|
-
}
|
|
57
|
-
return { builtIn, custom };
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function validateAgent(spec, kitRoot) {
|
|
61
|
-
const errs = [];
|
|
62
|
-
if (!spec.code) errs.push('code is required');
|
|
63
|
-
else if (!VALID_CODE.test(spec.code)) errs.push(`code "${spec.code}" must match wize-(agent|orchestrator)[-name]`);
|
|
64
|
-
if (!spec.name) errs.push('name is required');
|
|
65
|
-
if (!spec.title) errs.push('title is required');
|
|
66
|
-
if (!VALID_MODULES.includes(spec.module)) errs.push(`module must be one of: ${VALID_MODULES.join(', ')}`);
|
|
67
|
-
if (!spec.description || spec.description.length < 10) errs.push('description must be ≥ 10 characters');
|
|
68
|
-
// Collide check against built-ins when not overriding.
|
|
69
|
-
const builtinCodes = collectAssets(kitRoot, { profiles: ['core', 'web-overlay', 'app-overlay'] })
|
|
70
|
-
.filter(a => a.kind === 'agent').map(a => a.code);
|
|
71
|
-
if (builtinCodes.includes(spec.code) && !spec.allowOverride) {
|
|
72
|
-
errs.push(`code "${spec.code}" already exists as a built-in. Use \`wize-dev-kit agent edit ${spec.code}\` to override.`);
|
|
73
|
-
}
|
|
74
|
-
return errs;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function renderAgentYaml(spec) {
|
|
78
|
-
return [
|
|
79
|
-
`code: ${spec.code}`,
|
|
80
|
-
`name: ${spec.name}`,
|
|
81
|
-
`title: ${spec.title}`,
|
|
82
|
-
`icon: "${spec.icon || '🔧'}"`,
|
|
83
|
-
`team: ${spec.team || 'software-development'}`,
|
|
84
|
-
`module: ${spec.module}`,
|
|
85
|
-
'',
|
|
86
|
-
'description: |',
|
|
87
|
-
...spec.description.split('\n').map(l => ' ' + l),
|
|
88
|
-
''
|
|
89
|
-
].join('\n');
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function renderPersonaMd(spec) {
|
|
93
|
-
const body = (spec.persona || `I am **${spec.name}**. ${spec.description}`).trim();
|
|
94
|
-
return [
|
|
95
|
-
`# ${spec.name} — ${spec.title}`,
|
|
96
|
-
'',
|
|
97
|
-
body,
|
|
98
|
-
''
|
|
99
|
-
].join('\n');
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// Smoke dry-run: write to temp dir, re-read, assert frontmatter parses.
|
|
103
|
-
function dryRunPersist(spec) {
|
|
104
|
-
const tmp = path.join(require('node:os').tmpdir(), `wize-agent-${spec.code}-${Date.now()}`);
|
|
105
|
-
ensureDir(tmp);
|
|
106
|
-
try {
|
|
107
|
-
fs.writeFileSync(path.join(tmp, 'agent.yaml'), renderAgentYaml(spec), 'utf-8');
|
|
108
|
-
fs.writeFileSync(path.join(tmp, 'persona.md'), renderPersonaMd(spec), 'utf-8');
|
|
109
|
-
const reread = fs.readFileSync(path.join(tmp, 'agent.yaml'), 'utf-8');
|
|
110
|
-
if (!/^code:\s+/m.test(reread)) throw new Error('emitted agent.yaml has no "code:" line');
|
|
111
|
-
if (!/^name:\s+/m.test(reread)) throw new Error('emitted agent.yaml has no "name:" line');
|
|
112
|
-
return { ok: true };
|
|
113
|
-
} finally {
|
|
114
|
-
try { fs.rmSync(tmp, { recursive: true, force: true }); } catch (_) {}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
async function cmdAgentCreate({ kitRoot, projectRoot, opts = {} } = {}) {
|
|
119
|
-
const interactive = process.stdout.isTTY && process.stdin.isTTY && !opts.fromSpec;
|
|
120
|
-
let spec = opts.fromSpec || {};
|
|
121
|
-
|
|
122
|
-
if (interactive) {
|
|
123
|
-
const a = await prompts([
|
|
124
|
-
{ type: 'text', name: 'code', message: 'Agent code (e.g. wize-agent-runbooks)',
|
|
125
|
-
validate: v => VALID_CODE.test(v) || 'must match wize-(agent|orchestrator)[-name]' },
|
|
126
|
-
{ type: 'text', name: 'name', message: 'Display name (e.g. Riri Williams)', validate: v => !!v.trim() || 'required' },
|
|
127
|
-
{ type: 'text', name: 'title', message: 'Role / title (e.g. Reliability Engineer)', validate: v => !!v.trim() || 'required' },
|
|
128
|
-
{ type: 'text', name: 'icon', message: 'Icon emoji (optional)', initial: '🔧' },
|
|
129
|
-
{ type: 'text', name: 'team', message: 'Team', initial: 'software-development' },
|
|
130
|
-
{ type: 'select', name: 'module', message: 'Module', choices: VALID_MODULES.map(v => ({ title: v, value: v })), initial: VALID_MODULES.indexOf('custom') },
|
|
131
|
-
{ type: 'text', name: 'description', message: 'One-paragraph description (≥ 10 chars)', validate: v => v.length >= 10 || 'must be ≥ 10 characters' },
|
|
132
|
-
{ type: 'text', name: 'persona', message: 'Persona body (optional — defaults to description)', initial: '' }
|
|
133
|
-
], { onCancel: () => process.exit(130) });
|
|
134
|
-
spec = { ...spec, ...a };
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
const errs = validateAgent(spec, kitRoot);
|
|
138
|
-
if (errs.length) {
|
|
139
|
-
console.error('✖ Validation failed:');
|
|
140
|
-
for (const e of errs) console.error(' - ' + e);
|
|
141
|
-
process.exit(2);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
const dry = dryRunPersist(spec);
|
|
145
|
-
if (!dry.ok) {
|
|
146
|
-
console.error('✖ Dry-run failed; aborting.');
|
|
147
|
-
process.exit(3);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
const target = path.join(projectRoot, '.wize/custom/agents', spec.code);
|
|
151
|
-
ensureDir(target);
|
|
152
|
-
fs.writeFileSync(path.join(target, 'agent.yaml'), renderAgentYaml(spec), 'utf-8');
|
|
153
|
-
fs.writeFileSync(path.join(target, 'persona.md'), renderPersonaMd(spec), 'utf-8');
|
|
154
|
-
|
|
155
|
-
console.log(`✓ Created ${path.relative(projectRoot, target)}/`);
|
|
156
|
-
console.log(' Run `wize-dev-kit sync` to refresh IDE adapter outputs with the new agent.');
|
|
157
|
-
return { code: spec.code, path: target };
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
async function cmdAgentEdit({ kitRoot, projectRoot, code, opts = {} } = {}) {
|
|
161
|
-
if (!code) {
|
|
162
|
-
console.error('Usage: wize-dev-kit agent edit <code>');
|
|
163
|
-
process.exit(1);
|
|
164
|
-
}
|
|
165
|
-
const builtinCodes = collectAssets(kitRoot, { profiles: ['core', 'web-overlay', 'app-overlay'] })
|
|
166
|
-
.filter(a => a.kind === 'agent').map(a => a.code);
|
|
167
|
-
if (!builtinCodes.includes(code)) {
|
|
168
|
-
console.error(`✖ "${code}" is not a built-in agent. Use \`wize-dev-kit agent create\` for new agents.`);
|
|
169
|
-
process.exit(2);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
const target = path.join(projectRoot, '.wize/custom/agents', code);
|
|
173
|
-
ensureDir(target);
|
|
174
|
-
const customize = path.join(target, 'customize.toml');
|
|
175
|
-
if (fs.existsSync(customize) && !opts.force) {
|
|
176
|
-
console.log(`= ${path.relative(projectRoot, customize)} already exists. Edit it directly.`);
|
|
177
|
-
return { code, path: customize };
|
|
178
|
-
}
|
|
179
|
-
fs.writeFileSync(customize, `# Wize Dev Kit — overrides for the built-in agent "${code}".
|
|
180
|
-
# This file is loaded on top of the built-in agent's persona.md / agent.yaml
|
|
181
|
-
# at IDE adapter render time. Only the fields you set here are overridden.
|
|
182
|
-
|
|
183
|
-
[persona]
|
|
184
|
-
# motto = "your custom motto"
|
|
185
|
-
# voice = "succinct and irreverent"
|
|
186
|
-
# style = "show with code, not prose"
|
|
187
|
-
|
|
188
|
-
[behavior]
|
|
189
|
-
# defer_to = [] # e.g. ["wize-agent-pm"] to lower priority on certain decisions
|
|
190
|
-
# tools_deny = [] # tool codes the override removes from the agent
|
|
191
|
-
`, 'utf-8');
|
|
192
|
-
console.log(`✓ Created ${path.relative(projectRoot, customize)}`);
|
|
193
|
-
console.log(' Edit the file, then run `wize-dev-kit sync` to apply.');
|
|
194
|
-
return { code, path: customize };
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
module.exports = { cmdAgentList, cmdAgentCreate, cmdAgentEdit, listAgents, validateAgent };
|