@bonesofspring/ai-rules 0.2.52 → 0.2.53
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 +24 -0
- package/README.md +27 -3
- package/bin/cli.js +551 -60
- package/bin/lib/engine-scripts.js +10 -0
- package/bin/lib/mcp/clients.js +168 -0
- package/bin/lib/mcp/credentials.js +298 -0
- package/bin/lib/mcp/doctor.js +394 -0
- package/bin/lib/mcp/prompt.js +115 -0
- package/bin/lib/mcp/registry.js +170 -0
- package/bin/lib/mcp/run.js +123 -0
- package/bin/lib/merged-config.js +45 -0
- package/bin/lib/seed-ai-local-team.js +5 -0
- package/bin/lib/tool-installs.js +27 -0
- package/docs/MCP-SETUP.md +62 -0
- package/docs/PRESET-CONTRIBUTION.md +3 -1
- package/docs/TEAM-DB.md +173 -0
- package/docs/openapi/team-db.v1.json +5085 -0
- package/mcp/gitlab.mjs +123 -0
- package/mcp/lib/envfile.mjs +126 -0
- package/mcp/lib/yandex.mjs +384 -0
- package/mcp/yandex-mcp-proxy.mjs +155 -0
- package/mcp/yandex-token-refresh.mjs +65 -0
- package/package.json +14 -1
- package/presets/_shared/ai-local/scripts/manifest.mjs +99 -0
- package/presets/_shared/ai-local/scripts/team-db-api.mjs +1275 -0
- package/presets/_shared/ai-local/scripts/team-db-dashboard.mjs +1067 -0
- package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +1301 -0
- package/presets/_shared/ai-local/scripts/team-db-project.mjs +1506 -0
- package/presets/_shared/ai-local/scripts/team-db-schema.mjs +831 -0
- package/presets/_shared/ai-local/scripts/team-db.mjs +251 -0
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +109 -0
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +109 -0
- package/presets/claude/android-kotlin/team/README.md +10 -0
- package/presets/claude/go/hooks/chain-team-phases.sh +109 -0
- package/presets/claude/go/team/README.md +10 -0
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +109 -0
- package/presets/claude/ios-swift/team/README.md +10 -0
- package/presets/claude/java/hooks/chain-team-phases.sh +109 -0
- package/presets/claude/java/team/README.md +10 -0
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +109 -0
- package/presets/claude/mcp-ts/team/README.md +10 -0
- package/presets/claude/next/hooks/chain-team-phases.sh +109 -0
- package/presets/claude/next/team/README.md +10 -0
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +109 -0
- package/presets/claude/nuxt/team/README.md +10 -0
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +109 -0
- package/presets/claude/php-hexagonal/team/README.md +10 -0
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +109 -0
- package/presets/claude/php-laravel/team/README.md +10 -0
- package/presets/claude/svelte/hooks/chain-team-phases.sh +109 -0
- package/presets/claude/svelte/team/README.md +10 -0
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +109 -0
- package/presets/cursor/android-kotlin/team/README.md +10 -0
- package/presets/cursor/go/hooks/chain-team-phases.sh +109 -0
- package/presets/cursor/go/team/README.md +10 -0
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +109 -0
- package/presets/cursor/ios-swift/team/README.md +10 -0
- package/presets/cursor/java/hooks/chain-team-phases.sh +109 -0
- package/presets/cursor/java/team/README.md +10 -0
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +109 -0
- package/presets/cursor/mcp-ts/team/README.md +10 -0
- package/presets/cursor/next/MCP.md +7 -0
- package/presets/cursor/next/hooks/chain-team-phases.sh +109 -0
- package/presets/cursor/next/team/README.md +10 -0
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +109 -0
- package/presets/cursor/nuxt/team/README.md +10 -0
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +109 -0
- package/presets/cursor/php-hexagonal/team/README.md +10 -0
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +109 -0
- package/presets/cursor/php-laravel/team/README.md +10 -0
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +109 -0
- package/presets/cursor/svelte/team/README.md +10 -0
- package/presets/mavis/android-kotlin/adapter-map.json +1 -1
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +109 -0
- package/presets/mavis/android-kotlin/team/README.md +10 -0
- package/presets/mavis/go/adapter-map.json +1 -1
- package/presets/mavis/go/hooks/chain-team-phases.sh +109 -0
- package/presets/mavis/go/team/README.md +10 -0
- package/presets/mavis/ios-swift/adapter-map.json +1 -1
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +109 -0
- package/presets/mavis/ios-swift/team/README.md +10 -0
- package/presets/mavis/java/adapter-map.json +1 -1
- package/presets/mavis/java/hooks/chain-team-phases.sh +109 -0
- package/presets/mavis/java/team/README.md +10 -0
- package/presets/mavis/mcp-ts/adapter-map.json +1 -1
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +109 -0
- package/presets/mavis/mcp-ts/team/README.md +10 -0
- package/presets/mavis/next/MCP.md +7 -0
- package/presets/mavis/next/adapter-map.json +1 -1
- package/presets/mavis/next/hooks/chain-team-phases.sh +109 -0
- package/presets/mavis/next/team/README.md +10 -0
- package/presets/mavis/nuxt/adapter-map.json +1 -1
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +109 -0
- package/presets/mavis/nuxt/team/README.md +10 -0
- package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +109 -0
- package/presets/mavis/php-hexagonal/team/README.md +10 -0
- package/presets/mavis/php-laravel/adapter-map.json +1 -1
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +109 -0
- package/presets/mavis/php-laravel/team/README.md +10 -0
- package/presets/mavis/svelte/adapter-map.json +1 -1
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +109 -0
- package/presets/mavis/svelte/team/README.md +10 -0
- package/presets/opencode/android-kotlin/adapter-map.json +1 -1
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +109 -0
- package/presets/opencode/android-kotlin/team/README.md +10 -0
- package/presets/opencode/go/adapter-map.json +1 -1
- package/presets/opencode/go/hooks/chain-team-phases.sh +109 -0
- package/presets/opencode/go/team/README.md +10 -0
- package/presets/opencode/ios-swift/adapter-map.json +1 -1
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +109 -0
- package/presets/opencode/ios-swift/team/README.md +10 -0
- package/presets/opencode/java/adapter-map.json +1 -1
- package/presets/opencode/java/hooks/chain-team-phases.sh +109 -0
- package/presets/opencode/java/team/README.md +10 -0
- package/presets/opencode/mcp-ts/adapter-map.json +1 -1
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +109 -0
- package/presets/opencode/mcp-ts/team/README.md +10 -0
- package/presets/opencode/next/MCP.md +7 -0
- package/presets/opencode/next/adapter-map.json +1 -1
- package/presets/opencode/next/hooks/chain-team-phases.sh +109 -0
- package/presets/opencode/next/team/README.md +10 -0
- package/presets/opencode/nuxt/adapter-map.json +1 -1
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +109 -0
- package/presets/opencode/nuxt/team/README.md +10 -0
- package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +109 -0
- package/presets/opencode/php-hexagonal/team/README.md +10 -0
- package/presets/opencode/php-laravel/adapter-map.json +1 -1
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +109 -0
- package/presets/opencode/php-laravel/team/README.md +10 -0
- package/presets/opencode/svelte/adapter-map.json +1 -1
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +109 -0
- package/presets/opencode/svelte/team/README.md +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.53
|
|
4
|
+
|
|
5
|
+
### The team runtime gains a rebuildable SQLite projection and a local dashboard
|
|
6
|
+
|
|
7
|
+
- **Files stay authoritative.** A new `team-db` module family (six scripts in `.ai.local/scripts/`) projects `.ai.local/team/` into `.ai.local/team/team.db`. The two write seams — the chain hook after its file writes and `manifest.mjs` after a receipt — run one bounded 5 s child; a failure logs one line and never fails a file write. `AI_RULES_TEAM_DB_DISABLE=1` is the kill switch.
|
|
8
|
+
- **Read-only surface.** `team-db.mjs serve` binds loopback by default and serves a no-build dashboard and a frozen OpenAPI 3.1 document (`docs/openapi/team-db.v1.json`). `POST /api/v1/sync` is the only mutation; every other route is `GET`/`HEAD`.
|
|
9
|
+
- **Install surface.** `init` now seeds thirteen engine scripts and ignores `team.db`, `team.db-wal`, `team.db-shm`, and `team-db-errors.log` in `.ai.local/.gitignore`; the consumer root `.gitignore` is untouched. `engines` stays `>=18`: `node:sqlite` is required only at runtime (Node 22.13.0+), with a file-only fallback and no dependency change.
|
|
10
|
+
- **Gates.** `yarn test:team-db` runs the schema, project, dual-write, contract, API, security, dashboard, concurrency, and FAIL-direction fixture suites; `check-preset-structure.sh` wires every one. Concurrency covers two first projections on a missing database, mixed writers/readers, `SIGKILL` recovery, a held lock, and the hook budget.
|
|
11
|
+
- **Docs.** [`docs/TEAM-DB.md`](docs/TEAM-DB.md) states the behavior contract, the Node floor with its release-note citation, the exact environment names, retention, privacy, and rollback.
|
|
12
|
+
|
|
13
|
+
### MCP pack
|
|
14
|
+
|
|
15
|
+
- **Runtime in the package.** The GitLab wrapper over `@zereight/mcp-gitlab`, the Yandex stdio→HTTP proxy, and the `yc` IAM refresh move into `mcp/**` and ship in `files`; no consumer copy and no new dependency. `engines` stays `>=18`, and every `mcp` command stops on Node < 20 with one next step.
|
|
16
|
+
- **One command per provider.** `ai-rules mcp setup|add|remove|doctor|refresh|run` — `setup` prompts once, registers only the clients present, and ends with a four-area doctor; `doctor` exits 0/1/2 and names one next command per failure; `refresh` re-runs the Yandex browser login.
|
|
17
|
+
- **Four clients.** Cursor, Claude Code, Mavis, and OpenCode get their native shape from one registry, pinned to the exact installed version: a re-run is byte-identical, foreign entries are preserved, and no token or absolute path enters a config.
|
|
18
|
+
- **Credentials.** GitLab URL + token live in `.ai-rules/mcp/credentials.env` (`0600`, self-ignored); Yandex writes only non-secret settings and keeps the IAM token in the `yc` profile.
|
|
19
|
+
- **Opt-in.** `init` ships no entry for these servers — a credential-less server would fail in every consumer. Setup guide: [`docs/MCP-SETUP.md`](docs/MCP-SETUP.md).
|
|
20
|
+
|
|
21
|
+
### Upgrade
|
|
22
|
+
|
|
23
|
+
- Run `npx @bonesofspring/ai-rules update` to refresh the managed preset files and seed the thirteen `.ai.local/scripts/` modules.
|
|
24
|
+
- `team-db` needs Node 22.13.0+ at runtime for `node:sqlite`; older runtimes stay file-only. `AI_RULES_TEAM_DB_DISABLE=1` disables the projection.
|
|
25
|
+
- MCP servers are opt-in: run `npx @bonesofspring/ai-rules@latest mcp setup gitlab` or `... mcp setup yandex`. `init` ships no credential-less entry; MCP commands need Node 20+.
|
|
26
|
+
|
|
3
27
|
## 0.2.52
|
|
4
28
|
|
|
5
29
|
### The `next` preset catches up with Next 16 and its own gates
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ Run `init` from the **app root** (`--cwd` if needed). Default `--preset` is `nex
|
|
|
23
23
|
| Root agents | `REPO_AGENTS.md` → `AGENTS.md` (same file on all four) | | | |
|
|
24
24
|
| `/task` artifacts | **`.ai.local/team/`** (shared; templates refreshed; `tasks/<slug>/` never overwritten) | | | |
|
|
25
25
|
| Template drift | **`.ai.local/.template-base.json`** (shared; one record per tree of files that hold a shipped template byte; `update` prints one drift line, `update --merge-ai-local` fast-forwards a file only when its recorded base still matches and reports the rest) | | | |
|
|
26
|
-
| Self-learning engine | **`.ai.local/scripts/`** (shared;
|
|
26
|
+
| Self-learning engine | **`.ai.local/scripts/`** (shared; thirteen scripts — the engine, `manifest.mjs`, and the six `team-db*.mjs` projection modules; existing files never overwritten) | | | |
|
|
27
27
|
| Specs seed | `docs/specs/` copied only if the directory is **absent** | | | |
|
|
28
28
|
|
|
29
29
|
The engine is the in-task self-learning loop: `.ai.local/signals.jsonl` → `.ai.local/rule-changes.jsonl` →
|
|
@@ -38,8 +38,9 @@ node .ai.local/scripts/run.mjs --strict # read-only check: exit 1 when capture
|
|
|
38
38
|
|
|
39
39
|
`init` seeds the engine with **skip-if-exists** — a modified `run.mjs` stays yours and is reported as kept; there is no
|
|
40
40
|
`--force`. Re-running `init` does not update a seeded module, so delete the file to pick up a newer engine. The seeded
|
|
41
|
-
tree is byte-identical to `presets/_shared/ai-local/scripts/`, and `.ai.local/.gitignore` (created
|
|
42
|
-
ignores `*.lock`, `*.tmp`,
|
|
41
|
+
tree is byte-identical to `presets/_shared/ai-local/scripts/`, and `.ai.local/.gitignore` (created when absent, missing
|
|
42
|
+
required lines appended to an existing file) ignores `*.lock`, `*.tmp`, `.rollback/`, `team.db`, `team.db-wal`,
|
|
43
|
+
`team.db-shm`, and `team-db-errors.log`; the root `.gitignore` is never edited.
|
|
43
44
|
|
|
44
45
|
The same seeding ships `manifest.mjs`, the writer for `.ai.local/team/tasks/<slug>/artifact-manifest.json`:
|
|
45
46
|
|
|
@@ -52,6 +53,28 @@ node .ai.local/scripts/manifest.mjs check --slug <slug>
|
|
|
52
53
|
|
|
53
54
|
Producers merge their receipt with it — the manifest is a whole-file merge target, never a fragment edit.
|
|
54
55
|
|
|
56
|
+
### SQLite projection
|
|
57
|
+
|
|
58
|
+
The same seeded tree carries a rebuildable projection of `.ai.local/team/` into
|
|
59
|
+
`.ai.local/team/team.db` (SQLite, WAL). The **files stay authoritative**: the database is
|
|
60
|
+
derived, git-ignored, and safe to delete. The two write seams (the chain hook after its
|
|
61
|
+
file writes, and `manifest.mjs` after a receipt is printed) run a bounded 5 s child; a
|
|
62
|
+
failure is written to `team-db-errors.log` and never fails a file write.
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
node .ai.local/scripts/team-db.mjs init # create/migrate the database
|
|
66
|
+
node .ai.local/scripts/team-db.mjs sync # full backfill + reconciliation
|
|
67
|
+
node .ai.local/scripts/team-db.mjs sync --slug <slug> # the bounded hook-shaped projection
|
|
68
|
+
node .ai.local/scripts/team-db.mjs check # schema, fingerprint, integrity
|
|
69
|
+
node .ai.local/scripts/team-db.mjs serve # http://127.0.0.1:4178 + dashboard
|
|
70
|
+
AI_RULES_TEAM_DB_DISABLE=1 node .ai.local/scripts/team-db.mjs sync # no-op: file-only mode
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Requires Node 22.13.0+ for `node:sqlite`; older runtimes stay file-only with one line and exit 0.
|
|
74
|
+
`team-db.mjs serve` binds loopback only, is read-only apart from `POST /api/v1/sync`, and
|
|
75
|
+
serves the OpenAPI 3.1 document at `/openapi.json`. Details, environment names, retention,
|
|
76
|
+
and rollback: [`docs/TEAM-DB.md`](docs/TEAM-DB.md).
|
|
77
|
+
|
|
55
78
|
Living exceptions: **`.ai.local/rules/`** and **`.ai.local/conventions.md`** (`init` does not overwrite them). The only exception is opt-in and hash-gated: `update --merge-ai-local` fast-forwards a file whose recorded base in `.ai.local/.template-base.json` still matches, keeps an edited file byte-identical, and diverts its unified diff to `.ai.local/.rollback/template-drift/` (never a `.md`, never a conflict marker). Plain `update` only prints one drift line and records the files that already hold the shipped template; your own bytes never become a base. Overlay does not load `.ai.local/team/**` as rules; see [`docs/LOCAL-OVERLAY.md`](docs/LOCAL-OVERLAY.md#template-drift).
|
|
56
79
|
|
|
57
80
|
**`clean <tool>`** removes only CLI-managed paths under that tool root. It does **not** wipe the whole `.cursor/` / `.claude/` tree, and it **never** deletes `.ai.local/`. Root `AGENTS.md` is removed only when no other tool install remains.
|
|
@@ -99,6 +122,7 @@ Every installed preset ships requestable `anti-hallucination-contract` (not alwa
|
|
|
99
122
|
- Layers: [`presets/_shared/README.md`](presets/_shared/README.md)
|
|
100
123
|
- Guide: [`docs/PRESET-CONTRIBUTION.md`](docs/PRESET-CONTRIBUTION.md)
|
|
101
124
|
- Overlay: [`docs/LOCAL-OVERLAY.md`](docs/LOCAL-OVERLAY.md)
|
|
125
|
+
- MCP setup: [`docs/MCP-SETUP.md`](docs/MCP-SETUP.md)
|
|
102
126
|
- Dogfood: [`scripts/sync-dogfood-cursor.sh`](scripts/sync-dogfood-cursor.sh), [`scripts/sync-dogfood-claude.sh`](scripts/sync-dogfood-claude.sh), [`scripts/sync-dogfood-mavis.sh`](scripts/sync-dogfood-mavis.sh), [`scripts/sync-dogfood-opencode.sh`](scripts/sync-dogfood-opencode.sh) — seeds `.ai.local/team`, preserves slugs
|
|
103
127
|
- Gates: `yarn check:preset-structure`
|
|
104
128
|
|