soturail 0.2.2 → 0.3.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 (76) hide show
  1. package/README.md +55 -10
  2. package/dist/cli.js +11 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/bench.d.ts +1 -1
  5. package/dist/commands/bench.js +126 -2
  6. package/dist/commands/bench.js.map +1 -1
  7. package/dist/commands/context.d.ts +2 -0
  8. package/dist/commands/context.js +27 -0
  9. package/dist/commands/context.js.map +1 -0
  10. package/dist/commands/hooks.d.ts +3 -0
  11. package/dist/commands/hooks.js +32 -8
  12. package/dist/commands/hooks.js.map +1 -1
  13. package/dist/commands/mcp.d.ts +2 -0
  14. package/dist/commands/mcp.js +21 -0
  15. package/dist/commands/mcp.js.map +1 -0
  16. package/dist/commands/memory.d.ts +1 -0
  17. package/dist/commands/memory.js +2 -1
  18. package/dist/commands/memory.js.map +1 -1
  19. package/dist/commands/release.d.ts +3 -0
  20. package/dist/commands/release.js +227 -0
  21. package/dist/commands/release.js.map +1 -0
  22. package/dist/commands/skills.d.ts +2 -0
  23. package/dist/commands/skills.js +43 -0
  24. package/dist/commands/skills.js.map +1 -0
  25. package/dist/core/config.d.ts +5 -0
  26. package/dist/core/config.js +12 -2
  27. package/dist/core/config.js.map +1 -1
  28. package/dist/core/context-pack.d.ts +13 -0
  29. package/dist/core/context-pack.js +102 -0
  30. package/dist/core/context-pack.js.map +1 -0
  31. package/dist/core/mcp-resources.d.ts +13 -0
  32. package/dist/core/mcp-resources.js +46 -0
  33. package/dist/core/mcp-resources.js.map +1 -0
  34. package/dist/core/mcp-server.d.ts +14 -0
  35. package/dist/core/mcp-server.js +81 -0
  36. package/dist/core/mcp-server.js.map +1 -0
  37. package/dist/core/mcp-tools.d.ts +7 -0
  38. package/dist/core/mcp-tools.js +73 -0
  39. package/dist/core/mcp-tools.js.map +1 -0
  40. package/dist/core/release-preflight.d.ts +22 -0
  41. package/dist/core/release-preflight.js +201 -0
  42. package/dist/core/release-preflight.js.map +1 -0
  43. package/dist/core/skill-exporter.d.ts +3 -0
  44. package/dist/core/skill-exporter.js +72 -0
  45. package/dist/core/skill-exporter.js.map +1 -0
  46. package/dist/core/skill-schema.d.ts +55 -0
  47. package/dist/core/skill-schema.js +84 -0
  48. package/dist/core/skill-schema.js.map +1 -0
  49. package/dist/core/skill-store.d.ts +4 -0
  50. package/dist/core/skill-store.js +92 -0
  51. package/dist/core/skill-store.js.map +1 -0
  52. package/dist/core/skill-validator.d.ts +12 -0
  53. package/dist/core/skill-validator.js +94 -0
  54. package/dist/core/skill-validator.js.map +1 -0
  55. package/dist/core/version.d.ts +1 -0
  56. package/dist/core/version.js +3 -0
  57. package/dist/core/version.js.map +1 -0
  58. package/docs/benchmarking.md +6 -1
  59. package/docs/comparisons.md +35 -0
  60. package/docs/context-packs.md +29 -0
  61. package/docs/examples/skills/README.md +11 -0
  62. package/docs/hooks/claude.md +6 -4
  63. package/docs/hooks/codex.md +4 -3
  64. package/docs/hooks/cursor.md +4 -3
  65. package/docs/hooks/gemini.md +4 -3
  66. package/docs/hooks/mcp.md +10 -0
  67. package/docs/hooks.md +12 -16
  68. package/docs/mcp.md +18 -0
  69. package/docs/release-checklist.md +44 -1
  70. package/docs/release-workflow.md +41 -18
  71. package/docs/security-model.md +6 -0
  72. package/docs/skill-rail.md +14 -20
  73. package/docs/usage.md +15 -0
  74. package/docs/windows.md +22 -1
  75. package/docs/workflow-rail.md +1 -1
  76. package/package.json +8 -6
