agents-md-kit 0.1.0 → 0.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/README.md CHANGED
@@ -23,8 +23,11 @@ Requires Node 20 or newer to run the installer. Your project does not need Node
23
23
  npx agents-md-kit install [--preset <name>]... [--pack <name>]... [--target <dir>] [--apply]
24
24
  npx agents-md-kit validate [--target <dir>] [--template]
25
25
  npx agents-md-kit list
26
+ npx agents-md-kit --help
26
27
  ```
27
28
 
29
+ `--help` prints the usage, every pack and preset with a short description, and examples. `list` prints just the packs and presets.
30
+
28
31
  Exit codes: `0` success, `1` error, `2` install finished with conflicts (review the `.new` files).
29
32
 
30
33
  ## What gets installed
@@ -85,17 +88,17 @@ Run the same install command again with a newer kit. Managed blocks update in pl
85
88
  ## What is verified, and what is not
86
89
 
87
90
  Verified on 2026-11-11 (Windows 11, Node 22.18, npm 11.19, Python 3.13):
88
- - **Test suite:** `npm test` (installer and validator, run in temp directories).
91
+ - **Test suite:** `npm test` (installer and validator, run in temp directories). CI runs the type-check, the tests and `validate --template` on Node 20, 22 and 24 on Linux, macOS and Windows. On the Node 20 runners all 45 tests ran with none skipped, including the real exec-bit and file-symlink checks.
89
92
  - **react-typescript:** a planted bad component yields exactly 7 ESLint problems (5 errors, 2 warnings). A clean component passes ESLint and Prettier. husky rejects a bad commit message, accepts a good one and blocks a staged lint error.
90
93
  - **node-backend:** the same commitlint/husky checks pass. ESLint catches planted errors in a TypeScript sample.
91
94
  - **python:** `ruff check`, `ruff format --check`, `pytest` and `mypy` pass on a sample. pre-commit rejects a bad commit message, accepts a good one and blocks a staged Ruff error.
92
95
  - **Clean install:** every preset installs, validates, and re-installs as a no-op.
96
+ - **From the npm registry:** `npx agents-md-kit` (v0.1.0) lists the units, installs the `python` preset with the `github` pack, validates, and a second `--apply` writes nothing.
93
97
 
94
98
  **Untested:**
95
99
  - GitHub Actions workflows (`ci.yml`, `pr-title.yml`, `release-please.yml`), Dependabot configs and release-please behavior. They parse (light check only for YAML) but have never run. The pinned action majors (`actions/checkout@v4`, `setup-node@v4`, `setup-python@v5`, `release-please-action@v4`, `action-semantic-pull-request@v5`) are behind the latest majors. Dependabot will propose updates; review their changelogs before merging.
96
- - Node 20 (only Node 22 was run).
97
- - macOS and Linux. Setting the exec bit and refusing file symlinks were exercised only through simulation and Windows junctions.
98
- - pnpm/yarn variants, and running from the npm registry (`npx agents-md-kit` was run from a local `npm pack` tarball only).
100
+ - The presets' real-tool checks (ESLint, husky, Ruff, pre-commit) were run on Windows only. On Linux and macOS, only the installer's test suite has run, not the presets' tools.
101
+ - pnpm/yarn variants.
99
102
 
100
103
  `.claude/settings.json` deny rules use the documented `Bash(cmd *)` and `Read(./path)` forms (checked against the Claude Code permissions docs on 2026-11-11). Prefix deny rules are a guard rail, not a sandbox: a reordered command (`git push origin main --force`) is not matched.
101
104
 
@@ -132,6 +135,19 @@ npm run check # type-check, tests and template validation
132
135
 
133
136
  The source is plain JavaScript with JSDoc types, checked by `tsc --noEmit`. There is no build step: the files in `src/` are the files that ship.
134
137
 
138
+ ### Releasing
139
+
140
+ Releases are published from GitHub Actions with npm trusted publishing: no npm token is stored, and the run authenticates over OIDC. One-time setup, on npmjs.com under the package's Settings > Trusted Publisher > GitHub Actions: user `Rumpz`, repository `agents-md-kit`, workflow filename `publish.yml`, no environment. (A new trusted-publisher entry expires unless its first publish succeeds within 2 days.)
141
+
142
+ Then, for each release:
143
+
144
+ ```bash
145
+ npm version patch # or minor / major; bumps package.json and creates the vX.Y.Z tag
146
+ git push --follow-tags
147
+ ```
148
+
149
+ `.github/workflows/publish.yml` runs type-check, tests and template validation, checks the tag matches `package.json`, and publishes. To rehearse everything except the upload, run the workflow by hand from the Actions tab (it ends in `npm publish --dry-run`). That only passes when `package.json` holds a version that isn't on npm yet, so bump it first (`npm version patch --no-git-tag-version`, commit and push); on an already-published version it stops with "You cannot publish over the previously published versions".
150
+
135
151
  Installed files keep the short `agent-kit` name in two places: the managed-block markers (`agent-kit:<id>`) and the `docs/agent-kit/` folder.
136
152
 
137
153
  ## How this kit was built
package/bin/agent-kit.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-md-kit",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Installs AI-agent configuration (AGENTS.md, skills, memory, presets) into a repository. Dry run by default, never overwrites.",
5
5
  "keywords": [
6
6
  "agents-md",
package/src/cli.js CHANGED
@@ -12,9 +12,16 @@ const USAGE = `Usage:
12
12
  agents-md-kit install [--preset <name>]... [--pack <name>]... [--target <dir>] [--apply]
