@grvmithas/create-aies-kit 1.3.0 → 2.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.
- package/CHANGELOG.md +96 -0
- package/README.md +82 -29
- package/bin/create-aies-kit.js +143 -41
- package/lib/audit.js +367 -0
- package/lib/kit-core/apply.js +143 -0
- package/lib/kit-core/embedded-corpus.js +79 -67
- package/lib/kit-core/evals.js +256 -0
- package/lib/kit-core/generate.js +984 -412
- package/lib/kit-core/install-api.js +154 -106
- package/lib/kit-core/mcp-catalog.js +95 -40
- package/lib/kit-core/options.js +20 -3
- package/lib/kit-core/repo-scan.js +158 -0
- package/package.json +12 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Changelog — @grvmithas/create-aies-kit
|
|
2
|
+
|
|
3
|
+
Format: one `## [version] — date` heading per release (the release workflow refuses to publish without it).
|
|
4
|
+
|
|
5
|
+
## [2.3.0] — 2026-11-06
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **Definition-of-done gate** (`hooks/aies-done.mjs` + `hooks/aies-done.json`). It is wired to Claude Code `Stop`, Codex `Stop`, Devin `Stop`, Gemini CLI `AfterAgent`, and Cursor `stop` (`followup_message`).
|
|
9
|
+
- When the working tree changed, it runs the detected lint, typecheck, and test commands, and refuses completion with the last 40 lines of failing output.
|
|
10
|
+
- It skips unchanged trees, caches the fingerprint of the last green run, releases after 3 consecutive blocks, and fails open on internal errors.
|
|
11
|
+
- Copilot, Kiro, and opencode have no blocking completion event; the CI gate covers them.
|
|
12
|
+
- **Egress self-test** (`hooks/aies-egress-check.mjs` + `hooks/aies-egress.json`) for control AC-06.
|
|
13
|
+
- DNS and TCP probes to non-allowlisted hosts and a raw IP.
|
|
14
|
+
- Wired at session start for `--data-class confidential`. `--require-closed` exits 1 when anything is reachable, and `--json` gives machine-readable output.
|
|
15
|
+
- `audit` check `done-gate`. `fix` fills an empty command list from the detected verify commands.
|
|
16
|
+
- Guard protects `aies-done.*` and `aies-egress*` files from agent edits and deletion (14 self-test cases).
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- **`plugin` emits an Agent Plugins 1.0 bundle.** It contains a root `plugin.json` (spec schema), `skills/` (including the commands rendered as skills), and `mcp.json`, which Cursor and Kiro load natively.
|
|
20
|
+
- `.claude-plugin/` carries the Claude manifest, marketplace entry, and hooks (guard plus done gate) at `hooks/claude-hooks.json`.
|
|
21
|
+
- `.codex-plugin/plugin.json` is the Codex manifest.
|
|
22
|
+
- The bundle no longer emits `commands/`.
|
|
23
|
+
|
|
24
|
+
## [2.2.0] — 2026-11-06
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
- **`enhance` no longer overwrites your edits.** It previously forced every generated file, silently discarding customized `AGENTS.md`, skills, and agents. Re-running install previously skipped every existing file, so there was no safe upgrade path at all.
|
|
28
|
+
- `audit` no longer scores 100 on an unconfigured harness. It now fails on placeholder verify commands, a guard that fails its self-test, a missing eval suite, unwired `hooks/*.hook.sh`, and unmerged `*.aies-new` files.
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
- `.aies-kit.json` manifest of SHA-256 hashes for every kit-written file (CRLF-normalized). Upgrades update untouched files, keep edited ones (writing `<file>.aies-new` only when the kit version changed), delete retired files only when untouched, and record the profile so `enhance` no longer parses `AIES.md`.
|
|
32
|
+
- Verify-command detection: `package.json` scripts with the right runner (npm/pnpm/yarn/bun), `pyproject.toml`/requirements with uv/poetry/pdm (ruff, flake8, mypy, pyright, pytest), Maven/Gradle wrappers, `.sln`/`.csproj`, `go.mod`, and `Makefile` targets. Detected commands are written into `AGENTS.md`, `AIES_REPO_SCAN.md`, and the CI gate.
|
|
33
|
+
- `evals/`: promptfoo harness evals (7 cases: weaken lint, `--no-verify`, push to main, print `.env`, skip the plan, deploy, invent verify commands) with `AGENTS.md` injected as the system prompt and a pinned provider per `--model`; `evals/cases/` for product evals.
|
|
34
|
+
- `templates/ci/aies-gates.yml`: merge-blocking jobs for guard self-test + `audit --min-score 100`, the repo's verify commands, and evals when behavior-defining files change.
|
|
35
|
+
- `node hooks/aies-guard.mjs --self-test`: 12 fixed deny/allow cases; exits 1 on any mismatch or an invalid rules file.
|
|
36
|
+
- `upgrade` alias for `enhance`; `fix` fills detectable verify commands in place.
|
|
37
|
+
- Install uses the repo scan for MCP recommendations (previously only `enhance` did).
|
|
38
|
+
|
|
39
|
+
### Changed
|
|
40
|
+
- `mcps/` ships specs only for recommended servers (4–6 instead of 24; ~225 KB → ~40 KB). The full catalog stays online.
|
|
41
|
+
- `hooks/*.hook.sh` and `hooks/CONTRACT.md` are no longer installed — no runtime executed them and they depended on `OAIES_*` evidence files nothing produced. Their role moves to the CI gate.
|
|
42
|
+
- `AIES.md` and `AIES_REPO_SCAN.md` drop timestamps so re-runs do not churn diffs.
|
|
43
|
+
|
|
44
|
+
## [2.1.0] — 2026-11-06
|
|
45
|
+
|
|
46
|
+
### Security
|
|
47
|
+
- `aies-guard.mjs` enforces three policies instead of one: shell commands, **writes to the agent's own guardrails** (hook, permission, MCP, editor auto-approve, CI, CODEOWNERS files — the CVE-2025-53773 / MCPoison class), and **reads of secrets** (`.env*`, keys, cloud credentials, registry tokens).
|
|
48
|
+
- Fail closed: any guard error denies. Claude Code hooks set `onFailure: "block"`; Cursor hooks set `failClosed: true`.
|
|
49
|
+
- Codex `apply_patch` bodies are parsed so every patched file is checked.
|
|
50
|
+
- Custom rules gain `"protect"` path patterns alongside `"deny"` command patterns.
|
|
51
|
+
|
|
52
|
+
### Added
|
|
53
|
+
- Hook wiring for Codex (`.codex/hooks.json`), Gemini CLI (`hooks.BeforeTool` in `.gemini/settings.json`), Devin Desktop (`.devin/hooks.v1.json`), and opencode (`.opencode/plugins/aies-guard.js`). All 9 targets except Continue now have native enforcement.
|
|
54
|
+
- Claude Code guard covers `Edit|Write|MultiEdit|NotebookEdit` and `Read`; Cursor adds `preToolUse` and `beforeReadFile`; Kiro adds `write` and `read` matchers.
|
|
55
|
+
- Kiro skill mirror at `.kiro/skills/` (Kiro does not read `.agents/skills`).
|
|
56
|
+
- Devin Desktop MCP config `.devin/mcp_config.json` (empty by default).
|
|
57
|
+
- Codex `.codex/config.toml` sets project `sandbox_mode = "workspace-write"` and `approval_policy = "on-request"`.
|
|
58
|
+
|
|
59
|
+
### Changed
|
|
60
|
+
- Devin Desktop commands are emitted as skills (`.devin/skills/<name>/SKILL.md`); workflows are deprecated upstream. The `.devin/skills` skill mirror is dropped because Devin reads `.agents/skills`.
|
|
61
|
+
- Codex agent TOML no longer emits `sandbox_mode` (agent files cannot override it; it was silently ignored). Read-only roles carry an explicit read-only instruction; enforcement comes from the parent session's sandbox.
|
|
62
|
+
|
|
63
|
+
## [2.0.0] — 2026-11-06
|
|
64
|
+
|
|
65
|
+
### Breaking
|
|
66
|
+
- `AGENTS.md` is canonical. Root `copilot-instructions.md` and `aies-hooks.json` are no longer written; `CLAUDE.md` imports `@AGENTS.md`.
|
|
67
|
+
- Skills move to `.agents/skills/<name>/SKILL.md` (open Agent Skills standard), mirrored to `.claude/skills` / `.devin/skills` only where required.
|
|
68
|
+
- Commands move to native folders (`.cursor/commands`, `.claude/commands`, `.github/prompts`, `.gemini/commands`, `.opencode/commands`, `.devin/workflows`, `.kiro/steering`). `.cursor/prompts` and `.claude/prompts` are gone — runtimes never loaded them.
|
|
69
|
+
- `windsurf` now targets Devin Desktop paths (`.devin/rules`, `.devin/workflows`, `.devin/skills`).
|
|
70
|
+
- Node ≥ 20.
|
|
71
|
+
|
|
72
|
+
### Added
|
|
73
|
+
- Targets: `codex`, `gemini-cli`, `kiro`, `opencode` (plus aliases `vscode`, `claude`, `gemini`, `devin`).
|
|
74
|
+
- Native subagents with enforced privileges: `readonly` (Cursor), tool lists (Claude, Copilot, Gemini), `sandbox_mode` (Codex), `permission` maps (opencode). Ships planner, coder, reviewer, security, testing, prompt-engineer, parallel-implementer.
|
|
75
|
+
- `hooks/aies-guard.mjs` wired into Claude Code `PreToolUse`, Cursor `beforeShellExecution`, Copilot `preToolUse`, and Kiro `PreToolUse`; hashed audit log; fail-closed custom rules.
|
|
76
|
+
- `scripts/aies-worktree.mjs` + `plans/_TASK_CONTRACT.md` for parallel agents.
|
|
77
|
+
- Remote MCP catalog (GitHub, GitLab, Sentry, Linear, Notion, Atlassian, Asana, Supabase) rendered per runtime; empty config by default.
|
|
78
|
+
- `plugin` command (Claude Code plugin + marketplace manifest).
|
|
79
|
+
- Cloud agent setup: `copilot-setup-steps.yml`, `.cursor/environment.json`.
|
|
80
|
+
- `audit --min-score` and `--format json`; audit checks skills, native hooks, task contracts, MCP hygiene; `fix` never overwrites.
|
|
81
|
+
- `MODEL_POLICY.md` routes by task class.
|
|
82
|
+
|
|
83
|
+
### Verification
|
|
84
|
+
- Conformance suite (`npm run kit:check`): 9 runtimes × 4 stacks, frontmatter/TOML/JSON validity, guard behavior per hook protocol, layout snapshot.
|
|
85
|
+
|
|
86
|
+
## [1.3.0]
|
|
87
|
+
- Ephemeral `plans/{STORY_ID}-plan.md` + `reviews/{STORY_ID}-code-review.md`; agent hooks shipped; enhance-repo v2.
|
|
88
|
+
|
|
89
|
+
## [1.2.0]
|
|
90
|
+
- Layout fix: cookbook/guides/mcps/templates at repo root.
|
|
91
|
+
|
|
92
|
+
## [1.1.0]
|
|
93
|
+
- Self-contained package (embedded corpus + generator).
|
|
94
|
+
|
|
95
|
+
## [1.0.0]
|
|
96
|
+
- Initial publish (incomplete; do not use).
|
package/README.md
CHANGED
|
@@ -1,55 +1,108 @@
|
|
|
1
1
|
# @grvmithas/create-aies-kit
|
|
2
2
|
|
|
3
|
-
Scaffold
|
|
3
|
+
Scaffold the AIES harness into your repository in the **native formats each agent runtime actually loads** — `AGENTS.md`, open-standard skills, subagents, commands, enforcing hooks, MCP config, and a parallel-worktree helper. No `.aies/` folder.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npx @grvmithas/create-aies-kit@latest \
|
|
7
|
-
--stack nextjs --ide
|
|
7
|
+
--stack nextjs --ide claude-code --role fullstack \
|
|
8
8
|
--maturity intermediate --goal new-product \
|
|
9
9
|
--model claude --data-class internal --yes
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Install reads your repository first: `AGENTS.md` gets your real lint / typecheck / test / build commands (from `package.json` scripts with the right package manager, `pyproject.toml` with uv/poetry/pdm, Maven/Gradle wrappers, `.sln`/`.csproj`, `go.mod`, or `Makefile` targets), and `mcps/` gets specs only for the servers your stack needs.
|
|
13
|
+
|
|
14
|
+
Later, upgrade and rescan:
|
|
13
15
|
|
|
14
16
|
```bash
|
|
15
|
-
npx @grvmithas/create-aies-kit@latest enhance
|
|
17
|
+
npx @grvmithas/create-aies-kit@latest enhance # alias: upgrade — refreshes the harness, keeps your edits
|
|
16
18
|
```
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
…and run the `enhance-repo` command in your agent for conventions a scan cannot infer (`/enhance-repo` in Cursor, Claude Code, Copilot, opencode; `/aies:enhance-repo` in Gemini CLI).
|
|
21
|
+
|
|
22
|
+
## Your edits are safe
|
|
23
|
+
|
|
24
|
+
`.aies-kit.json` records a hash of every file the kit wrote. Re-running install or `enhance`:
|
|
19
25
|
|
|
20
|
-
|
|
26
|
+
| Your file is… | The kit… |
|
|
27
|
+
|---|---|
|
|
28
|
+
| Untouched | Updates it to the new kit version |
|
|
29
|
+
| Edited, kit version unchanged | Leaves it alone |
|
|
30
|
+
| Edited, kit version changed | Leaves it alone; writes the new version to `<file>.aies-new` for you to merge |
|
|
31
|
+
| Retired by the new kit version, untouched | Deletes it |
|
|
32
|
+
| Retired, edited | Leaves it in place and tells you |
|
|
21
33
|
|
|
22
|
-
|
|
23
|
-
|----------|----------|
|
|
24
|
-
| IDE folder (`.cursor` / `.github` / `.claude` / …) | **prompts**, **skills**, **agents** only (+ IDE rules / MCP config) |
|
|
25
|
-
| Repo root | `cookbook/{stack}/`, `guides/`, `mcps/`, `templates/`, `MODEL_POLICY.md`, root instruction files |
|
|
34
|
+
`--force` replaces edited files with the kit version. Commit `.aies-kit.json`; add `*.aies-new` and `hooks/logs/` to `.gitignore`.
|
|
26
35
|
|
|
27
|
-
|
|
36
|
+
## Runtimes
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
| `--ide` | Instructions | Skills | Subagents | Commands | Native hook | MCP config |
|
|
39
|
+
|---|---|---|---|---|---|---|
|
|
40
|
+
| `cursor` | `AGENTS.md` + `.cursor/rules/aies.mdc` | `.agents/skills` | `.cursor/agents/*.md` | `.cursor/commands` | `.cursor/hooks.json` | `.cursor/mcp.json` |
|
|
41
|
+
| `claude-code` | `CLAUDE.md` → `@AGENTS.md` | `.agents/skills` + `.claude/skills` | `.claude/agents/*.md` | `.claude/commands` | `.claude/settings.json` | `.mcp.json` |
|
|
42
|
+
| `copilot` | `AGENTS.md` + `.github/copilot-instructions.md` | `.agents/skills` | `.github/agents/*.agent.md` | `.github/prompts` | `.github/hooks/aies-guard.json` | `.mcp.json` |
|
|
43
|
+
| `codex` | `AGENTS.md` | `.agents/skills` | `.codex/agents/*.toml` | `prompts/` | `.codex/hooks.json` (trust via `/hooks`) | `.codex/config.toml` |
|
|
44
|
+
| `gemini-cli` | `AGENTS.md` via `.gemini/settings.json` | `.agents/skills` | `.gemini/agents/*.md` | `.gemini/commands/aies/*.toml` | `hooks.BeforeTool` in `.gemini/settings.json` | `.gemini/settings.json` |
|
|
45
|
+
| `kiro` | `AGENTS.md` + `.kiro/steering` | `.agents/skills` + `.kiro/skills` | — | `.kiro/steering/aies-*.md` (manual) | `.kiro/hooks/aies-guard.json` | `.kiro/settings/mcp.json` |
|
|
46
|
+
| `windsurf` (Devin Desktop) | `AGENTS.md` + `.devin/rules` | `.agents/skills` | — | `.devin/skills/<name>/SKILL.md` | `.devin/hooks.v1.json` | `.devin/mcp_config.json` |
|
|
47
|
+
| `opencode` | `AGENTS.md` | `.agents/skills` | `.opencode/agents/*.md` | `.opencode/commands` | `.opencode/plugins/aies-guard.js` | `opencode.json` |
|
|
48
|
+
| `continue` | `AGENTS.md` + `.continue/rules` | `.agents/skills` | — | `.continue/prompts` | — | `.continue/mcpServers/aies.json` |
|
|
49
|
+
|
|
50
|
+
Aliases: `vscode`→`copilot`, `claude`→`claude-code`, `gemini`→`gemini-cli`, `devin`→`windsurf`.
|
|
51
|
+
|
|
52
|
+
## What every install gets
|
|
30
53
|
|
|
31
54
|
| Path | Purpose |
|
|
32
55
|
|------|---------|
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
|
|
|
37
|
-
| `
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
| `
|
|
56
|
+
| `AGENTS.md` | Canonical instructions (every runtime reads it or imports it) |
|
|
57
|
+
| `AIES.md` | Operator guide: profile, plans, commands, skills, hooks, MCP, worktrees |
|
|
58
|
+
| `MODEL_POLICY.md` | Model routing by task class + data-class rules |
|
|
59
|
+
| `.agents/skills/<name>/SKILL.md` | Open Agent Skills standard (`name` = folder, trigger-style `description`) |
|
|
60
|
+
| `hooks/aies-guard.mjs` | Dependency-free guard: denies force pushes, pushes to protected branches, `reset --hard`, pipe-to-shell, destructive SQL, publishes/deploys, edits to its own guardrails, secret reads. Fails closed. `--self-test` proves it in CI. Extend via `hooks/aies-guard.rules.json` |
|
|
61
|
+
| `hooks/aies-done.mjs` · `hooks/aies-done.json` | Definition-of-done gate on the runtime's completion event (Claude Code, Codex, Devin `Stop`; Gemini `AfterAgent`; Cursor `stop`): when the working tree changed, runs your verify commands and sends the agent back with the failing output. Skips Q&A turns, caches green results, releases after 3 consecutive blocks, fails open. `AIES_DONE_SKIP=1` bypasses it |
|
|
62
|
+
| `hooks/aies-egress-check.mjs` · `hooks/aies-egress.json` | Network-isolation self-test (control AC-06): DNS and TCP probes to non-allowlisted hosts and a raw IP. Wired at session start for `--data-class confidential`; `--require-closed` exits 1 when anything is reachable |
|
|
63
|
+
| `evals/` | promptfoo harness evals: seven cases that check the `AGENTS.md` non-negotiables hold under pressure (weaken lint, `--no-verify`, push to main, print `.env`, skip the plan, deploy, invent verify commands). Add product evals under `evals/cases/` |
|
|
64
|
+
| `templates/ci/aies-gates.yml` | Merge-blocking CI: guard self-test + `audit --min-score 100`, your repo's verify commands, and evals when behavior-defining files change. Copy to `.github/workflows/` |
|
|
65
|
+
| `scripts/aies-worktree.mjs` | `new` / `list` / `check` / `overlap` / `remove` for one-task-one-worktree parallel agents (max 4), with per-slot ports and DB schema |
|
|
66
|
+
| `plans/_TEMPLATE.md` · `plans/_TASK_CONTRACT.md` | Ephemeral per-story plans and per-task contracts (allowed/prohibited paths, acceptance, stop conditions) |
|
|
67
|
+
| `reviews/` | `{STORY_ID}-code-review.md` reports |
|
|
68
|
+
| `mcps/recommended.json` · `mcps/<spec>.mcp.md` | Vendor-hosted remote MCP servers (OAuth, read-only first) rendered for your runtime, plus specs for the recommended servers only — **nothing is enabled by default** |
|
|
69
|
+
| `cookbook/{stack}/` · `guides/` · `templates/` | Reference material at repo root |
|
|
70
|
+
| Cloud setup | `.github/workflows/copilot-setup-steps.yml` (Copilot) or `.cursor/environment.json` (Cursor) |
|
|
71
|
+
|
|
72
|
+
## Commands
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npx @grvmithas/create-aies-kit@latest audit # score the harness (0–100)
|
|
76
|
+
npx @grvmithas/create-aies-kit@latest audit --min-score 100 # CI gate: exit 1 below threshold
|
|
77
|
+
npx @grvmithas/create-aies-kit@latest audit --format json
|
|
78
|
+
npx @grvmithas/create-aies-kit@latest fix # create missing files, fill detectable verify commands; never overwrites
|
|
79
|
+
node hooks/aies-guard.mjs --self-test # prove the guard denies and allows what it should
|
|
80
|
+
node hooks/aies-done.mjs # run the definition-of-done gate by hand
|
|
81
|
+
node hooks/aies-egress-check.mjs --require-closed # CI/sandbox: exit 1 if egress is open
|
|
82
|
+
npx @grvmithas/create-aies-kit@latest plugin --out ./aies-plugin # Agent Plugins 1.0 bundle
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The plugin bundle follows [Agent Plugins 1.0](https://agent-plugins.org/specification): root `plugin.json`, `skills/`, and `mcp.json`, which Cursor and Kiro load natively, plus `.claude-plugin/` (with the guard and done-gate hooks) and `.codex-plugin/` manifests.
|
|
41
86
|
|
|
42
|
-
|
|
87
|
+
## Parallel agents
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
node scripts/aies-worktree.mjs new JIRA-123 # ../<repo>.worktrees/JIRA-123 on agent/JIRA-123
|
|
91
|
+
# fill plans/JIRA-123-contract.md, run the agent in that worktree
|
|
92
|
+
node scripts/aies-worktree.mjs check JIRA-123 # changed files vs contract allowed/prohibited paths
|
|
93
|
+
node scripts/aies-worktree.mjs overlap # files touched by more than one active task
|
|
94
|
+
node scripts/aies-worktree.mjs remove JIRA-123
|
|
95
|
+
```
|
|
43
96
|
|
|
44
|
-
##
|
|
97
|
+
## What the audit checks
|
|
45
98
|
|
|
46
|
-
`
|
|
99
|
+
`audit` measures whether the harness *works*, not just whether files exist: verify commands are real (no `(fill in)` placeholders), the guard passes its self-test and is wired into the runtime's hook config, the definition-of-done gate lists commands and is wired where the runtime supports it, MCP config has no literal tokens, an eval suite exists, and no `*.aies-new` updates are waiting to be merged.
|
|
47
100
|
|
|
48
|
-
|
|
101
|
+
## Upgrading from 1.x or 2.0–2.1
|
|
49
102
|
|
|
50
|
-
|
|
103
|
+
1. Commit, then run `npx @grvmithas/create-aies-kit@latest enhance`. Installs before 2.2 have no `.aies-kit.json`, so any file that differs from the new kit version is treated as yours: it is kept and the new version lands in `<file>.aies-new`. Merge or delete those, or re-run with `--force` to take every kit version.
|
|
104
|
+
2. 2.2 stops installing the unwired `hooks/*.hook.sh` scripts and the MCP specs your stack does not use; `enhance` deletes copies identical to what the kit shipped and leaves edited ones.
|
|
105
|
+
3. Delete dead 1.x paths the runtime never loaded: root `copilot-instructions.md`, `.cursor/prompts/`, `.claude/prompts/`, `aies-hooks.json`, IDE-folder `*.skill.md`.
|
|
106
|
+
4. Run `audit --min-score 100`.
|
|
51
107
|
|
|
52
|
-
|
|
53
|
-
- **1.2.0** — Layout fix: cookbook/guides/mcps/templates at repo root for all IDEs; `.github` holds prompts/skills/agents (+ copilot-instructions) only.
|
|
54
|
-
- **1.1.0** — Self-contained package (embedded corpus + generator).
|
|
55
|
-
- **1.0.0** — Initial publish (incomplete; do not use).
|
|
108
|
+
Docs: https://www.ai-standards.dev/quickstart · Changelog: [CHANGELOG.md](./CHANGELOG.md)
|
package/bin/create-aies-kit.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { mkdir, writeFile, access, readFile } from 'node:fs/promises';
|
|
4
4
|
import { dirname, join, resolve } from 'node:path';
|
|
5
|
-
import { constants } from 'node:fs';
|
|
5
|
+
import fs, { constants } from 'node:fs';
|
|
6
6
|
import {
|
|
7
7
|
GOALS,
|
|
8
8
|
ROLES,
|
|
@@ -13,36 +13,53 @@ import {
|
|
|
13
13
|
STACKS,
|
|
14
14
|
STACK_LABELS,
|
|
15
15
|
idsOf,
|
|
16
|
+
normalizeIde,
|
|
17
|
+
IDE_ALIASES,
|
|
18
|
+
KIT_VERSION,
|
|
16
19
|
} from '../lib/kit-core/options.js';
|
|
17
|
-
import { enhanceStarterKit,
|
|
20
|
+
import { enhanceStarterKit, generatePluginBundle, generateStarterKit } from '../lib/kit-core/generate.js';
|
|
21
|
+
import { applyBundle, readManifest, CONFLICT_SUFFIX, MANIFEST_FILE } from '../lib/kit-core/apply.js';
|
|
22
|
+
import { detectVerifyCommands } from '../lib/kit-core/repo-scan.js';
|
|
23
|
+
import { detectRepoSignals, stackMcpIds } from '../lib/kit-core/mcp-catalog.js';
|
|
18
24
|
import { choose, confirm } from '../lib/prompts.js';
|
|
25
|
+
import { runAudit } from '../lib/audit.js';
|
|
19
26
|
|
|
20
27
|
function printHelp() {
|
|
21
28
|
console.log(`
|
|
22
|
-
create-aies-kit —
|
|
29
|
+
create-aies-kit ${KIT_VERSION} — AIES harness in runtime-native paths
|
|
23
30
|
|
|
24
31
|
Usage:
|
|
25
|
-
npx @grvmithas/create-aies-kit
|
|
26
|
-
npx @grvmithas/create-aies-kit --stack nextjs --ide cursor --role fullstack --maturity intermediate --goal new-product --model claude --data-class internal --yes
|
|
27
|
-
npx @grvmithas/create-aies-kit enhance
|
|
32
|
+
npx @grvmithas/create-aies-kit@latest
|
|
33
|
+
npx @grvmithas/create-aies-kit@latest --stack nextjs --ide cursor --role fullstack --maturity intermediate --goal new-product --model claude --data-class internal --yes
|
|
34
|
+
npx @grvmithas/create-aies-kit@latest enhance rescan repo and upgrade the harness (keeps your edits; alias: upgrade)
|
|
35
|
+
npx @grvmithas/create-aies-kit@latest audit score harness conformance (--format json, --min-score 100 for CI)
|
|
36
|
+
npx @grvmithas/create-aies-kit@latest fix write missing harness files
|
|
37
|
+
npx @grvmithas/create-aies-kit@latest plugin --out ./aies-plugin Agent Plugins 1.0 bundle (Cursor, Kiro, Claude Code, Codex)
|
|
28
38
|
|
|
29
|
-
Install writes:
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
Install writes:
|
|
40
|
+
AGENTS.md (canonical, with this repo's detected lint/typecheck/test commands) + tool rules file
|
|
41
|
+
AIES.md, MODEL_POLICY.md, implementation_plan.md
|
|
42
|
+
.agents/skills/<name>/SKILL.md (open Agent Skills standard)
|
|
43
|
+
native subagents + commands for the chosen runtime
|
|
44
|
+
hooks/aies-guard.mjs wired into the runtime's native hook config (deny unsafe shell, writes, reads)
|
|
45
|
+
evals/ (promptfoo harness evals) + templates/ci/aies-gates.yml (merge-blocking CI gates)
|
|
46
|
+
scripts/aies-worktree.mjs + plans/_TASK_CONTRACT.md (parallel agents)
|
|
47
|
+
empty MCP config + mcps/recommended.json (remote, OAuth; nothing enabled by default)
|
|
32
48
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
run the enhance-repo prompt in your IDE.
|
|
49
|
+
Re-running install or enhance never overwrites a file you edited: the new version goes to <file>.aies-new.
|
|
50
|
+
${MANIFEST_FILE} records what the kit wrote — commit it.
|
|
36
51
|
|
|
37
52
|
Flags:
|
|
38
53
|
--stack ${idsOf(STACKS).join(' | ')}
|
|
39
54
|
--ide ${idsOf(IDES).join(' | ')}
|
|
55
|
+
aliases: ${Object.entries(IDE_ALIASES).map(([a, t]) => `${a}→${t}`).join(', ')}
|
|
40
56
|
--role ${idsOf(ROLES).join(' | ')}
|
|
41
57
|
--maturity ${idsOf(MATURITIES).join(' | ')}
|
|
42
58
|
--goal ${idsOf(GOALS).join(' | ')}
|
|
43
59
|
--model ${idsOf(MODELS).join(' | ')}
|
|
44
60
|
--data-class ${idsOf(DATA_CLASSES).join(' | ')}
|
|
45
|
-
--
|
|
61
|
+
--out Output directory for the plugin command (default ./aies-plugin)
|
|
62
|
+
--force Replace files you edited with the kit version (default: write <file>.aies-new)
|
|
46
63
|
--dry-run Print files without writing
|
|
47
64
|
--yes, -y Non-interactive when profile flags are set
|
|
48
65
|
--help, -h Show help
|
|
@@ -127,6 +144,12 @@ async function recoverProfile(cwd, args) {
|
|
|
127
144
|
|
|
128
145
|
if (Object.values(profile).every(Boolean)) return profile;
|
|
129
146
|
|
|
147
|
+
const saved = readManifest(cwd).profile;
|
|
148
|
+
if (saved) {
|
|
149
|
+
for (const key of Object.keys(profile)) profile[key] = profile[key] || saved[key];
|
|
150
|
+
if (Object.values(profile).every(Boolean)) return profile;
|
|
151
|
+
}
|
|
152
|
+
|
|
130
153
|
try {
|
|
131
154
|
const aies = await readFile(join(cwd, 'AIES.md'), 'utf8');
|
|
132
155
|
const m = aies.match(
|
|
@@ -153,16 +176,85 @@ async function recoverProfile(cwd, args) {
|
|
|
153
176
|
|
|
154
177
|
async function main() {
|
|
155
178
|
const rawArgv = process.argv.slice(2);
|
|
156
|
-
const
|
|
157
|
-
const
|
|
179
|
+
const cmd = rawArgv[0];
|
|
180
|
+
const isAudit = cmd === 'audit';
|
|
181
|
+
const isFix = cmd === 'fix';
|
|
182
|
+
const isEnhance = cmd === 'enhance' || cmd === 'upgrade';
|
|
183
|
+
const isPlugin = cmd === 'plugin';
|
|
184
|
+
|
|
185
|
+
const args = parseArgs(isAudit || isFix || isEnhance || isPlugin ? rawArgv.slice(1) : rawArgv);
|
|
158
186
|
|
|
159
187
|
if (args.help) {
|
|
160
188
|
printHelp();
|
|
161
189
|
return;
|
|
162
190
|
}
|
|
163
191
|
|
|
192
|
+
if (args.version || cmd === '--version' || cmd === '-v') {
|
|
193
|
+
console.log(KIT_VERSION);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
|
|
164
197
|
const cwd = resolve(process.cwd());
|
|
198
|
+
|
|
199
|
+
if (isPlugin) {
|
|
200
|
+
const out = resolve(cwd, String(args.out || 'aies-plugin'));
|
|
201
|
+
const bundle = generatePluginBundle({
|
|
202
|
+
stack: args.stack || 'nextjs',
|
|
203
|
+
ide: 'claude-code',
|
|
204
|
+
role: args.role || 'fullstack',
|
|
205
|
+
maturity: args.maturity || 'intermediate',
|
|
206
|
+
goal: args.goal || 'existing-codebase',
|
|
207
|
+
model: args.model || 'claude',
|
|
208
|
+
dataClass: args['data-class'] || 'internal',
|
|
209
|
+
});
|
|
210
|
+
const { written, skipped } = await writeBundle(out, bundle.files, { force: Boolean(args.force), dryRun: Boolean(args.dryRun) });
|
|
211
|
+
console.log(`\nAgent Plugins 1.0 bundle → ${out}`);
|
|
212
|
+
console.log(`${args.dryRun ? 'Would write' : 'Wrote'} ${written.length} file(s); skipped ${skipped.length}.`);
|
|
213
|
+
console.log('\nNext:');
|
|
214
|
+
console.log(' Cursor / Kiro: push the folder to a git repo and add it as a team plugin (reads plugin.json)');
|
|
215
|
+
console.log(` Claude Code: /plugin marketplace add ${out} then /plugin install aies@aies-marketplace`);
|
|
216
|
+
console.log(' Codex: reads .codex-plugin/plugin.json; hooks come from the repo install');
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (isAudit || isFix) {
|
|
221
|
+
let profile = await recoverProfile(cwd, args);
|
|
222
|
+
const minScore = args['min-score'] !== undefined ? Number(args['min-score']) : null;
|
|
223
|
+
const auditRes = await runAudit(cwd, { fix: isFix, profile });
|
|
224
|
+
if (minScore !== null && auditRes.score < minScore) process.exitCode = 1;
|
|
225
|
+
|
|
226
|
+
if (args.format === 'json') {
|
|
227
|
+
console.log(JSON.stringify(auditRes, null, 2));
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
console.log(`\n🔍 AIES Harness Conformance ${isFix ? '& Auto-Fix Engine' : 'Audit'} — ${cwd}`);
|
|
232
|
+
console.log(`\nResults:`);
|
|
233
|
+
for (const r of auditRes.results) {
|
|
234
|
+
console.log(` ${r.ok ? '✅' : '❌'} [${r.weight}pts] ${r.name}: ${r.msg}`);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (auditRes.fixesApplied.length > 0) {
|
|
238
|
+
console.log(`\nAuto-Fix Remediations Applied:`);
|
|
239
|
+
for (const f of auditRes.fixesApplied) {
|
|
240
|
+
console.log(` 🛠️ ${f}`);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
console.log(`\n----------------------------------------`);
|
|
245
|
+
console.log(`Score: ${auditRes.score}/100 (Grade: ${auditRes.grade})`);
|
|
246
|
+
console.log(`----------------------------------------`);
|
|
247
|
+
|
|
248
|
+
if (!isFix && auditRes.score < 100) {
|
|
249
|
+
console.log(`\n💡 Tip: Run "npx @grvmithas/create-aies-kit@latest fix" to create missing harness files (existing files are never overwritten).`);
|
|
250
|
+
}
|
|
251
|
+
if (minScore !== null && auditRes.score < minScore) {
|
|
252
|
+
console.log(`\n❌ Score ${auditRes.score} is below --min-score ${minScore}.`);
|
|
253
|
+
}
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
165
256
|
let profile = await recoverProfile(cwd, args);
|
|
257
|
+
if (profile.ide) profile.ide = normalizeIde(profile.ide);
|
|
166
258
|
|
|
167
259
|
assertChoice('stack', profile.stack, idsOf(STACKS));
|
|
168
260
|
assertChoice('ide', profile.ide, idsOf(IDES));
|
|
@@ -203,38 +295,48 @@ async function main() {
|
|
|
203
295
|
}
|
|
204
296
|
}
|
|
205
297
|
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
const
|
|
209
|
-
const
|
|
210
|
-
force,
|
|
298
|
+
const verify = detectVerifyCommands(cwd, fs);
|
|
299
|
+
const recommendedMcpIds = [...new Set([...stackMcpIds(profile.stack), ...detectRepoSignals(cwd, fs).recommendedMcpIds])];
|
|
300
|
+
const bundle = isEnhance ? enhanceStarterKit(cwd, profile) : generateStarterKit(profile, { verify, recommendedMcpIds });
|
|
301
|
+
const res = applyBundle(cwd, bundle.files, {
|
|
302
|
+
force: Boolean(args.force),
|
|
211
303
|
dryRun: Boolean(args.dryRun),
|
|
304
|
+
retired: bundle.retired,
|
|
305
|
+
kitVersion: KIT_VERSION,
|
|
306
|
+
profile: bundle.profile,
|
|
212
307
|
});
|
|
213
308
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
309
|
+
const list = (title, items, mark, max = 15) => {
|
|
310
|
+
if (!items.length) return;
|
|
311
|
+
console.log(`\n${title} (${items.length}):`);
|
|
312
|
+
items.slice(0, max).forEach(f => console.log(` ${mark} ${f}`));
|
|
313
|
+
if (items.length > max) console.log(` … +${items.length - max} more`);
|
|
314
|
+
};
|
|
315
|
+
const verb = args.dryRun ? 'Would ' : '';
|
|
316
|
+
list(`${verb}create`, res.created, '+', args.dryRun ? 40 : 15);
|
|
317
|
+
list(`${verb}update (untouched since the kit wrote them)`, res.updated, '~');
|
|
318
|
+
list(`${verb}remove (retired by this kit version, untouched)`, res.removed, '-');
|
|
319
|
+
list(`Kept your edits — review the new kit version in <file>${CONFLICT_SUFFIX}, merge, then delete it`, res.conflicts, '!', 40);
|
|
320
|
+
list('Retired by this kit version but edited by you — left in place; delete if unused', res.kept, '?');
|
|
321
|
+
console.log(`\n${res.unchanged.length} file(s) already current; ${res.customized.length} customized by you and kept (no kit change).`);
|
|
223
322
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
323
|
+
const found = Object.keys(verify.commands);
|
|
324
|
+
console.log(
|
|
325
|
+
found.length
|
|
326
|
+
? `\nVerify commands detected (${verify.sources.join(', ')}): ${found.map(k => `${k} → ${verify.commands[k]}`).join(' · ')}`
|
|
327
|
+
: '\nNo lint/typecheck/test commands detected — fill the "(fill in)" lines in AGENTS.md; audit fails until you do.',
|
|
328
|
+
);
|
|
228
329
|
|
|
229
|
-
const
|
|
330
|
+
const enhanceCommand = Object.keys(bundle.files).find(f => /enhance-repo/.test(f) && !f.startsWith('cookbook/'));
|
|
331
|
+
const steps = ['Read AIES.md, then AGENTS.md'];
|
|
332
|
+
if (res.conflicts.length) steps.push(`Merge the ${res.conflicts.length} *${CONFLICT_SUFFIX} file(s), then delete them`);
|
|
333
|
+
if (enhanceCommand) steps.push(`Run the enhance-repo command (${enhanceCommand}) in your agent for conventions the scan cannot infer`);
|
|
334
|
+
steps.push('Copy templates/ci/aies-gates.yml to .github/workflows/ and make its jobs required checks');
|
|
335
|
+
steps.push('Commit .aies-kit.json; add *.aies-new and hooks/logs/ to .gitignore');
|
|
336
|
+
steps.push('npx @grvmithas/create-aies-kit@latest audit');
|
|
337
|
+
steps.push('https://www.ai-standards.dev/workflows');
|
|
230
338
|
console.log('\nNext:');
|
|
231
|
-
console.log(
|
|
232
|
-
if (!isEnhance) {
|
|
233
|
-
console.log(' 2. npx @grvmithas/create-aies-kit enhance');
|
|
234
|
-
}
|
|
235
|
-
console.log(` ${isEnhance ? '2' : '3'}. Run ${L.promptsDir}/enhance-repo.prompt.md in your IDE agent`);
|
|
236
|
-
console.log(` ${isEnhance ? '3' : '4'}. Fill implementation_plan.md`);
|
|
237
|
-
console.log(` ${isEnhance ? '4' : '5'}. https://www.ai-standards.dev/workflows`);
|
|
339
|
+
steps.forEach((s, i) => console.log(` ${i + 1}. ${s}`));
|
|
238
340
|
}
|
|
239
341
|
|
|
240
342
|
main().catch(err => {
|