@makerx/yoke 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.
Files changed (2) hide show
  1. package/dist/cli.js +74 -78
  2. package/package.json +1 -1
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.2.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
 
@@ -208,83 +278,9 @@ var prSkill = {
208
278
  name: "pr",
209
279
  description: "Raise a PR with a concise What/Why/(How) description",
210
280
  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 |
281
+ Run \`yoke pr raise --help\` and follow it exactly. Do not use \`gh pr create\`.
249
282
 
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.
283
+ If \`yoke\` is not on PATH, stop and tell the user to run \`npm i -g @makerx/yoke\`.
288
284
  `
289
285
  };
290
286
 
@@ -323,7 +319,7 @@ program.command("sync").description("Write yoke's skills into this repo's .claud
323
319
  for (const dir of skipped) console.log(`skipped ${display(dir)} (your own skill; delete it to take yoke's)`);
324
320
  });
325
321
  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) => {
322
+ 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
323
  try {
328
324
  console.log(raisePr(options));
329
325
  } 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.2.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",