wabachi 0.1.0 → 0.2.1

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 (34) hide show
  1. package/.codex-plugin/plugin.json +6 -0
  2. package/LICENSE +1 -1
  3. package/README.md +13 -22
  4. package/dist/architecture/canon/codec.js +26 -2
  5. package/dist/architecture/canon/codec.js.map +1 -1
  6. package/dist/architecture/canon/elements.d.ts +8 -1
  7. package/dist/architecture/canon/elements.js +56 -1
  8. package/dist/architecture/canon/elements.js.map +1 -1
  9. package/dist/architecture/canon/validate.d.ts +1 -1
  10. package/dist/architecture/canon/validate.js +37 -1
  11. package/dist/architecture/canon/validate.js.map +1 -1
  12. package/dist/architecture/canon/views.d.ts +5 -0
  13. package/dist/architecture/canon/views.js +4 -0
  14. package/dist/architecture/canon/views.js.map +1 -1
  15. package/dist/architecture/cli.js +5 -5
  16. package/dist/architecture/cli.js.map +1 -1
  17. package/dist/architecture/documentation/project.js +1 -1
  18. package/dist/architecture/documentation/project.js.map +1 -1
  19. package/dist/architecture/projection/structurizr-export.js +5 -4
  20. package/dist/architecture/projection/structurizr-export.js.map +1 -1
  21. package/dist/architecture/projection/structurizr.d.ts +1 -1
  22. package/dist/architecture/projection/structurizr.js +156 -54
  23. package/dist/architecture/projection/structurizr.js.map +1 -1
  24. package/dist/cli.js +53 -14
  25. package/dist/cli.js.map +1 -1
  26. package/dist/command-contract.d.ts +77 -0
  27. package/dist/command-contract.js +193 -0
  28. package/dist/command-contract.js.map +1 -0
  29. package/dist/skill.d.ts +47 -0
  30. package/dist/skill.js +160 -0
  31. package/dist/skill.js.map +1 -0
  32. package/docs/USAGE.md +110 -0
  33. package/package.json +21 -21
  34. package/skills/wabachi/SKILL.md +30 -0
