@wazir-dev/cli 1.0.0 → 1.2.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/CHANGELOG.md +100 -2
- package/README.md +6 -6
- package/docs/concepts/architecture.md +1 -1
- package/docs/concepts/roles-and-workflows.md +2 -0
- package/docs/concepts/why-wazir.md +59 -0
- package/docs/decisions/2026-03-19-deferred-items.md +564 -0
- package/docs/decisions/2026-03-19-enhancement-decisions.md +300 -0
- package/docs/plans/2026-03-15-cli-pipeline-integration-plan.md +1 -1
- package/docs/readmes/INDEX.md +21 -5
- package/docs/readmes/features/expertise/README.md +2 -2
- package/docs/readmes/features/exports/README.md +2 -2
- package/docs/readmes/features/schemas/README.md +3 -0
- package/docs/readmes/features/skills/README.md +17 -0
- package/docs/readmes/features/skills/clarifier.md +5 -0
- package/docs/readmes/features/skills/claude-cli.md +5 -0
- package/docs/readmes/features/skills/codex-cli.md +5 -0
- package/docs/readmes/features/skills/dispatching-parallel-agents.md +5 -0
- package/docs/readmes/features/skills/executing-plans.md +5 -0
- package/docs/readmes/features/skills/executor.md +5 -0
- package/docs/readmes/features/skills/finishing-a-development-branch.md +5 -0
- package/docs/readmes/features/skills/gemini-cli.md +5 -0
- package/docs/readmes/features/skills/humanize.md +5 -0
- package/docs/readmes/features/skills/init-pipeline.md +5 -0
- package/docs/readmes/features/skills/receiving-code-review.md +5 -0
- package/docs/readmes/features/skills/requesting-code-review.md +5 -0
- package/docs/readmes/features/skills/reviewer.md +5 -0
- package/docs/readmes/features/skills/subagent-driven-development.md +5 -0
- package/docs/readmes/features/skills/using-git-worktrees.md +5 -0
- package/docs/readmes/features/skills/wazir.md +5 -0
- package/docs/readmes/features/skills/writing-skills.md +5 -0
- package/docs/readmes/features/workflows/prepare-next.md +1 -1
- package/docs/reference/configuration-reference.md +47 -6
- package/docs/reference/launch-checklist.md +4 -4
- package/docs/reference/review-loop-pattern.md +538 -0
- package/docs/reference/roles-reference.md +1 -0
- package/docs/reference/skill-tiers.md +147 -0
- package/docs/reference/tooling-cli.md +5 -1
- package/docs/truth-claims.yaml +18 -0
- package/expertise/antipatterns/process/ai-coding-antipatterns.md +97 -1
- package/exports/hosts/claude/.claude/agents/clarifier.md +3 -0
- package/exports/hosts/claude/.claude/agents/designer.md +3 -0
- package/exports/hosts/claude/.claude/agents/executor.md +2 -0
- package/exports/hosts/claude/.claude/agents/planner.md +3 -0
- package/exports/hosts/claude/.claude/agents/researcher.md +2 -0
- package/exports/hosts/claude/.claude/agents/reviewer.md +5 -1
- package/exports/hosts/claude/.claude/agents/specifier.md +3 -0
- package/exports/hosts/claude/.claude/commands/clarify.md +4 -0
- package/exports/hosts/claude/.claude/commands/design-review.md +4 -0
- package/exports/hosts/claude/.claude/commands/design.md +4 -0
- package/exports/hosts/claude/.claude/commands/discover.md +4 -0
- package/exports/hosts/claude/.claude/commands/execute.md +4 -0
- package/exports/hosts/claude/.claude/commands/plan-review.md +4 -0
- package/exports/hosts/claude/.claude/commands/plan.md +4 -0
- package/exports/hosts/claude/.claude/commands/spec-challenge.md +4 -0
- package/exports/hosts/claude/.claude/commands/specify.md +4 -0
- package/exports/hosts/claude/.claude/commands/verify.md +4 -0
- package/exports/hosts/claude/.claude/settings.json +9 -0
- package/exports/hosts/claude/CLAUDE.md +1 -1
- package/exports/hosts/claude/export.manifest.json +22 -20
- package/exports/hosts/claude/host-package.json +3 -1
- package/exports/hosts/codex/AGENTS.md +1 -1
- package/exports/hosts/codex/export.manifest.json +22 -20
- package/exports/hosts/codex/host-package.json +3 -1
- package/exports/hosts/cursor/.cursor/hooks.json +4 -0
- package/exports/hosts/cursor/.cursor/rules/wazir-core.mdc +1 -1
- package/exports/hosts/cursor/export.manifest.json +22 -20
- package/exports/hosts/cursor/host-package.json +3 -1
- package/exports/hosts/gemini/GEMINI.md +1 -1
- package/exports/hosts/gemini/export.manifest.json +22 -20
- package/exports/hosts/gemini/host-package.json +3 -1
- package/hooks/context-mode-router +191 -0
- package/hooks/definitions/context_mode_router.yaml +19 -0
- package/hooks/definitions/loop_cap_guard.yaml +1 -1
- package/hooks/hooks.json +43 -0
- package/hooks/protected-path-write-guard +8 -0
- package/hooks/routing-matrix.json +45 -0
- package/hooks/session-start +62 -1
- package/llms-full.txt +905 -132
- package/package.json +3 -3
- package/roles/clarifier.md +3 -0
- package/roles/designer.md +3 -0
- package/roles/executor.md +2 -0
- package/roles/planner.md +3 -0
- package/roles/researcher.md +2 -0
- package/roles/reviewer.md +5 -1
- package/roles/specifier.md +3 -0
- package/schemas/hook.schema.json +2 -1
- package/schemas/phase-report.schema.json +80 -0
- package/schemas/usage.schema.json +25 -1
- package/schemas/wazir-manifest.schema.json +19 -0
- package/skills/brainstorming/SKILL.md +20 -56
- package/skills/clarifier/SKILL.md +243 -0
- package/skills/claude-cli/SKILL.md +320 -0
- package/skills/codex-cli/SKILL.md +260 -0
- package/skills/debugging/SKILL.md +24 -1
- package/skills/design/SKILL.md +13 -0
- package/skills/dispatching-parallel-agents/SKILL.md +13 -0
- package/skills/executing-plans/SKILL.md +28 -2
- package/skills/executor/SKILL.md +129 -0
- package/skills/finishing-a-development-branch/SKILL.md +13 -0
- package/skills/gemini-cli/SKILL.md +260 -0
- package/skills/humanize/SKILL.md +13 -0
- package/skills/init-pipeline/SKILL.md +76 -78
- package/skills/prepare-next/SKILL.md +81 -10
- package/skills/receiving-code-review/SKILL.md +21 -0
- package/skills/requesting-code-review/SKILL.md +38 -5
- package/skills/reviewer/SKILL.md +423 -0
- package/skills/run-audit/SKILL.md +13 -0
- package/skills/scan-project/SKILL.md +13 -0
- package/skills/self-audit/SKILL.md +197 -16
- package/skills/subagent-driven-development/SKILL.md +38 -2
- package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +2 -0
- package/skills/subagent-driven-development/implementer-prompt.md +8 -0
- package/skills/subagent-driven-development/spec-reviewer-prompt.md +7 -0
- package/skills/tdd/SKILL.md +21 -0
- package/skills/using-git-worktrees/SKILL.md +13 -0
- package/skills/using-skills/SKILL.md +13 -0
- package/skills/verification/SKILL.md +13 -0
- package/skills/wazir/SKILL.md +286 -262
- package/skills/writing-plans/SKILL.md +44 -4
- package/skills/writing-skills/SKILL.md +13 -0
- package/templates/artifacts/implementation-plan.md +3 -0
- package/templates/artifacts/tasks-template.md +133 -0
- package/templates/examples/phase-report.example.json +48 -0
- package/templates/examples/wazir-manifest.example.yaml +1 -1
- package/tooling/src/adapters/composition-engine.js +256 -0
- package/tooling/src/adapters/model-router.js +84 -0
- package/tooling/src/capture/command.js +111 -2
- package/tooling/src/capture/run-config.js +23 -0
- package/tooling/src/capture/store.js +24 -0
- package/tooling/src/capture/usage.js +106 -0
- package/tooling/src/checks/ac-matrix.js +256 -0
- package/tooling/src/checks/brand-truth.js +3 -6
- package/tooling/src/checks/command-registry.js +13 -0
- package/tooling/src/checks/docs-truth.js +1 -1
- package/tooling/src/checks/runtime-surface.js +3 -7
- package/tooling/src/checks/skills.js +111 -0
- package/tooling/src/cli.js +17 -3
- package/tooling/src/commands/stats.js +161 -0
- package/tooling/src/commands/validate.js +5 -1
- package/tooling/src/export/compiler.js +33 -37
- package/tooling/src/gating/agent.js +145 -0
- package/tooling/src/guards/phase-prerequisite-guard.js +127 -0
- package/tooling/src/hooks/routing-logic.js +69 -0
- package/tooling/src/init/auto-detect.js +260 -0
- package/tooling/src/init/command.js +161 -0
- package/tooling/src/input/scanner.js +46 -0
- package/tooling/src/reports/command.js +103 -0
- package/tooling/src/reports/phase-report.js +323 -0
- package/tooling/src/state/command.js +160 -0
- package/tooling/src/state/db.js +287 -0
- package/tooling/src/status/command.js +53 -1
- package/wazir.manifest.yaml +26 -17
- package/workflows/clarify.md +4 -0
- package/workflows/design-review.md +4 -0
- package/workflows/design.md +4 -0
- package/workflows/discover.md +4 -0
- package/workflows/execute.md +4 -0
- package/workflows/plan-review.md +4 -0
- package/workflows/plan.md +4 -0
- package/workflows/spec-challenge.md +4 -0
- package/workflows/specify.md +4 -0
- package/workflows/verify.md +4 -0
package/hooks/hooks.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hooks": {
|
|
3
|
+
"PreToolUse": [
|
|
4
|
+
{
|
|
5
|
+
"matcher": "Write|Edit",
|
|
6
|
+
"hooks": [
|
|
7
|
+
{
|
|
8
|
+
"type": "command",
|
|
9
|
+
"command": "./hooks/protected-path-write-guard"
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"matcher": "Bash",
|
|
15
|
+
"hooks": [
|
|
16
|
+
{
|
|
17
|
+
"type": "command",
|
|
18
|
+
"command": "./hooks/context-mode-router"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"SessionStart": [
|
|
24
|
+
{
|
|
25
|
+
"hooks": [
|
|
26
|
+
{
|
|
27
|
+
"type": "command",
|
|
28
|
+
"command": "./hooks/loop-cap-guard"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"matcher": "startup|resume|clear|compact",
|
|
34
|
+
"hooks": [
|
|
35
|
+
{
|
|
36
|
+
"type": "command",
|
|
37
|
+
"command": "./hooks/session-start"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -7,6 +7,14 @@ import { evaluateProtectedPathWriteGuard } from '../tooling/src/guards/protected
|
|
|
7
7
|
try {
|
|
8
8
|
const input = readFileSync(0, 'utf8');
|
|
9
9
|
const payload = input.trim() ? JSON.parse(input) : {};
|
|
10
|
+
|
|
11
|
+
// Map Claude Code payload format to guard format (target_path)
|
|
12
|
+
// Claude may send file_path at top level or nested under tool_input
|
|
13
|
+
if (!payload.target_path) {
|
|
14
|
+
payload.target_path = payload.file_path
|
|
15
|
+
?? payload.tool_input?.file_path;
|
|
16
|
+
}
|
|
17
|
+
|
|
10
18
|
const decision = evaluateProtectedPathWriteGuard(payload);
|
|
11
19
|
|
|
12
20
|
process.stdout.write(`${JSON.stringify({ guard_decision: decision })}\n`);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"large": [
|
|
3
|
+
"npm test",
|
|
4
|
+
"vitest",
|
|
5
|
+
"jest",
|
|
6
|
+
"pytest",
|
|
7
|
+
"npm run build",
|
|
8
|
+
"tsc --noEmit",
|
|
9
|
+
"npm ls",
|
|
10
|
+
"pip list",
|
|
11
|
+
"eslint .",
|
|
12
|
+
"prettier --check .",
|
|
13
|
+
"tail -f"
|
|
14
|
+
],
|
|
15
|
+
"small": [
|
|
16
|
+
"git status",
|
|
17
|
+
"git log",
|
|
18
|
+
"git branch",
|
|
19
|
+
"git rev-parse",
|
|
20
|
+
"ls",
|
|
21
|
+
"pwd",
|
|
22
|
+
"mkdir",
|
|
23
|
+
"cp",
|
|
24
|
+
"mv",
|
|
25
|
+
"rm",
|
|
26
|
+
"wazir doctor",
|
|
27
|
+
"wazir index",
|
|
28
|
+
"wazir capture",
|
|
29
|
+
"wazir validate",
|
|
30
|
+
"which",
|
|
31
|
+
"echo"
|
|
32
|
+
],
|
|
33
|
+
"ambiguous_heuristic": {
|
|
34
|
+
"pipe_detected": true,
|
|
35
|
+
"redirect_detected": true,
|
|
36
|
+
"verbose_binaries": [
|
|
37
|
+
"find",
|
|
38
|
+
"rg",
|
|
39
|
+
"grep",
|
|
40
|
+
"awk",
|
|
41
|
+
"sed",
|
|
42
|
+
"curl"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
}
|
package/hooks/session-start
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
3
|
+
import { execFileSync } from 'node:child_process';
|
|
3
4
|
import { dirname, join } from 'node:path';
|
|
4
5
|
import { fileURLToPath } from 'node:url';
|
|
5
6
|
|
|
@@ -26,6 +27,66 @@ if (existsSync(skillFile)) {
|
|
|
26
27
|
);
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
// Index freshness check (AC-D2.1 through AC-D2.3)
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
|
|
34
|
+
const FRESHNESS_THRESHOLD_MS = 3600 * 1000; // 1 hour
|
|
35
|
+
|
|
36
|
+
function refreshIndex() {
|
|
37
|
+
try {
|
|
38
|
+
const wazirPath = execFileSync('which', ['wazir'], { encoding: 'utf8', timeout: 5000 }).trim();
|
|
39
|
+
if (!wazirPath) return;
|
|
40
|
+
|
|
41
|
+
// Check index freshness via stats
|
|
42
|
+
let needsRefresh = true;
|
|
43
|
+
try {
|
|
44
|
+
const statsOut = execFileSync(wazirPath, ['index', 'stats', '--json'], {
|
|
45
|
+
encoding: 'utf8',
|
|
46
|
+
timeout: 10000,
|
|
47
|
+
cwd: projectRoot,
|
|
48
|
+
});
|
|
49
|
+
const stats = JSON.parse(statsOut);
|
|
50
|
+
if (stats.database_path) {
|
|
51
|
+
const mtime = statSync(stats.database_path).mtimeMs;
|
|
52
|
+
const age = Date.now() - mtime;
|
|
53
|
+
if (age < FRESHNESS_THRESHOLD_MS) {
|
|
54
|
+
needsRefresh = false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
} catch {
|
|
58
|
+
// No index or stats failed — needs build
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (!needsRefresh) return;
|
|
62
|
+
|
|
63
|
+
// Run refresh (or build if no index)
|
|
64
|
+
try {
|
|
65
|
+
execFileSync(wazirPath, ['index', 'refresh'], {
|
|
66
|
+
encoding: 'utf8',
|
|
67
|
+
timeout: 30000,
|
|
68
|
+
cwd: projectRoot,
|
|
69
|
+
});
|
|
70
|
+
process.stderr.write('[wazir:session-start] Index refreshed.\n');
|
|
71
|
+
} catch {
|
|
72
|
+
try {
|
|
73
|
+
execFileSync(wazirPath, ['index', 'build'], {
|
|
74
|
+
encoding: 'utf8',
|
|
75
|
+
timeout: 30000,
|
|
76
|
+
cwd: projectRoot,
|
|
77
|
+
});
|
|
78
|
+
process.stderr.write('[wazir:session-start] Index built.\n');
|
|
79
|
+
} catch (err) {
|
|
80
|
+
process.stderr.write(`[wazir:session-start] WARN: index refresh/build failed: ${err.message}\n`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
} catch {
|
|
84
|
+
process.stderr.write('[wazir:session-start] WARN: wazir CLI not found, skipping index refresh.\n');
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
refreshIndex();
|
|
89
|
+
|
|
29
90
|
process.stdout.write(
|
|
30
91
|
`<cli-bootstrap-guidance>\n` +
|
|
31
92
|
`## CLI Bootstrap\n\n` +
|