@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.
- package/LICENSE +24 -0
- package/SKILL.md +271 -0
- package/changelog.md +887 -0
- package/examples/migration.md +21 -0
- package/examples/publishing.md +21 -0
- package/examples/quickstart.md +22 -0
- package/examples/readme.md +22 -0
- package/examples/release-pr.md +20 -0
- package/package.json +40 -13
- package/readme.md +63 -0
- package/skills/adoption.md +125 -0
- package/skills/artifact-types.md +529 -0
- package/skills/changeset-guide.md +231 -0
- package/skills/changesets.md +332 -0
- package/skills/commands.md +204 -0
- package/skills/configuration.md +258 -0
- package/skills/linting.md +539 -0
- package/skills/multi-package-publishing.md +237 -0
- package/skills/readme.md +18 -0
- package/skills/reference.md +667 -0
- package/skills/trusted-publishing.md +459 -0
- package/README.md +0 -3
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# Commands skill
|
|
2
|
+
|
|
3
|
+
Use this guide when the task is to choose, explain, or sequence monochange CLI commands.
|
|
4
|
+
|
|
5
|
+
## Command selection by goal
|
|
6
|
+
|
|
7
|
+
### Create or repair config
|
|
8
|
+
|
|
9
|
+
| Goal | Command | When to use it |
|
|
10
|
+
| --------------------------- | ------------- | --------------------------------------------------------------- |
|
|
11
|
+
| Bootstrap a repo | `mc init` | You need a starter `monochange.toml` based on detected packages |
|
|
12
|
+
| Check config and changesets | `mc validate` | Before and after release-affecting edits |
|
|
13
|
+
|
|
14
|
+
Examples:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
mc init
|
|
18
|
+
mc init --provider github
|
|
19
|
+
mc validate
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Inspect the workspace
|
|
23
|
+
|
|
24
|
+
| Goal | Command | When to use it |
|
|
25
|
+
| ----------------------------------------- | -------------------------------- | ------------------------------------------------------------------ |
|
|
26
|
+
| See normalized packages and groups | `mc discover --format json` | You need package ids, dependency edges, or group ownership |
|
|
27
|
+
| Audit pending changesets with git context | `mc diagnostics --format json` | You need introduced commits, linked reviews, or related issues |
|
|
28
|
+
| Inspect a durable release declaration | `mc release-record --from <ref>` | You need to inspect a past release after the commit already exists |
|
|
29
|
+
|
|
30
|
+
Examples:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
mc discover --format json
|
|
34
|
+
mc diagnostics --format json
|
|
35
|
+
mc diagnostics --changeset .changeset/feature.md
|
|
36
|
+
mc release-record --from v1.2.3
|
|
37
|
+
mc release-record --from HEAD --format json
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Inspect lint rules and presets
|
|
41
|
+
|
|
42
|
+
| Goal | Command | When to use it |
|
|
43
|
+
| ------------------------------- | ---------------------- | ----------------------------------------------------------------------- |
|
|
44
|
+
| List registered rules/presets | `mc lint list` | You want to see which lint ids and presets monochange currently exposes |
|
|
45
|
+
| Explain one rule or preset | `mc lint explain <id>` | You want the details before configuring a rule in `[lints]` |
|
|
46
|
+
| Run configured lint enforcement | `mc check` | You want validation plus lint execution against manifests |
|
|
47
|
+
|
|
48
|
+
Examples:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
mc lint list
|
|
52
|
+
mc lint list --format json
|
|
53
|
+
mc lint explain cargo/recommended
|
|
54
|
+
mc lint explain npm/workspace-protocol
|
|
55
|
+
mc check --fix
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Create release intent
|
|
59
|
+
|
|
60
|
+
| Goal | Command | When to use it |
|
|
61
|
+
| ---------------------------------------- | --------------------------- | -------------------------------------------------------------------------------------------- |
|
|
62
|
+
| Create a changeset | `mc change` | You know the target package or group id |
|
|
63
|
+
| Check policy coverage from changed files | `mc step:affected-packages` | CI or review needs to confirm that changed packages have changesets without a config wrapper |
|
|
64
|
+
|
|
65
|
+
Examples:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
mc change --package monochange --bump minor --reason "add diagnostics command"
|
|
69
|
+
mc change --package monochange_config --bump none --caused-by monochange_core --reason "dependency-only follow-up"
|
|
70
|
+
mc step:affected-packages --verify --changed-paths crates/monochange/src/lib.rs --format json
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Plan or execute a release
|
|
74
|
+
|
|
75
|
+
| Goal | Command | When to use it |
|
|
76
|
+
| ------------------------------- | ---------------------------------- | -------------------------------------------------------------------------------- |
|
|
77
|
+
| Preview a release safely | `mc release --dry-run` | You want the computed plan without mutating files |
|
|
78
|
+
| Preview file diffs too | `mc release --dry-run --diff` | You want to see version/changelog patches before applying them |
|
|
79
|
+
| Apply the release locally | `mc release` | You are ready to update files on disk |
|
|
80
|
+
| Create a release commit locally | `mc commit-release` | You want the prepared commit before provider publishing |
|
|
81
|
+
| Publish package artifacts | `mc publish --output <path>` | Built-in package publishing is configured for the release state |
|
|
82
|
+
| Create provider releases | `mc publish-release` | Source/provider publishing is configured |
|
|
83
|
+
| Open or update a release PR | `mc release-pr` | You want provider-hosted release-request automation |
|
|
84
|
+
| Bootstrap release packages | `mc publish-bootstrap --from HEAD` | A release package must exist in the public registry before automation can finish |
|
|
85
|
+
| Retarget a recent release | `mc repair-release --from <ref>` | A just-created release needs to move forward to a later commit |
|
|
86
|
+
|
|
87
|
+
Examples:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
mc release --dry-run
|
|
91
|
+
mc release --dry-run --diff
|
|
92
|
+
mc release --dry-run --format json
|
|
93
|
+
mc commit-release --dry-run --diff
|
|
94
|
+
mc publish --dry-run --format json
|
|
95
|
+
mc publish-readiness --from HEAD --output .monochange/readiness.json
|
|
96
|
+
mc publish-bootstrap --from HEAD --output .monochange/bootstrap-result.json
|
|
97
|
+
mc publish-readiness --from HEAD --output .monochange/readiness.json
|
|
98
|
+
mc publish-plan --readiness .monochange/readiness.json --format json
|
|
99
|
+
mc publish --output .monochange/publish-result.json
|
|
100
|
+
mc publish-release --dry-run --format json
|
|
101
|
+
mc release-pr --dry-run --format json
|
|
102
|
+
mc placeholder-publish --dry-run --format json
|
|
103
|
+
mc repair-release --from v1.2.3 --target HEAD --dry-run
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Assistant workflows
|
|
107
|
+
|
|
108
|
+
| Goal | Command | When to use it |
|
|
109
|
+
| ------------------------------------- | ----------------------------- | ------------------------------------------------------------ |
|
|
110
|
+
| Install the monochange skill locally | `mc skill [skills-add flags]` | You want the project-local skill bundle through `skills add` |
|
|
111
|
+
| Generate repo-local agent setup files | `mc subagents <target>` | You want monochange-aware agents, subagents, or rules |
|
|
112
|
+
| Start the MCP server | `mc mcp` | The client launches monochange over stdio |
|
|
113
|
+
|
|
114
|
+
Examples:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
mc help skill
|
|
118
|
+
mc skill
|
|
119
|
+
mc skill -a pi -y
|
|
120
|
+
mc help subagents
|
|
121
|
+
mc subagents claude
|
|
122
|
+
mc subagents pi codex
|
|
123
|
+
mc mcp
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Output formats
|
|
127
|
+
|
|
128
|
+
Many commands support `text`, `markdown`, and `json`.
|
|
129
|
+
|
|
130
|
+
Use:
|
|
131
|
+
|
|
132
|
+
- `--format json` for automation and agent parsing
|
|
133
|
+
- `--format markdown` for human-readable terminal output with richer structure
|
|
134
|
+
- `--format text` when you explicitly want the older plain-text rendering
|
|
135
|
+
|
|
136
|
+
For release-oriented commands, markdown is the default output format.
|
|
137
|
+
|
|
138
|
+
## A practical command flow
|
|
139
|
+
|
|
140
|
+
For most work, use this order:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
mc validate
|
|
144
|
+
mc discover --format json
|
|
145
|
+
mc change --package <id> --bump patch --reason "describe the change"
|
|
146
|
+
mc diagnostics --format json
|
|
147
|
+
mc release --dry-run --diff
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Then choose the next step:
|
|
151
|
+
|
|
152
|
+
- `mc release` to apply
|
|
153
|
+
- `mc commit-release` to produce the local release commit
|
|
154
|
+
- `mc publish-readiness --from HEAD --output <path>`, optional `mc publish-bootstrap --from HEAD --output <path>`, `mc publish-plan --readiness <path>`, and `mc publish --output <path>` to preflight/plan/bootstrap/publish package artifacts; rerun with `--resume <path>` after a partial publish failure
|
|
155
|
+
- `mc publish-release` to create provider releases
|
|
156
|
+
- `mc release-pr` to update a release request instead
|
|
157
|
+
|
|
158
|
+
## Common mistakes
|
|
159
|
+
|
|
160
|
+
### Guessing package ids
|
|
161
|
+
|
|
162
|
+
**Avoid:**
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
mc change --package crates/monochange --bump patch --reason "..."
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**Prefer:**
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
mc discover --format json
|
|
172
|
+
mc change --package monochange --bump patch --reason "..."
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Releasing before a dry run
|
|
176
|
+
|
|
177
|
+
**Avoid:**
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
mc release
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Prefer:**
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
mc release --dry-run --diff
|
|
187
|
+
mc release
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Reading raw changesets when diagnostics would be clearer
|
|
191
|
+
|
|
192
|
+
**Avoid:** manually scraping `.changeset/*.md` files to discover provenance.
|
|
193
|
+
|
|
194
|
+
**Prefer:**
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
mc diagnostics --format json
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Related references
|
|
201
|
+
|
|
202
|
+
- [reference.md](./reference.md)
|
|
203
|
+
- [configuration.md](./configuration.md)
|
|
204
|
+
- [changesets.md](./changesets.md)
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
# Configuration skill
|
|
2
|
+
|
|
3
|
+
Use this guide when the task is to create, review, or extend `monochange.toml`.
|
|
4
|
+
|
|
5
|
+
## First choice: generate, then edit
|
|
6
|
+
|
|
7
|
+
Start with generated config whenever possible:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
mc init
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
`mc init` seeds editable `[cli.*]` workflow commands. If you already have `monochange.toml`, edit existing workflow tables directly or add new `[cli.<name>]` tables; use immutable `mc step:*` commands when you need direct built-in step execution without a wrapper.
|
|
14
|
+
|
|
15
|
+
Validate after every meaningful change:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
mc validate
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Minimum viable config
|
|
22
|
+
|
|
23
|
+
A small repo can start with defaults plus one package:
|
|
24
|
+
|
|
25
|
+
```toml
|
|
26
|
+
[defaults]
|
|
27
|
+
package_type = "cargo"
|
|
28
|
+
|
|
29
|
+
[package.monochange]
|
|
30
|
+
path = "crates/monochange"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Use this when the repo is simple and one ecosystem dominates.
|
|
34
|
+
|
|
35
|
+
## Add changelog defaults early
|
|
36
|
+
|
|
37
|
+
A useful next step is defining how changelogs should render:
|
|
38
|
+
|
|
39
|
+
```toml
|
|
40
|
+
[defaults]
|
|
41
|
+
package_type = "cargo"
|
|
42
|
+
|
|
43
|
+
[defaults.changelog]
|
|
44
|
+
path = "{{ path }}/changelog.md"
|
|
45
|
+
format = "keep_a_changelog"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Why:
|
|
49
|
+
|
|
50
|
+
- packages inherit the same changelog shape by default
|
|
51
|
+
- you avoid repeating the same table everywhere
|
|
52
|
+
- you can still override per package or group later
|
|
53
|
+
|
|
54
|
+
## Declare packages explicitly
|
|
55
|
+
|
|
56
|
+
monochange works best when every managed package has a stable id.
|
|
57
|
+
|
|
58
|
+
```toml
|
|
59
|
+
[package.monochange_core]
|
|
60
|
+
path = "crates/monochange_core"
|
|
61
|
+
|
|
62
|
+
[package.monochange]
|
|
63
|
+
path = "crates/monochange"
|
|
64
|
+
versioned_files = ["Cargo.toml"]
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Prefer ids you want to see in changesets and release output.
|
|
68
|
+
|
|
69
|
+
## Use groups for shared release identity
|
|
70
|
+
|
|
71
|
+
When several packages version together, create a group:
|
|
72
|
+
|
|
73
|
+
```toml
|
|
74
|
+
[group.sdk]
|
|
75
|
+
packages = ["monochange_core", "monochange"]
|
|
76
|
+
tag = true
|
|
77
|
+
release = true
|
|
78
|
+
version_format = "primary"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Use a group when the outward release boundary is shared.
|
|
82
|
+
|
|
83
|
+
Do not use a group just because packages depend on each other. Simple dependency propagation often does the right thing without grouping.
|
|
84
|
+
|
|
85
|
+
## Add extra changelog sections intentionally
|
|
86
|
+
|
|
87
|
+
Use `extra_changelog_sections` when one change type deserves its own heading:
|
|
88
|
+
|
|
89
|
+
```toml
|
|
90
|
+
[package.web-app]
|
|
91
|
+
path = "apps/web"
|
|
92
|
+
type = "cargo"
|
|
93
|
+
extra_changelog_sections = [
|
|
94
|
+
{ name = "User Experience", types = ["ux"], default_bump = "minor" },
|
|
95
|
+
]
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Then create a changeset like:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
mc change --package web-app --bump minor --type ux --reason "redesign settings navigation"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Version more than manifests
|
|
105
|
+
|
|
106
|
+
Use `versioned_files` when a release also needs to update README badges, install scripts, or extra manifests.
|
|
107
|
+
|
|
108
|
+
### Ecosystem-aware entries
|
|
109
|
+
|
|
110
|
+
```toml
|
|
111
|
+
[package.monochange]
|
|
112
|
+
path = "crates/monochange"
|
|
113
|
+
versioned_files = [
|
|
114
|
+
"Cargo.toml",
|
|
115
|
+
{ path = "crates/monochange/extra.toml", type = "cargo" },
|
|
116
|
+
]
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Regex entries for plain text
|
|
120
|
+
|
|
121
|
+
```toml
|
|
122
|
+
[package.monochange]
|
|
123
|
+
path = "crates/monochange"
|
|
124
|
+
versioned_files = [
|
|
125
|
+
{ path = "README.md", regex = 'v(?<version>\d+\.\d+\.\d+)' },
|
|
126
|
+
]
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Use regex entries when no ecosystem parser applies.
|
|
130
|
+
|
|
131
|
+
## Lockfile refresh strategy
|
|
132
|
+
|
|
133
|
+
If the built-in lockfile rewriting is enough, keep config minimal.
|
|
134
|
+
|
|
135
|
+
Add `lockfile_commands` only when the package manager must do the refresh:
|
|
136
|
+
|
|
137
|
+
```toml
|
|
138
|
+
[ecosystems.npm]
|
|
139
|
+
lockfile_commands = [
|
|
140
|
+
{ command = "pnpm install --lockfile-only", cwd = "packages/web" },
|
|
141
|
+
]
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Use this when workspace-specific package-manager behavior matters more than raw speed.
|
|
145
|
+
|
|
146
|
+
## Package publishing and trust
|
|
147
|
+
|
|
148
|
+
Publishing is separate from release planning.
|
|
149
|
+
|
|
150
|
+
```toml
|
|
151
|
+
[ecosystems.npm.publish]
|
|
152
|
+
mode = "builtin"
|
|
153
|
+
trusted_publishing = true
|
|
154
|
+
|
|
155
|
+
[package.web.publish.placeholder]
|
|
156
|
+
readme_file = "docs/web-placeholder.md"
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Use:
|
|
160
|
+
|
|
161
|
+
- `mc placeholder-publish` to bootstrap missing public packages
|
|
162
|
+
- `mc publish-readiness --from HEAD --output <path>` and `mc publish` for package-registry publishing
|
|
163
|
+
- `mc publish-release` for hosted/provider releases
|
|
164
|
+
|
|
165
|
+
Preference rules for trusted publishing:
|
|
166
|
+
|
|
167
|
+
- for npm on GitHub, `mode = "builtin"` is the preferred path because monochange can verify and configure trust itself
|
|
168
|
+
- for `crates.io`, prefer `rust-lang/crates-io-auth-action@v1` when you want a registry-native GitHub Actions publish workflow
|
|
169
|
+
- for `pub.dev`, prefer `dart-lang/setup-dart/.github/workflows/publish.yml@v1` when you want the workflow shape recommended by the Dart team
|
|
170
|
+
- for `crates.io` and `pub.dev`, `mode = "external"` is often the clearest fit when the registry-maintained workflow should own the publish command directly
|
|
171
|
+
- if one repository publishes multiple public packages, use [multi-package-publishing.md](./multi-package-publishing.md) to decide between one shared readiness-enforced `mc publish` job, package-specific jobs, or fully external workflows
|
|
172
|
+
|
|
173
|
+
## Release titles and changelog headings
|
|
174
|
+
|
|
175
|
+
Customize outward release text with these fields:
|
|
176
|
+
|
|
177
|
+
```toml
|
|
178
|
+
[defaults]
|
|
179
|
+
release_title = "{{ version }} ({{ date }})"
|
|
180
|
+
changelog_version_title = "[{{ version }}]({{ tag_url }}) ({{ date }})"
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Use them when:
|
|
184
|
+
|
|
185
|
+
- provider release titles need a consistent format
|
|
186
|
+
- changelog headings should include links or dates
|
|
187
|
+
- group releases should read differently from package releases
|
|
188
|
+
|
|
189
|
+
## Add or override top-level commands
|
|
190
|
+
|
|
191
|
+
`monochange.toml` can define or override `[cli.<command>]` entries.
|
|
192
|
+
|
|
193
|
+
```toml
|
|
194
|
+
[cli.release]
|
|
195
|
+
help_text = "Prepare a release from discovered change files"
|
|
196
|
+
|
|
197
|
+
[[cli.release.inputs]]
|
|
198
|
+
name = "format"
|
|
199
|
+
type = "choice"
|
|
200
|
+
choices = ["markdown", "text", "json"]
|
|
201
|
+
default = "markdown"
|
|
202
|
+
|
|
203
|
+
[[cli.release.steps]]
|
|
204
|
+
type = "PrepareRelease"
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Use the `[cli.*]` workflow tables generated by `mc init` as the editable starting point, or add a new `[cli.<name>]` table yourself.
|
|
208
|
+
|
|
209
|
+
## A safe config-edit workflow
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
mc init
|
|
213
|
+
mc validate
|
|
214
|
+
mc discover --format json
|
|
215
|
+
mc validate
|
|
216
|
+
mc release --dry-run --format json
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
If you touched grouped packages, changelog settings, or versioned files, add `--diff` to inspect the planned file changes:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
mc release --dry-run --diff
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## Common mistakes
|
|
226
|
+
|
|
227
|
+
### Hand-writing ids before discovery
|
|
228
|
+
|
|
229
|
+
**Avoid:** inventing ids from directory names.
|
|
230
|
+
|
|
231
|
+
**Prefer:**
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
mc discover --format json
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Over-grouping packages
|
|
238
|
+
|
|
239
|
+
**Avoid:** putting every related package into one group.
|
|
240
|
+
|
|
241
|
+
**Prefer:** only group packages that should share one outward version and release identity.
|
|
242
|
+
|
|
243
|
+
### Forgetting validation after config edits
|
|
244
|
+
|
|
245
|
+
**Avoid:** editing `monochange.toml` and going straight to publishing.
|
|
246
|
+
|
|
247
|
+
**Prefer:**
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
mc validate
|
|
251
|
+
mc release --dry-run --format json
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
## Related references
|
|
255
|
+
|
|
256
|
+
- [reference.md](./reference.md)
|
|
257
|
+
- [commands.md](./commands.md)
|
|
258
|
+
- [linting.md](./linting.md)
|