package/docs/hooks.md CHANGED
@@ -1,26 +1,22 @@
1
1
  # Agent Hooks
2
2
 
3
- SotuRail hook support is cautious. Claude gets a conservative hook template first; Codex, Gemini and Cursor remain prompt-only fallbacks because host APIs are not all stable.
3
+ SotuRail hook support is cautious. Claude gets conservative safe-hooks and MCP guidance first; Codex, Gemini and Cursor use prompt-only fallbacks when stable native hook APIs are unavailable.
4
4
 
5
5
  ```bash
6
6
  soturail hooks list
7
7
  soturail hooks doctor
8
- soturail hooks install claude --dry-run
9
- soturail hooks install claude
10
- soturail hooks uninstall claude
11
- soturail hooks install all --dry-run
12
- soturail hooks prompt-only codex
8
+ soturail hooks install --agent claude --mode safe-hooks --dry-run
9
+ soturail hooks install --agent claude --mode mcp
10
+ soturail hooks install --agent codex --mode prompt-only
11
+ soturail hooks install --agent gemini --mode prompt-only
12
+ soturail hooks install --agent cursor --mode prompt-only
13
+ soturail hooks uninstall --agent claude
14
+ soturail hooks export --agent claude
15
+ soturail hooks export --agent codex
13
16
  ```
14
17
 
15
- Installers create backups before modifying existing files. If a host config location is uncertain, SotuRail generates prompt-only guidance instead of guessing.
18
+ Installers create backups before modifying existing files. Dry-run prints every file that would change. If a host config location is uncertain, SotuRail generates prompt-only guidance instead of guessing.
16
19
 
17
- Claude install writes `.claude/settings.json` and hook scripts under `.claude/hooks/`. Dry-run prints every file that would change.
20
+ Claude safe-hooks write `.claude/settings.json` and hook scripts under `.claude/hooks/`. The pre-tool hook blocks destructive command shapes and suggests `soturail run` for tests, builds and logs.
18
21
 
19
- Always review generated hooks before enabling them. SotuRail should never auto-install unreviewed third-party skills, hooks or scripts. Prompt-only fallback remains available for every host:
20
-
21
- ```bash
22
- soturail hooks prompt-only claude
23
- soturail hooks prompt-only codex
24
- soturail hooks prompt-only gemini
25
- soturail hooks prompt-only cursor
26
- ```
22
+ Always review generated hooks before enabling them. SotuRail should never auto-install unreviewed third-party skills, hooks or scripts.
package/docs/mcp.md ADDED
@@ -0,0 +1,18 @@
1
+ # MCP Server
2
+
3
+ SotuRail v0.3.0 includes a local MCP-compatible server over stdio using JSON-RPC 2.0 style messages.
4
+
5
+ ```bash
6
+ soturail mcp doctor
7
+ soturail mcp manifest
8
+ soturail mcp serve --transport stdio
9
+ ```
10
+
11
+ The server exposes read-only resources such as the repo map, tree, rules, approved memory, self report, latest benchmarks and roadmap. It also exposes safe tools for indexing, progressive reads, formatting, rule checks, skill listing, context pack generation and raw log expansion.
12
+
13
+ Security defaults:
14
+
15
+ - no arbitrary shell execution;
16
+ - no `soturail run` MCP tool in v0.3.0;
17
+ - raw log expansion redacts probable secrets unless `allow_raw=true`;
18
+ - provider cache hits are never invented.
@@ -9,12 +9,27 @@ Before publishing:
9
9
  - [ ] `npm test`
10
10
  - [ ] `npm audit --omit=dev`
11
11
  - [ ] `node dist/cli.js self all`
12
+ - [ ] `node dist/cli.js skills --help`
13
+ - [ ] `node dist/cli.js mcp --help`
14
+ - [ ] `node dist/cli.js context --help`
12
15
  - [ ] `npm pack --dry-run`
13
16
  - [ ] `npm run release:check`
17
+ - [ ] `node dist/cli.js --version` matches `package.json`.
14
18
  - [ ] Confirm docs mention limitations honestly.
15
19
  - [ ] Confirm no telemetry exists.
16
20
  - [ ] Confirm no `git push` is routed through `soturail run`.
17
21
 
