@guiho/mirror 3.1.0 → 3.1.2

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 CHANGED
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.1.1] - 2026-06-07
9
+
10
+ ### Changed
11
+
12
+ - Changed Mirror skill installation paths to the standard `.agents/skills` and `~/.agents/skills` directories.
13
+ - Changed automatic skill installation to global-only by default while keeping explicit local installation available through `mirror agents install local`.
14
+ - Changed no-argument `mirror` startup to run configured agent setup before showing help.
15
+ - Updated documentation, schema text, and tests to describe the standard agent skill directories.
16
+
8
17
  ## [3.1.0] - 2026-06-07
9
18
 
10
19
  ### Added
package/DOCS.md CHANGED
@@ -194,12 +194,14 @@ mirror agents install global
194
194
  mirror agents instructions
195
195
  ```
196
196
 
197
- - `install local`: Writes `.opencode/skills/guiho-as-mirror/SKILL.md` in the project.
198
- - `install global`: Writes `~/.config/opencode/skills/guiho-as-mirror/SKILL.md`.
197
+ - `install local`: Writes `.agents/skills/guiho-as-mirror/SKILL.md` in the project.
198
+ - `install global`: Writes `~/.agents/skills/guiho-as-mirror/SKILL.md`.
199
199
  - `instructions`: Creates or updates `AGENTS.md` with the GUIHO Mirror semantic versioning section.
200
200
 
201
201
  Global skill installation uses the user home directory. Tests and automation can override that home root with `MIRROR_AGENT_HOME`.
202
202
 
203
+ Automatic skill installation is global-only by default. Use `mirror agents install local` when a project-local `.agents/skills/guiho-as-mirror/SKILL.md` copy is intentionally needed.
204
+
203
205
  ### `mirror version`
204
206
 
205
207
  Reads, plans, and applies version changes.
@@ -304,24 +306,29 @@ Agent settings tell AI coding agents how to prepare release documentation and wh
304
306
  - `write_changelog`: Optional. Tell agents whether changelog edits are allowed. Default: `true`.
305
307
  - `changelog_path`: Optional. Changelog file path for agents. Default: `CHANGELOG.md`.
306
308
  - `auto_agents_md`: Optional. Insert Mirror guidance into `AGENTS.md` when present. Default: `true`.
307
- - `auto_skill_install`: Optional. Install `guiho-as-mirror` when missing. Default: `true`.
309
+ - `auto_skill_install`: Optional. Install `guiho-as-mirror` globally when missing. Default: `true`.
308
310
 
309
311
  Set `write_changelog = false` when agents must skip changelog edits, even if a changelog exists. Set `changelog_path` when the changelog is not at the project root or when a package inside a monorepo writes release notes elsewhere.
310
312
 
313
+ Mirror uses standard agent skill directories:
314
+
315
+ - Local: `.agents/skills/<skill-name>/SKILL.md`
316
+ - Global: `~/.agents/skills/<skill-name>/SKILL.md`
317
+
311
318
  ## Agent Automation
312
319
 
313
- Mirror can self-provision AI-agent instructions for projects that use opencode-compatible skills.
320
+ Mirror can self-provision AI-agent instructions for projects that use standard agent skill directories.
314
321
 
315
- When automation is enabled, project commands check for `AGENTS.md` and for local/global `guiho-as-mirror` skill installation. If guidance is missing, Mirror notifies the user and writes the missing skill or AGENTS section.
322
+ When automation is enabled, project commands check for `AGENTS.md` and for global `guiho-as-mirror` skill installation. If guidance is missing, Mirror notifies the user and writes the missing global skill or AGENTS section. Running `mirror` with no arguments performs this configured setup before showing help. Mirror does not automatically write a local skill file; local installation is explicit.
316
323
 
317
324
  Automation is controlled by `[agents]`.
318
325
 
319
326
  - Disable AGENTS.md insertion with `auto_agents_md = false`.
320
- - Disable local/global skill installation with `auto_skill_install = false`.
327
+ - Disable automatic global skill installation with `auto_skill_install = false`.
321
328
  - Disable changelog edits by agents with `write_changelog = false`.
322
329
  - Direct agents to the correct changelog with `changelog_path = "path/to/CHANGELOG.md"`.
323
330
 
324
- The generated AGENTS section instructs agents to invoke `guiho-as-mirror` for versioning work, inspect `mirror.config.toml`, respect `write_changelog`, and use `changelog_path` for changelog edits.
331
+ The generated AGENTS section instructs agents to invoke `guiho-as-mirror` for versioning work, inspect `mirror.config.toml`, respect `write_changelog`, and use `changelog_path` for changelog edits. Use `mirror agents install local` only when a project-local skill copy is desired explicitly.
325
332
 
326
333
  ## Release Safety Rules
327
334
 
package/README.md CHANGED
@@ -86,8 +86,8 @@ Validates and inspects configuration.
86
86
 
87
87
  #### `mirror agents`
88
88
  Installs Mirror-aware agent guidance for projects that use AI coding agents.
89
- - `mirror agents install local`: Installs the bundled `guiho-as-mirror` skill at `.opencode/skills/guiho-as-mirror/SKILL.md`.
90
- - `mirror agents install global`: Installs the bundled `guiho-as-mirror` skill at `~/.config/opencode/skills/guiho-as-mirror/SKILL.md`.
89
+ - `mirror agents install local`: Installs the bundled `guiho-as-mirror` skill at `.agents/skills/guiho-as-mirror/SKILL.md`.
90
+ - `mirror agents install global`: Installs the bundled `guiho-as-mirror` skill at `~/.agents/skills/guiho-as-mirror/SKILL.md`.
91
91
  - `mirror agents instructions`: Creates or updates `AGENTS.md` with the GUIHO Mirror semantic versioning section.
92
92
 
93
93
  #### `mirror version`
@@ -132,14 +132,14 @@ allow_dirty = false # Optional. Allow dirty Git worktree. Def
132
132
  write_changelog = true # Optional. Tell agents changelog edits are allowed. Default: true.
133
133
  changelog_path = "CHANGELOG.md" # Optional. Changelog file path for agents. Default: "CHANGELOG.md".
134
134
  auto_agents_md = true # Optional. Insert Mirror guidance into AGENTS.md when present. Default: true.
135
- auto_skill_install = true # Optional. Install guiho-as-mirror when missing. Default: true.
135
+ auto_skill_install = true # Optional. Install guiho-as-mirror globally when missing. Default: true.
136
136
  ```
