@makerx/yoke 0.1.0 → 0.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.
Files changed (3) hide show
  1. package/README.md +0 -1
  2. package/dist/cli.js +77 -92
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -4,7 +4,6 @@ Claude Code skills for MakerX AI-assisted delivery, and the CLI they call.
4
4
 
5
5
  ## Principles
6
6
 
7
- - **User-invoked.** Skills run only when you type their slash command.
8
7
  - **Overridable.** A skill of your own with the same name wins.
9
8
  - **Lean.** Few skills, short prompts; the CLI enforces the rules.
10
9
 
package/dist/cli.js CHANGED
@@ -7,7 +7,7 @@ import { Command } from "commander";
7
7
  // package.json
8
8
  var package_default = {
9
9
  name: "@makerx/yoke",
10
- version: "0.1.0",
10
+ version: "0.3.0",
11
11
  description: "Lean, user-invoked Claude Code skills for MakerX AI-assisted delivery, plus the CLI they call.",
12
12
  license: "MIT",
13
13
  author: "MakerX",
@@ -58,6 +58,76 @@ var package_default = {
58
58
  }
59
59
  };
60
60
 
61
+ // src/features/pr/guide.ts
62
+ var raiseGuide = `
63
+ Compose a short PR in the format below, get the user's approval in the terminal, push, then create it as a draft with \`yoke pr raise\`, which rejects a title or body that breaks the rules.
64
+
65
+ Preconditions
66
+
67
+ - Working tree clean, every change committed. If not, stop and say what is uncommitted.
68
+ - Branch is not the default branch.
69
+ - \`gh pr view\` reports no PR for the branch. If one exists, do not create another: propose edits to the existing title and body and apply them with \`gh pr edit\` after the same approval step.
70
+
71
+ Body
72
+
73
+ Use exactly these sections, in this order, with these headings. Never add a section and never rename one: no \`## Summary\`, no \`## Changes\`, no \`## Test plan\`.
74
+
75
+ Closes #<issue number>
76
+
77
+ ## What
78
+
79
+ <2\u20133 sentences>
80
+
81
+ ## Why
82
+
83
+ <1\u20132 sentences>
84
+
85
+ Then, only if earned: \`## How\` (1\u20132 sentences).
86
+
87
+ Closes line. If the session or branch name gives an issue number, make it the first line, written \`Closes #123\` for a same-repo issue or \`Closes owner/repo#123\` for a cross-repo one. One \`Closes\` per issue. Nothing else goes above \`## What\`.
88
+
89
+ One section, one question.
90
+
91
+ What what is observably different for a user or caller. Never function, file or component names, or how it is built.
92
+ Why the problem that made the change worth doing. Never mechanism.
93
+ How a non-obvious decision the diff cannot explain: a trade-off, a workaround, a rejected obvious approach. Never a walkthrough of the diff or a restatement of What.
94
+
95
+ Litmus for mechanism: a sentence with "by \u2026ing", "so that it can", "because the X uses", or the name of an internal component, function or file belongs in How, and probably does not belong at all.
96
+
97
+ Brevity budget. Hard caps enforced by \`yoke pr raise\`: What 300 characters, Why 200, How 250, and 600 across all sections. Ceilings, not targets. Prefer deleting a sentence to shortening it.
98
+
99
+ No per-file lists. Never list changes file by file; the diff already shows that.
100
+
101
+ Register. Write like a commit message. Short declarative sentences, present tense, active voice. Cut "this change", "in order to", "it is worth noting", hedges and adverbs.
102
+
103
+ Wordy: This change introduces a confirmation step so that users are able to cancel before their results are reset.
104
+ Terse: Retake asks for confirmation before resetting results.
105
+
106
+ Prose, not bullets. Bullets only for 3 or more genuinely parallel items, and never in What.
107
+
108
+ Backticks around symbols, commands and flags.
109
+
110
+ The title and body never mention Claude, AI assistance or attribution. No \`Co-Authored-By\` or "Generated with" anywhere.
111
+
112
+ Title
113
+
114
+ One line, at most 70 characters, conventional-commit prefix as the repo uses (\`fix(scope): \u2026\`, \`feat(scope): \u2026\`, \`chore: \u2026\`). Says what changed for the user, not what files moved.
115
+
116
+ Approval
117
+
118
+ Mandatory in every permission mode, including auto-accept and bypass. Write the full title and body verbatim in your visible reply. Then call \`AskUserQuestion\` with an approve option whose \`preview\` holds the complete title and body, plus a revise option. Approval covers the push as well as the create. On revise, redraft and ask again.
119
+
120
+ Create
121
+
122
+ git push -u origin HEAD
123
+ yoke pr raise --title "<title>" --body "$(cat <<'EOF'
124
+ <body>
125
+ EOF
126
+ )"
127
+
128
+ Always a draft; the user marks it ready for review themselves. If \`yoke pr raise\` rejects the description, it names each rule that failed: fix those, show the revised description, and get approval again before rerunning. On success it prints the PR URL; report it.
129
+ `;
130
+
61
131
  // src/features/pr/raise.ts