@@ -0,0 +1,47 @@
1
+ import { type CommandId } from "./command-contract.js";
2
+ /** Deterministic intent-oriented playbooks for the supported Wabachi surface. */
3
+ export declare const SKILL_MODEL_VERSION: "1.0.0";
4
+ export declare const MAX_SKILL_OUTPUT_BYTES = 4096;
5
+ export interface SkillWorkflowStep {
6
+ readonly summary: string;
7
+ /** Stable reference into the versioned command contract. */
8
+ readonly commandId: CommandId;
9
+ /** Bare executable command derived from commandId. */
10
+ readonly command: string;
11
+ /** Practical example derived from commandId. */
12
+ readonly example: string;
13
+ /** Progressive-help pointer derived from commandId. */
14
+ readonly helpPointer: string;
15
+ }
16
+ export interface SkillScenario {
17
+ readonly id: string;
18
+ readonly title: string;
19
+ readonly whenToUse: string;
20
+ readonly workflow: readonly SkillWorkflowStep[];
21
+ readonly invariants: readonly string[];
22
+ readonly canonicalCommandId: CommandId;
23
+ readonly canonicalEntrypoint: string;
24
+ readonly helpPointer: string;
25
+ }
26
+ export declare const SKILL_SCENARIOS: readonly SkillScenario[];
27
+ export interface SkillIndexEntry {
28
+ readonly id: string;
29
+ readonly title: string;
30
+ readonly whenToUse: string;
31
+ }
32
+ export interface SkillIndexProjection {
33
+ readonly version: typeof SKILL_MODEL_VERSION;
34
+ readonly scenarios: readonly SkillIndexEntry[];
35
+ }
36
+ export interface SkillScenarioProjection extends SkillScenario {
37
+ readonly version: typeof SKILL_MODEL_VERSION;
38
+ }
39
+ export declare function findSkillScenario(id: string): SkillScenario | undefined;
40
+ export declare function projectSkillIndexToJson(): SkillIndexProjection;
41
+ export declare function projectSkillIndexToText(): string;
42
+ export declare function projectSkillScenarioToJson(scenario: SkillScenario): SkillScenarioProjection;
43
+ export declare function projectSkillScenarioToText(scenario: SkillScenario): string;
44
+ /** Keep text diagnostics and projections within the explicit UTF-8 budget. */
45
+ export declare function boundText(value: string): string;
46
+ /** Serialize a JSON projection without allowing the machine-readable path to exceed the same cap. */
47
+ export declare function serializeSkillJson(value: unknown): string;
package/dist/skill.js ADDED
@@ -0,0 +1,160 @@
1
+ import { commandExample, commandHelpPointer, commandInvocation, getCommand, } from "./command-contract.js";
2
+ /** Deterministic intent-oriented playbooks for the supported Wabachi surface. */
3
+ export const SKILL_MODEL_VERSION = "1.0.0";
4
+ export const MAX_SKILL_OUTPUT_BYTES = 4096;
5
+ function workflowStep(summary, commandId) {
6
+ getCommand(commandId);
7
+ return {
8
+ summary,
9
+ commandId,
10
+ command: commandInvocation(commandId),
11
+ example: commandExample(commandId),
12
+ helpPointer: commandHelpPointer(commandId),
13
+ };
14
+ }
15
+ function skillScenario(input) {
16
+ return {
17
+ id: input.id,
18
+ title: input.title,
19
+ whenToUse: input.whenToUse,
20
+ workflow: input.workflow.map(([summary, commandId]) => workflowStep(summary, commandId)),
21
+ invariants: input.invariants,
22
+ canonicalCommandId: input.canonicalCommandId,
23
+ canonicalEntrypoint: commandInvocation(input.canonicalCommandId),
24
+ helpPointer: commandHelpPointer(input.canonicalCommandId),
25
+ };
26
+ }
27
+ export const SKILL_SCENARIOS = [
28
+ skillScenario({
29
+ id: "analyze-repository",
30
+ title: "Analyze a repository",
31
+ whenToUse: "Use when you need deterministic provider output for a repository at a selected revision.",
32
+ workflow: [["Resolve the repository and execute the registered analysis providers.", "run.execute"]],
33
+ invariants: [
34
+ "Choose an explicit revision when reproducibility matters; the default resolution remains supported.",
35
+ "Retain the output directory when another workflow or reviewer needs the manifest and provider artifacts.",
36
+ "The provider set and analysis execution semantics are owned by the runtime, not this playbook.",
37
+ ],
38
+ canonicalCommandId: "run.execute",
39
+ }),
40
+ skillScenario({
41
+ id: "provider-matrix",
42
+ title: "Build a provider matrix",
43
+ whenToUse: "Use when you need auditable facts, correlations, matrix output, and a report for one revision.",
44
+ workflow: [["Run the provider matrix and retain its generated artifacts.", "matrix.execute"]],
45
+ invariants: [
46
+ "Use a 40-character commit SHA when matrix evidence must be tied to an immutable revision.",
47
+ "Provide an output directory so the report and its supporting artifacts remain inspectable.",
48
+ "Provider registration and matrix execution order remain runtime authority.",
49
+ ],
50
+ canonicalCommandId: "matrix.execute",
51
+ }),
52
+ skillScenario({
53
+ id: "validate-architecture-canon",
54
+ title: "Validate an Architecture Canon",
55
+ whenToUse: "Use before rendering an explicit Architecture Canon document or handing it to another workflow.",
56
+ workflow: [["Validate the explicit Canon file and inspect any bounded diagnostics.", "architecture.validate"]],
57
+ invariants: [
58
+ "The Canon file is explicit input; this workflow does not create or mutate one.",
59
+ "Validation must succeed before rendering or publishing derived documentation.",
60
+ "Machine-readable diagnostics are available through the command's JSON projection.",
61
+ ],
62
+ canonicalCommandId: "architecture.validate",
63
+ }),
64
+ skillScenario({
65
+ id: "render-architecture-canon",
66
+ title: "Render Architecture Canon documentation",
67
+ whenToUse: "Use when a valid Architecture Canon should become a retained static documentation site.",
68
+ workflow: [["Render the explicit Canon file into a retained output directory.", "architecture.render"]],
69
+ invariants: [
70
+ "Validate the same Canon file first when its validity has not already been established.",
71
+ "The Structurizr CLI is required for static export; use the command's executable override only when needed.",
72
+ "Rendering is a projection and does not add an Architecture Canon authoring command.",
73
+ ],
74
+ canonicalCommandId: "architecture.render",
75
+ }),
76
+ skillScenario({
77
+ id: "architecture-documentation",
78
+ title: "Follow the Architecture Documentation workflow",
79
+ whenToUse: "Use for the normal manual-authoring, validation, and rendering path for Architecture Canon documentation.",
80
+ workflow: [
81
+ [
82
+ "Author or revise the explicit Canon document using repository documentation guidance; no init command is implied.",
83
+ "architecture.help",
84
+ ],
85
+ ["Validate the authored Canon before producing derived documentation.", "architecture.validate"],
86
+ ["Render the validated Canon into a retained static site.", "architecture.render"],
87
+ ],
88
+ invariants: [
89
+ "Authoring remains a deliberate file-editing step; Wabachi does not invent an init or edit command.",
90
+ "Validation and rendering operate on an explicit Canon file and preserve existing execution semantics.",
91
+ "Keep the generated site and source Canon together when the result is intended for review or publication.",
92
+ ],
93
+ canonicalCommandId: "architecture.help",
94
+ }),
95
+ ];
96
+ export function findSkillScenario(id) {
97
+ return SKILL_SCENARIOS.find((scenario) => scenario.id === id);
98
+ }
99
+ export function projectSkillIndexToJson() {
100
+ return {
101
+ version: SKILL_MODEL_VERSION,
102
+ scenarios: SKILL_SCENARIOS.map(({ id, title, whenToUse }) => ({ id, title, whenToUse })),
103
+ };
104
+ }
105
+ export function projectSkillIndexToText() {
106
+ const lines = [`Wabachi skill scenarios (v${SKILL_MODEL_VERSION}):`, ""];
107
+ for (const scenario of SKILL_SCENARIOS) {
108
+ lines.push(` ${scenario.id} - ${scenario.title}`);
109
+ lines.push(` ${scenario.whenToUse}`);
110
+ }
111
+ lines.push("", "Run `wabachi skill <scenario>` for one bounded playbook.");
112
+ return boundText(lines.join("\n"));
113
+ }
114
+ export function projectSkillScenarioToJson(scenario) {
115
+ return {
116
+ version: SKILL_MODEL_VERSION,
117
+ ...scenario,
118
+ workflow: scenario.workflow.map((step) => workflowStep(step.summary, step.commandId)),
119
+ };
120
+ }
121
+ export function projectSkillScenarioToText(scenario) {
122
+ const projected = projectSkillScenarioToJson(scenario);
123
+ const lines = [`${projected.title} (${projected.id})`, "", `When to use: ${projected.whenToUse}`, "", "Workflow:"];
124
+ projected.workflow.forEach((step, index) => {
125
+ lines.push(` ${index + 1}. ${step.summary}`);
126
+ lines.push(` Command: ${step.command}`);
127
+ lines.push(` Example: ${step.example}`);
128
+ lines.push(` Help: ${step.helpPointer}`);
129
+ });
130
+ lines.push("", "Invariants:");
131
+ for (const invariant of projected.invariants)
132
+ lines.push(` - ${invariant}`);
133
+ lines.push("", `Canonical entrypoint: ${projected.canonicalEntrypoint}`, `Exact syntax: ${projected.helpPointer}`);
134
+ return boundText(lines.join("\n"));
135
+ }
136
+ /** Keep text diagnostics and projections within the explicit UTF-8 budget. */
137
+ export function boundText(value) {
138
+ if (Buffer.byteLength(value, "utf8") <= MAX_SKILL_OUTPUT_BYTES)
139
+ return value;
140
+ const suffix = "…";
141
+ const characters = Array.from(value);
142
+ while (characters.length > 0 &&
143
+ Buffer.byteLength(`${characters.join("")}${suffix}`, "utf8") > MAX_SKILL_OUTPUT_BYTES) {
144
+ characters.pop();
145
+ }
146
+ return `${characters.join("")}${suffix}`;
147
+ }
148
+ /** Serialize a JSON projection without allowing the machine-readable path to exceed the same cap. */
149
+ export function serializeSkillJson(value) {
150
+ const serialized = JSON.stringify(value);
151
+ if (Buffer.byteLength(serialized, "utf8") <= MAX_SKILL_OUTPUT_BYTES)
152
+ return serialized;
153
+ return JSON.stringify({
154
+ ok: false,
155
+ diagnostics: [
156
+ { code: "skill-output-too-large", message: `skill output exceeds ${MAX_SKILL_OUTPUT_BYTES} UTF-8 bytes` },
157
+ ],
158
+ });
159
+ }
160
+ //# sourceMappingURL=skill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill.js","sourceRoot":"","sources":["../src/skill.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,GAEX,MAAM,uBAAuB,CAAC;AAE/B,iFAAiF;AAEjF,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAgB,CAAC;AACpD,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAyB3C,SAAS,YAAY,CAAC,OAAe,EAAE,SAAoB;IACzD,UAAU,CAAC,SAAS,CAAC,CAAC;IACtB,OAAO;QACL,OAAO;QACP,SAAS;QACT,OAAO,EAAE,iBAAiB,CAAC,SAAS,CAAC;QACrC,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC;QAClC,WAAW,EAAE,kBAAkB,CAAC,SAAS,CAAC;KAC3C,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,KAOtB;IACC,OAAO;QACL,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACxF,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;QAC5C,mBAAmB,EAAE,iBAAiB,CAAC,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explains the normal workflows for people. The installed command
5
+ contract is authoritative: use `wabachi --help`, progressive command help, and
6
+ `wabachi skill` for the exact current syntax.
7
+
8
+ ## Install and discover
9
+
10
+ Wabachi requires Node.js 24 or newer.
11
+
12
+ ```bash
13
+ npm install --global wabachi
14
+ wabachi --version
15
+ wabachi --help
16
+ ```
17
+
18
+ For an ephemeral run, use `npx --yes wabachi --help`. Agents can begin with
19
+ `wabachi skill` and then request one bounded playbook with
20
+ `wabachi skill <scenario>`. Add `--json` to skill or help when consuming the
21
+ projection from a script.
22
+
23
+ ## Analyze a repository
24
+
25
+ `run` resolves a repository and executes the registered analysis providers. It
26
+ can use the default revision resolution or an explicit revision, and writes a
27
+ manifest plus provider output under a temporary directory unless `--out` is
28
+ provided.
29
+
30
+ ```bash
31
+ wabachi run .
32
+ wabachi run . --revision HEAD --out ./artifacts/run
33
+ ```
34
+
35
+ Use a commit SHA or another stable ref when the result will be compared or
36
+ reviewed. The command prints the manifest path. Keep the directory named by
37
+ `--out` if downstream work needs the facts or provider outputs.
38
+
39
+ ## Build a provider matrix
40
+
41
+ `matrix` runs the matrix workflow for one revision and requires retained output
42
+ artifacts. A full 40-character commit SHA is the safest input for reproducible
43
+ evidence.
44
+
45
+ ```bash
46
+ wabachi matrix . --revision 0123456789abcdef0123456789abcdef01234567 --out ./artifacts/matrix
47
+ ```
48
+
49
+ The command prints the report path. The output directory also contains the
50
+ supporting facts and correlation artifacts used to produce the report. For a
51
+ configured provider workflow, pass a JSON configuration file with the source,
52
+ revision, provider IDs, and addition order:
53
+
54
+ ```bash
55
+ wabachi matrix --config ./matrix-workflow.json
56
+ ```
57
+
58
+ The configured provider set must match the providers registered by the
59
+ installed Wabachi version.
60
+
61
+ ## Architecture Canon
62
+
63
+ Architecture Canon authoring is an explicit file-editing step. Wabachi does
64
+ not provide an init or edit command. Create or revise the Canon document using
65
+ the repository's documented schema, then validate it before rendering.
66
+
67
+ ```bash
68
+ wabachi architecture validate ./architecture.json
69
+ wabachi architecture validate ./architecture.json --json
70
+ ```
71
+
72
+ Rendering requires the Structurizr CLI. Wabachi writes the generated site and
73
+ static diagrams beneath the directory passed to `--out`:
74
+
75
+ ```bash
76
+ wabachi architecture render ./architecture.json --out ./artifacts/site
77
+ ```
78
+
79
+ If `structurizr` is not on `PATH`, provide one executable identity without
80
+ changing the workflow:
81
+
82
+ ```bash
83
+ wabachi architecture render ./architecture.json \
84
+ --out ./artifacts/site \
85
+ --structurizr-command /opt/structurizr/structurizr.sh
86
+ ```
87
+
88
+ The normal documentation path is: author the explicit Canon, validate that
89
+ same file, then render it into a retained site. The matching live playbook is
90
+ `wabachi skill architecture-documentation`.
91
+
92
+ ## Common failures and recovery
93
+
94
+ - If a repository cannot be resolved, confirm the path or remote and retry
95
+ `run` with an explicit revision. Preserve the printed diagnostic when the
96
+ failure needs investigation.
97
+ - If `matrix` rejects a revision, use a full commit SHA and provide `--out`.
98
+ If a configuration is rejected, compare its provider IDs and addition order
99
+ with the installed provider set.
100
+ - If Canon validation fails, fix the reported document issue and validate the
101
+ same file again before rendering. `--json` is useful for automation.
102
+ - If rendering fails before export, validate the Canon and check that the
103
+ Structurizr executable can run. Use `--structurizr-command` for a deliberate
104
+ executable override and inspect the retained output directory.
105
+ - If syntax is uncertain, stop relying on a copied example and resolve the
106
+ current contract with `wabachi architecture --help` or the relevant leaf
107
+ help. Unsupported commands fail closed.
108
+
109
+ Generated outputs are ordinary retained files; Wabachi does not publish them
110
+ or activate an agent plugin as a side effect of npm installation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wabachi",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "Repository analysis and Architecture Canon tooling for deterministic codebase understanding.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -9,23 +9,11 @@
9
9
  "files": [
10
10
  "dist",
11
11
  "README.md",
12
- "LICENSE"
12
+ "LICENSE",
13
+ "docs/USAGE.md",
14
+ "skills",
15
+ ".codex-plugin"
13
16
  ],
