@monochange/skill 0.0.0 → 0.4.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.
@@ -0,0 +1,667 @@
1
+ # monochange reference
2
+
3
+ ## What monochange is for
4
+
5
+ monochange manages versions and releases for monorepos that span more than one package ecosystem.
6
+
7
+ Use it when a repository needs one release-planning model across:
8
+
9
+ - Cargo
10
+ - npm / pnpm / Bun
11
+ - Deno
12
+ - Dart / Flutter
13
+ - Python
14
+
15
+ It discovers packages, normalizes dependency relationships, applies package and group rules from `monochange.toml`, reads explicit `.changeset/*.md` files, and turns those inputs into deterministic release plans.
16
+
17
+ ## Installation
18
+
19
+ ### CLI via npm
20
+
21
+ ```bash
22
+ npm install -g @monochange/cli
23
+ monochange --help
24
+ mc --help
25
+ ```
26
+
27
+ ### CLI via Cargo
28
+
29
+ ```bash
30
+ cargo install monochange
31
+ monochange --help
32
+ mc --help
33
+ ```
34
+
35
+ ### Skill package
36
+
37
+ ```bash
38
+ mc help skill
39
+ mc skill
40
+ mc skill --list
41
+ mc skill -a pi -y
42
+ ```
43
+
44
+ `mc skill` forwards the remaining arguments to the upstream `skills add` workflow for the monochange skill source.
45
+
46
+ If you need the lower-level package helper directly, you can still use:
47
+
48
+ ```bash
49
+ npm install -g @monochange/skill
50
+ monochange-skill --print-install
51
+ monochange-skill --print-skill
52
+ monochange-skill --copy ~/.pi/agent/skills/monochange
53
+ ```
54
+
55
+ ## Skill map
56
+
57
+ Use the bundled docs like this:
58
+
59
+ - [SKILL.md](../SKILL.md) — concise entrypoint for agents
60
+ - [readme.md](./readme.md) — index of focused skill modules
61
+ - [adoption.md](./adoption.md) — setup-depth questions, migration guidance, and recommendation patterns
62
+ - [changesets.md](./changesets.md) — creating and managing changesets
63
+ - [commands.md](./commands.md) — built-in commands and workflow selection
64
+ - [configuration.md](./configuration.md) — creating and evolving `monochange.toml`
65
+ - [linting.md](./linting.md) — `mc check`, `[lints]`, presets, and manifest-focused rule explanations with examples
66
+ - [../examples/readme.md](../examples/readme.md) — condensed scenario examples for quick recommendations
67
+ - [changeset-guide.md](./changeset-guide.md) — full lifecycle guidance
68
+ - [artifact-types.md](./artifact-types.md) — artifact-aware changeset framing
69
+
70
+ Keep this `reference.md` open when you want one longer document with broader examples and copy-paste snippets.
71
+
72
+ When the user is still choosing setup depth or migrating from existing tooling, start with [adoption.md](./adoption.md) before generating files.
73
+
74
+ ## Recommended command flow
75
+
76
+ <!-- {=recommendedCommandFlow} -->
77
+
78
+ 1. **Validate** — `mc validate` checks config and changeset targets.
79
+ 2. **Discover** — `mc discover --format json` inspects the workspace model.
80
+ 3. **Create changesets** — `mc change --package <id> --bump <severity> --reason "..."` writes explicit release intent.
81
+ 4. **Preview release** — `mc release --dry-run --format json` shows planned bumps, changelog output, and changed files.
82
+ 5. **Inspect changeset context** — `mc diagnostics --format json` shows git provenance and linked review metadata for all pending changesets.
83
+ 6. **Inspect cached manifest** — `mc release --dry-run --format json` refreshes the cached manifest and shows the downstream automation payload.
84
+ 7. **Publish** — `mc publish-release --format json` creates provider releases after human review.
85
+
86
+ <!-- {/recommendedCommandFlow} -->
87
+
88
+ For release-oriented commands, markdown is the default human-readable output format. Use `--format json` for automation and `--diff` when you want file previews without mutating the workspace.
89
+
90
+ ## Command catalog
91
+
92
+ ### Bootstrap and validate
93
+
94
+ ```bash
95
+ mc init
96
+ mc init --provider github
97
+ mc validate
98
+ ```
99
+
100
+ Use these when you are creating or refining `monochange.toml`.
101
+
102
+ - `mc init` generates a starter config from detected packages
103
+ - `mc init --provider github` also seeds source/provider automation config
104
+ - `mc init` seeds editable `[cli.*]` workflow commands; built-in steps are also available directly as `mc step:*`
105
+ - `mc validate` checks config shape and changeset targets before you do anything riskier
106
+
107
+ ### Inspect the workspace model
108
+
109
+ ```bash
110
+ mc discover --format json
111
+ mc diagnostics --format json
112
+ mc release-record --from HEAD --format json
113
+ ```
114
+
115
+ Use these when you need facts before making changes.
116
+
117
+ - `mc discover --format json` gives you package ids, dependency edges, and groups
118
+ - `mc diagnostics --format json` adds changeset provenance, linked reviews, and related issues
119
+ - `mc release-record --from <ref>` inspects the durable release declaration stored in release history
120
+
121
+ ### Create release intent
122
+
123
+ ```bash
124
+ mc change --package monochange --bump minor --reason "add diagnostics command"
125
+ mc change --package monochange_config --bump none --caused-by monochange_core --reason "dependency-only follow-up"
126
+ mc step:affected-packages --verify --changed-paths crates/monochange/src/lib.rs --format json
127
+ ```
128
+
129
+ Use these when you are deciding what should be released.
130
+
131
+ ### Preview and apply releases
132
+
133
+ ```bash
134
+ mc release --dry-run
135
+ mc release --dry-run --diff
136
+ mc release --dry-run --format json
137
+ mc commit-release --dry-run --diff
138
+ mc publish --dry-run --format json
139
+ mc publish-release --dry-run --format json
140
+ mc release-pr --dry-run --format json
141
+ mc placeholder-publish --dry-run --format json
142
+ mc repair-release --from v1.2.3 --target HEAD --dry-run
143
+ ```
144
+
145
+ Use the dry-run forms first. They are the safest way to audit release behavior before mutating files, git state, registries, or provider releases.
146
+
147
+ ### Subagents and MCP
148
+
149
+ ```bash
150
+ mc help subagents
151
+ mc subagents pi
152
+ mc subagents claude codex
153
+ mc mcp
154
+ ```
155
+
156
+ Use `mc subagents` when you need repo-local monochange-aware agent files. Use `mc mcp` when the client actually needs the stdio server process.
157
+
158
+ For a shorter command-only guide, see [commands.md](./commands.md).
159
+
160
+ ## Changeset authoring
161
+
162
+ Changesets are markdown files in `.changeset/` with YAML frontmatter:
163
+
164
+ ```markdown
165
+ ---
166
+ core: minor
167
+ ---
168
+
169
+ #### add release automation
170
+
171
+ Introduce automated release preparation with changelog rendering and version bumps.
172
+ ```
173
+
174
+ Frontmatter keys are package or group ids. Values are bump severities (`none`, `patch`, `minor`, `major`) or configured change types. Object syntax supports `bump`, `version`, `type`, and `caused_by`:
175
+
176
+ ```markdown
177
+ ---
178
+ core:
179
+ bump: major
180
+ version: "2.0.0"
181
+ type: security
182
+ ---
183
+
184
+ #### breaking API change
185
+
186
+ Redesign the public API surface.
187
+ ```
188
+
189
+ ### Dependency propagation with `caused_by`
190
+
191
+ When a dependency changes, monochange automatically patches all dependents with no context. The `caused_by` field provides that context and suppresses the matching automatic propagation. Because `caused_by` is part of the object form, use table syntax when you need it:
192
+
193
+ ```markdown
194
+ ---
195
+ monochange_config:
196
+ bump: patch
197
+ caused_by: ["monochange_core"]
198
+ ---
199
+
200
+ #### update dependency on monochange_core
201
+
202
+ Bumps `monochange_core` dependency to v2.1.0 after the public API change to `ChangelogFormat`.
203
+ ```
204
+
205
+ For packages flagged by `mc step:affected-packages` that have no meaningful change, use `bump: none` with `caused_by`:
206
+
207
+ ```markdown
208
+ ---
209
+ monochange_config:
210
+ bump: none
211
+ caused_by: ["monochange_core"]
212
+ type: deps
213
+ ---
214
+
215
+ #### update monochange_core dependency
216
+
217
+ No user-facing changes. Dependency version updated to match the group release.
218
+ ```
219
+
220
+ `caused_by` can reference package ids or group ids. It suppresses only the matching propagated entry, so unrelated upstream dependency changes can still propagate normally.
221
+
222
+ CLI authoring accepts one or more `--caused-by <id>` flags:
223
+
224
+ - `mc change --package <id> --bump patch --caused-by monochange_core --reason "update dependency"`
225
+ - `mc change --package <id> --bump none --caused-by sdk --reason "dependency-only follow-up"`
226
+
227
+ ### Granularity and lifecycle rules
228
+
229
+ Agent-authored changesets should follow package-centric granularity:
230
+
231
+ - review existing `.changeset/*.md` files before writing a new one
232
+ - choose the right lifecycle action for each note: create, update, replace, or remove
233
+ - keep related work together, but split unrelated features apart even when they land in the same package
234
+ - combine near-duplicate notes when multiple related packages changed for the same outward reason
235
+ - use `caused_by` when a package is only changing because of dependency propagation, and prefer `bump: none` when there is no real user-facing change
236
+ - treat breaking changes as separate, dedicated changesets with their own migration guides
237
+ - avoid cloned compatibility notes; if only the package ids change and the user-facing message stays the same, write one multi-package changeset
238
+
239
+ Use these decision rules:
240
+
241
+ - **Create new** when the feature is genuinely new or distinct from existing release notes
242
+ - **Update existing** only when the same feature expanded in scope
243
+ - **Replace** when the implementation changed enough that the old note is misleading
244
+ - **Remove** when the feature was reverted or replaced before release
245
+
246
+ Examples:
247
+
248
+ ```markdown
249
+ # Good: separate changesets for distinct features in the same package
250
+
251
+ ---
252
+
253
+ ## core: minor
254
+
255
+ #### add file diff preview
256
+
257
+ ...
258
+
259
+ ---
260
+
261
+ ## core: minor
262
+
263
+ #### add changelog format detection
264
+
265
+ ...
266
+ ```
267
+
268
+ ```markdown
269
+ # Good: combine similar package notes into one related multi-package changeset
270
+
271
+ ---
272
+
273
+ github: patch gitlab: none gitea: none hosting: none
274
+
275
+ ---
276
+
277
+ #### align provider manifests with package publication metadata
278
+
279
+ ...
280
+ ```
281
+
282
+ ```markdown
283
+ # Good: update an existing changeset when the same feature grows
284
+
285
+ ---
286
+
287
+ ## cli: minor
288
+
289
+ #### add --verbose and --debug flags
290
+
291
+ Adds two related debugging flags:
292
+
293
+ - `--verbose` for progress detail
294
+ - `--debug` for internal timing and state output
295
+ ```
296
+
297
+ ```markdown
298
+ # Good: dedicate a separate changeset to a breaking change
299
+
300
+ ---
301
+
302
+ ## config: major
303
+
304
+ #### rename `WorkflowDefinition` to `CliCommandDefinition`
305
+
306
+ > **Breaking change** — update imports and config references from `workflows` to `cli`.
307
+ ```
308
+
309
+ Changeset content still needs the full user-facing quality bar:
310
+
311
+ - a clear headline
312
+ - an impact summary explaining why the change matters
313
+ - concrete before/after examples or realistic usage snippets
314
+
315
+ Use `mc diagnostics --format json` when you need changeset provenance and review context before deciding whether a note should be created, updated, or removed.
316
+
317
+ ## CLI step types and composition
318
+
319
+ `monochange.toml` defines top-level CLI commands with `[cli.<command>]` entries. Each command has `help_text`, optional `inputs`, and ordered `steps`.
320
+
321
+ ### Input types
322
+
323
+ | Type | Description |
324
+ | ------------- | -------------------------------------- |
325
+ | `string` | Single string value |
326
+ | `string_list` | Repeatable value (`--flag a --flag b`) |
327
+ | `path` | File path value |
328
+ | `choice` | Constrained to a set of `choices` |
329
+ | `boolean` | Boolean flag (`true`/`false`) |
330
+
331
+ ### Step types
332
+
333
+ <!-- {=cliStepTypes} -->
334
+
335
+ **Standalone steps** (no prerequisites):
336
+
337
+ - `Validate` — validate config and changeset targets
338
+ - `Discover` — discover packages across ecosystems
339
+ - `CreateChangeFile` — write a `.changeset/*.md` file
340
+ - `AffectedPackages` — evaluate changeset policy from CI-supplied paths and labels
341
+ - `DiagnoseChangesets` — show changeset context and review metadata
342
+ - `RetargetRelease` — repair a recent release by moving its tags
343
+
344
+ **Release-state consumer steps** (require `PrepareRelease`):
345
+
346
+ - `PrepareRelease` — compute release plan, update versions, changelogs, and versioned files
347
+ - `CommitRelease` — create a local release commit
348
+ - `PublishRelease` — create provider releases
349
+ - `OpenReleaseRequest` — open or update a release pull request
350
+ - `CommentReleasedIssues` — comment on issues referenced in changesets
351
+
352
+ **Generic step:**
353
+
354
+ - `Command` — run an arbitrary shell command with template interpolation
355
+
356
+ <!-- {/cliStepTypes} -->
357
+
358
+ ### Command step features
359
+
360
+ `Command` steps support template interpolation with built-in variables (`{{ version }}`, `{{ group_version }}`, `{{ released_packages }}`, `{{ changed_files }}`, `{{ changesets }}`), CLI input forwarding via `{{ inputs.name }}`, and step output references via `{{ steps.ID.stdout }}`.
361
+
362
+ ```toml
363
+ [cli.post-release]
364
+ help_text = "Release and run post-release commands"
365
+
366
+ [[cli.post-release.steps]]
367
+ type = "PrepareRelease"
368
+
369
+ [[cli.post-release.steps]]
370
+ type = "Command"
371
+ id = "notify"
372
+ command = "echo Released {{ version }}"
373
+ shell = true
374
+ ```
375
+
376
+ `shell` accepts `true` (uses `sh -c`), a shell name like `"bash"`, or `false`/omitted for direct execution.
377
+
378
+ ## Configuration reference
379
+
380
+ ### Defaults
381
+
382
+ ```toml
383
+ [defaults]
384
+ parent_bump = "patch"
385
+ include_private = false
386
+ warn_on_group_mismatch = true
387
+ strict_version_conflicts = false
388
+ # package_type = "cargo"
389
+
390
+ [defaults.changelog]
391
+ path = "{{ path }}/changelog.md"
392
+ format = "keep_a_changelog"
393
+ ```
394
+
395
+ ### Release titles
396
+
397
+ <!-- {=releaseTitleConfig} -->
398
+
399
+ Two template fields control how release names and changelog version headings render:
400
+
401
+ - **`release_title`** — plain text title for provider releases (GitHub, GitLab, Gitea)
402
+ - **`changelog_version_title`** — markdown-capable title for changelog version headings
403
+
404
+ Both are configurable at `[defaults]`, `[package.*]`, and `[group.*]` levels.
405
+
406
+ Available template variables: `{{ version }}`, `{{ id }}`, `{{ date }}`, `{{ time }}`, `{{ datetime }}`, `{{ changes_count }}`, `{{ tag_url }}`, `{{ compare_url }}`.
407
+
408
+ ```toml
409
+ [defaults]
410
+ release_title = "{{ version }} ({{ date }})"
411
+ changelog_version_title = "[{{ version }}]({{ tag_url }}) ({{ date }})"
412
+
413
+ [group.main]
414
+ release_title = "v{{ version }} — released {{ date }}"
415
+ ```
416
+
417
+ <!-- {/releaseTitleConfig} -->
418
+
419
+ ### Versioned files
420
+
421
+ `versioned_files` update additional managed files beyond native manifests when versions change:
422
+
423
+ ```toml
424
+ # package-scoped shorthand infers the package ecosystem
425
+ versioned_files = ["Cargo.toml"]
426
+ versioned_files = ["**/crates/*/Cargo.toml"]
427
+
428
+ # explicit typed entries
429
+ versioned_files = [{ path = "group.toml", type = "cargo", name = "sdk-core" }]
430
+
431
+ # regex entries update plain-text files (must include (?<version>...) capture)
432
+ versioned_files = [
433
+ { path = "README.md", regex = 'v(?<version>\d+\.\d+\.\d+)' },
434
+ ]
435
+ ```
436
+
437
+ ### Lockfile commands
438
+
439
+ Lockfile refresh is command-driven. monochange infers defaults when not configured:
440
+
441
+ - Cargo: `cargo generate-lockfile`
442
+ - npm-family: detects owned lockfiles and runs the matching command (`npm install --package-lock-only`, `pnpm install --lockfile-only`, `bun install --lockfile-only`)
443
+ - Dart / Flutter: direct `pubspec.lock` updates by default; configure `dart pub get` or `flutter pub get` when needed
444
+ - Python: `uv.lock` infers `uv lock`, `poetry.lock` infers `poetry lock --no-update`, and unknown Python lockfiles are skipped
445
+ - Go: `go.mod` / `go.sum` refreshes infer `go mod tidy`; `go.sum` is checksum data, not a directly patched lockfile
446
+ - Deno: no inferred default
447
+
448
+ Explicit configuration overrides inference:
449
+
450
+ ```toml
451
+ [ecosystems.npm]
452
+ lockfile_commands = [
453
+ { command = "pnpm install --lockfile-only", cwd = "packages/web" },
454
+ { command = "npm install --package-lock-only", cwd = "packages/legacy", shell = true },
455
+ ]
456
+ ```
457
+
458
+ ### Package publishing and trusted publishing
459
+
460
+ Package publishing is separate from provider release publishing:
461
+
462
+ - `mc publish-bootstrap --from HEAD --output <path>` bootstraps release-record packages with placeholder `0.0.0` releases and writes a JSON result artifact
463
+ - `mc placeholder-publish` is the lower-level command for reserving missing registry packages outside a release-scoped bootstrap flow
464
+ - `mc publish-readiness --from HEAD --output <path>` checks package-registry readiness from release state
465
+ - `mc publish-plan --readiness <path>` validates readiness for planning, including the release record, selected package set, and publish input fingerprint, then excludes non-ready package ids from rate-limit batches
466
+ - `mc publish --output <path>` runs built-in package-registry publishing from prepared release or `HEAD` release state and writes a result artifact that can be reused with `--resume <path>` after partial failures
467
+ - Rerun `mc publish-readiness` if workspace config, manifests, lockfiles, or publish tooling inputs change after the readiness artifact was written
468
+ - `mc publish-release` publishes hosted/provider releases such as GitHub releases
469
+
470
+ Built-in package publishing currently supports only the canonical public registries:
471
+
472
+ - Cargo → `crates.io`
473
+ - npm packages → `npm`
474
+ - Deno packages → `jsr`
475
+ - Dart / Flutter packages → `pub.dev`
476
+ - Python packages → `pypi`
477
+ - Go modules → `go_proxy` via VCS tags
478
+
479
+ Python package discovery and release planning are supported, but PyPI publishing is not built in yet. Use `mode = "external"` for Python, private registries, or unsupported publishing flows.
480
+
481
+ For Cargo, readiness uses the current `Cargo.toml` as a pre-mutation guard. Built-in crates.io publishing is blocked by `publish = false`, by `publish = [...]` when the list omits `crates-io`, by a missing `description`, or by a missing `license`/`license-file`. Workspace-inherited `description`, `license`, and `license-file` values are accepted.
482
+
483
+ If a workspace uses `pnpm`, monochange uses `pnpm publish` and `pnpm exec npm trust ...` instead of raw `npm` commands so workspace protocol and catalog dependency handling stays aligned with the workspace manager.
484
+
485
+ Publishing is configured through `publish` on packages and ecosystems:
486
+
487
+ ```toml
488
+ [ecosystems.npm.publish]
489
+ mode = "builtin"
490
+ trusted_publishing = true
491
+
492
+ [package.web.publish.placeholder]
493
+ readme_file = "docs/web-placeholder.md"
494
+ ```
495
+
496
+ Placeholder README content can come from:
497
+
498
+ - `publish.placeholder.readme`
499
+ - `publish.placeholder.readme_file`
500
+
501
+ `trusted_publishing = true` tells monochange to manage or verify trusted publishing when supported.
502
+
503
+ - npm trusted publishing can be configured automatically from GitHub Actions context; monochange verifies the current state first, then runs `npm trust github <package> --repo <owner/repo> --file <workflow> [--env <environment>] --yes` or the `pnpm exec npm trust ...` equivalent for pnpm workspaces
504
+ - Cargo, `jsr`, and `pub.dev` currently require manual trusted-publishing setup; monochange reports the setup URL and blocks the next built-in release publish until trust is configured
505
+ - See [trusted-publishing.md](./trusted-publishing.md) for a GitHub-focused setup guide covering the exact registry fields and commands for `npm`, `crates.io`, `jsr`, `pub.dev`, PyPI, and Go module tags
506
+ - See [multi-package-publishing.md](./multi-package-publishing.md) when one repository publishes multiple public packages and you need to choose between shared built-in flows and package-specific external workflows
507
+ - Built-in publishing does not yet manage registry rate-limit retries or delayed requeues; use `mode = "external"` when your workflow needs custom scheduling
508
+
509
+ ### Lint rules
510
+
511
+ Configure manifest lint presets, global rules, and scoped overrides in the top-level `[lints]` section, then run them through `mc check`:
512
+
513
+ ```toml
514
+ [lints]
515
+ use = ["cargo/recommended", "npm/recommended"]
516
+
517
+ [lints.rules]
518
+ "cargo/internal-dependency-workspace" = "error"
519
+ "npm/workspace-protocol" = "error"
520
+
521
+ [[lints.scopes]]
522
+ name = "published cargo packages"
523
+ match = { ecosystems = ["cargo"], managed = true, publishable = true }
524
+ rules = { "cargo/required-package-fields" = "error" }
525
+ ```
526
+
527
+ Rule configuration:
528
+
529
+ - Simple severity: `"rule-id" = "error"`, `"rule-id" = "warning"`, or `"rule-id" = "off"`
530
+ - Detailed config: `{ level = "error", fix = true, ...options }`
531
+
532
+ Use `mc lint list` to inspect registered rules and presets. Use `mc lint explain <id>` to see the details for a rule or preset before configuring it.
533
+
534
+ Today the built-in rule sets focus on Cargo and npm-family manifests.
535
+
536
+ Available Cargo lint rules:
537
+
538
+ - `cargo/dependency-field-order` — Enforces consistent field ordering in dependency specifications
539
+ - `cargo/internal-dependency-workspace` — Requires `workspace = true` for internal dependencies
540
+ - `cargo/required-package-fields` — Enforces required `[package]` fields
541
+ - `cargo/sorted-dependencies` — Requires alphabetically sorted dependency tables
542
+ - `cargo/unlisted-package-private` — Packages not in monochange.toml must be private
543
+
544
+ Available NPM lint rules:
545
+
546
+ - `npm/workspace-protocol` — Requires `workspace:` protocol for internal dependencies
547
+ - `npm/sorted-dependencies` — Requires alphabetically sorted dependencies
548
+ - `npm/required-package-fields` — Enforces required fields in package.json
549
+ - `npm/root-no-prod-deps` — Root package.json should only have devDependencies
550
+ - `npm/no-duplicate-dependencies` — Prevents duplicate dependencies across sections
551
+ - `npm/unlisted-package-private` — Packages not in monochange.toml must be private
552
+
553
+ Run `mc check` to validate and lint. Use `mc check --fix` to auto-fix where possible.
554
+
555
+ ### Groups
556
+
557
+ Groups synchronize versions across packages:
558
+
559
+ ```toml
560
+ [group.sdk]
561
+ packages = ["sdk-core", "web-sdk"]
562
+ tag = true
563
+ release = true
564
+ version_format = "primary"
565
+
566
+ [group.sdk.changelog]
567
+ path = "changelog.md"
568
+ include = ["sdk-cli"]
569
+ ```
570
+
571
+ ### Changeset verification
572
+
573
+ ```toml
574
+ [changesets.affected]
575
+ enabled = true
576
+ required = true
577
+ skip_labels = ["no-changeset-required"]
578
+ comment_on_failure = true
579
+ ```
580
+
581
+ ## Linting and validation reference
582
+
583
+ monochange's linting docs in this skill package are about **manifest lint rules configured in `monochange.toml` and run via `mc check`**.
584
+
585
+ Use this workflow when editing package manifests or lint configuration:
586
+
587
+ ```bash
588
+ mc validate
589
+ mc check
590
+ mc check --fix
591
+ ```
592
+
593
+ If you edited shared docs in `.templates/`, also run:
594
+
595
+ ```bash
596
+ devenv shell docs:check
597
+ ```
598
+
599
+ For the full rule-by-rule explanation — including the available `[lints]` presets and rules, why you would enable them, and examples of what changes with and without them — see [linting.md](./linting.md).
600
+
601
+ ## Important modeling rules
602
+
603
+ - `monochange.toml` is the source of truth.
604
+ - Groups own outward release identity for their member packages.
605
+ - Package changelogs and package versioned files may still apply even when a group owns versioning.
606
+ - Changesets should reference configured package ids or group ids.
607
+ - Prefer package ids over group ids when the change is package-specific — monochange propagates to dependents and groups automatically.
608
+ - Source-provider release publishing is downstream from prepared release data, not a substitute for planning.
609
+ - Built-in package publishing currently supports public registries only. Use `mode = "external"` for private or custom registries.
610
+ - Changelog version headings now include the release date by default. Set `changelog_version_title = "{{ version }}"` to restore the previous format.
611
+
612
+ ## MCP server
613
+
614
+ The MCP server exposes reviewable, JSON-first tools for workspace inspection and release planning:
615
+
616
+ <!-- {=mcpToolsList} -->
617
+
618
+ - `monochange_validate` — validate `monochange.toml` and `.changeset` targets
619
+ - `monochange_discover` — discover packages, dependencies, and groups across the repository
620
+ - `monochange_diagnostics` — inspect pending changesets with git and review context as structured JSON
621
+ - `monochange_change` — write a `.changeset` markdown file for one or more package or group ids
622
+ - `monochange_release_preview` — prepare a dry-run release preview from discovered `.changeset` files
623
+ - `monochange_release_manifest` — generate a dry-run release manifest JSON document for downstream automation
624
+ - `monochange_affected_packages` — evaluate changeset policy from changed paths and optional labels
625
+ - `monochange_lint_catalog` — list registered manifest lint rules and presets
626
+ - `monochange_lint_explain` — explain one manifest lint rule or preset
627
+ - `monochange_analyze_changes` — analyze git diff state and return ecosystem-specific semantic changes
628
+ - `monochange_validate_changeset` — validate one changeset against the current semantic diff
629
+
630
+ <!-- {/mcpToolsList} -->
631
+
632
+ ### MCP configuration
633
+
634
+ <!-- {=mcpConfigSnippet} -->
635
+
636
+ ```json
637
+ {
638
+ "mcpServers": {
639
+ "monochange": {
640
+ "command": "monochange",
641
+ "args": ["mcp"]
642
+ }
643
+ }
644
+ }
645
+ ```
646
+
647
+ <!-- {/mcpConfigSnippet} -->
648
+
649
+ Start the server manually: `mc mcp`
650
+
651
+ Generate repo-local setup files with `mc subagents claude`, `mc subagents pi`, or `mc subagents codex`
652
+
653
+ ## Repo-local guidance for assistants
654
+
655
+ <!-- {=assistantRepoGuidance} -->
656
+
657
+ - Read `monochange.toml` before proposing release workflow changes.
658
+ - Run `mc validate` before and after release-affecting edits.
659
+ - Use `mc discover --format json` to inspect package ids, group ownership, and dependency edges.
660
+ - Use `mc diagnostics --format json` or `monochange_diagnostics` for a structured view of all pending changesets with git and review context.
661
+ - Use `monochange_lint_catalog` and `monochange_lint_explain` when you need lint metadata without shelling out.
662
+ - Prefer `mc change` plus `.changeset/*.md` files over ad hoc release notes.
663
+ - Use `mc release --dry-run --format json` before mutating release state.
664
+
665
+ <!-- {/assistantRepoGuidance} -->
666
+
667
+ When you need full changeset context — introduced commit, linked PR, related issues — use `mc diagnostics --format json` directly. It returns stable workspace-relative paths and structured records that agents can parse without reading raw markdown files.