22
+ ## Version Sync
23
+
24
+ Check four separate release identifiers before publishing:
25
+
26
+ - npm package version: `package.json` and `package-lock.json`.
27
+ - CLI runtime version: `node dist/cli.js --version`.
28
+ - Git tag: created only when the release process calls for it.
29
+ - GitHub release: created only after npm publish succeeds.
30
+
31
+ The package version and CLI runtime version must match. `npm run build` regenerates the CLI version source from `package.json`, and `npm run release:check` verifies the built CLI before publication.
32
+
18
33
  ## Audit Distinction
19
34
 
20
35
  `npm audit` checks all dependencies, including dev dependencies used for local tests and builds.
@@ -23,7 +38,35 @@ Before publishing:
23
38
 
24
39
  Runtime audit is clean with `npm audit --omit=dev`. Remaining audit findings, if any, are development dependency findings and should be upgraded safely without `--force`.
25
40
 
26
- For v0.2.2, the full audit findings are in the Vitest/Vite development test stack. npm's suggested fix is a semver-major Vitest upgrade, so do not run `npm audit fix --force` blindly.
41
+ For v0.2.x, the full audit findings are in the Vitest/Vite development test stack when present. npm's suggested fix may be a semver-major Vitest upgrade, so do not run `npm audit fix --force` blindly.
42
+
43
+ ## npm Login And 2FA
44
+
45
+ Use browser-based npm login before publishing:
46
+
47
+ ```bash
48
+ npm login --auth-type=web
49
+ npm whoami
50
+ ```
51
+
52
+ If npm requires a one-time password during publish, provide a fresh authenticator code through `NPM_CONFIG_OTP` or `--otp`. Do not commit tokens, OTPs or npm credentials.
53
+
54
+ PowerShell example:
55
+
56
+ ```powershell
57
+ $env:NPM_CONFIG_OTP="<code>"
58
+ npm run release:publish -- --version X.Y.Z
59
+ Remove-Item Env:NPM_CONFIG_OTP
60
+ ```
61
+
62
+ After npm publish succeeds, verify:
63
+
64
+ ```bash
65
+ npm view soturail version
66
+ npx --yes soturail@X.Y.Z --version
67
+ ```
68
+
69
+ Create or update the GitHub release only after those npm checks pass.
27
70
 
28
71
  ## Windows Paste Safety
29
72
 
@@ -1,6 +1,6 @@
1
1
  # Release Workflow
2
2
 
3
- SotuRail releases should be repeatable and evidence-backed. The release helper lives at `scripts/release.mjs`.
3
+ SotuRail releases should be repeatable and evidence-backed. v0.3.0 exposes release helpers through `soturail release`.
4
4
 
5
5
  ## Check
6
6
 
@@ -10,38 +10,61 @@ npm run release:check
10
10
 
11
11
  Runs install, build, tests, runtime audit, self-dogfooding, pack dry-run and npm version checks. It also reports whether full audit findings are development-only.
12
12
 
13
- ## Prepare
13
+ The check also verifies:
14
+
15
+ - `package.json` and `package-lock.json` version sync;
16
+ - `node dist/cli.js --version` matches the package version;
17
+ - npm pack dry-run emits the matching tarball name;
18
+ - `CHANGELOG.md` and `RELEASE_NOTES_vX.Y.Z.md` exist for the local version;
19
+ - README install instructions and `LICENSE` exist.
20
+
21
+ ## Publish
14
22
 
15
23
  ```bash
16
- npm run release:prepare -- --version X.Y.Z
24
+ npm run release:publish -- X.Y.Z
17
25
  ```
18
26
 
19
- Prepare mode:
20
-
21
- - validates the version argument;
22
- - updates `package.json`, `package-lock.json` and CLI version text;
23
- - updates `CHANGELOG.md`;
24
- - creates `RELEASE_NOTES_vX.Y.Z.md`;
25
- - runs validation;
26
- - commits `chore(release): prepare vX.Y.Z`;
27
- - pushes `main`;
28
- - never publishes to npm.
27
+ Publish mode refuses to publish if build, tests, release preflight or runtime audit fail, if the git tree is dirty, or if the version already exists on npm.
29
28
 
30
- ## Publish
29
+ For browser-based npm login:
31
30
 
32
31
  ```bash
33
- npm run release:publish -- --version X.Y.Z
32
+ npm login --auth-type=web
33
+ npm whoami
34
34
  ```
35
35
 