14
- "scripts": {
15
- "build": "tsc -p tsconfig.build.json && node scripts/chmod-bin.mjs",
16
- "start": "node dist/index.js",
17
- "test": "node --test --import tsx src/**/*.test.ts scripts/**/*.test.mjs",
18
- "typecheck": "tsc --noEmit",
19
- "lint": "eslint 'src/**/*.ts' 'scripts/**/*.mjs' 'eslint.config.mjs'",
20
- "format": "prettier --write .",
21
- "format:check": "prettier --check .",
22
- "smoke-test": "node scripts/smoke-test.mjs",
23
- "test:package": "pnpm run build && node scripts/run-package-suite.mjs",
24
- "governance:actions": "node scripts/validate-action-pins.mjs",
25
- "verify": "pnpm run format:check && pnpm run lint && pnpm run typecheck && pnpm test && pnpm run governance:actions && pnpm run test:package",
26
- "prepack": "pnpm run build",
27
- "prepublishOnly": "pnpm run typecheck && pnpm test"
28
- },
29
17
  "dependencies": {
30
18
  "@sourcegraph/scip-typescript": "0.4.0",
31
19
  "typescript": "^6.0.3"
@@ -39,9 +27,8 @@
39
27
  "typescript-eslint": "8.67.0"
40
28
  },
