codeassembly-guidance 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.
- package/.meta/changelog.json +984 -0
- package/CHANGELOG.md +240 -0
- package/README.md +45 -99
- package/bin/codeassembly-validate-preferences.js +18 -0
- package/content/_partials/README.md +21 -5
- package/content/_partials/comment-discipline.md +1 -1
- package/content/_partials/diff-audit-checklist.md +1 -0
- package/content/_partials/kb-standard-tags.md +7 -0
- package/content/_partials/plain-speech-calibration.md +4 -0
- package/content/_partials/technical-recommendations.md +1 -0
- package/content/codeassembly-content.yaml +17 -1
- package/content/collections/all.md +2 -2
- package/content/collections/atlassian.md +2 -1
- package/content/collections/recommended.md +9 -2
- package/content/collections/triage.md +3 -67
- package/content/collections/williamthorsen.md +2 -1
- package/content/guidance/README.md +1 -1
- package/content/guidance/rulebooks/accessibility-conventions.md +23 -5
- package/content/guidance/rulebooks/cli-conventions.md +206 -0
- package/content/guidance/rulebooks/codeassembly-content-specification.md +50 -10
- package/content/guidance/rulebooks/commit-conventions.md +5 -4
- package/content/guidance/rulebooks/live-worktree-policy.md +3 -2
- package/content/guidance/rulebooks/readme-conventions.md +3 -3
- package/content/guidance/rulebooks/shared-data-conventions.md +2 -2
- package/content/guidance/rulebooks/shell-conventions.md +17 -23
- package/content/guidance/rulebooks/ui-copy-conventions.md +34 -0
- package/content/guidance/rulebooks/williamthorsen-collaboration-preferences.md +18 -12
- package/content/guidance/rulebooks/williamthorsen-ticketing-preferences.md +3 -3
- package/content/guidance/rulebooks/williamthorsen-tooling-preferences.md +6 -6
- package/content/guidance/rulebooks/williamthorsen-typescript-preferences.md +1 -1
- package/content/guidance/rulebooks/williamthorsen-workflow-preferences.md +7 -7
- package/content/guidance/rulebooks/williamthorsen-writing-preferences.md +28 -1
- package/content/guidance/shared/AGENTS.md +39 -4
- package/content/scripts/README.md +5 -2
- package/content/scripts/check-branch-currency.mjs +11 -0
- package/content/scripts/check-prose.mjs +171 -0
- package/content/scripts/describe-change.mjs +98 -98
- package/content/scripts/manage-jira-ticket.mjs +99 -94
- package/content/scripts/resolve-frontmatter.sh +1 -1
- package/content/scripts/resolve-review-run.mjs +9 -9
- package/content/scripts/select-lede-exemplars.mjs +87 -87
- package/content/scripts/validate-preferences.mjs +146 -0
- package/content/skills/_data/action-items.md +2 -0
- package/content/skills/_data/artifact-conventions.md +64 -16
- package/content/skills/_data/branch-currency.md +36 -0
- package/content/skills/_data/change-record.md +2 -2
- package/content/skills/_data/complexity-classification.md +1 -1
- package/content/skills/_data/design-priorities.md +15 -4
- package/content/skills/_data/project-stage.md +32 -0
- package/content/skills/_data/recommendation-gradient.md +9 -7
- package/content/skills/_data/scope-and-deferral.md +1 -1
- package/content/skills/_data/spike-conventions.md +21 -6
- package/content/skills/_data/ticket-evaluation.md +2 -2
- package/content/skills/_data/ticket-source-resolution.md +36 -3
- package/content/skills/_data/title-templates.md +22 -12
- package/content/skills/_partials/action-items.md +2 -2
- package/content/skills/_partials/apply-guidance-edits.md +5 -0
- package/content/skills/_partials/commit-title-rendering.md +1 -1
- package/content/skills/_partials/jira-task-list-flattening.md +1 -0
- package/content/skills/_partials/next-steps-after-plan.md +11 -11
- package/content/skills/_partials/option-format.md +18 -17
- package/content/skills/_partials/plan-template.md +7 -5
- package/content/skills/_partials/split-ticket-compose.md +1 -1
- package/content/skills/_partials/split-ticket-create.md +1 -1
- package/content/skills/_partials/ticket-and-plan-completeness.md +2 -2
- package/content/skills/_partials/ticket-composition.md +40 -0
- package/content/skills/_partials/ticket-criteria-conventions.md +3 -3
- package/content/skills/_partials/ticket-skeleton.md +15 -1
- package/content/skills/add-change-record/SKILL.md +2 -2
- package/content/skills/align-ticket-with-implementation/SKILL.md +3 -7
- package/content/skills/anti-patterns/SKILL.md +1 -1
- package/content/skills/assess-code-health/SKILL.md +127 -0
- package/content/skills/assess-code-health/assess-code-health.mjs +77 -0
- package/content/skills/assess-usability/SKILL.md +98 -0
- package/content/skills/capture-event/SKILL.md +4 -2
- package/content/skills/capture-event/capture-event.mjs +89 -89
- package/content/skills/capture-feedback/SKILL.md +1 -1
- package/content/skills/capture-lede-decision/SKILL.md +4 -4
- package/content/skills/capture-lede-decision/capture-lede-decision.mjs +98 -98
- package/content/skills/collaborate/SKILL.md +3 -3
- package/content/skills/create-bitbucket-pr/SKILL.md +2 -1
- package/content/skills/create-commit/SKILL.md +1 -1
- package/content/skills/create-gh-pr/SKILL.md +28 -10
- package/content/skills/create-pr/SKILL.md +7 -6
- package/content/skills/create-ticket/SKILL.md +64 -23
- package/content/skills/create-ticket/resolve-ticket-target.mjs +143 -0
- package/content/skills/derive-session-context/derive-session-context.mjs +83 -82
- package/content/skills/design-and-plan/SKILL.md +17 -18
- package/content/skills/groom-backlog/SKILL.md +8 -6
- package/content/skills/groom-backlog/groom-backlog.mjs +64 -62
- package/content/skills/implement-plan/SKILL.md +27 -23
- package/content/skills/index-prototypes/SKILL.md +86 -31
- package/content/skills/index-prototypes/index-prototypes.mjs +76 -16
- package/content/skills/kb-add/SKILL.md +4 -1
- package/content/skills/kb-add/kb-add.mjs +128 -128
- package/content/skills/kb-curate/SKILL.md +9 -7
- package/content/skills/kb-curate/kb-curate.mjs +103 -103
- package/content/skills/kb-edit/SKILL.md +5 -3
- package/content/skills/kb-edit/kb-edit.mjs +94 -94
- package/content/skills/kb-retrieve/kb-retrieve.mjs +86 -85
- package/content/skills/kb-retrieve-events/SKILL.md +20 -11
- package/content/skills/kb-retrieve-events/kb-retrieve-events.mjs +86 -85
- package/content/skills/kb-update-events/SKILL.md +10 -7
- package/content/skills/kb-update-events/kb-update-events.mjs +110 -109
- package/content/skills/lesson-clusters/lesson-clusters.mjs +209 -0
- package/content/skills/merge-bb-pr/SKILL.md +1 -1
- package/content/skills/merge-gh-pr/merge-gh-pr.mjs +5 -5
- package/content/skills/merge-pr/SKILL.md +11 -11
- package/content/skills/migrate-feedback-memories/SKILL.md +3 -2
- package/content/skills/migrate-feedback-memories/feedback-memories.mjs +76 -76
- package/content/skills/plan/SKILL.md +2 -2
- package/content/skills/prepare-prototype-brief/SKILL.md +66 -14
- package/content/skills/pull-from-backlog/SKILL.md +3 -3
- package/content/skills/pull-from-backlog/pull-from-backlog.mjs +83 -82
- package/content/skills/refine-guidance/SKILL.md +97 -0
- package/content/skills/refine-plan/SKILL.md +7 -3
- package/content/skills/refine-prototype/SKILL.md +113 -0
- package/content/skills/respond-to-review/SKILL.md +1 -1
- package/content/skills/review-bb-pr/SKILL.md +1 -1
- package/content/skills/review-branch/SKILL.md +354 -3
- package/content/skills/review-criteria/SKILL.md +36 -3
- package/content/skills/review-gh-pr/select-pr-ticket.mjs +6 -6
- package/content/skills/revise-comments/SKILL.md +38 -5
- package/content/skills/revise-prose/SKILL.md +1 -1
- package/content/skills/revise-prose/revise-prose.mjs +119 -119
- package/content/skills/save-artifact/SKILL.md +3 -1
- package/content/skills/streamline-guidance/SKILL.md +11 -16
- package/content/skills/streamline-guidance/streamline-guidance.mjs +86 -86
- package/content/skills/summarize-change/SKILL.md +23 -14
- package/content/skills/testing-conventions/SKILL.md +81 -8
- package/content/skills/triage-feedback/SKILL.md +150 -0
- package/content/skills/triage-feedback/triage-feedback.mjs +70 -0
- package/content/skills/triage-spike-findings/SKILL.md +113 -0
- package/content/skills/triage-spike-findings/triage-spike-findings.mjs +73 -0
- package/content/skills/typescript-testing-conventions/SKILL.md +50 -1
- package/content/skills/update-jira-ticket/SKILL.md +20 -8
- package/content/skills/update-jira-ticket/update-jira-ticket.mjs +7 -7
- package/content/skills/update-project-guidance/SKILL.md +12 -12
- package/content/subagents/_data/claude.yaml +6 -0
- package/content/subagents/_data/rovo.yaml +12 -2
- package/content/subagents/canary.md +2 -1
- package/content/subagents/code-health-assessor.md +98 -0
- package/content/subagents/disposition-challenger.md +78 -0
- package/content/subagents/entry-drafter.md +14 -10
- package/content/subagents/feedback-triage-challenger.md +81 -0
- package/content/subagents/handoff-reviewer.md +2 -2
- package/content/subagents/lesson-clusterer.md +68 -0
- package/content/subagents/plan-reviewer.md +1 -1
- package/content/subagents/prose-reviser.md +4 -2
- package/content/subagents/ticket-assessor.md +9 -6
- package/content/subagents/usability-assessor.md +157 -0
- package/package.json +21 -17
- package/schemas/preferences.v1.json +50 -7
- package/schemas/work-types.v1.json +1 -1
- package/content/_partials/code-descriptions.md +0 -4
- package/content/_partials/code-style.md +0 -7
- package/content/_partials/live-repo-writes.md +0 -13
- package/content/_partials/reduced-object-relative.md +0 -28
- package/content/_partials/test-structure-audit-checklist.md +0 -7
- package/content/skills/_partials/acceptance-criteria-scaffold.md +0 -15
- package/content/skills/_partials/next-steps-after-review.md +0 -350
- package/content/skills/_partials/ticket-concision.md +0 -18
- package/content/skills/_partials/ticket-placement.md +0 -14
- package/content/skills/_partials/ticket-skeleton-tiers.md +0 -6
- package/content/skills/testing-conventions/mistakes.md +0 -1
|
@@ -23,7 +23,7 @@ Internal delegate that merges a pull request on Bitbucket. Called by `merge-pr`
|
|
|
23
23
|
|
|
24
24
|
## Bitbucket access
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Make every Bitbucket call below with the tool named in [Bitbucket pull-request access](../_data/bitbucket-pr-access.md). Coordinates come from that document's cascade: the PR URL when `merge-pr` resolved one, and the git remote when it was handed a bare `--pr {n}` instead.
|
|
27
27
|
|
|
28
28
|
## Process
|
|
29
29
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire as __cjsCreateRequire } from 'node:module';
|
|
2
2
|
const require = __cjsCreateRequire(import.meta.url);
|
|
3
|
-
var
|
|
4
|
-
${n.
|
|
3
|
+
var M=Object.defineProperty;var o=(e,t)=>M(e,"name",{value:t,configurable:!0});import{execFile as v}from"node:child_process";import{readFileSync as O,statSync as G}from"node:fs";import d from"node:process";import{promisify as j}from"node:util";function m(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}o(m,"isError");function g(e){try{return m(e)&&typeof e.message=="string"&&e.message!==""?e.message:String(e)}catch{return"[unstringifiable value]"}}o(g,"describeError");import{realpathSync as p}from"node:fs";import y from"node:process";import{fileURLToPath as $}from"node:url";function h(e,t){let r=y.argv[1];if(r===void 0)return!1;try{return p($(e))===p(r)}catch(n){return y.stderr.write(`${t}: warning: could not determine entry point: ${g(n)}
|
|
4
|
+
`),!0}}o(h,"isEntryPoint");function b(e,t){let r=[],n=[];for(let i=0;i<e.length;i+=1){let s=e[i];if(s===void 0)continue;if(!s.startsWith("--")){r.push(s);continue}let a=P(s,t);if(a===null)throw new Error(`unknown flag: ${s}`);let{spec:u,inlineValue:f}=a;if(!u.takesValue){if(f!==null)throw new Error(`--${u.name} does not take a value`);n.push({name:u.name,value:null});continue}if(f!==null){n.push({name:u.name,value:f});continue}let c=e[i+1]??null;if(c===null||c.startsWith("--"))throw new Error(`--${u.name} requires a value`);n.push({name:u.name,value:c}),i+=1}return{positionals:r,flags:n}}o(b,"scanFlags");function w(e){let t={};for(let{name:r,value:n}of e)n!==null&&(t[r]=n);return t}o(w,"valueFlagMap");function P(e,t){for(let r of t)for(let n of[r.name,...r.aliases??[]]){let i=`--${n}`;if(e===i)return{spec:r,inlineValue:null};if(e.startsWith(`${i}=`))return{spec:r,inlineValue:e.slice(i.length+1)}}return null}o(P,"matchFlag");function C(e,t){return x(e)&&e.code===t}o(C,"isErrorCode");function R(e){return C(e,"ENOENT")}o(R,"isEnoent");function l(e){return x(e)&&!Array.isArray(e)}o(l,"isRecord");function x(e){return typeof e=="object"&&e!==null}o(x,"isObject");var V="state,mergeCommit,url,mergedAt,headRefName,headRepository,headRepositoryOwner";async function N(e,t){let r=await t(A(e));if(r.exitCode!==0)return{ok:!1,exitCode:r.exitCode,stderr:r.stderr};let n=await t(["pr","view",String(e.prNumber),"--json",V]);if(n.exitCode!==0)return{ok:!1,exitCode:n.exitCode,stderr:`PR #${e.prNumber} merge ran, but its state could not be read; branch not deleted.
|
|
5
|
+
${n.stderr}`};let i=T(n.stdout);if(i.kind==="unreadable")return{ok:!1,exitCode:1,stderr:`PR #${e.prNumber} merge ran, but its state could not be read; branch not deleted.
|
|
5
6
|
`};if(i.kind==="not-merged")return{ok:!1,exitCode:1,stderr:`PR #${e.prNumber} is ${i.state} after merge; branch not deleted.
|
|
6
|
-
`};let s=[];return{ok:!0,result:{branchDeletion:await
|
|
7
|
+
`};let s=[];return{ok:!0,result:{branchDeletion:await D(e.deletionStrategy,i,t,s),headRefName:i.headRefName,mergeCommit:{oid:i.oid},mergedAt:i.mergedAt,url:i.url},warnings:s}}o(N,"mergePullRequest");function A(e){let t=["pr","merge",String(e.prNumber),`--${e.strategy}`];return e.strategy==="squash"&&e.title!==void 0&&t.push("--subject",e.title),e.strategy!=="rebase"&&e.bodyPath!==void 0&&t.push("--body-file",e.bodyPath),e.deletionStrategy==="both"&&t.push("--delete-branch"),t}o(A,"buildMergeArgs");async function D(e,t,r,n){if(e==="none")return"not-requested";if(e==="both")return"by-gh";if(t.headOwner===void 0||t.headRepo===void 0)return"already-deleted";let i=t.headRefName.split("/").map(encodeURIComponent).join("/"),s=`repos/${encodeURIComponent(t.headOwner)}/${encodeURIComponent(t.headRepo)}/git/refs/heads/${i}`,a=await r(["api","-X","DELETE",s]);return a.exitCode===0?"deleted":a.stderr.includes("HTTP 422")&&a.stderr.includes("Reference does not exist")?"already-deleted":(n.push(`warning: Failed to delete remote branch '${t.headRefName}': ${a.stderr.trim()}`),"failed")}o(D,"deleteHeadBranch");function T(e){let t;try{t=JSON.parse(e)}catch{return{kind:"unreadable"}}if(!l(t)||typeof t.state!="string")return{kind:"unreadable"};if(t.state!=="MERGED")return{kind:"not-merged",state:t.state};let{headRefName:r,mergeCommit:n,mergedAt:i,url:s}=t,a=l(n)?n.oid:void 0;return typeof r!="string"||typeof i!="string"||typeof a!="string"||typeof s!="string"?{kind:"unreadable"}:{kind:"merged",headOwner:E(t.headRepositoryOwner,"login"),headRefName:r,headRepo:E(t.headRepository,"name"),mergedAt:i,oid:a,url:s}}o(T,"parseMergedView");function E(e,t){if(!l(e))return;let r=e[t];return typeof r=="string"&&r.length>0?r:void 0}o(E,"readNamedField");var q=j(v),I=[{name:"body-file",takesValue:!0},{name:"delete",takesValue:!0},{name:"pr",takesValue:!0},{name:"strategy",takesValue:!0},{name:"title-file",takesValue:!0}],B=["both","none","remote"],L=["merge","rebase","squash"];async function U(){try{let e=_(W(d.argv.slice(2))),t=await N(e,J);t.ok||(d.stderr.write(t.stderr),d.exit(t.exitCode));for(let r of t.warnings)d.stderr.write(`${r}
|
|
7
8
|
`);d.stdout.write(`${JSON.stringify(t.result,null,2)}
|
|
8
9
|
`)}catch(e){d.stderr.write(`merge-gh-pr: ${g(e)}
|
|
9
|
-
`),d.exit(1)}}o(
|
|
10
|
-
`),!1}}o(L,"isEntryPoint");function N(e){try{let t=T(e);return t.isFile()&&t.size>0}catch{return!1}}o(N,"isNonEmptyFile");function U(e){let{flags:t,positionals:r}=p(e,j);if(r.length>0)throw new Error(`unexpected argument: ${r.join(" ")}`);let n=y(t),i=S(n,"pr");if(!/^[1-9]\d*$/.test(i))throw new Error(`--pr must be a positive integer, got '${i}'`);return{bodyFile:n["body-file"],deletionStrategy:E(n,"delete",q),prNumber:Number(i),strategy:E(n,"strategy",I),titleFile:n["title-file"]}}o(U,"parseArgs");function W(e){let t=e.strategy!=="rebase",r=e.strategy==="squash",n;if(r&&(n=_(e.titleFile)),t){if(e.bodyFile===void 0)throw new Error(`--body-file is required for --strategy ${e.strategy}`);if(!N(e.bodyFile))throw new Error(`Body file missing or empty: ${e.bodyFile}`)}return{bodyPath:t?e.bodyFile:void 0,deletionStrategy:e.deletionStrategy,prNumber:e.prNumber,strategy:e.strategy,title:n}}o(W,"readRequest");function _(e){if(e===void 0)throw new Error("--title-file is required for --strategy squash");if(!N(e))throw new Error(`Title file missing or empty: ${e}`);let t=D(e,"utf8").replace(/\r?\n$/,"");if(t.length===0)throw new Error(`Title file missing or empty: ${e}`);return t}o(_,"readTitle");function E(e,t,r){let n=S(e,t),i=r.find(s=>s===n);if(i===void 0)throw new Error(`--${t} must be one of ${r.join(", ")}, got '${n}'`);return i}o(E,"requireMember");function S(e,t){let r=e[t];if(r===void 0)throw new Error(`--${t} is required`);return r}o(S,"requireValue");async function H(e){try{let{stderr:t,stdout:r}=await G("gh",e,{maxBuffer:16777216});return{exitCode:0,stderr:t,stdout:r}}catch(t){if(h(t))throw new Error("gh is not installed or not on PATH",{cause:t});if(u(t)&&typeof t.code=="number"&&typeof t.stderr=="string"&&typeof t.stdout=="string")return{exitCode:t.code,stderr:t.stderr,stdout:t.stdout};throw t}}o(H,"runGh");
|
|
10
|
+
`),d.exit(1)}}o(U,"main");h(import.meta.url,"merge-gh-pr")&&await U();function k(e){try{let t=G(e);return t.isFile()&&t.size>0}catch{return!1}}o(k,"isNonEmptyFile");function W(e){let{flags:t,positionals:r}=b(e,I);if(r.length>0)throw new Error(`unexpected argument: ${r.join(" ")}`);let n=w(t),i=F(n,"pr");if(!/^[1-9]\d*$/.test(i))throw new Error(`--pr must be a positive integer, got '${i}'`);return{bodyFile:n["body-file"],deletionStrategy:S(n,"delete",B),prNumber:Number(i),strategy:S(n,"strategy",L),titleFile:n["title-file"]}}o(W,"parseArgs");function _(e){let t=e.strategy!=="rebase",r=e.strategy==="squash",n;if(r&&(n=H(e.titleFile)),t){if(e.bodyFile===void 0)throw new Error(`--body-file is required for --strategy ${e.strategy}`);if(!k(e.bodyFile))throw new Error(`Body file missing or empty: ${e.bodyFile}`)}return{bodyPath:t?e.bodyFile:void 0,deletionStrategy:e.deletionStrategy,prNumber:e.prNumber,strategy:e.strategy,title:n}}o(_,"readRequest");function H(e){if(e===void 0)throw new Error("--title-file is required for --strategy squash");if(!k(e))throw new Error(`Title file missing or empty: ${e}`);let t=O(e,"utf8").replace(/\r?\n$/,"");if(t.length===0)throw new Error(`Title file missing or empty: ${e}`);return t}o(H,"readTitle");function S(e,t,r){let n=F(e,t),i=r.find(s=>s===n);if(i===void 0)throw new Error(`--${t} must be one of ${r.join(", ")}, got '${n}'`);return i}o(S,"requireMember");function F(e,t){let r=e[t];if(r===void 0)throw new Error(`--${t} is required`);return r}o(F,"requireValue");async function J(e){try{let{stderr:t,stdout:r}=await q("gh",e,{maxBuffer:16777216});return{exitCode:0,stderr:t,stdout:r}}catch(t){if(R(t))throw new Error("gh is not installed or not on PATH",{cause:t});if(l(t)&&typeof t.code=="number"&&typeof t.stderr=="string"&&typeof t.stdout=="string")return{exitCode:t.code,stderr:t.stderr,stdout:t.stdout};throw t}}o(J,"runGh");
|
|
@@ -109,7 +109,7 @@ The helper prints one JSON object. Read it from the command's output, with pytho
|
|
|
109
109
|
|
|
110
110
|
The overrides passed to this run are the merge's **override set**. Each later run of this step, for a choice at the gate or for step 8's re-read, passes the whole set with that run's addition, and the same `--head`.
|
|
111
111
|
|
|
112
|
-
**When the first run's `notices` contains `absent-block`, offer to add the block, if this checkout can draft it.** The pull request does not contain a change record, so the merge would not publish any change entries. `{skill:add-change-record}` drafts the entries from `{default_branch}...HEAD`, and refuses when HEAD is not the pull request's head commit
|
|
112
|
+
**When the first run's `notices` contains `absent-block`, offer to add the block, if this checkout can draft it.** The pull request does not contain a change record, so the merge would not publish any change entries. `{skill:add-change-record}` drafts the entries from `{default_branch}...HEAD`, and refuses when HEAD is not the pull request's head commit. Read the local head before offering:
|
|
113
113
|
|
|
114
114
|
```bash
|
|
115
115
|
git rev-parse HEAD
|
|
@@ -180,11 +180,11 @@ Do not audit the draft here: The user reads the published body at the approval g
|
|
|
180
180
|
|
|
181
181
|
### 6. Approval gate
|
|
182
182
|
|
|
183
|
-
Settle every item in `defects` before showing the proposal. Settle the entry defects first, in entry order: Amending an entry can change the effective record, and with it the record's own defects. Decide each type and each marker by the test below and the type's `breakingPolicy`, never by asking which to choose: This session
|
|
183
|
+
Settle every item in `defects` before showing the proposal. Settle the entry defects first, in entry order: Amending an entry can change the effective record, and with it the record's own defects. Decide each type and each marker by the test below and the type's `breakingPolicy`, never by asking which to choose: This session has the diff, the sources, and the test, and the gate's title shows the result before the merge.
|
|
184
184
|
|
|
185
185
|
**An entry defect** (one that names an `entry`) is settled by amending that entry in the PR body, because an override changes only the effective record, and the merge block would still publish the entry as it stands. Decide each amendment: For an `undeclared-type`, the type that the test below assigns to the entry's own text; for a `policy-violation`, the same test's type, with the marker kept when that type's `breakingPolicy` permits it and dropped otherwise. The amendments rewrite the PR body, which is remote shared state, so ask once to authorize all of them: Quote each entry's `text` from `sources.block.entries`, name its defect, and state the decided type or marker with its reason in one line. A no is a redirect, not a request for a menu: Take the type or marker that the developer names in place of the decided one.
|
|
186
186
|
|
|
187
|
-
On approval, re-read the PR body into a fresh scratch file as step 3 writes one, named `gh-body-pr{number}-amend-{timestamp}.md`: from the platform on GitHub, and on Bitbucket from a fresh read of the description through step 2's platform dispatch.
|
|
187
|
+
On approval, re-read the PR body into a fresh scratch file as step 3 writes one, named `gh-body-pr{number}-amend-{timestamp}.md`: from the platform on GitHub, and on Bitbucket from a fresh read of the description through step 2's platform dispatch. Because the approval is human-paced, the copy that step 3 read can be older than the PR, and writing it back would discard an edit made while the ask was pending. Then amend each entry in that file, opening each call with the assignment and the guard. Pass `--type` when the amendment changes the type, and `--breaking` or `--no-breaking` when it changes the marker:
|
|
188
188
|
|
|
189
189
|
```bash
|
|
190
190
|
body_path="{absolute path from the re-read}"
|
|
@@ -200,7 +200,7 @@ The helper rewrites the file in place and refuses an amendment that would leave
|
|
|
200
200
|
- **`"github"`**: `gh pr edit {number} --body-file "$body_path"`, in a call that opens with the same assignment and guard.
|
|
201
201
|
- **`"bitbucket"`**: [Bitbucket pull-request access](../_data/bitbucket-pr-access.md) does not document a description-write action. Stop, showing the amended `change-record` block from the body file and saying that the author pastes it over the description's block in the Bitbucket UI, then runs the merge again.
|
|
202
202
|
|
|
203
|
-
Then re-run step 3 with the same override set and the same `--head`. Its fresh read of the body confirms that the
|
|
203
|
+
Then re-run step 3 with the same override set and the same `--head`. Its fresh read of the body confirms that the PR contains the amendment.
|
|
204
204
|
|
|
205
205
|
**A defect of the effective record** is settled by an override, which changes nothing outside this run, so decide it without an ask and state the decision in one line with its reason:
|
|
206
206
|
|
|
@@ -211,7 +211,7 @@ Decide each type by applying this test to the change, whether the diff or an ent
|
|
|
211
211
|
|
|
212
212
|
<!-- include: ../../_partials/work-type-choice.md / -->
|
|
213
213
|
|
|
214
|
-
Apply the test to the diff whether or not `defects`
|
|
214
|
+
Apply the test to the diff whether or not `defects` contains an item. Commits, labels, and a PR title that agree can agree on one wrong type, which does not raise a defect, and the merge title would then publish that type. When the test's type differs from the effective record's, add `--override-type` with the test's type to the override set and state the decision in one line with its reason; when they agree, report nothing, here or at the gate.
|
|
215
215
|
|
|
216
216
|
A type that the developer named, through `--type` or in an answer at the gate, stands: Never replace it with the test's type, here or in a record defect above: The gate shows the type so that the developer can correct it, and replacing the correction leaves the developer unable to merge under it. When the test disagrees with it, state the disagreement in one line at the gate and change nothing.
|
|
217
217
|
|
|
@@ -246,12 +246,12 @@ Proposed merge for PR #{pr_number}:
|
|
|
246
246
|
Render each notice there as one line. When a line says where a field came from, name the source that `effective_sources` gives for that field:
|
|
247
247
|
|
|
248
248
|
- **`absent-block`**: The PR does not contain a `change-record` block, so the merge does not publish any change entries, and the effective record comes from the sources that `effective_sources` names field by field.
|
|
249
|
-
- **`malformed-block`**:
|
|
250
|
-
- **`commits-unavailable`**: The commits were not read (its `reason`)
|
|
249
|
+
- **`malformed-block`**: Because the PR's `change-record` block cannot be read (its `defect`), the labels and the commits resolved the effective record.
|
|
250
|
+
- **`commits-unavailable`**: The commits were not read (its `reason`). When the block does not record any entries, the effective record comes from the labels alone.
|
|
251
251
|
- **`pr-title-divergence`**: The PR title's prefix differs from the proposal on the fields that the notice's `fields` lists. Name the prefix's values for those fields, read from `sources.pr_title`.
|
|
252
|
-
- **`pr-title-unparsed`**: The PR title did not parse
|
|
253
|
-
- **`malformed-entries`**:
|
|
254
|
-
- **`stale-entries`**: The block's entries were derived at the commit that the notice's `entries_commit` names, `null` when the block records none, and not at the head that its `head_commit` names
|
|
252
|
+
- **`pr-title-unparsed`**: The PR title did not parse. The title comes from the source that `effective_sources.title` names.
|
|
253
|
+
- **`malformed-entries`**: Because the block's entry list cannot be read (its `defect`), the block does not record any entries, and the labels and the commits resolved the base record. Its title and overrides still stand.
|
|
254
|
+
- **`stale-entries`**: The block's entries were derived at the commit that the notice's `entries_commit` names, `null` when the block records none, and not at the head that its `head_commit` names. Commits pushed since then may not be described by the entries, whose record still stands.
|
|
255
255
|
|
|
256
256
|
**A `stale-entries` notice is reported and nothing is re-derived.**
|
|
257
257
|
|
|
@@ -293,7 +293,7 @@ If the new report contains a defect, return to step 6 and settle it before compa
|
|
|
293
293
|
|
|
294
294
|
The lede comparison keys on the report's `body` rather than on the composed lede because step 5's thin-lede fallback composes fresh prose, which does not reproduce word for word from one run to the next. Comparing composed output would report a change on every pass, and the loop below would never reach a fixed point. The helper's extraction is deterministic, so it has one. Keying on the `## What` section rather than on the whole description also means an edit confined to another section raises nothing, which is correct: Nothing outside `## What` appears in the merge commit.
|
|
295
295
|
|
|
296
|
-
The merge block takes a comparison of its own because `body` excludes the `change-record` block: An edit confined to that block leaves `body` identical while changing what the merge publishes, and `merge_title` catches only the subset of such edits that move the record ranked from the entries. `merge_block` is rendered by the helper rather than drafted,
|
|
296
|
+
The merge block takes a comparison of its own because `body` excludes the `change-record` block: An edit confined to that block leaves `body` identical while changing what the merge publishes, and `merge_title` catches only the subset of such edits that move the record ranked from the entries. Because `merge_block` is rendered by the helper rather than drafted, comparing it has the fixed point that the lede comparison needs `body` to supply.
|
|
297
297
|
|
|
298
298
|
The window that this step closes is an edit to the PR's title or description. New commits pushed to the branch are not in scope: The re-run reads the commits up to the head commit read in step 2, and a generated body is not recomposed on account of later commits. The delegate's own branch-sync check reports local and remote divergence.
|
|
299
299
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: migrate-feedback-memories
|
|
3
|
-
description:
|
|
3
|
+
description: Dispose of this machine's per-project feedback memories (capture the propagating ones as capture-feedback candidates, delete the redundant, retain the genuinely local) via a bundled enumerator with a confirm-by-default batch flow and an --auto escape hatch
|
|
4
|
+
standalone: wanted once per machine, too rarely to justify a standing skill-index line
|
|
4
5
|
user-invocable: true
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# Migrate feedback memories
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
Decide where every `feedback`-type agent memory on this machine belongs, and move it there. A bundled helper does the mechanical work: It enumerates feedback memories across every memory store, and executes deletions with `MEMORY.md` reconciliation. You do the judgment work: Classify each memory, dedup capture candidates against the knowledge base, and compose each capture.
|
|
10
11
|
|
|
11
12
|
A **memory store** is one project's memory directory under `~/.claude/projects/`. It is not a **KB store** (the `~/.agents/kb.yaml` registry entry that `capture-event` and the `kb-*` skills select with `--store`). This procedure uses both: The helper's `--memory-store` names the origin (step 1), and `capture-event`'s `--store` names the destination (step 5).
|
|
12
13
|
|