13
13
  agents-md-kit validate [--target <dir>] [--template]
14
14
  agents-md-kit list
15
+ agents-md-kit --help
15
16
 
16
17
  install is a dry run unless --apply is given. core is always installed.`;
17
18
 
19
+ const EXAMPLES = `Examples:
20
+ agents-md-kit install --preset react-typescript --pack github preview, writes nothing
21
+ agents-md-kit install --preset python --pack github --apply install into this directory
22
+ agents-md-kit install --pack web --target ../my-repo --apply core + web into another repo
23
+ agents-md-kit validate check what was installed`;
24
+
18
25
  export function parseArgs(/** @type {string[]} */ argv) {
19
26
  const [command, ...rest] = argv;
20
27
  /** @type {{ command: string, presets: string[], packs: string[], target: string, apply: boolean, template: boolean, help: boolean }} */
@@ -63,6 +70,44 @@ export function parseArgs(/** @type {string[]} */ argv) {
63
70
 
64
71
  /** @typedef {(line: string) => void} Print */
65
72
 
73
+ const WRAP_COLUMNS = 100;
74
+
75
+ /** Wrap `text` after a `prefix`, indenting continuation lines under the text. */
76
+ function wrapAfter(/** @type {string} */ prefix, /** @type {string} */ text) {
77
+ const pad = ' '.repeat(prefix.length);
78
+ /** @type {string[]} */
79
+ const lines = [];
80
+ let line = '';
81
+ for (const word of text.split(/\s+/).filter(Boolean)) {
82
+ if (line && prefix.length + line.length + 1 + word.length > WRAP_COLUMNS) {
83
+ lines.push(line);
84
+ line = word;
85
+ } else {
86
+ line = line ? `${line} ${word}` : word;
87
+ }
88
+ }
89
+ lines.push(line);
90
+ return lines.map((l, i) => (i === 0 ? prefix : pad) + l).join('\n');
91
+ }
92
+
93
+ /** Print core, packs and presets with their descriptions (shared by `list` and `--help`). */
94
+ function printUnits(/** @type {import('./manifest.js').Units} */ units, /** @type {Print} */ out) {
95
+ out('core (always installed)');
96
+ out(wrapAfter(' ', units.core.description));
97
+ for (const [label, map] of /** @type {const} */ ([
98
+ ['packs (--pack)', units.packs],
99
+ ['presets (--preset)', units.presets],
100
+ ])) {
101
+ out('');
102
+ out(`${label}:`);
103
+ if (map.size === 0) out(' (none)');
104
+ for (const u of map.values()) {
105
+ const inc = u.implies.length ? ` (also installs pack ${u.implies.join(', ')})` : '';
106
+ out(wrapAfter(` ${u.name.padEnd(18)} `, `${u.description}${inc}`));
107
+ }
108
+ }
109
+ }
110
+
66
111
  function printReport(
67
112
  /** @type {{ errors: string[], warnings: string[], notes: string[] }} */ { errors, warnings, notes },
68
113
  /** @type {Print} */ out,
@@ -81,25 +126,23 @@ export function main(/** @type {string[]} */ argv, { out = console.log, err = co
81
126
  return 1;
82
127
  }
83
128
  if (opts.help) {
129
+ out('agents-md-kit: install AI-agent config (AGENTS.md, skills, memory, tooling) into a repo.');
130
+ out('');
84
131
  out(USAGE);
132
+ try {
133
+ out('');
134
+ printUnits(loadUnits(kitRoot), out);
135
+ } catch {
136
+ // A damaged kit still gets the usage text; `validate --template` explains what is wrong.
137
+ }
138
+ out('');
139
+ out(EXAMPLES);
85
140
  return 0;
86
141
  }
87
142
  const target = path.resolve(cwd, opts.target);
88
143
  try {
89
144
  if (opts.command === 'list') {
90
- const units = loadUnits(kitRoot);
91
- out(`core (always installed)\n ${units.core.description}`);
92
- for (const [label, map] of /** @type {const} */ ([
93
- ['packs (--pack)', units.packs],
94
- ['presets (--preset)', units.presets],
95
- ])) {
96
- out(`\n${label}:`);
97
- if (map.size === 0) out(' (none)');
98
- for (const u of map.values()) {
99
- const inc = u.implies.length ? ` (also installs pack ${u.implies.join(', ')})` : '';
100
- out(` ${u.name.padEnd(18)} ${u.description}${inc}`);
101
- }
102
- }
145
+ printUnits(loadUnits(kitRoot), out);
103
146
  return 0;
104
147
  }
105
148
  if (opts.command === 'validate') {