41
29
  "engines": {
42
- "node": ">=22.13"
30
+ "node": ">=24"
43
31
  },
44
- "packageManager": "pnpm@11.18.0",
45
32
  "publishConfig": {
46
33
  "access": "public",
47
34
  "registry": "https://registry.npmjs.org/",
@@ -68,5 +55,18 @@
68
55
  "ai-agents"
69
56
  ],
70
57
  "main": "dist/index.js",
71
- "types": "./dist/index.d.ts"
72
- }
58
+ "types": "./dist/index.d.ts",
59
+ "scripts": {
60
+ "build": "tsc -p tsconfig.build.json && node scripts/chmod-bin.mjs",
61
+ "start": "node dist/index.js",
62
+ "test": "node --test --import tsx src/**/*.test.ts scripts/**/*.test.mjs",
63
+ "typecheck": "tsc --noEmit",
64
+ "lint": "eslint 'src/**/*.ts' 'scripts/**/*.mjs' 'eslint.config.mjs'",
65
+ "format": "prettier --write .",
66
+ "format:check": "prettier --check .",
67
+ "smoke-test": "node scripts/smoke-test.mjs",
68
+ "test:package": "pnpm run build && node scripts/run-package-suite.mjs",
69
+ "governance:actions": "node scripts/validate-action-pins.mjs",
70
+ "verify": "pnpm run format:check && pnpm run lint && pnpm run typecheck && pnpm test && pnpm run governance:actions && pnpm run test:package"
71
+ }
72
+ }
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: wabachi
3
+ description: |
4
+ Use Wabachi for deterministic repository analysis, provider matrices, and
5
+ Architecture Canon validation or rendering. Resolve current workflows and
6
+ exact syntax through the live CLI.
7
+ ---
8
+
9
+ # Wabachi
10
+
11
+ This bundled Skill is a routing entrypoint. The installed CLI is the authority
12
+ for command syntax and operational playbooks; this file intentionally does not
13
+ duplicate flags or workflow details.
14
+
15
+ Start with:
16
+
17
+ ```bash
18
+ wabachi skill
19
+ wabachi --help
20
+ ```
21
+
22
+ Then choose a bounded intent with `wabachi skill <scenario>`. Resolve exact
23
+ syntax for each command through its progressive help pointer, for example:
24
+
25
+ ```bash
26
+ wabachi architecture --help
27
+ wabachi architecture validate --help
28
+ ```
29
+
30
+ Use `--json` on `skill` or help when a machine-readable projection is needed.