36
- Publish mode refuses to publish if build, tests or runtime audit fail, if the git tree is dirty, or if the version already exists on npm. If npm asks for 2FA or authentication, rerun the same command after completing the auth step.
36
+ If npm asks for 2FA during publish, use a fresh authenticator code:
37
+
38
+ ```powershell
39
+ $env:NPM_CONFIG_OTP="<code>"
40
+ npm run release:publish -- X.Y.Z
41
+ Remove-Item Env:NPM_CONFIG_OTP
42
+ ```
37
43
 
38
44
  ## Full
39
45
 
40
46
  ```bash
41
- npm run release:full -- --version X.Y.Z
47
+ npm run release:full -- X.Y.Z --publish-npm --github-release
48
+ ```
49
+
50
+ Full mode runs release gates, then publishes to npm only when `--publish-npm` is supplied, and creates or updates the GitHub release only when `--github-release` is supplied.
51
+
52
+ For explicit CLI usage:
53
+
54
+ ```bash
55
+ soturail release publish X.Y.Z
56
+ soturail release github X.Y.Z
57
+ soturail release full X.Y.Z --publish-npm --github-release
42
58
  ```
43
59
 
44
- Full mode runs prepare, publish and then creates or updates the GitHub release using `gh` when available. If the npm version already exists, full mode skips npm publish and only creates or updates the GitHub release.
60
+ Release commands also accept `--target-version X.Y.Z`. The older `--version X.Y.Z` form remains supported for npm scripts, but the positional form avoids confusion with the global `soturail --version` flag.
61
+
62
+ Only create or update the GitHub release after npm publish succeeds and these checks pass:
63
+
64
+ ```bash
65
+ npm view soturail version
66
+ npx --yes soturail@X.Y.Z --version
67
+ ```
45
68
 
46
69
  Safety rules:
47
70
 
@@ -27,6 +27,12 @@ This is intentionally verbose so accidental bypasses are unlikely.
27
27
 
28
28
  Raw command logs remain on disk so compressed summaries can always be audited.
29
29
 
30
+ Raw logs may contain secrets. Do not commit `.soturail/raw/`. MCP raw-log expansion redacts probable secrets by default unless `allow_raw=true` is explicitly passed.
31
+
32
+ ## MCP And Skills
33
+
34
+ The v0.3.0 MCP server does not expose arbitrary shell execution. Skill Rail exports are local files for human review; SotuRail does not auto-install unreviewed third-party skills.
35
+
30
36
  ## Limitations
31
37
 
32
38
  SotuRail does not isolate processes, prevent all shell tricks or replace OS permissions. Treat it as a policy and evidence layer.
@@ -1,28 +1,22 @@
1
1
  # Skill Rail
2
2
 
3
- Skill Rail is planned for v0.3.0. It is not implemented in v0.2.2.
4
-
5
- The goal is to turn approved SotuRail specs, rules and workflows into portable, reviewable agent skills without installing untrusted marketplace content automatically.
6
-
7
- Planned commands:
3
+ Skill Rail exports safe local agent skills without depending on external skill ecosystems.
8
4
 
9
5
  ```bash
10
- soturail skills init <name>
11
- soturail skills from-spec <spec-id>
12
- soturail skills from-rules <rules-file>
13
- soturail skills validate <path>
14
- soturail skills export claude|codex|gemini|cursor
6
+ soturail skills init demo-skill
7
+ soturail skills list
8
+ soturail skills validate
9
+ soturail skills export --target claude
10
+ soturail skills export --target codex
11
+ soturail skills export --target gemini
12
+ soturail skills export --target cursor
13
+ soturail skills export --target generic
14
+ soturail skills pack --format json
15
+ soturail skills pack --format markdown
15
16
  ```
16
17
 
17
- ## Security Requirements
18
+ Skills live in `.soturail/skills/<skill-id>/` with `skill.yml`, `SKILL.md`, examples and validators.
18
19
 
19
- - No automatic marketplace install.
20
- - Validate `SKILL.md` before use.
21
- - Scan for prompt injection.
22
- - Scan for destructive shell commands.
23
- - Scan for secret exfiltration language.
24
- - Scan for `curl`/`wget` pipe execution.
25
- - Warn about untrusted scripts.
26
- - Require human approval before enabling generated skills.
20
+ Validation checks required metadata, target names, duplicate IDs, deterministic content hashes, destructive shell patterns, prompt-injection style instructions and probable embedded secrets.
27
21
 