62
132
  import { execFileSync } from "child_process";
63
133
 
@@ -189,102 +259,17 @@ import { join } from "path";
189
259
  // src/skill.ts
190
260
  var ownerMarker = 'owner: "@makerx/yoke"';
191
261
  function renderSkill({ name, description, body }) {
192
- return [
193
- "---",
194
- `name: ${name}`,
195
- `description: ${description}`,
196
- "disable-model-invocation: true",
197
- "metadata:",
198
- ` ${ownerMarker}`,
199
- "---",
200
- "",
201
- body.trim(),
202
- ""
203
- ].join("\n");
262
+ return ["---", `name: ${name}`, `description: ${description}`, "metadata:", ` ${ownerMarker}`, "---", "", body.trim(), ""].join("\n");
204
263
  }
205
264
 
206
265
  // src/features/pr/skill.ts
207
266
  var prSkill = {
208
267
  name: "pr",
209
- description: "Raise a PR with a concise What/Why/(How) description",
268
+ description: "Raise a PR with a concise What/Why/(How) description. Use when asked to raise, open or create a pull request, or to rewrite a PR description.",
210
269
  body: `
211
- # Raise a PR
212
-
213
- Compose a short PR in the format below, get the user's approval in the terminal, push, then create it as a draft with \`yoke pr raise\`, which rejects a title or body that breaks the rules.
214
-
215
- ## Preconditions
216
-
217
- - \`yoke\` is on PATH. If not, stop and tell the user to run \`npm i -g @makerx/yoke\`.
218
- - Working tree clean, every change committed. If not, stop and say what is uncommitted.
219
- - Branch is not the default branch.
220
- - \`gh pr view\` reports no PR for the branch. If one exists, do not create another: propose edits to the existing title and body and apply them with \`gh pr edit\` after the same approval step.
221
-
222
- ## Body
223
-
224
- Use exactly these sections, in this order, with these headings. Never add a section and never rename one: no \`## Summary\`, no \`## Changes\`, no \`## Test plan\`.
225
-
226
- \`\`\`
227
- Closes #<issue number>
228
-
229
- ## What
230
-
231
- <2\u20133 sentences>
232
-
233
- ## Why
234
-
235
- <1\u20132 sentences>
236
- \`\`\`
237
-
238
- Then, only if earned: \`## How\` (1\u20132 sentences).
239
-
240
- **Closes line.** If the session or branch name gives an issue number, make it the first line, written \`Closes #123\` for a same-repo issue or \`Closes owner/repo#123\` for a cross-repo one. One \`Closes\` per issue. Nothing else goes above \`## What\`.
241
-
242
- **One section, one question.**
243
-
244
- | Section | Answers | Never contains |
245
- |---|---|---|
246
- | What | What is observably different for a user or caller | Function, file or component names; how it is built |
247
- | Why | The problem that made the change worth doing | Mechanism |
248
- | How | A non-obvious decision the diff cannot explain: a trade-off, a workaround, a rejected obvious approach | A walkthrough of the diff; a restatement of What |
270
+ Run \`yoke pr raise --help\` and follow it exactly. Do not use \`gh pr create\`.
249
271
 
250
- Litmus for mechanism: a sentence with "by \u2026ing", "so that it can", "because the X uses", or the name of an internal component, function or file belongs in How, and probably does not belong at all.
251
-
252
- **Brevity budget.** Hard caps enforced by \`yoke pr raise\`: What 300 characters, Why 200, How 250, and 600 across all sections. Ceilings, not targets. Prefer deleting a sentence to shortening it.
253
-
254
- **No per-file lists.** Never list changes file by file; the diff already shows that.
255
-
256
- **Register.** Write like a commit message. Short declarative sentences, present tense, active voice. Cut "this change", "in order to", "it is worth noting", hedges and adverbs.
257
-
258
- \`\`\`
259
- Wordy: This change introduces a confirmation step so that users are able to cancel before their results are reset.
260
- Terse: Retake asks for confirmation before resetting results.
261
- \`\`\`
262
-
263
- Prose, not bullets. Bullets only for 3 or more genuinely parallel items, and never in What.
264
-
265
- Backticks around symbols, commands and flags.
266
-
267
- The title and body never mention Claude, AI assistance or attribution. No \`Co-Authored-By\` or "Generated with" anywhere.
268
-
269
- ## Title
270
-
271
- One line, at most 70 characters, conventional-commit prefix as the repo uses (\`fix(scope): \u2026\`, \`feat(scope): \u2026\`, \`chore: \u2026\`). Says what changed for the user, not what files moved.
272
-
273
- ## Approval
274
-
275
- Mandatory in every permission mode, including auto-accept and bypass. Write the full title and body verbatim in your visible reply. Then call \`AskUserQuestion\` with an approve option whose \`preview\` holds the complete title and body, plus a revise option. Approval covers the push as well as the create. On revise, redraft and ask again.
276
-
277
- ## Create
278
-
279
- \`\`\`bash
280
- git push -u origin HEAD
281
- yoke pr raise --title "<title>" --body "$(cat <<'EOF'
282
- <body>
283
- EOF
284
- )"
285
- \`\`\`
286
-
287
- Always a draft; the user marks it ready for review themselves. If \`yoke pr raise\` rejects the description, it names each rule that failed: fix those, show the revised description, and get approval again before rerunning. On success it prints the PR URL; report it.
272
+ If \`yoke\` is not on PATH, stop and tell the user to run \`npm i -g @makerx/yoke\`.
288
273
  `
289
274
  };