137
137
 
138
138
  ### Agent Automation
139
139
 
140
- Mirror is designed to be safely used by AI agents. Project commands automatically check for `AGENTS.md` and the `guiho-as-mirror` skill, then add the Mirror guidance or install the missing skill when automation is enabled.
140
+ Mirror is designed to be safely used by AI agents. Project commands automatically check for `AGENTS.md` and the `guiho-as-mirror` skill, then add the Mirror guidance or install the missing skill when automation is enabled. Running `mirror` with no arguments also performs this configured agent setup before showing help.
141
141
 
142
- Set `write_changelog = false` when agents should skip changelog edits during release preparation. Set `changelog_path = "docs/CHANGELOG.md"` when the changelog is not at the project root. Set `auto_agents_md = false` or `auto_skill_install = false` to opt out of automatic guidance insertion or skill installation.
142
+ Set `write_changelog = false` when agents should skip changelog edits during release preparation. Set `changelog_path = "docs/CHANGELOG.md"` when the changelog is not at the project root. Set `auto_agents_md = false` to opt out of automatic guidance insertion, or `auto_skill_install = false` to opt out of automatic global skill installation.
143
143
 
144
144
  ### Safety & Git Automation
145
145
 
package/jsr.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guiho/mirror",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
4
4
  "exports": "./source/guiho-mirror.ts",