28
- Skill Rail should preserve SotuRail's local-first evidence model: generated skills must cite the spec, rule or workflow that produced them.
22
+ Exports are written to `.soturail/exports/skills/<target>/`. Review every generated file before enabling it in Claude, Codex, Gemini, Cursor or another host.
package/docs/usage.md CHANGED
@@ -62,3 +62,18 @@ soturail rules check
62
62
  soturail native doctor
63
63
  soturail bench compare-engines
64
64
  ```
65
+
66
+ ## v0.3.0 Workflows
67
+
68
+ ```bash
69
+ soturail skills init demo-skill
70
+ soturail skills validate
71
+ soturail skills export --target claude
72
+ soturail context pack --target generic
73
+ soturail mcp doctor
74
+ soturail mcp manifest
75
+ soturail hooks install --agent claude --mode safe-hooks --dry-run
76
+ soturail release check
77
+ ```
78
+
79
+ MCP is local stdio JSON-RPC style transport and does not expose arbitrary shell execution in v0.3.0.
package/docs/windows.md CHANGED
@@ -26,7 +26,7 @@ From a source checkout:
26
26
  npm run build
27
27
  npm pack --dry-run
28
28
  npm pack
29
- npm install -g .\soturail-0.2.1.tgz
29
+ npm install -g .\soturail-0.3.0.tgz
30
30
  soturail --version
31
31
  ```
32
32
 
@@ -74,3 +74,24 @@ npx soturail --help
74
74
  ## Safety
75
75
 
76
76
  SotuRail blocks destructive command shapes through `soturail run`, including `rm -rf`, `sudo`, `del /s`, downloaded script piping and automatic `git push`.
77
+
78
+ ## Release Checks On Windows
79
+
80
+ Before publishing from Windows, run:
81
+
82
+ ```powershell
83
+ npm run build
84
+ node .\dist\cli.js --version
85
+ npm run release:check
86
+ ```
87
+
88
+ `package.json`, `package-lock.json`, `node dist/cli.js --version`, the npm tarball name, the changelog and the release notes must all agree on the same version.
89
+
90
+ Use browser-based npm login when needed:
91
+
92
+ ```powershell
93
+ npm login --auth-type=web
94
+ npm whoami
95
+ ```
96
+
97
+ Only create the GitHub release after npm publish succeeds and `npx --yes soturail@X.Y.Z --version` prints the published version.
@@ -1,6 +1,6 @@
1
1
  # Workflow Rail
2
2
 
3
- Workflow Rail is planned for v0.4.0. It is not implemented in v0.2.2.
3
+ Workflow Rail is planned for v0.4.0. It is not implemented in v0.3.0.
4
4
 
5
5
  The goal is to describe repeatable engineering workflows as local, auditable artifacts that can later export into Skill Rail or an MCP server.
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soturail",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "Local-first context rails for AI coding agents: reversible terminal compression, progressive repo reading, SDD workflows, hooks, benchmarks, memory and cache-friendly payloads.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,7 +16,8 @@
16
16
  "docs"
17
17
  ],
18
18
  "scripts": {
19
- "build": "tsc -p tsconfig.json",
19
+ "sync:version": "node scripts/sync-version.mjs",
20
+ "build": "npm run sync:version && tsc -p tsconfig.json",
20
21
  "prepack": "npm run build",
21
22
  "test": "vitest run",
22
23
  "typecheck": "tsc -p tsconfig.json --noEmit",
@@ -29,10 +30,11 @@
29
30
  "bench:report": "node dist/cli.js bench report",
30
31
  "bench:native": "node dist/cli.js bench run --engine native",
31
32
  "bench:compare": "node dist/cli.js bench compare-engines",
32
- "release:check": "node scripts/release.mjs check",
33
- "release:prepare": "node scripts/release.mjs prepare",
34
- "release:publish": "node scripts/release.mjs publish",
35
- "release:full": "node scripts/release.mjs full"
33
+ "release:check": "npm run build && node dist/cli.js release check",
34
+ "release:notes": "npm run build && node dist/cli.js release notes",
35
+ "release:publish": "npm run build && node dist/cli.js release publish",
36
+ "release:github": "npm run build && node dist/cli.js release github",
37
+ "release:full": "npm run build && node dist/cli.js release full"
36
38
  },
37
39
  "keywords": [
38
40
  "ai-agents",