290
275
 
@@ -314,7 +299,7 @@ function syncSkills(destination, skills = bundledSkills) {
314
299
 
315
300
  // src/cli.ts
316
301
  var { version } = package_default;
317
- var program = new Command("yoke").description("Lean, user-invoked Claude Code skills and the CLI they call.").version(version);
302
+ var program = new Command("yoke").description("Lean Claude Code skills and the CLI they call.").version(version);
318
303
  program.command("sync").description("Write yoke's skills into this repo's .claude/skills, or ~/.claude/skills with --user").option("--user", "write to ~/.claude/skills instead, for every repo").action((options) => {
319
304
  const user = options.user ?? false;
320
305
  const display = (path) => user ? path : relative(process.cwd(), path);
@@ -323,7 +308,7 @@ program.command("sync").description("Write yoke's skills into this repo's .claud
323
308
  for (const dir of skipped) console.log(`skipped ${display(dir)} (your own skill; delete it to take yoke's)`);
324
309
  });
325
310
  var pr = program.command("pr").description("Pull request commands");
326
- pr.command("raise").description("Validate a PR title and body, then create the PR with gh").requiredOption("--title <title>", "single-line PR title").requiredOption("--body <body>", "PR body with ## What, ## Why and optionally ## How").option("--base <branch>", "base branch (defaults to the repo default)").option("--no-draft", "create a ready-for-review PR instead of a draft").action((options) => {
311
+ pr.command("raise").description("Validate a PR title and body, then create the PR with gh").requiredOption("--title <title>", "single-line PR title").requiredOption("--body <body>", "PR body with ## What, ## Why and optionally ## How").option("--base <branch>", "base branch (defaults to the repo default)").option("--no-draft", "create a ready-for-review PR instead of a draft").addHelpText("after", raiseGuide).action((options) => {
327
312
  try {
328
313
  console.log(raisePr(options));
329
314
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makerx/yoke",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "Lean, user-invoked Claude Code skills for MakerX AI-assisted delivery, plus the CLI they call.",
5
5
  "license": "MIT",
6
6
  "author": "MakerX",