5
5
  "publish": {
6
6
  "include": [
@@ -1 +1 @@
1
- {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../source/agents.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,KAAK,EACV,2BAA2B,EAC3B,mBAAmB,EACnB,8BAA8B,EAC9B,gBAAgB,EAChB,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,YAAY,CAAA;AAInB,eAAO,MAAM,eAAe,oBAAoB,CAAA;AAChD,eAAO,MAAM,0BAA0B,mDAAmD,CAAA;AAE1F,eAAO,MAAM,0BAA0B,EAAE,mBAKxC,CAAA;AAED,eAAO,MAAM,mBAAmB,6jBAO/B,CAAA;AAED,KAAK,sBAAsB,GAAG;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,KAAK,yBAAyB,GAAG,sBAAsB,GAAG;IACxD,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,KAAK,4BAA4B,GAAG,gBAAgB,GAAG;IACrD,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,OAAO,uBAAuB,EAAE,UAAS,sBAA2B,WAI1G,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,OAAO,uBAAuB,EAAE,UAAS,sBA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,EAAE,UAAS,sBAA2B,WAI1G,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,OAAO,uBAAuB,EAAE,UAAS,sBAA2B,YACvD,CAAA;AAEpD,eAAO,MAAM,kBAAkB,GAC7B,OAAO,uBAAuB,EAC9B,UAAS,yBAA8B,KACtC,OAAO,CAAC,wBAAwB,CAelC,CAAA;AAED,eAAO,MAAM,8BAA8B,GAAU,KAAK,MAAM,EAAE,gBAAc,KAAG,OAAO,CAAC,8BAA8B,CAkBxH,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,KAAK,MAAM,KAAG,MAAM,GAAG,SAWrD,CAAA;AAED,eAAO,MAAM,0BAA0B,GAAU,UAAS,gBAAqB,KAAG,OAAO,CAAC,mBAAmB,CAa5G,CAAA;AAED,eAAO,MAAM,wBAAwB,GACnC,UAAS,4BAAiC,EAC1C,SAAQ,CAAC,OAAO,EAAE,MAAM,KAAK,IAAe,KAC3C,OAAO,CAAC,2BAA2B,CAkBrC,CAAA"}
package/library/agents.js CHANGED
@@ -25,8 +25,8 @@ Use [agents].changelog_path as the changelog file path. If it is missing, use CH
25
25
  `;
26
26
  export const resolveMirrorSkillPath = (scope, options = {}) => {
27
27
  if (scope === 'local')
28
- return resolve(options.cwd ?? process.cwd(), '.opencode', 'skills', mirrorSkillName, 'SKILL.md');
29
- return resolve(resolveMirrorAgentHome(options.homeDirectory), '.config', 'opencode', 'skills', mirrorSkillName, 'SKILL.md');
28
+ return resolve(options.cwd ?? process.cwd(), '.agents', 'skills', mirrorSkillName, 'SKILL.md');
29
+ return resolve(resolveMirrorAgentHome(options.homeDirectory), '.agents', 'skills', mirrorSkillName, 'SKILL.md');
30
30
  };
31
31
  export const isMirrorSkillInstalled = (scope, options = {}) => existsSync(resolveMirrorSkillPath(scope, options));
32
32
  export const installMirrorSkill = async (scope, options = {}) => {
@@ -91,16 +91,11 @@ export const runMirrorAgentAutomation = async (options = {}, notify = () => { })
91
91
  if (settings.autoAgentsMd)
92
92
  result.agentsMd = await ensureMirrorAgentsInstructions(cwd, false);
93
93
  if (settings.autoSkillInstall) {
94
- for (const scope of ['local', 'global']) {
95
- if (isMirrorSkillInstalled(scope, { cwd, homeDirectory: options.homeDirectory }))
96
- continue;
94
+ const scope = 'global';
95
+ if (!isMirrorSkillInstalled(scope, { cwd, homeDirectory: options.homeDirectory })) {
97
96
  const path = resolveMirrorSkillPath(scope, { cwd, homeDirectory: options.homeDirectory });
98
97
  notify(`notice: ${mirrorSkillName} skill not found ${scope}; Mirror is installing it at ${path}`);
99
- const installed = await installMirrorSkill(scope, { cwd, homeDirectory: options.homeDirectory, overwrite: false });
100
- if (scope === 'local')
101
- result.localSkill = installed;
102
- if (scope === 'global')
103
- result.globalSkill = installed;
98
+ result.globalSkill = await installMirrorSkill(scope, { cwd, homeDirectory: options.homeDirectory, overwrite: false });
104
99
  }
105
100
  }
106
101
  return result;
@@ -183,7 +178,7 @@ const embeddedMirrorSkillContent = [
183
178
  '',
184
179
  'Common configuration keys: `[version].source`, `[version].output`, `[version].prerelease_id`, `[git].tag_template`, `[git].commit`, `[git].push`, `[git].allow_dirty`, `[agents].write_changelog`, `[agents].changelog_path`, `[agents].auto_agents_md`, and `[agents].auto_skill_install`.',
185
180
  '',
186
- 'Agent automation options default to true. Set `write_changelog = false` to tell agents to skip changelog edits, `changelog_path = "docs/CHANGELOG.md"` to specify the changelog file, `auto_agents_md = false` to stop Mirror from inserting its AGENTS.md section, and `auto_skill_install = false` to stop Mirror from installing `guiho-as-mirror` when missing.',
181
+ 'Agent automation options default to true. Set `write_changelog = false` to tell agents to skip changelog edits, `changelog_path = "docs/CHANGELOG.md"` to specify the changelog file, `auto_agents_md = false` to stop Mirror from inserting its AGENTS.md section, and `auto_skill_install = false` to stop Mirror from installing `guiho-as-mirror` globally when missing.',
187
182
  '',
188
183
  '## CLI Reference',
189
184
  '',
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../source/cli.ts"],"names":[],"mappings":"AAAA;;GAEG;AA2DH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;EAc5B,CAAA;AAEJ,eAAO,MAAM,YAAY,GAAU,kBAA+B,kBAoEjE,CAAA"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../source/cli.ts"],"names":[],"mappings":"AAAA;;GAEG;AA2DH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;EAc5B,CAAA;AAEJ,eAAO,MAAM,YAAY,GAAU,kBAA+B,kBAwEjE,CAAA"}
package/library/cli.js CHANGED
@@ -61,6 +61,9 @@ export const runMirrorCli = async (rawArgs = process.argv.slice(2)) => {
61
61
  try {
62
62
  if (effectiveArgs.includes('--no-color'))
63
63
  process.env['NO_COLOR'] = '1';
64
+ if (rawArgs.length === 0) {
65
+ await prepareAgents({});
66
+ }
64
67
  if (effectiveArgs.includes('--help')) {
65
68
  const parsed = parseMirrorCliOptions(effectiveArgs);
66
69
  const cwd = resolve(parsed.cwd ?? process.cwd());
@@ -73,7 +73,7 @@ export const reportConfigSchema = (format = 'text') => {
73
73
  ' write_changelog = true | false Optional. Tell agents to write changelog entries. Default: true.',
74
74
  ' changelog_path = "<path>" Optional. Changelog file path for agents. Default: "CHANGELOG.md".',
75
75
  ' auto_agents_md = true | false Optional. Insert Mirror guidance into AGENTS.md when present. Default: true.',
76
- ' auto_skill_install = true | false Optional. Install guiho-as-mirror when missing. Default: true.',
76
+ ' auto_skill_install = true | false Optional. Install guiho-as-mirror globally when missing. Default: true.',
77
77
  '',
78
78
  ].join('\n');
79
79
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@guiho/mirror",
3
3
  "description": "Open source project versioning for Bun, npm, JSR, and Git.",
4
- "version": "3.1.0",
4
+ "version": "3.1.2",
5
5
  "type": "module",
6
6
  "main": "./library/guiho-mirror.js",
7
7
  "types": "./library/guiho-mirror.d.ts",
@@ -147,7 +147,7 @@ auto_skill_install = true
147
147
 
148
148
  Supported version sources and outputs are `package.json`, `jsr.json`, and `git`. Supported Git tag templates are `v{version}`, `{name}@{version}`, and `{name}/v{version}`.
149
149
 
150
- Agent automation options default to true. Set `write_changelog = false` to tell agents to skip changelog edits, `changelog_path = "docs/CHANGELOG.md"` to specify the changelog file, `auto_agents_md = false` to stop Mirror from inserting its AGENTS.md section, and `auto_skill_install = false` to stop Mirror from installing `guiho-as-mirror` when missing.
150
+ Agent automation options default to true. Set `write_changelog = false` to tell agents to skip changelog edits, `changelog_path = "docs/CHANGELOG.md"` to specify the changelog file, `auto_agents_md = false` to stop Mirror from inserting its AGENTS.md section, and `auto_skill_install = false` to stop Mirror from installing `guiho-as-mirror` globally when missing.
151
151
 
152
152
  ## CLI Reference
153
153