codeassembly-guidance 0.7.0 → 0.8.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 (101) hide show
  1. package/.meta/changelog.json +261 -0
  2. package/CHANGELOG.md +62 -0
  3. package/README.md +47 -29
  4. package/bin/codeassembly-validate-preferences.js +2 -8
  5. package/content/_partials/diff-audit-checklist.md +1 -0
  6. package/content/_partials/plain-speech.md +2 -2
  7. package/content/_partials/ticket-assessment.md +3 -3
  8. package/content/codeassembly-content.yaml +6 -0
  9. package/content/collections/recommended.md +6 -0
  10. package/content/collections/williamthorsen.md +2 -1
  11. package/content/guidance/rulebooks/accessibility-conventions.md +6 -3
  12. package/content/guidance/rulebooks/cross-repo-migration-conventions.md +27 -0
  13. package/content/guidance/rulebooks/ui-copy-conventions.md +2 -2
  14. package/content/guidance/rulebooks/visual-design-conventions.md +58 -0
  15. package/content/guidance/rulebooks/williamthorsen-collaboration-preferences.md +3 -18
  16. package/content/guidance/rulebooks/williamthorsen-ticketing-preferences.md +6 -2
  17. package/content/guidance/rulebooks/williamthorsen-visual-design-preferences.md +14 -0
  18. package/content/guidance/rulebooks/williamthorsen-workflow-preferences.md +5 -3
  19. package/content/guidance/rulebooks/williamthorsen-writing-preferences.md +5 -20
  20. package/content/guidance/shared/AGENTS.md +2 -3
  21. package/content/scripts/README.md +1 -1
  22. package/content/scripts/check-branch-currency.mjs +7 -7
  23. package/content/scripts/check-prose.mjs +38 -38
  24. package/content/scripts/describe-change.mjs +32 -32
  25. package/content/scripts/manage-jira-ticket.mjs +148 -146
  26. package/content/scripts/validate-preferences.mjs +9 -9
  27. package/content/skills/_data/artifact-conventions.md +3 -3
  28. package/content/skills/_data/entry-points.md +1 -1
  29. package/content/skills/_data/reduced-object-relatives.md +15 -0
  30. package/content/skills/_data/spike-conventions.md +9 -2
  31. package/content/skills/_data/ticket-evaluation.md +3 -0
  32. package/content/skills/_partials/implementation-order-list.md +4 -4
  33. package/content/skills/_partials/merge-settled-criterion.md +1 -0
  34. package/content/skills/_partials/plan-template.md +1 -1
  35. package/content/skills/_partials/resolve-plan-and-ticket.md +2 -2
  36. package/content/skills/_partials/split-ticket-create.md +1 -1
  37. package/content/skills/_partials/ticket-criteria-conventions.md +2 -0
  38. package/content/skills/align-ticket-with-implementation/SKILL.md +2 -2
  39. package/content/skills/analyze-performance/SKILL.md +1 -1
  40. package/content/skills/assess-code-health/SKILL.md +4 -4
  41. package/content/skills/assess-code-health/assess-code-health.mjs +20 -20
  42. package/content/skills/assess-ticket/SKILL.md +3 -1
  43. package/content/skills/assess-ticket/next-steps-after-assessment.md +11 -14
  44. package/content/skills/assess-usability/SKILL.md +4 -4
  45. package/content/skills/capture-event/capture-event.mjs +30 -30
  46. package/content/skills/capture-lede-decision/SKILL.md +1 -1
  47. package/content/skills/capture-lede-decision/capture-lede-decision.mjs +37 -37
  48. package/content/skills/collaborate/SKILL.md +1 -1
  49. package/content/skills/condense-branch/SKILL.md +18 -36
  50. package/content/skills/condense-branch/condense-branch.mjs +17 -0
  51. package/content/skills/create-bitbucket-pr/SKILL.md +9 -11
  52. package/content/skills/create-commit/SKILL.md +1 -1
  53. package/content/skills/create-devlog/SKILL.md +4 -4
  54. package/content/skills/create-gh-pr/SKILL.md +9 -11
  55. package/content/skills/create-pr/SKILL.md +9 -11
  56. package/content/skills/create-ticket/SKILL.md +22 -15
  57. package/content/skills/curate-feedback/SKILL.md +2 -2
  58. package/content/skills/derive-session-context/derive-session-context.mjs +103 -103
  59. package/content/skills/design-and-plan/SKILL.md +6 -6
  60. package/content/skills/groom-backlog/groom-backlog.mjs +15 -15
  61. package/content/skills/implement-plan/SKILL.md +1 -1
  62. package/content/skills/implementation-order/implementation-order.mjs +29 -29
  63. package/content/skills/index-prototypes/SKILL.md +2 -2
  64. package/content/skills/investigate-spike/SKILL.md +3 -3
  65. package/content/skills/list-gh-progress-items/SKILL.md +36 -0
  66. package/content/skills/list-gh-progress-items/list-gh-progress-items.mjs +68 -0
  67. package/content/skills/list-implementation-order/SKILL.md +2 -2
  68. package/content/skills/merge-bb-pr/SKILL.md +9 -11
  69. package/content/skills/merge-gh-pr/SKILL.md +9 -11
  70. package/content/skills/merge-pr/SKILL.md +10 -12
  71. package/content/skills/plan/SKILL.md +2 -2
  72. package/content/skills/prepare-prototype-brief/SKILL.md +2 -2
  73. package/content/skills/pull-from-backlog/pull-from-backlog.mjs +22 -22
  74. package/content/skills/refine-plan/SKILL.md +3 -3
  75. package/content/skills/refine-prototype/SKILL.md +2 -1
  76. package/content/skills/respond-to-review/SKILL.md +4 -4
  77. package/content/skills/review-bb-pr/SKILL.md +1 -2
  78. package/content/skills/review-branch/SKILL.md +18 -13
  79. package/content/skills/review-criteria/SKILL.md +1 -1
  80. package/content/skills/review-gh-pr/SKILL.md +1 -2
  81. package/content/skills/review-pr/SKILL.md +2 -3
  82. package/content/skills/revise-prose/revise-prose.mjs +52 -52
  83. package/content/skills/save-artifact/SKILL.md +4 -6
  84. package/content/skills/save-plan/SKILL.md +2 -2
  85. package/content/skills/start-ticket/SKILL.md +1 -1
  86. package/content/skills/streamline-guidance/streamline-guidance.mjs +24 -24
  87. package/content/skills/summarize-change/SKILL.md +5 -4
  88. package/content/skills/summarize-chat/SKILL.md +2 -2
  89. package/content/skills/triage-feedback/SKILL.md +2 -2
  90. package/content/skills/triage-spike-findings/SKILL.md +26 -22
  91. package/content/skills/triage-spike-findings/triage-spike-findings.mjs +19 -19
  92. package/content/skills/update-project-guidance/SKILL.md +1 -1
  93. package/content/skills/wrap-up/SKILL.md +4 -4
  94. package/content/skills/write-progress-report/SKILL.md +111 -0
  95. package/content/skills/write-progress-report/write-progress-report.mjs +150 -0
  96. package/content/subagents/disposition-challenger.md +7 -6
  97. package/content/subagents/entry-drafter.md +2 -0
  98. package/content/subagents/usability-assessor.md +3 -2
  99. package/package.json +11 -10
  100. package/schemas/preferences.v1.json +9 -1
  101. package/schemas/work-types.v1.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __cjsCreateRequire } from 'node:module';
2
2
  const require = __cjsCreateRequire(import.meta.url);
3
- var jo=Object.create;var Zt=Object.defineProperty;var Bo=Object.getOwnPropertyDescriptor;var Ko=Object.getOwnPropertyNames;var Ro=Object.getPrototypeOf,Fo=Object.prototype.hasOwnProperty;var a=(s,e)=>Zt(s,"name",{value:e,configurable:!0}),Ze=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var y=(s,e)=>()=>{try{return e||s((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}};var Uo=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ko(e))!Fo.call(s,n)&&n!==t&&Zt(s,n,{get:()=>e[n],enumerable:!(i=Bo(e,n))||i.enumerable});return s};var Yo=(s,e,t)=>(t=s!=null?jo(Ro(s)):{},Uo(e||!s||!s.__esModule?Zt(t,"default",{value:s,enumerable:!0}):t,s));var O=y($=>{"use strict";var es=Symbol.for("yaml.alias"),Di=Symbol.for("yaml.document"),et=Symbol.for("yaml.map"),ji=Symbol.for("yaml.pair"),ts=Symbol.for("yaml.scalar"),tt=Symbol.for("yaml.seq"),U=Symbol.for("yaml.node.type"),Jo=a(s=>!!s&&typeof s=="object"&&s[U]===es,"isAlias"),Vo=a(s=>!!s&&typeof s=="object"&&s[U]===Di,"isDocument"),xo=a(s=>!!s&&typeof s=="object"&&s[U]===et,"isMap"),Wo=a(s=>!!s&&typeof s=="object"&&s[U]===ji,"isPair"),Bi=a(s=>!!s&&typeof s=="object"&&s[U]===ts,"isScalar"),Go=a(s=>!!s&&typeof s=="object"&&s[U]===tt,"isSeq");function Ki(s){if(s&&typeof s=="object")switch(s[U]){case et:case tt:return!0}return!1}a(Ki,"isCollection");function Ho(s){if(s&&typeof s=="object")switch(s[U]){case es:case et:case ts:case tt:return!0}return!1}a(Ho,"isNode");var Qo=a(s=>(Bi(s)||Ki(s))&&!!s.anchor,"hasAnchor");$.ALIAS=es;$.DOC=Di;$.MAP=et;$.NODE_TYPE=U;$.PAIR=ji;$.SCALAR=ts;$.SEQ=tt;$.hasAnchor=Qo;$.isAlias=Jo;$.isCollection=Ki;$.isDocument=Vo;$.isMap=xo;$.isNode=Ho;$.isPair=Wo;$.isScalar=Bi;$.isSeq=Go});var ke=y(ss=>{"use strict";var I=O(),M=Symbol("break visit"),Ri=Symbol("skip children"),R=Symbol("remove node");function st(s,e){let t=Fi(e);I.isDocument(s)?ue(null,s.contents,t,Object.freeze([s]))===R&&(s.contents=null):ue(null,s,t,Object.freeze([]))}a(st,"visit");st.BREAK=M;st.SKIP=Ri;st.REMOVE=R;function ue(s,e,t,i){let n=Ui(s,e,t,i);if(I.isNode(n)||I.isPair(n))return Yi(s,i,n),ue(s,n,t,i);if(typeof n!="symbol"){if(I.isCollection(e)){i=Object.freeze(i.concat(e));for(let r=0;r<e.items.length;++r){let o=ue(r,e.items[r],t,i);if(typeof o=="number")r=o-1;else{if(o===M)return M;o===R&&(e.items.splice(r,1),r-=1)}}}else if(I.isPair(e)){i=Object.freeze(i.concat(e));let r=ue("key",e.key,t,i);if(r===M)return M;r===R&&(e.key=null);let o=ue("value",e.value,t,i);if(o===M)return M;o===R&&(e.value=null)}}return n}a(ue,"visit_");async function it(s,e){let t=Fi(e);I.isDocument(s)?await he(null,s.contents,t,Object.freeze([s]))===R&&(s.contents=null):await he(null,s,t,Object.freeze([]))}a(it,"visitAsync");it.BREAK=M;it.SKIP=Ri;it.REMOVE=R;async function he(s,e,t,i){let n=await Ui(s,e,t,i);if(I.isNode(n)||I.isPair(n))return Yi(s,i,n),he(s,n,t,i);if(typeof n!="symbol"){if(I.isCollection(e)){i=Object.freeze(i.concat(e));for(let r=0;r<e.items.length;++r){let o=await he(r,e.items[r],t,i);if(typeof o=="number")r=o-1;else{if(o===M)return M;o===R&&(e.items.splice(r,1),r-=1)}}}else if(I.isPair(e)){i=Object.freeze(i.concat(e));let r=await he("key",e.key,t,i);if(r===M)return M;r===R&&(e.key=null);let o=await he("value",e.value,t,i);if(o===M)return M;o===R&&(e.value=null)}}return n}a(he,"visitAsync_");function Fi(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}a(Fi,"initVisitor");function Ui(s,e,t,i){if(typeof t=="function")return t(s,e,i);if(I.isMap(e))return t.Map?.(s,e,i);if(I.isSeq(e))return t.Seq?.(s,e,i);if(I.isPair(e))return t.Pair?.(s,e,i);if(I.isScalar(e))return t.Scalar?.(s,e,i);if(I.isAlias(e))return t.Alias?.(s,e,i)}a(Ui,"callVisitor");function Yi(s,e,t){let i=e[e.length-1];if(I.isCollection(i))i.items[s]=t;else if(I.isPair(i))s==="key"?i.key=t:i.value=t;else if(I.isDocument(i))i.contents=t;else{let n=I.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}a(Yi,"replaceNode");ss.visit=st;ss.visitAsync=it});var is=y(Vi=>{"use strict";var Ji=O(),Xo=ke(),zo={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Zo=a(s=>s.replace(/[!,[\]{}]/g,e=>zo[e]),"escapeTagName"),Ne=class s{static{a(this,"Directives")}constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),n=i.shift();switch(n){case"%TAG":{if(i.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[r,o]=i;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=i;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,i,n]=e.match(/^(.*!)([^!]*)$/s);n||t(`The ${e} tag has no suffix`);let r=this.tags[i];if(r)try{return r+decodeURIComponent(n)}catch(o){return t(String(o)),null}return i==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,i]of Object.entries(this.tags))if(e.startsWith(i))return t+Zo(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),n;if(e&&i.length>0&&Ji.isNode(e.contents)){let r={};Xo.visit(e.contents,(o,l)=>{Ji.isNode(l)&&l.tag&&(r[l.tag]=!0)}),n=Object.keys(r)}else n=[];for(let[r,o]of i)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||n.some(l=>l.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
4
- `)}};Ne.defaultYaml={explicit:!1,version:"1.2"};Ne.defaultTags={"!!":"tag:yaml.org,2002:"};Vi.Directives=Ne});var nt=y(Ae=>{"use strict";var xi=O(),ea=ke();function ta(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}a(ta,"anchorIsValid");function Wi(s){let e=new Set;return ea.visit(s,{Value(t,i){i.anchor&&e.add(i.anchor)}}),e}a(Wi,"anchorNames");function Gi(s,e){for(let t=1;;++t){let i=`${s}${t}`;if(!e.has(i))return i}}a(Gi,"findNewAnchor");function sa(s,e){let t=[],i=new Map,n=null;return{onAnchor:a(r=>{t.push(r),n??(n=Wi(s));let o=Gi(e,n);return n.add(o),o},"onAnchor"),setAnchors:a(()=>{for(let r of t){let o=i.get(r);if(typeof o=="object"&&o.anchor&&(xi.isScalar(o.node)||xi.isCollection(o.node)))o.node.anchor=o.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=r,l}}},"setAnchors"),sourceObjects:i}}a(sa,"createNodeAnchors");Ae.anchorIsValid=ta;Ae.anchorNames=Wi;Ae.createNodeAnchors=sa;Ae.findNewAnchor=Gi});var ns=y(Hi=>{"use strict";function qe(s,e,t,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let n=0,r=i.length;n<r;++n){let o=i[n],l=qe(s,i,String(n),o);l===void 0?delete i[n]:l!==o&&(i[n]=l)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let r=i.get(n),o=qe(s,i,n,r);o===void 0?i.delete(n):o!==r&&i.set(n,o)}else if(i instanceof Set)for(let n of Array.from(i)){let r=qe(s,i,n,n);r===void 0?i.delete(n):r!==n&&(i.delete(n),i.add(r))}else for(let[n,r]of Object.entries(i)){let o=qe(s,i,n,r);o===void 0?delete i[n]:o!==r&&(i[n]=o)}return s.call(e,t,i)}a(qe,"applyReviver");Hi.applyReviver=qe});var V=y(Xi=>{"use strict";var ia=O();function Qi(s,e,t){if(Array.isArray(s))return s.map((i,n)=>Qi(i,String(n),t));if(s&&typeof s.toJSON=="function"){if(!t||!ia.hasAnchor(s))return s.toJSON(e,t);let i={aliasCount:0,count:1,res:void 0};t.anchors.set(s,i),t.onCreate=r=>{i.res=r,delete t.onCreate};let n=s.toJSON(e,t);return t.onCreate&&t.onCreate(n),n}return typeof s=="bigint"&&!t?.keep?Number(s):s}a(Qi,"toJS");Xi.toJS=Qi});var rt=y(Zi=>{"use strict";var na=ns(),zi=O(),ra=V(),rs=class{static{a(this,"NodeBase")}constructor(e){Object.defineProperty(this,zi.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:i,onAnchor:n,reviver:r}={}){if(!zi.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=ra.toJS(this,"",o);if(typeof n=="function")for(let{count:c,res:f}of o.anchors.values())n(f,c);return typeof r=="function"?na.applyReviver(r,{"":l},"",l):l}};Zi.NodeBase=rs});var Oe=y(en=>{"use strict";var oa=nt(),aa=ke(),de=O(),la=rt(),ca=V(),os=class extends la.NodeBase{static{a(this,"Alias")}constructor(e){super(de.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;t?.aliasResolveCache?i=t.aliasResolveCache:(i=[],aa.visit(e,{Node:a((r,o)=>{(de.isAlias(o)||de.hasAnchor(o))&&i.push(o)},"Node")}),t&&(t.aliasResolveCache=i));let n;for(let r of i){if(r===this)break;r.anchor===this.source&&(n=r)}if(n&&t){let{anchors:r,doc:o,maxAliasCount:l}=t,c=r.get(n);if(c||(ca.toJS(n,null,t),c=r.get(n)),c?.res===void 0){let f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(l>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=ot(o,n,r)),c.count*c.aliasCount>l)){let f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}}return n}toJSON(e,t){if(!t)return{source:this.source};let i=this.resolve(t.doc,t);if(!i){let n=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(n)}return t.anchors.get(i).res}toString(e,t,i){let n=`*${this.source}`;if(e){if(oa.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${n} `}return n}};function ot(s,e,t){if(de.isAlias(e)){let i=e.resolve(s),n=t&&i&&t.get(i);return n?n.count*n.aliasCount:0}else if(de.isCollection(e)){let i=0;for(let n of e.items){let r=ot(s,n,t);r>i&&(i=r)}return i}else if(de.isPair(e)){let i=ot(s,e.key,t),n=ot(s,e.value,t);return Math.max(i,n)}return 1}a(ot,"getAliasCount");en.Alias=os});var T=y(as=>{"use strict";var fa=O(),ua=rt(),ha=V(),da=a(s=>!s||typeof s!="function"&&typeof s!="object","isScalarValue"),x=class extends ua.NodeBase{static{a(this,"Scalar")}constructor(e){super(fa.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:ha.toJS(this.value,e,t)}toString(){return String(this.value)}};x.BLOCK_FOLDED="BLOCK_FOLDED";x.BLOCK_LITERAL="BLOCK_LITERAL";x.PLAIN="PLAIN";x.QUOTE_DOUBLE="QUOTE_DOUBLE";x.QUOTE_SINGLE="QUOTE_SINGLE";as.Scalar=x;as.isScalarValue=da});var Ee=y(sn=>{"use strict";var pa=Oe(),se=O(),tn=T(),ma="tag:yaml.org,2002:";function ga(s,e,t){if(e){let i=t.filter(r=>r.tag===e),n=i.find(r=>!r.format)??i[0];if(!n)throw new Error(`Tag ${e} not found`);return n}return t.find(i=>i.identify?.(s)&&!i.format)}a(ga,"findTagObject");function ya(s,e,t){if(se.isDocument(s)&&(s=s.contents),se.isNode(s))return s;if(se.isPair(s)){let u=t.schema[se.MAP].createNode?.(t.schema,null,t);return u.items.push(s),u}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:i,onAnchor:n,onTagObj:r,schema:o,sourceObjects:l}=t,c;if(i&&s&&typeof s=="object"){if(c=l.get(s),c)return c.anchor??(c.anchor=n(s)),new pa.Alias(c.anchor);c={anchor:null,node:null},l.set(s,c)}e?.startsWith("!!")&&(e=ma+e.slice(2));let f=ga(s,e,o.tags);if(!f){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let u=new tn.Scalar(s);return c&&(c.node=u),u}f=s instanceof Map?o[se.MAP]:Symbol.iterator in Object(s)?o[se.SEQ]:o[se.MAP]}r&&(r(f),delete t.onTagObj);let p=f?.createNode?f.createNode(t.schema,s,t):typeof f?.nodeClass?.from=="function"?f.nodeClass.from(t.schema,s,t):new tn.Scalar(s);return e?p.tag=e:f.default||(p.tag=f.tag),c&&(c.node=p),p}a(ya,"createNode");sn.createNode=ya});var lt=y(at=>{"use strict";var ba=Ee(),F=O(),wa=rt();function ls(s,e,t){let i=t;for(let n=e.length-1;n>=0;--n){let r=e[n];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=i,i=o}else i=new Map([[r,i]])}return ba.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:a(()=>{throw new Error("This should not happen, please report a bug.")},"onAnchor"),schema:s,sourceObjects:new Map})}a(ls,"collectionFromPath");var nn=a(s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,"isEmptyPath"),cs=class extends wa.NodeBase{static{a(this,"Collection")}constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(i=>F.isNode(i)||F.isPair(i)?i.clone(e):i),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(nn(e))this.add(t);else{let[i,...n]=e,r=this.get(i,!0);if(F.isCollection(r))r.addIn(n,t);else if(r===void 0&&this.schema)this.set(i,ls(this.schema,n,t));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}deleteIn(e){let[t,...i]=e;if(i.length===0)return this.delete(t);let n=this.get(t,!0);if(F.isCollection(n))return n.deleteIn(i);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${i}`)}getIn(e,t){let[i,...n]=e,r=this.get(i,!0);return n.length===0?!t&&F.isScalar(r)?r.value:r:F.isCollection(r)?r.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!F.isPair(t))return!1;let i=t.value;return i==null||e&&F.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[t,...i]=e;if(i.length===0)return this.has(t);let n=this.get(t,!0);return F.isCollection(n)?n.hasIn(i):!1}setIn(e,t){let[i,...n]=e;if(n.length===0)this.set(i,t);else{let r=this.get(i,!0);if(F.isCollection(r))r.setIn(n,t);else if(r===void 0&&this.schema)this.set(i,ls(this.schema,n,t));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}};at.Collection=cs;at.collectionFromPath=ls;at.isEmptyPath=nn});var Le=y(ct=>{"use strict";var Sa=a(s=>s.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function fs(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}a(fs,"indentComment");var va=a((s,e,t)=>s.endsWith(`
3
+ var jo=Object.create;var Zt=Object.defineProperty;var Bo=Object.getOwnPropertyDescriptor;var Ko=Object.getOwnPropertyNames;var Ro=Object.getPrototypeOf,Fo=Object.prototype.hasOwnProperty;var a=(s,e)=>Zt(s,"name",{value:e,configurable:!0}),Ze=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var y=(s,e)=>()=>{try{return e||s((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}};var Uo=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ko(e))!Fo.call(s,n)&&n!==t&&Zt(s,n,{get:()=>e[n],enumerable:!(i=Bo(e,n))||i.enumerable});return s};var Yo=(s,e,t)=>(t=s!=null?jo(Ro(s)):{},Uo(e||!s||!s.__esModule?Zt(t,"default",{value:s,enumerable:!0}):t,s));var O=y($=>{"use strict";var es=Symbol.for("yaml.alias"),Di=Symbol.for("yaml.document"),et=Symbol.for("yaml.map"),ji=Symbol.for("yaml.pair"),ts=Symbol.for("yaml.scalar"),tt=Symbol.for("yaml.seq"),U=Symbol.for("yaml.node.type"),Jo=a(s=>!!s&&typeof s=="object"&&s[U]===es,"isAlias"),Vo=a(s=>!!s&&typeof s=="object"&&s[U]===Di,"isDocument"),xo=a(s=>!!s&&typeof s=="object"&&s[U]===et,"isMap"),Wo=a(s=>!!s&&typeof s=="object"&&s[U]===ji,"isPair"),Bi=a(s=>!!s&&typeof s=="object"&&s[U]===ts,"isScalar"),Go=a(s=>!!s&&typeof s=="object"&&s[U]===tt,"isSeq");function Ki(s){if(s&&typeof s=="object")switch(s[U]){case et:case tt:return!0}return!1}a(Ki,"isCollection");function Ho(s){if(s&&typeof s=="object")switch(s[U]){case es:case et:case ts:case tt:return!0}return!1}a(Ho,"isNode");var Qo=a(s=>(Bi(s)||Ki(s))&&!!s.anchor,"hasAnchor");$.ALIAS=es;$.DOC=Di;$.MAP=et;$.NODE_TYPE=U;$.PAIR=ji;$.SCALAR=ts;$.SEQ=tt;$.hasAnchor=Qo;$.isAlias=Jo;$.isCollection=Ki;$.isDocument=Vo;$.isMap=xo;$.isNode=Ho;$.isPair=Wo;$.isScalar=Bi;$.isSeq=Go});var ke=y(ss=>{"use strict";var I=O(),M=Symbol("break visit"),Ri=Symbol("skip children"),K=Symbol("remove node");function st(s,e){let t=Fi(e);I.isDocument(s)?ue(null,s.contents,t,Object.freeze([s]))===K&&(s.contents=null):ue(null,s,t,Object.freeze([]))}a(st,"visit");st.BREAK=M;st.SKIP=Ri;st.REMOVE=K;function ue(s,e,t,i){let n=Ui(s,e,t,i);if(I.isNode(n)||I.isPair(n))return Yi(s,i,n),ue(s,n,t,i);if(typeof n!="symbol"){if(I.isCollection(e)){i=Object.freeze(i.concat(e));for(let r=0;r<e.items.length;++r){let o=ue(r,e.items[r],t,i);if(typeof o=="number")r=o-1;else{if(o===M)return M;o===K&&(e.items.splice(r,1),r-=1)}}}else if(I.isPair(e)){i=Object.freeze(i.concat(e));let r=ue("key",e.key,t,i);if(r===M)return M;r===K&&(e.key=null);let o=ue("value",e.value,t,i);if(o===M)return M;o===K&&(e.value=null)}}return n}a(ue,"visit_");async function it(s,e){let t=Fi(e);I.isDocument(s)?await he(null,s.contents,t,Object.freeze([s]))===K&&(s.contents=null):await he(null,s,t,Object.freeze([]))}a(it,"visitAsync");it.BREAK=M;it.SKIP=Ri;it.REMOVE=K;async function he(s,e,t,i){let n=await Ui(s,e,t,i);if(I.isNode(n)||I.isPair(n))return Yi(s,i,n),he(s,n,t,i);if(typeof n!="symbol"){if(I.isCollection(e)){i=Object.freeze(i.concat(e));for(let r=0;r<e.items.length;++r){let o=await he(r,e.items[r],t,i);if(typeof o=="number")r=o-1;else{if(o===M)return M;o===K&&(e.items.splice(r,1),r-=1)}}}else if(I.isPair(e)){i=Object.freeze(i.concat(e));let r=await he("key",e.key,t,i);if(r===M)return M;r===K&&(e.key=null);let o=await he("value",e.value,t,i);if(o===M)return M;o===K&&(e.value=null)}}return n}a(he,"visitAsync_");function Fi(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}a(Fi,"initVisitor");function Ui(s,e,t,i){if(typeof t=="function")return t(s,e,i);if(I.isMap(e))return t.Map?.(s,e,i);if(I.isSeq(e))return t.Seq?.(s,e,i);if(I.isPair(e))return t.Pair?.(s,e,i);if(I.isScalar(e))return t.Scalar?.(s,e,i);if(I.isAlias(e))return t.Alias?.(s,e,i)}a(Ui,"callVisitor");function Yi(s,e,t){let i=e[e.length-1];if(I.isCollection(i))i.items[s]=t;else if(I.isPair(i))s==="key"?i.key=t:i.value=t;else if(I.isDocument(i))i.contents=t;else{let n=I.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}a(Yi,"replaceNode");ss.visit=st;ss.visitAsync=it});var is=y(Vi=>{"use strict";var Ji=O(),Xo=ke(),zo={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Zo=a(s=>s.replace(/[!,[\]{}]/g,e=>zo[e]),"escapeTagName"),Ne=class s{static{a(this,"Directives")}constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),n=i.shift();switch(n){case"%TAG":{if(i.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[r,o]=i;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=i;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,i,n]=e.match(/^(.*!)([^!]*)$/s);n||t(`The ${e} tag has no suffix`);let r=this.tags[i];if(r)try{return r+decodeURIComponent(n)}catch(o){return t(String(o)),null}return i==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,i]of Object.entries(this.tags))if(e.startsWith(i))return t+Zo(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),n;if(e&&i.length>0&&Ji.isNode(e.contents)){let r={};Xo.visit(e.contents,(o,l)=>{Ji.isNode(l)&&l.tag&&(r[l.tag]=!0)}),n=Object.keys(r)}else n=[];for(let[r,o]of i)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||n.some(l=>l.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
4
+ `)}};Ne.defaultYaml={explicit:!1,version:"1.2"};Ne.defaultTags={"!!":"tag:yaml.org,2002:"};Vi.Directives=Ne});var nt=y(Ae=>{"use strict";var xi=O(),ea=ke();function ta(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}a(ta,"anchorIsValid");function Wi(s){let e=new Set;return ea.visit(s,{Value(t,i){i.anchor&&e.add(i.anchor)}}),e}a(Wi,"anchorNames");function Gi(s,e){for(let t=1;;++t){let i=`${s}${t}`;if(!e.has(i))return i}}a(Gi,"findNewAnchor");function sa(s,e){let t=[],i=new Map,n=null;return{onAnchor:a(r=>{t.push(r),n??(n=Wi(s));let o=Gi(e,n);return n.add(o),o},"onAnchor"),setAnchors:a(()=>{for(let r of t){let o=i.get(r);if(typeof o=="object"&&o.anchor&&(xi.isScalar(o.node)||xi.isCollection(o.node)))o.node.anchor=o.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=r,l}}},"setAnchors"),sourceObjects:i}}a(sa,"createNodeAnchors");Ae.anchorIsValid=ta;Ae.anchorNames=Wi;Ae.createNodeAnchors=sa;Ae.findNewAnchor=Gi});var ns=y(Hi=>{"use strict";function qe(s,e,t,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let n=0,r=i.length;n<r;++n){let o=i[n],l=qe(s,i,String(n),o);l===void 0?delete i[n]:l!==o&&(i[n]=l)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let r=i.get(n),o=qe(s,i,n,r);o===void 0?i.delete(n):o!==r&&i.set(n,o)}else if(i instanceof Set)for(let n of Array.from(i)){let r=qe(s,i,n,n);r===void 0?i.delete(n):r!==n&&(i.delete(n),i.add(r))}else for(let[n,r]of Object.entries(i)){let o=qe(s,i,n,r);o===void 0?delete i[n]:o!==r&&(i[n]=o)}return s.call(e,t,i)}a(qe,"applyReviver");Hi.applyReviver=qe});var V=y(Xi=>{"use strict";var ia=O();function Qi(s,e,t){if(Array.isArray(s))return s.map((i,n)=>Qi(i,String(n),t));if(s&&typeof s.toJSON=="function"){if(!t||!ia.hasAnchor(s))return s.toJSON(e,t);let i={aliasCount:0,count:1,res:void 0};t.anchors.set(s,i),t.onCreate=r=>{i.res=r,delete t.onCreate};let n=s.toJSON(e,t);return t.onCreate&&t.onCreate(n),n}return typeof s=="bigint"&&!t?.keep?Number(s):s}a(Qi,"toJS");Xi.toJS=Qi});var rt=y(Zi=>{"use strict";var na=ns(),zi=O(),ra=V(),rs=class{static{a(this,"NodeBase")}constructor(e){Object.defineProperty(this,zi.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:i,onAnchor:n,reviver:r}={}){if(!zi.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=ra.toJS(this,"",o);if(typeof n=="function")for(let{count:c,res:f}of o.anchors.values())n(f,c);return typeof r=="function"?na.applyReviver(r,{"":l},"",l):l}};Zi.NodeBase=rs});var Oe=y(en=>{"use strict";var oa=nt(),aa=ke(),de=O(),la=rt(),ca=V(),os=class extends la.NodeBase{static{a(this,"Alias")}constructor(e){super(de.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;t?.aliasResolveCache?i=t.aliasResolveCache:(i=[],aa.visit(e,{Node:a((r,o)=>{(de.isAlias(o)||de.hasAnchor(o))&&i.push(o)},"Node")}),t&&(t.aliasResolveCache=i));let n;for(let r of i){if(r===this)break;r.anchor===this.source&&(n=r)}if(n&&t){let{anchors:r,doc:o,maxAliasCount:l}=t,c=r.get(n);if(c||(ca.toJS(n,null,t),c=r.get(n)),c?.res===void 0){let f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(l>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=ot(o,n,r)),c.count*c.aliasCount>l)){let f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}}return n}toJSON(e,t){if(!t)return{source:this.source};let i=this.resolve(t.doc,t);if(!i){let n=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(n)}return t.anchors.get(i).res}toString(e,t,i){let n=`*${this.source}`;if(e){if(oa.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${n} `}return n}};function ot(s,e,t){if(de.isAlias(e)){let i=e.resolve(s),n=t&&i&&t.get(i);return n?n.count*n.aliasCount:0}else if(de.isCollection(e)){let i=0;for(let n of e.items){let r=ot(s,n,t);r>i&&(i=r)}return i}else if(de.isPair(e)){let i=ot(s,e.key,t),n=ot(s,e.value,t);return Math.max(i,n)}return 1}a(ot,"getAliasCount");en.Alias=os});var T=y(as=>{"use strict";var fa=O(),ua=rt(),ha=V(),da=a(s=>!s||typeof s!="function"&&typeof s!="object","isScalarValue"),x=class extends ua.NodeBase{static{a(this,"Scalar")}constructor(e){super(fa.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:ha.toJS(this.value,e,t)}toString(){return String(this.value)}};x.BLOCK_FOLDED="BLOCK_FOLDED";x.BLOCK_LITERAL="BLOCK_LITERAL";x.PLAIN="PLAIN";x.QUOTE_DOUBLE="QUOTE_DOUBLE";x.QUOTE_SINGLE="QUOTE_SINGLE";as.Scalar=x;as.isScalarValue=da});var Ee=y(sn=>{"use strict";var pa=Oe(),se=O(),tn=T(),ma="tag:yaml.org,2002:";function ga(s,e,t){if(e){let i=t.filter(r=>r.tag===e),n=i.find(r=>!r.format)??i[0];if(!n)throw new Error(`Tag ${e} not found`);return n}return t.find(i=>i.identify?.(s)&&!i.format)}a(ga,"findTagObject");function ya(s,e,t){if(se.isDocument(s)&&(s=s.contents),se.isNode(s))return s;if(se.isPair(s)){let u=t.schema[se.MAP].createNode?.(t.schema,null,t);return u.items.push(s),u}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:i,onAnchor:n,onTagObj:r,schema:o,sourceObjects:l}=t,c;if(i&&s&&typeof s=="object"){if(c=l.get(s),c)return c.anchor??(c.anchor=n(s)),new pa.Alias(c.anchor);c={anchor:null,node:null},l.set(s,c)}e?.startsWith("!!")&&(e=ma+e.slice(2));let f=ga(s,e,o.tags);if(!f){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let u=new tn.Scalar(s);return c&&(c.node=u),u}f=s instanceof Map?o[se.MAP]:Symbol.iterator in Object(s)?o[se.SEQ]:o[se.MAP]}r&&(r(f),delete t.onTagObj);let p=f?.createNode?f.createNode(t.schema,s,t):typeof f?.nodeClass?.from=="function"?f.nodeClass.from(t.schema,s,t):new tn.Scalar(s);return e?p.tag=e:f.default||(p.tag=f.tag),c&&(c.node=p),p}a(ya,"createNode");sn.createNode=ya});var lt=y(at=>{"use strict";var ba=Ee(),R=O(),wa=rt();function ls(s,e,t){let i=t;for(let n=e.length-1;n>=0;--n){let r=e[n];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=i,i=o}else i=new Map([[r,i]])}return ba.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:a(()=>{throw new Error("This should not happen, please report a bug.")},"onAnchor"),schema:s,sourceObjects:new Map})}a(ls,"collectionFromPath");var nn=a(s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,"isEmptyPath"),cs=class extends wa.NodeBase{static{a(this,"Collection")}constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(i=>R.isNode(i)||R.isPair(i)?i.clone(e):i),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(nn(e))this.add(t);else{let[i,...n]=e,r=this.get(i,!0);if(R.isCollection(r))r.addIn(n,t);else if(r===void 0&&this.schema)this.set(i,ls(this.schema,n,t));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}deleteIn(e){let[t,...i]=e;if(i.length===0)return this.delete(t);let n=this.get(t,!0);if(R.isCollection(n))return n.deleteIn(i);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${i}`)}getIn(e,t){let[i,...n]=e,r=this.get(i,!0);return n.length===0?!t&&R.isScalar(r)?r.value:r:R.isCollection(r)?r.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!R.isPair(t))return!1;let i=t.value;return i==null||e&&R.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[t,...i]=e;if(i.length===0)return this.has(t);let n=this.get(t,!0);return R.isCollection(n)?n.hasIn(i):!1}setIn(e,t){let[i,...n]=e;if(n.length===0)this.set(i,t);else{let r=this.get(i,!0);if(R.isCollection(r))r.setIn(n,t);else if(r===void 0&&this.schema)this.set(i,ls(this.schema,n,t));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}};at.Collection=cs;at.collectionFromPath=ls;at.isEmptyPath=nn});var Le=y(ct=>{"use strict";var Sa=a(s=>s.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function fs(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}a(fs,"indentComment");var va=a((s,e,t)=>s.endsWith(`
5
5
  `)?fs(t,e):t.includes(`
6
6
  `)?`
7
7
  `+fs(t,e):(s.endsWith(" ")?"":" ")+t,"lineComment");ct.indentComment=fs;ct.lineComment=va;ct.stringifyComment=Sa});var on=y(Te=>{"use strict";var ka="flow",us="block",ft="quoted";function Na(s,e,t="flow",{indentAtStart:i,lineWidth:n=80,minContentWidth:r=20,onFold:o,onOverflow:l}={}){if(!n||n<0)return s;n<r&&(r=0);let c=Math.max(1+r,1+n-e.length);if(s.length<=c)return s;let f=[],p={},u=n-e.length;typeof i=="number"&&(i>n-Math.max(2,r)?f.push(0):u=n-i);let h,g,b=!1,d=-1,m=-1,S=-1;t===us&&(d=rn(s,d,e.length),d!==-1&&(u=d+c));for(let k;k=s[d+=1];){if(t===ft&&k==="\\"){switch(m=d,s[d+1]){case"x":d+=3;break;case"u":d+=5;break;case"U":d+=9;break;default:d+=1}S=d}if(k===`
@@ -136,11 +136,11 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
136
136
  `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
137
137
  `,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let i="end"in t.value?t.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Qt(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,n=i&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",r=[];if(n&&t.sep&&!t.value){let o=[];for(let l=0;l<t.sep.length;++l){let c=t.sep[l];switch(c.type){case"newline":o.push(l);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":n||t.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):n||t.value?(r.push(this.sourceToken),e.items.push({start:r,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Z(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(bo(t.key)&&!Z(t.sep,"newline")){let o=ve(t.start),l=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:c}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(Z(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=ve(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||n?e.items.push({start:r,key:null,sep:[this.sourceToken]}):Z(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);n||t.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!Z(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:r});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let i="end"in t.value?t.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Qt(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||Z(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let n=Ht(i),r=ve(n);yo(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
138
138
  `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
139
- `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=Ht(e),i=ve(t);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Ht(e),i=ve(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};wo.Parser=Pi});var Ao=y(Xe=>{"use strict";var So=bi(),Zf=Ue(),Qe=Ve(),eu=gs(),tu=O(),su=Ci(),vo=Ii();function ko(s){let e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new su.LineCounter||null,prettyErrors:e}}a(ko,"parseOptions");function iu(s,e={}){let{lineCounter:t,prettyErrors:i}=ko(e),n=new vo.Parser(t?.addNewLine),r=new So.Composer(e),o=Array.from(r.compose(n.parse(s)));if(i&&t)for(let l of o)l.errors.forEach(Qe.prettifyError(s,t)),l.warnings.forEach(Qe.prettifyError(s,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}a(iu,"parseAllDocuments");function No(s,e={}){let{lineCounter:t,prettyErrors:i}=ko(e),n=new vo.Parser(t?.addNewLine),r=new So.Composer(e),o=null;for(let l of r.compose(n.parse(s),!0,s.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new Qe.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&t&&(o.errors.forEach(Qe.prettifyError(s,t)),o.warnings.forEach(Qe.prettifyError(s,t))),o}a(No,"parseDocument");function nu(s,e,t){let i;typeof e=="function"?i=e:t===void 0&&e&&typeof e=="object"&&(t=e);let n=No(s,t);if(!n)return null;if(n.warnings.forEach(r=>eu.warn(n.options.logLevel,r)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:i},t))}a(nu,"parse");function ru(s,e,t){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let n=Math.round(t);t=n<1?void 0:n>8?{indent:8}:{indent:n}}if(s===void 0){let{keepUndefined:n}=t??e??{};if(!n)return}return tu.isDocument(s)&&!i?s.toString(t):new Zf.Document(s,i,t).toString(t)}a(ru,"stringify");Xe.parse=nu;Xe.parseAllDocuments=iu;Xe.parseDocument=No;Xe.stringify=ru});var Oo=y(E=>{"use strict";var ou=bi(),au=Ue(),lu=zs(),$i=Ve(),cu=Oe(),ee=O(),fu=H(),uu=T(),hu=X(),du=z(),pu=Wt(),mu=Li(),gu=Ci(),yu=Ii(),Xt=Ao(),qo=ke();E.Composer=ou.Composer;E.Document=au.Document;E.Schema=lu.Schema;E.YAMLError=$i.YAMLError;E.YAMLParseError=$i.YAMLParseError;E.YAMLWarning=$i.YAMLWarning;E.Alias=cu.Alias;E.isAlias=ee.isAlias;E.isCollection=ee.isCollection;E.isDocument=ee.isDocument;E.isMap=ee.isMap;E.isNode=ee.isNode;E.isPair=ee.isPair;E.isScalar=ee.isScalar;E.isSeq=ee.isSeq;E.Pair=fu.Pair;E.Scalar=uu.Scalar;E.YAMLMap=hu.YAMLMap;E.YAMLSeq=du.YAMLSeq;E.CST=pu;E.Lexer=mu.Lexer;E.LineCounter=gu.LineCounter;E.Parser=yu.Parser;E.parse=Xt.parse;E.parseAllDocuments=Xt.parseAllDocuments;E.parseDocument=Xt.parseDocument;E.stringify=Xt.stringify;E.visit=qo.visit;E.visitAsync=qo.visitAsync});import{readFile as Ou}from"node:fs/promises";import ze from"node:path";import K from"node:process";import{parseArgs as Eu}from"node:util";function _i(s){return s instanceof Error||Object.prototype.toString.call(s)==="[object Error]"}a(_i,"isError");function te(s){try{return _i(s)&&typeof s.message=="string"&&s.message!==""?s.message:String(s)}catch{return"[unstringifiable value]"}}a(te,"describeError");var _o=Yo(Oo(),1);import{realpathSync as Eo}from"node:fs";import Lo from"node:process";import{fileURLToPath as bu}from"node:url";function To(s,e){let t=Lo.argv[1];if(t===void 0)return!1;try{return Eo(bu(s))===Eo(t)}catch(i){return Lo.stderr.write(`${e}: warning: could not determine entry point: ${te(i)}
140
- `),!0}}a(To,"isEntryPoint");function wu(s,e){return Po(s)&&s.code===e}a(wu,"isErrorCode");function Co(s){return wu(s,"ENOENT")}a(Co,"isEnoent");function le(s){return Po(s)&&!Array.isArray(s)}a(le,"isRecord");function Po(s){return typeof s=="object"&&s!==null}a(Po,"isObject");var Io={$schema:"https://json-schema.org/draft/2020-12/schema",title:"Preferences",description:"Configuration read by agent skills. Resolved from .agents/preferences.yaml at the project level, with ~/.agents/preferences.yaml as a global fallback.",type:"object",properties:{$schema:{type:"string",description:"JSON Schema reference URI for editor tooling."},artifacts:{type:"object",description:"Artifact storage configuration: where generated artifacts live and how they are categorized.",properties:{base_dir:{type:"string",description:"Root directory for all generated artifacts. Supports `~` expansion. Default: `~/ai-artifacts`."},paths:{type:"object",description:"Maps artifact category names (e.g., `chats`, `devlogs`, `plans`) to subdirectory names relative to the project artifact directory. Any category key is permitted; values must be strings.",additionalProperties:{type:"string"}}}},commit:{type:"object",description:"Commit-title rendering configuration consumed by the `describe-change.mjs` script.",properties:{title_format:{type:"string",description:"Template string used to render commit titles. Supports the tokens `{scope}`, `{type}`, `{breaking}`, `{title}`, and `{ticket_ref}`, and nesting `[...]` groups that drop when a token directly inside them resolves empty."}},required:["title_format"]},editors:{type:"array",description:"Optional list of editor configurations mapping file extensions to an editor command.",items:{type:"object",properties:{name:{type:"string",description:"Display name of the editor."},command:{type:"string",description:"Shell command to open files. The file path is appended as an argument."},extensions:{type:"string",description:"Glob pattern for file types this editor handles (e.g., `*.md`)."}},required:["name","command","extensions"]}},integrations:{type:"object",description:"Per-integration configuration. Keys are integration names (e.g., `jira`, `github`, `linear`); each integration object must declare an `enabled` boolean.",properties:{jira:{type:"object",description:"Jira integration configuration. Beyond `enabled`, the keys here are read by the `manage-jira-ticket` helper, which the `create-ticket` skill runs to create a Jira work item.",properties:{enabled:{type:"boolean",description:"Whether the integration is enabled."},issue_types:{type:"object",description:"Maps work-type keys and aliases (from the work-type taxonomy, e.g. `feat`, `fix`, `bugfix`) to Jira issue-type names, plus a `default` entry covering every unmapped work type. A created work item whose work type matches neither falls back to `Task`.",additionalProperties:{type:"string"}},project_key:{type:"string",description:"Key of the Jira project to create work items in (e.g., `MAC`). Overrides the key derived from `project.ticket_ref_prefix` minus its trailing separator."}},required:["enabled"]}},additionalProperties:{type:"object",properties:{enabled:{type:"boolean",description:"Whether the integration is enabled."}},required:["enabled"]}},merge:{type:"object",description:"Merge configuration for the `merge-pr` skill family: approval, merge strategy, branch deletion, and squash-merge title rendering.",properties:{approval:{type:"string",enum:["ask","auto"],description:"Whether `merge-pr` asks before merging: `ask`, or `auto` to merge without asking only when the run is clean: no notice, no decision of its own, not breaking, and a clean merge state on GitHub. Defaults to `ask`."},title_format:{type:"string",description:"Template string used to render the squash-merge commit title. Supports the same token vocabulary as `commit.title_format`, plus `{pr_number}`."},strategy:{type:"string",enum:["squash","merge","rebase"],description:"How `merge-pr` merges a pull request. Its `--strategy` flag outranks this value. Defaults to `squash`."},deletion_strategy:{type:"string",enum:["both","remote","none"],description:"Which branches `merge-pr` deletes after merging: `both` (GitHub only), `remote`, or `none`. Its `--delete` flag outranks this value. Defaults to `remote`."}}},platform:{type:"string",description:"Deprecated legacy spelling of `scm`, retained so existing preferences files validate during the migration window. Prefer `scm`; a future release removes this alias.",enum:["github","bitbucket"]},pr:{type:"object",description:"Pull-request configuration: title rendering and the state at creation.",properties:{initial_state:{type:"string",enum:["draft","ready"],description:"The state in which `create-pr` opens a pull request: `draft`, or `ready` for review. Defaults to `draft`."},title_format:{type:"string",description:"Template string used to render pull-request titles. Supports the same token vocabulary as `commit.title_format`."}}},project:{type:"object",description:"Project identification configuration, and the project's declared stage (`maturity`, `sensitivity`, `audience`, and the `stages` of its subdirectories), which design guidance treats as premises.",properties:{audience:{type:"string",enum:["owner","team","public"],description:"Who uses the project. `owner`: only the repo's owner. `team`: a known, bounded group. `public`: anyone who can reach it. Read from the project preferences file only."},maturity:{type:"string",enum:["exploration","hobby","early","production"],description:"How far the project has come. `exploration`: the output's shape is still being found, and nothing depends on it yet. `hobby`: built for the owner's own use or learning; breakage costs only the owner's time. `early`: in use by others, but the shape is still changing; downtime is tolerated. `production`: others depend on it; downtime and data loss have real costs. Read from the project preferences file only."},scopes:{type:"array",description:"Directories that own a change scope although they are not workspace packages, such as an app built by another toolchain. `describe-change resolve-scopes` resolves paths against these together with the pnpm workspace's packages, the longest containing directory winning. Read from the project preferences file only; the global file contributes no scopes. A declared directory does not become a workspace to any tool.",items:{type:"object",properties:{name:{type:"string",minLength:1,description:"Scope name. Defaults to the directory's basename, and overrides the basename of a package directory with the same path."},path:{type:"string",minLength:1,description:"Directory relative to the repository root. An absolute path, a path outside the repository, and a path that is not an existing directory are skipped with a warning."}},required:["path"],additionalProperties:!1}},sensitivity:{type:"string",enum:["low","personal","confidential"],description:"The most sensitive data that the project holds. `low`: nothing that would harm anyone if published. `personal`: personal data about the owner or identifiable individuals. `confidential`: secrets, credentials, or data that a third party is obliged to protect. Read from the project preferences file only."},slug:{type:"string",description:"Project identifier used for namespacing artifacts under `{base_dir}/projects/{slug}/`."},stages:{type:"array",description:"Stages that subdirectories declare, overriding the project's for work under them. Each value that an entry leaves undeclared is inherited from the project. When entries are nested, the longest containing path wins. Read from the project preferences file only.",items:{type:"object",properties:{audience:{type:"string",enum:["owner","team","public"],description:"Who uses the subdirectory's output, as `project.audience` defines the values."},maturity:{type:"string",enum:["exploration","hobby","early","production"],description:"How far the subdirectory's work has come, as `project.maturity` defines the values."},path:{type:"string",minLength:1,description:"Directory relative to the repository root."},sensitivity:{type:"string",enum:["low","personal","confidential"],description:"The most sensitive data that the subdirectory holds, as `project.sensitivity` defines the values."}},required:["path"],minProperties:2,additionalProperties:!1}},ticket_ref_prefix:{type:"string",description:"Prefix that appears at the start of `ticket_ref`. Use `#` for GitHub issues (added at render time, omitted from file paths) or a Jira project key like `MAC-` (part of the canonical ticket ID)."}}},repository:{type:"object",description:"Repository configuration: default remote and (deprecated) project slug fallback.",properties:{default_remote:{type:"object",description:"Default git remote used when constructing remote refs such as `origin/main`.",properties:{name:{type:"string",description:"Name of the default git remote (e.g., `origin`)."},default_branch:{type:"string",description:"Default branch of the remote (e.g., `main`)."}},required:["name","default_branch"]},slug:{type:"string",description:"Deprecated. Use `project.slug` instead. Kept as a fallback."}}},scm:{type:"string",description:"Source-code-management host. Supported values are `github` and `bitbucket`; new hosts can be added additively.",enum:["github","bitbucket"]},ticket:{type:"object",description:"Ticket (issue) configuration: title rendering, the base URL used to resolve bare ticket references, and the `pull-from-backlog` settings.",properties:{title_format:{type:"string",description:"Template string used to render ticket (issue) titles. Supports the same token vocabulary as `commit.title_format`."},base_url:{type:"string",description:"Org-stable base URL that a bare ticket id is appended to when reconstructing a ticket URL, for platforms where the URL cannot otherwise be derived (e.g. Jira `https://org.atlassian.net/browse/`). The trailing slash is optional. Surfaced into the branch manifest as `ticket_base_url`."},pull:{type:"object",description:"Settings of the `pull-from-backlog` skill, read from the project preferences file only.",properties:{assignOnPick:{type:"boolean",default:!1,description:"Assign the user to a picked ticket without asking first."},excludeLabels:{type:"array",items:{type:"string",minLength:1},default:["status:blocked","status:on-hold"],description:"Labels that make a ticket ineligible to be pulled, matched without regard to case. An ineligible ticket is never a candidate and does not count toward picking the Now milestone. An empty list disables exclusion."},now:{type:"string",minLength:1,description:"Title of the open milestone that forms the Now set. Without it, the Now set is the open milestone with the nearest due date, else the open milestone with the most open eligible issues (see `excludeLabels`), else the whole backlog."},priorityPrefix:{type:"string",minLength:1,default:"priority:",description:"Prefix of the priority labels. The value after it ranks `high`, `medium`, then `low`; any other value ranks as unlabelled."},staleBranchDays:{type:"integer",minimum:1,default:14,description:"Days since an in-progress branch's last commit at which the skill warns about it."},staleGroomDays:{type:"integer",minimum:1,default:14,description:"Days since the last groom at which the skill offers `/groom-backlog`."},staleGroomNewTickets:{type:"integer",minimum:1,default:10,description:"Open tickets created since the last groom at which the skill offers `/groom-backlog`."}},additionalProperties:!1}},required:["title_format"]},triage_feedback:{type:"object",description:"Settings of the `triage-feedback` skill.",properties:{defer_days:{type:"integer",minimum:1,description:"The days for which a deferred feedback cluster stays out of a triage, unless it gains an undeferred event. Defaults to 30."}}}},additionalProperties:!1};function $o(s,e){let t=Math.max(1,Math.floor(s.length/3)),i;for(let n of e.toSorted()){let r=vu(s.toLowerCase(),n.toLowerCase());r<=t&&(i===void 0||r<i.distance)&&(i={key:n,distance:r})}return i?.key}a($o,"findNearestKey");function vu(s,e){let t=Array.from({length:e.length+1},(i,n)=>n);for(let i=1;i<=s.length;i++){let n=[i];for(let r=1;r<=e.length;r++){let o=(t[r-1]??0)+(s[i-1]===e[r-1]?0:1);n[r]=Math.min((t[r]??0)+1,(n[r-1]??0)+1,o)}t=n}return t[e.length]??0}a(vu,"measureEditDistance");function Mo(s,e){let t=[];return zt(s,e,[],t),t}a(Mo,"validatePreferences");function ku(s){return s.length===0?"(root)":s.map((e,t)=>typeof e=="number"?`[${e}]`:t===0?e:`.${e}`).join("")}a(ku,"formatPath");function Nu(s,e){switch(e){case"array":return Array.isArray(s);case"boolean":return typeof s=="boolean";case"integer":return Number.isSafeInteger(s);case"number":return typeof s=="number";case"object":return le(s);case"string":return typeof s=="string";default:return!0}}a(Nu,"matchesType");function ce(s,e,t,i){s.push({level:e,path:ku(t),message:i})}a(ce,"report");function Au(s,e,t,i){if(e.items!==void 0)for(let[n,r]of s.entries())zt(r,e.items,[...t,n],i)}a(Au,"walkArray");function qu(s,e,t,i){let n=le(e.properties)?e.properties:void 0,r=e.required;if(Array.isArray(r))for(let o of r)typeof o=="string"&&!Object.hasOwn(s,o)&&ce(i,"error",t,`missing required key '${o}'`);for(let[o,l]of Object.entries(s)){let c=[...t,o];if(n!==void 0&&Object.hasOwn(n,o))zt(l,n[o],c,i);else if(le(e.additionalProperties))zt(l,e.additionalProperties,c,i);else if(n!==void 0&&e.additionalProperties!==!0){let f=$o(o,Object.keys(n)),p=f===void 0?"":`; did you mean '${f}'?`;ce(i,"warning",c,`unrecognized key${p}`)}}}a(qu,"walkObject");function zt(s,e,t,i){if(le(e)){if(e.type!==void 0&&!Nu(s,e.type)){let n=typeof e.type=="string"?e.type:JSON.stringify(e.type);ce(i,"error",t,`expected ${n} (got ${JSON.stringify(s)})`);return}if(Array.isArray(e.enum)&&!e.enum.includes(s)){let n=e.enum.map(r=>JSON.stringify(r)).join(", ");ce(i,"error",t,`must be one of ${n} (got ${JSON.stringify(s)})`)}if(typeof e.minLength=="number"&&typeof s=="string"&&s.length<e.minLength&&ce(i,"error",t,`must be at least ${e.minLength} characters long`),typeof e.minimum=="number"&&typeof s=="number"&&s<e.minimum&&ce(i,"error",t,`must be at least ${e.minimum} (got ${s})`),typeof e.minProperties=="number"&&le(s)){let n=Object.keys(s).length;n<e.minProperties&&ce(i,"error",t,`must have at least ${e.minProperties} keys (got ${n})`)}le(s)?qu(s,e,t,i):Array.isArray(s)&&Au(s,e,t,i)}}a(zt,"walkValue");async function Lu(s,e,t=Do(K.argv[1])){if(s.includes("--help")||s.includes("-h"))return K.stdout.write(Tu(t)),0;let i;try{i=Pu(s)}catch(l){return K.stderr.write(`${t}: ${te(l)}; run ${t} --help for usage
141
- `),1}let n=i.files.length===0,r=n?[ze.join(".agents","preferences.yaml")]:i.files,o=[];for(let l of r)o.push(await Iu(ze.resolve(e,l),{isOptional:n,isStrict:i.strict}));if(i.json)for(let l of o)K.stdout.write(`${JSON.stringify(l)}
142
- `);else K.stdout.write(Cu(o,e,t));return o.every(l=>l.valid)?0:1}a(Lu,"runValidatePreferences");if(To(import.meta.url,"validate-preferences")){let s=Do(K.argv[1]);try{K.exit(await Lu(K.argv.slice(2),K.cwd(),s))}catch(e){K.stderr.write(`${s}: ${te(e)}
143
- `),K.exit(1)}}function Tu(s){return[`${s}: validate preferences.yaml files against the preferences schema bundled with this release`,"",`Usage: ${s} [--json] [--strict] [file...]`,"","Arguments:"," file A preferences file to validate. Every named file must exist."," Without one, validates .agents/preferences.yaml, which may be absent.","","Options:"," --json Print one JSON object per file: { file, present, valid, findings }"," --strict Treat warnings, such as an unrecognized key, as failures"," -h, --help Print this help","","Exits 1 when any file is invalid, and 0 otherwise.","","Example:",` ${s} --strict .agents/preferences.yaml ~/.agents/preferences.yaml`,""].join(`
144
- `)}a(Tu,"buildHelp");function Do(s){return s===void 0?"validate-preferences":ze.basename(s,ze.extname(s))}a(Do,"deriveProgramName");function Cu(s,e,t){let i=[];for(let r of s){let o=ze.relative(e,r.file)||r.file;!r.present&&r.valid&&i.push(`${o}: not present; the file is optional`);for(let l of r.findings)i.push(`${o}: ${l.path}: ${l.level}: ${l.message}`)}let n=s.filter(r=>!r.valid).length;return i.push(n===0?`${t}: ${s.length} file(s) valid`:`${t}: ${n} of ${s.length} file(s) invalid`),`${i.join(`
139
+ `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=Ht(e),i=ve(t);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Ht(e),i=ve(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};wo.Parser=Pi});var Ao=y(Xe=>{"use strict";var So=bi(),Zf=Ue(),Qe=Ve(),eu=gs(),tu=O(),su=Ci(),vo=Ii();function ko(s){let e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new su.LineCounter||null,prettyErrors:e}}a(ko,"parseOptions");function iu(s,e={}){let{lineCounter:t,prettyErrors:i}=ko(e),n=new vo.Parser(t?.addNewLine),r=new So.Composer(e),o=Array.from(r.compose(n.parse(s)));if(i&&t)for(let l of o)l.errors.forEach(Qe.prettifyError(s,t)),l.warnings.forEach(Qe.prettifyError(s,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}a(iu,"parseAllDocuments");function No(s,e={}){let{lineCounter:t,prettyErrors:i}=ko(e),n=new vo.Parser(t?.addNewLine),r=new So.Composer(e),o=null;for(let l of r.compose(n.parse(s),!0,s.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new Qe.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&t&&(o.errors.forEach(Qe.prettifyError(s,t)),o.warnings.forEach(Qe.prettifyError(s,t))),o}a(No,"parseDocument");function nu(s,e,t){let i;typeof e=="function"?i=e:t===void 0&&e&&typeof e=="object"&&(t=e);let n=No(s,t);if(!n)return null;if(n.warnings.forEach(r=>eu.warn(n.options.logLevel,r)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:i},t))}a(nu,"parse");function ru(s,e,t){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let n=Math.round(t);t=n<1?void 0:n>8?{indent:8}:{indent:n}}if(s===void 0){let{keepUndefined:n}=t??e??{};if(!n)return}return tu.isDocument(s)&&!i?s.toString(t):new Zf.Document(s,i,t).toString(t)}a(ru,"stringify");Xe.parse=nu;Xe.parseAllDocuments=iu;Xe.parseDocument=No;Xe.stringify=ru});var Oo=y(E=>{"use strict";var ou=bi(),au=Ue(),lu=zs(),$i=Ve(),cu=Oe(),ee=O(),fu=H(),uu=T(),hu=X(),du=z(),pu=Wt(),mu=Li(),gu=Ci(),yu=Ii(),Xt=Ao(),qo=ke();E.Composer=ou.Composer;E.Document=au.Document;E.Schema=lu.Schema;E.YAMLError=$i.YAMLError;E.YAMLParseError=$i.YAMLParseError;E.YAMLWarning=$i.YAMLWarning;E.Alias=cu.Alias;E.isAlias=ee.isAlias;E.isCollection=ee.isCollection;E.isDocument=ee.isDocument;E.isMap=ee.isMap;E.isNode=ee.isNode;E.isPair=ee.isPair;E.isScalar=ee.isScalar;E.isSeq=ee.isSeq;E.Pair=fu.Pair;E.Scalar=uu.Scalar;E.YAMLMap=hu.YAMLMap;E.YAMLSeq=du.YAMLSeq;E.CST=pu;E.Lexer=mu.Lexer;E.LineCounter=gu.LineCounter;E.Parser=yu.Parser;E.parse=Xt.parse;E.parseAllDocuments=Xt.parseAllDocuments;E.parseDocument=Xt.parseDocument;E.stringify=Xt.stringify;E.visit=qo.visit;E.visitAsync=qo.visitAsync});import{readFile as Ou}from"node:fs/promises";import ze from"node:path";import F from"node:process";import{parseArgs as Eu}from"node:util";function _i(s){return s instanceof Error||Object.prototype.toString.call(s)==="[object Error]"}a(_i,"isError");function te(s){try{return _i(s)&&typeof s.message=="string"&&s.message!==""?s.message:String(s)}catch{return"[unstringifiable value]"}}a(te,"describeError");var _o=Yo(Oo(),1);import{realpathSync as Eo}from"node:fs";import Lo from"node:process";import{fileURLToPath as bu}from"node:url";function To(s,e){let t=Lo.argv[1];if(t===void 0)return!1;try{return Eo(bu(s))===Eo(t)}catch(i){return Lo.stderr.write(`${e}: warning: could not determine entry point: ${te(i)}
140
+ `),!0}}a(To,"isEntryPoint");function wu(s,e){return Po(s)&&s.code===e}a(wu,"isErrorCode");function Co(s){return wu(s,"ENOENT")}a(Co,"isEnoent");function le(s){return Po(s)&&!Array.isArray(s)}a(le,"isRecord");function Po(s){return typeof s=="object"&&s!==null}a(Po,"isObject");var Io={$schema:"https://json-schema.org/draft/2020-12/schema",title:"Preferences",description:"Configuration read by agent skills. Resolved from .agents/preferences.yaml at the project level, with ~/.agents/preferences.yaml as a global fallback.",type:"object",properties:{$schema:{type:"string",description:"JSON Schema reference URI for editor tooling."},artifacts:{type:"object",description:"Artifact storage configuration: where generated artifacts live and how they are categorized.",properties:{base_dir:{type:"string",description:"Root directory for all generated artifacts. Supports `~` expansion. Default: `~/ai-artifacts`."},paths:{type:"object",description:"Maps artifact category names (e.g., `chats`, `devlogs`, `plans`) to subdirectory names relative to the project artifact directory. Any category key is permitted; values must be strings.",additionalProperties:{type:"string"}}}},commit:{type:"object",description:"Commit-title rendering configuration consumed by the `describe-change.mjs` script.",properties:{title_format:{type:"string",description:"Template string used to render commit titles. Supports the tokens `{scope}`, `{type}`, `{breaking}`, `{title}`, and `{ticket_ref}`, and nesting `[...]` groups that drop when a token directly inside them resolves empty."}},required:["title_format"]},editors:{type:"array",description:"Optional list of editor configurations mapping file extensions to an editor command.",items:{type:"object",properties:{name:{type:"string",description:"Display name of the editor."},command:{type:"string",description:"Shell command to open files. The file path is appended as an argument."},extensions:{type:"string",description:"Glob pattern for file types this editor handles (e.g., `*.md`)."}},required:["name","command","extensions"]}},integrations:{type:"object",description:"Per-integration configuration. Keys are integration names (e.g., `jira`, `github`, `linear`); each integration object must declare an `enabled` boolean.",properties:{jira:{type:"object",description:"Jira integration configuration. Beyond `enabled`, the keys here are read by the `manage-jira-ticket` helper, which the `create-ticket` skill runs to create a Jira work item.",properties:{enabled:{type:"boolean",description:"Whether the integration is enabled."},issue_types:{type:"object",description:"Maps work-type keys and aliases (from the work-type taxonomy, e.g. `feat`, `fix`, `bugfix`) to Jira issue-type names, plus a `default` entry covering every unmapped work type. A created work item whose work type matches neither falls back to `Task`.",additionalProperties:{type:"string"}},project_key:{type:"string",description:"Key of the Jira project to create work items in (e.g., `MAC`). Overrides the key derived from `project.ticket_ref_prefix` minus its trailing separator."},subtask_issue_type:{type:"string",description:"Jira issue-type name of a work item that `create-ticket` creates under a level-0 parent, such as a `Task`, under which Jira accepts only a subtask (e.g., `Subtask`, or `Sub-task` on older sites). Overrides the `Subtask` default; the work type does not apply."},umbrella_issue_type:{type:"string",description:"Jira issue-type name of an umbrella, a work item that `create-ticket --umbrella` creates for its children to be parented to (e.g., `Epic`). Overrides the `Epic` default; the work type does not apply."}},required:["enabled"]}},additionalProperties:{type:"object",properties:{enabled:{type:"boolean",description:"Whether the integration is enabled."}},required:["enabled"]}},merge:{type:"object",description:"Merge configuration for the `merge-pr` skill family: approval, merge strategy, branch deletion, and squash-merge title rendering.",properties:{approval:{type:"string",enum:["ask","auto"],description:"Whether `merge-pr` asks before merging: `ask`, or `auto` to merge without asking only when the run is clean: no notice, no decision of its own, not breaking, and a clean merge state on GitHub. Defaults to `ask`."},title_format:{type:"string",description:"Template string used to render the squash-merge commit title. Supports the same token vocabulary as `commit.title_format`, plus `{pr_number}`."},strategy:{type:"string",enum:["squash","merge","rebase"],description:"How `merge-pr` merges a pull request. Its `--strategy` flag outranks this value. Defaults to `squash`."},deletion_strategy:{type:"string",enum:["both","remote","none"],description:"Which branches `merge-pr` deletes after merging: `both` (GitHub only), `remote`, or `none`. Its `--delete` flag outranks this value. Defaults to `remote`."}}},platform:{type:"string",description:"Deprecated legacy spelling of `scm`, retained so existing preferences files validate during the migration window. Prefer `scm`; a future release removes this alias.",enum:["github","bitbucket"]},pr:{type:"object",description:"Pull-request configuration: title rendering and the state at creation.",properties:{initial_state:{type:"string",enum:["draft","ready"],description:"The state in which `create-pr` opens a pull request: `draft`, or `ready` for review. Defaults to `draft`."},title_format:{type:"string",description:"Template string used to render pull-request titles. Supports the same token vocabulary as `commit.title_format`."}}},project:{type:"object",description:"Project identification configuration, and the project's declared stage (`maturity`, `sensitivity`, `audience`, and the `stages` of its subdirectories), which design guidance treats as premises.",properties:{audience:{type:"string",enum:["owner","team","public"],description:"Who uses the project. `owner`: only the repo's owner. `team`: a known, bounded group. `public`: anyone who can reach it. Read from the project preferences file only."},maturity:{type:"string",enum:["exploration","hobby","early","production"],description:"How far the project has come. `exploration`: the output's shape is still being found, and nothing depends on it yet. `hobby`: built for the owner's own use or learning; breakage costs only the owner's time. `early`: in use by others, but the shape is still changing; downtime is tolerated. `production`: others depend on it; downtime and data loss have real costs. Read from the project preferences file only."},scopes:{type:"array",description:"Directories that own a change scope although they are not workspace packages, such as an app built by another toolchain. `describe-change resolve-scopes` resolves paths against these together with the pnpm workspace's packages, the longest containing directory winning. Read from the project preferences file only; the global file contributes no scopes. A declared directory does not become a workspace to any tool.",items:{type:"object",properties:{name:{type:"string",minLength:1,description:"Scope name. Defaults to the directory's basename, and overrides the basename of a package directory with the same path."},path:{type:"string",minLength:1,description:"Directory relative to the repository root. An absolute path, a path outside the repository, and a path that is not an existing directory are skipped with a warning."}},required:["path"],additionalProperties:!1}},sensitivity:{type:"string",enum:["low","personal","confidential"],description:"The most sensitive data that the project holds. `low`: nothing that would harm anyone if published. `personal`: personal data about the owner or identifiable individuals. `confidential`: secrets, credentials, or data that a third party is obliged to protect. Read from the project preferences file only."},slug:{type:"string",description:"Project identifier used for namespacing artifacts under `{base_dir}/projects/{slug}/`."},stages:{type:"array",description:"Stages that subdirectories declare, overriding the project's for work under them. Each value that an entry leaves undeclared is inherited from the project. When entries are nested, the longest containing path wins. Read from the project preferences file only.",items:{type:"object",properties:{audience:{type:"string",enum:["owner","team","public"],description:"Who uses the subdirectory's output, as `project.audience` defines the values."},maturity:{type:"string",enum:["exploration","hobby","early","production"],description:"How far the subdirectory's work has come, as `project.maturity` defines the values."},path:{type:"string",minLength:1,description:"Directory relative to the repository root."},sensitivity:{type:"string",enum:["low","personal","confidential"],description:"The most sensitive data that the subdirectory holds, as `project.sensitivity` defines the values."}},required:["path"],minProperties:2,additionalProperties:!1}},ticket_ref_prefix:{type:"string",description:"Prefix that appears at the start of `ticket_ref`. Use `#` for GitHub issues (added at render time, omitted from file paths) or a Jira project key like `MAC-` (part of the canonical ticket ID)."}}},repository:{type:"object",description:"Repository configuration: default remote and (deprecated) project slug fallback.",properties:{default_remote:{type:"object",description:"Default git remote used when constructing remote refs such as `origin/main`.",properties:{name:{type:"string",description:"Name of the default git remote (e.g., `origin`)."},default_branch:{type:"string",description:"Default branch of the remote (e.g., `main`)."}},required:["name","default_branch"]},slug:{type:"string",description:"Deprecated. Use `project.slug` instead. Kept as a fallback."}}},scm:{type:"string",description:"Source-code-management host. Supported values are `github` and `bitbucket`; new hosts can be added additively.",enum:["github","bitbucket"]},ticket:{type:"object",description:"Ticket (issue) configuration: title rendering, the base URL used to resolve bare ticket references, and the `pull-from-backlog` settings.",properties:{title_format:{type:"string",description:"Template string used to render ticket (issue) titles. Supports the same token vocabulary as `commit.title_format`."},base_url:{type:"string",description:"Org-stable base URL that a bare ticket id is appended to when reconstructing a ticket URL, for platforms where the URL cannot otherwise be derived (e.g. Jira `https://org.atlassian.net/browse/`). The trailing slash is optional. Surfaced into the branch manifest as `ticket_base_url`."},pull:{type:"object",description:"Settings of the `pull-from-backlog` skill, read from the project preferences file only.",properties:{assignOnPick:{type:"boolean",default:!1,description:"Assign the user to a picked ticket without asking first."},excludeLabels:{type:"array",items:{type:"string",minLength:1},default:["status:blocked","status:on-hold"],description:"Labels that make a ticket ineligible to be pulled, matched without regard to case. An ineligible ticket is never a candidate and does not count toward picking the Now milestone. An empty list disables exclusion."},now:{type:"string",minLength:1,description:"Title of the open milestone that forms the Now set. Without it, the Now set is the open milestone with the nearest due date, else the open milestone with the most open eligible issues (see `excludeLabels`), else the whole backlog."},priorityPrefix:{type:"string",minLength:1,default:"priority:",description:"Prefix of the priority labels. The value after it ranks `high`, `medium`, then `low`; any other value ranks as unlabelled."},staleBranchDays:{type:"integer",minimum:1,default:14,description:"Days since an in-progress branch's last commit at which the skill warns about it."},staleGroomDays:{type:"integer",minimum:1,default:14,description:"Days since the last groom at which the skill offers `/groom-backlog`."},staleGroomNewTickets:{type:"integer",minimum:1,default:10,description:"Open tickets created since the last groom at which the skill offers `/groom-backlog`."}},additionalProperties:!1}},required:["title_format"]},triage_feedback:{type:"object",description:"Settings of the `triage-feedback` skill.",properties:{defer_days:{type:"integer",minimum:1,description:"The days for which a deferred feedback cluster stays out of a triage, unless it gains an undeferred event. Defaults to 30."}}}},additionalProperties:!1};function $o(s,e){let t=Math.max(1,Math.floor(s.length/3)),i;for(let n of e.toSorted()){let r=vu(s.toLowerCase(),n.toLowerCase());r<=t&&(i===void 0||r<i.distance)&&(i={key:n,distance:r})}return i?.key}a($o,"findNearestKey");function vu(s,e){let t=Array.from({length:e.length+1},(i,n)=>n);for(let i=1;i<=s.length;i++){let n=[i];for(let r=1;r<=e.length;r++){let o=(t[r-1]??0)+(s[i-1]===e[r-1]?0:1);n[r]=Math.min((t[r]??0)+1,(n[r-1]??0)+1,o)}t=n}return t[e.length]??0}a(vu,"measureEditDistance");function Mo(s,e){let t=[];return zt(s,e,[],t),t}a(Mo,"validatePreferences");function ku(s){return s.length===0?"(root)":s.map((e,t)=>typeof e=="number"?`[${e}]`:t===0?e:`.${e}`).join("")}a(ku,"formatPath");function Nu(s,e){switch(e){case"array":return Array.isArray(s);case"boolean":return typeof s=="boolean";case"integer":return Number.isSafeInteger(s);case"number":return typeof s=="number";case"object":return le(s);case"string":return typeof s=="string";default:return!0}}a(Nu,"matchesType");function ce(s,e,t,i){s.push({level:e,path:ku(t),message:i})}a(ce,"report");function Au(s,e,t,i){if(e.items!==void 0)for(let[n,r]of s.entries())zt(r,e.items,[...t,n],i)}a(Au,"walkArray");function qu(s,e,t,i){let n=le(e.properties)?e.properties:void 0,r=e.required;if(Array.isArray(r))for(let o of r)typeof o=="string"&&!Object.hasOwn(s,o)&&ce(i,"error",t,`missing required key '${o}'`);for(let[o,l]of Object.entries(s)){let c=[...t,o];if(n!==void 0&&Object.hasOwn(n,o))zt(l,n[o],c,i);else if(le(e.additionalProperties))zt(l,e.additionalProperties,c,i);else if(n!==void 0&&e.additionalProperties!==!0){let f=$o(o,Object.keys(n)),p=f===void 0?"":`; did you mean '${f}'?`;ce(i,"warning",c,`unrecognized key${p}`)}}}a(qu,"walkObject");function zt(s,e,t,i){if(le(e)){if(e.type!==void 0&&!Nu(s,e.type)){let n=typeof e.type=="string"?e.type:JSON.stringify(e.type);ce(i,"error",t,`expected ${n} (got ${JSON.stringify(s)})`);return}if(Array.isArray(e.enum)&&!e.enum.includes(s)){let n=e.enum.map(r=>JSON.stringify(r)).join(", ");ce(i,"error",t,`must be one of ${n} (got ${JSON.stringify(s)})`)}if(typeof e.minLength=="number"&&typeof s=="string"&&s.length<e.minLength&&ce(i,"error",t,`must be at least ${e.minLength} characters long`),typeof e.minimum=="number"&&typeof s=="number"&&s<e.minimum&&ce(i,"error",t,`must be at least ${e.minimum} (got ${s})`),typeof e.minProperties=="number"&&le(s)){let n=Object.keys(s).length;n<e.minProperties&&ce(i,"error",t,`must have at least ${e.minProperties} keys (got ${n})`)}le(s)?qu(s,e,t,i):Array.isArray(s)&&Au(s,e,t,i)}}a(zt,"walkValue");async function Lu(s,e,t=Do(F.argv[1])){if(s.includes("--help")||s.includes("-h"))return F.stdout.write(Cu(t)),0;let i;try{i=Iu(s)}catch(l){return F.stderr.write(`${t}: ${te(l)}; run ${t} --help for usage
141
+ `),1}let n=i.files.length===0,r=n?[ze.join(".agents","preferences.yaml")]:i.files,o=[];for(let l of r)o.push(await $u(ze.resolve(e,l),{isOptional:n,isStrict:i.strict}));if(i.json)for(let l of o)F.stdout.write(`${JSON.stringify(l)}
142
+ `);else F.stdout.write(Pu(o,e,t));return o.every(l=>l.valid)?0:1}a(Lu,"runValidatePreferences");async function Tu(s,e,t){try{return await Lu(s,e,t)}catch(i){return F.stderr.write(`${t}: ${te(i)}
143
+ `),1}}a(Tu,"runValidatePreferencesCommand");To(import.meta.url,"validate-preferences")&&F.exit(await Tu(F.argv.slice(2),F.cwd(),Do(F.argv[1])));function Cu(s){return[`${s}: validate preferences.yaml files against the preferences schema bundled with this release`,"",`Usage: ${s} [--json] [--strict] [file...]`,"","Arguments:"," file A preferences file to validate. Every named file must exist."," Without one, validates .agents/preferences.yaml, which may be absent.","","Options:"," --json Print one JSON object per file: { file, present, valid, findings }"," --strict Treat warnings, such as an unrecognized key, as failures"," -h, --help Print this help","","Exits 1 when any file is invalid, and 0 otherwise.","","Example:",` ${s} --strict .agents/preferences.yaml ~/.agents/preferences.yaml`,""].join(`
144
+ `)}a(Cu,"buildHelp");function Do(s){return s===void 0?"validate-preferences":ze.basename(s,ze.extname(s))}a(Do,"deriveProgramName");function Pu(s,e,t){let i=[];for(let r of s){let o=ze.relative(e,r.file)||r.file;!r.present&&r.valid&&i.push(`${o}: not present; the file is optional`);for(let l of r.findings)i.push(`${o}: ${l.path}: ${l.level}: ${l.message}`)}let n=s.filter(r=>!r.valid).length;return i.push(n===0?`${t}: ${s.length} file(s) valid`:`${t}: ${n} of ${s.length} file(s) invalid`),`${i.join(`
145
145
  `)}
146
- `}a(Cu,"formatText");function Pu(s){let{values:e,positionals:t}=Eu({args:[...s],allowPositionals:!0,options:{json:{type:"boolean",default:!1},strict:{type:"boolean",default:!1}},strict:!0});return{json:e.json,strict:e.strict,files:t}}a(Pu,"parseOptions");async function Iu(s,{isOptional:e,isStrict:t}){let i;try{i=await Ou(s,"utf8")}catch(l){if(!Co(l))throw l;return e?{file:s,present:!1,valid:!0,findings:[]}:{file:s,present:!1,valid:!1,findings:[{level:"error",path:"(root)",message:"file not found"}]}}let n;try{n=(0,_o.parse)(i)}catch(l){let c={level:"error",path:"(root)",message:`malformed YAML: ${te(l)}`};return{file:s,present:!0,valid:!1,findings:[c]}}let r=Mo(n??{},Io),o=t?r.length===0:r.every(l=>l.level!=="error");return{file:s,present:!0,valid:o,findings:r}}a(Iu,"validateFile");export{Lu as runValidatePreferences};
146
+ `}a(Pu,"formatText");function Iu(s){let{values:e,positionals:t}=Eu({args:[...s],allowPositionals:!0,options:{json:{type:"boolean",default:!1},strict:{type:"boolean",default:!1}},strict:!0});return{json:e.json,strict:e.strict,files:t}}a(Iu,"parseOptions");async function $u(s,{isOptional:e,isStrict:t}){let i;try{i=await Ou(s,"utf8")}catch(l){if(!Co(l))throw l;return e?{file:s,present:!1,valid:!0,findings:[]}:{file:s,present:!1,valid:!1,findings:[{level:"error",path:"(root)",message:"file not found"}]}}let n;try{n=(0,_o.parse)(i)}catch(l){let c={level:"error",path:"(root)",message:`malformed YAML: ${te(l)}`};return{file:s,present:!0,valid:!1,findings:[c]}}let r=Mo(n??{},Io),o=t?r.length===0:r.every(l=>l.level!=="error");return{file:s,present:!0,valid:o,findings:r}}a($u,"validateFile");export{Lu as runValidatePreferences,Tu as runValidatePreferencesCommand};
@@ -13,7 +13,7 @@ The artifact directory is the developer's audit trail of development. Its plans,
13
13
 
14
14
  ## Directory structure
15
15
 
16
- All artifacts are stored under a configurable base directory (`base_dir`, default `~/ai-artifacts`). Invoke the bundled session-context deriver (`node {harness_home_dir}/skills/derive-session-context/derive-session-context.mjs`) to resolve `artifact_base_dir`:
16
+ All artifacts are stored under a configurable base directory (`base_dir`, default `~/ai-artifacts`). Invoke the bundled session-context deriver (`node {harness_home_dir}/skills/derive-session-context/derive-session-context.mjs`) to resolve the directories. Its manifest is the source of each: `artifact_base_dir` for `{base_dir}/`, `project_artifact_dir` for `{base_dir}/projects/{project-slug}/`, and `ticket_dir` for `{base_dir}/projects/{project-slug}/tickets/{ticket-id}/`, which is `null` when the branch does not encode a ticket. The tree illustrates the layout; read the paths from the manifest rather than composing them:
17
17
 
18
18
  ```
19
19
  {base_dir}/
@@ -141,7 +141,7 @@ The reader does still hard-fail on malformed YAML, missing git state, and shape
141
141
  {base_dir}/projects/{project-slug}/tickets/{ticket-id}/
142
142
  ```
143
143
 
144
- Ticket-level artifacts and run directories are both stored here. Invoke the bundled session-context deriver to obtain `ticket_id`, which includes any prefix other than `#` (see [Ticket ID](#ticket-id)).
144
+ Ticket-level artifacts and run directories are both stored here, in the manifest's `ticket_dir`. Its last segment is `ticket_id`, which includes any prefix other than `#` (see [Ticket ID](#ticket-id)). When `ticket_dir` is `null`, `save-artifact` states the directory to use.
145
145
 
146
146
  ### Run paths
147
147
 
@@ -160,7 +160,7 @@ Ticket-level artifacts and run directories are both stored here. Invoke the bund
160
160
  | feedback-triage | `feedback-triage` | `{base_dir}/projects/{project-slug}/feedback-triage/` |
161
161
  | plans | `plans` | `{base_dir}/projects/{project-slug}/plans/` |
162
162
 
163
- Non-ticket paths are relative to the project directory. Category names remain configurable via `artifacts.paths.{category}` in preferences.yaml, with three exceptions: `deferred-findings`, `feedback-curation`, and `feedback-triage` are hardcoded and cannot be overridden.
163
+ Non-ticket paths are relative to the project directory, the manifest's `project_artifact_dir`. Category names remain configurable via `artifacts.paths.{category}` in preferences.yaml, with three exceptions: `deferred-findings`, `feedback-curation`, and `feedback-triage` are hardcoded and cannot be overridden.
164
164
 
165
165
  Devlogs, deferred-findings, feedback-curation, and feedback-triage artifacts are dual-homed: When a ticket is in session context they are written as ticket-level artifacts under `tickets/{ticket-id}/`; otherwise they fall back to the project-scoped paths above (`devlogs/`, `deferred-findings/`, `feedback-curation/`, and `feedback-triage/`). All filenames in these types use the standard `YYYYMMDD-HHMMSSZ` ticket-level timestamp shape regardless of which directory they are written to.
166
166
 
@@ -6,7 +6,7 @@ The skill that opens the work in a ticket's worktree follows from the ticket's s
6
6
 
7
7
  - **The ticket's state**: open or closed, from the platform fetch in [ticket source resolution](ticket-source-resolution.md#platform-specific-fetch).
8
8
  - **The branch's pull request**: `pr_url` from the session-context manifest, or else the pull request whose head is `branch_name` in any state (on GitHub, `gh pr list --head {branch_name} --state all --json url,state`). `pr_url` is usually null on a ticket branch, so the lookup is the common case.
9
- - **The ticket directory**: `{artifact_base_dir}/projects/{project_slug}/tickets/{ticket_id}/`, and the artifact types that [artifact conventions](artifact-conventions.md) defines. The newest plan is the one that the plan resolution of {skill?:implement-plan} selects (its [process](../implement-plan/SKILL.md#process), step 2): the greatest filename prefix across `*_plan.md` and `*_plan-v*.md`, never `*_plan-review.md`. The newest artifact of any other type is the one with the greatest filename prefix.
9
+ - **The ticket directory**: The manifest's `ticket_dir`, and the artifact types that [artifact conventions](artifact-conventions.md) defines. The newest plan is the one that the plan resolution of {skill?:implement-plan} selects (its [process](../implement-plan/SKILL.md#process), step 2): the greatest filename prefix across `*_plan.md` and `*_plan-v*.md`, never `*_plan-review.md`. The newest artifact of any other type is the one with the greatest filename prefix.
10
10
 
11
11
  ## Routes
12
12
 
@@ -0,0 +1,15 @@
1
+ # Reduced object relatives: rare cases
2
+
3
+ The "Reduced object relatives" rule of the writing preferences governs these cases, which its repairs do not settle on their own.
4
+
5
+ ## A gap after a copula
6
+
7
+ **A predicate-nominal gap takes the restored relativizer.** "the throwing mock that it is", never "the throwing mock it is". Neither of the other repairs applies to it: A copula does not have a preposition to pied-pipe or an actor to promote into a participle. If the restored relativizer reads stiffly, recast.
8
+
9
+ ## A coordinated gap
10
+
11
+ **A coordinated gap takes a doubled relative or one shared stranded relativizer.** When a direct-object gap coordinates with an oblique one, pied-piping cannot apply to the first, which does not have a preposition to pipe. The parallel forms are "the error which it threw or with which it rejected" and "the error that it threw or rejected with".
12
+
13
+ ## The anaphoric one-series as head
14
+
15
+ The anaphoric one-series heads a relative clause under the rule too, though it is not a lexical noun, because a relativizer restores to it: "one that the spy carries".
@@ -97,14 +97,15 @@ The agent that ends a spike posts its conclusion on the ticket as a comment, the
97
97
  - The counts and the proposed groupings, when the spike produced them.
98
98
  - Links to the published page, when the spike published one, and to the findings artifact, with the artifact's path written `~/`-relative, so that the post does not publish a home-directory path.
99
99
 
100
- The skill that ends the spike offers the post. When the findings leave an item without a disposition, the triage round that disposes of them on the same ticket ends the spike: `triage-spike-findings` offers the post, and the skill that produced the findings names the triage as its next step without offering the post, which could not yet answer the decisions to enable. When the findings leave nothing to triage, the skill that produced them offers it. A follow-up triage ticket for a later batch does not take a closing post, because its dispositions comment is its record: `triage-spike-findings` closes it as completed, without a post, once that comment is posted, under the confirmation that covers the round's writes. The post on the original ticket names the follow-ups.
100
+ The skill that ends the spike offers the post. When the findings leave an item without a disposition and the ticket is on a [triage platform](#triage-platforms), the triage round that disposes of them on the same ticket ends the spike: `triage-spike-findings` offers the post, and the skill that produced the findings names the triage as its next step without offering the post, which could not yet answer the decisions to enable. When the findings leave nothing to triage, the skill that produced them offers it. A follow-up triage ticket for a later batch does not take a closing post, because its dispositions comment is its record: `triage-spike-findings` closes it as completed, without a post, once that comment is posted, under the confirmation that covers the round's writes. The post on the original ticket names the follow-ups.
101
101
 
102
102
  Offer the post and the close as one item in the closing action-items block of that skill, show the post's body, and name both actions in the ask: "Post this conclusion on #420 and close it as completed?". Make both writes only on consent: They are remote writes, and the developer is the one who can tell whether a finding is fit for the ticket's tracker and whether the spike is done. Consent to the offer is the developer's call on closing the ticket. When the developer declines, post nothing and leave the ticket open. When the session does not have a ticket, do not offer it.
103
103
 
104
104
  Before writing, read the ticket's comments and its state, and decide each write on its own, so that a rerun neither posts the conclusion twice nor fails on a closed ticket:
105
105
 
106
106
  - Post the conclusion unless a comment already opens with the post's first line. Pass the body through a file, per [gh body file](ticket-source-resolution.md#gh-body-file).
107
- - Close the ticket with `gh issue close {number} --reason completed` only while its state is `OPEN`.
107
+ - Close a GitHub ticket with `gh issue close {number} --reason completed` only while its state is `OPEN`.
108
+ - Make both writes on a Jira ticket with `node {harness_home_dir}/scripts/manage-jira-ticket.mjs close --key {key} --post {body file}`, which makes both checks and transitions the ticket only while its status category is not `done`. The repository's `integrations.jira.done_status` preference names the status to which it transitions. When `acli` is unavailable or signed in to another site, make the same two checks through the Jira client that {skill?:update-jira-ticket} names.
108
109
 
109
110
  ## Findings batches
110
111
 
@@ -112,6 +113,12 @@ A batch is the set of items that one triage round inventories: the proposals, fi
112
113
 
113
114
  Each batch has a ticket of its own, which covers the assessment that produced the batch and the triage round that disposes of it, so the ticket's [closing post](#closing-post) follows the triage round. An assessment that spans more than one unit is an umbrella with one child per unit, each child covering that unit's assessment and triage round and blocked by the child before it, so that each round runs after the earlier rounds have posted their dispositions and can read them. A findings artifact that holds more than 10 items is triaged in several batches, each on its own ticket, as `triage-spike-findings` states.
114
115
 
116
+ ## Triage platforms
117
+
118
+ `triage-spike-findings` supports GitHub and Jira. The platform is where the tickets live, resolved as {skill?:create-ticket} step 3 resolves it, not the code host that the session-context manifest's `scm` names: A Bitbucket repository can keep its tickets in Jira.
119
+
120
+ On a ticket on any other platform, the skill that produced the findings does not name the triage as its next step: It names the items that the findings leave for disposal by hand, and offers the [closing post](#closing-post) as it does when the findings leave nothing to triage. `triage-spike-findings` stops at its preflight on such a ticket.
121
+
115
122
  ## Aligning a spike
116
123
 
117
124
  When `align-ticket-with-implementation` reconciles a spike, the branch's "implementation" is the findings: Reconcile whether the investigation answered its questions and reached a recommendation, not whether the branch met acceptance criteria. Align the ticket's questions and decisions to what the investigation actually concluded.
@@ -7,7 +7,10 @@ The author may have framed it poorly, missed the actual problem, scoped it too n
7
7
  - **Is the problem real?** Reproduce or verify the underlying observation, not just the framing.
8
8
  - **Is the scope right?** Look for related instances of the same defect class, neighboring code paths, or assumptions that don't hold beyond the ticket's frame. Scope can grow, not only shrink: By default, the agent folds work required by the problem into the current change rather than deferring it; see [scope-and-deferral](./scope-and-deferral.md). Scope can also be too large: When the ticket contains two or more pieces that can each be merged and verified on their own, raise the split before design begins, while the cut still requires an edit rather than a rewrite of the ticket, new children, a re-cut plan, and work already committed against it.
9
9
  - **Is the proposed solution sound?** A ticket may include a recommended fix that solves the symptom but not the cause, or that fixes the cause less well than an alternative. Apply the [design priorities](./design-priorities.md) criteria: A convenient-but-wrong fix is unsound, even if it matches surrounding code.
10
+ - **Can its pull request settle each criterion?** When the ticket's work is a code change, apply the test of the merge-settled criterion convention below to each acceptance criterion. Report each criterion that fails it, and recommend the ticket to which it moves: the ticket that consumes the change, or a new ticket when the tracker does not contain one.
10
11
  - **Is the title accurate?** "Flaky test in X" may be a hygiene anti-pattern that exists in three places. Reframe titles when the underlying truth is broader or different.
11
12
  - **Is the change worth making?** Synthesize the above: Doing nothing, or doing something narrower, may be the right call. Don't treat acceptance as the default.
12
13
 
14
+ <!-- include: ../_partials/merge-settled-criterion.md / -->
15
+
13
16
  When evaluation reveals a divergence from the ticket as written, raise the observation to the user before designing, but lead with the substantive finding, not the ticket. The ticket's job was to start the conversation; once it has started, the codebase reality and the user's judgment decide, not the original wording.
@@ -1,17 +1,17 @@
1
1
  ## Implementation-order list
2
2
 
3
- Print open tickets in the order in which to implement them, as a tree for a narrow column. The step that links here names the tickets, in the order in which it reached them, an `--external` entry for each ticket outside GitHub, and an `--edge` for each dependency that the tracker does not record. A bundled helper reads the tickets, orders them, and writes the fixed part of every line. You shorten the titles and mark the publish gates.
3
+ Print open tickets that have work of their own in the order in which to implement them, as a tree for a narrow column. An umbrella, a ticket that has sub-issues, is left out, because its children do its work; the step names the children for them to be listed. The step that links here names the tickets, in the order in which it reached them, an `--external` entry for each ticket outside GitHub, and an `--edge` for each dependency that the tracker does not record. A bundled helper reads the tickets, orders them, and writes the fixed part of every line. You shorten the titles and mark the publish gates.
4
4
 
5
5
  1. **Run the helper.**
6
6
 
7
7
  ```bash
8
8
  node {harness_home_dir}/skills/implementation-order/implementation-order.mjs \
9
- --ticket {OWNER/REPO#N} --external "{KEY}={Title}" --edge "{BLOCKER}>{BLOCKED}"
9
+ --ticket {OWNER/REPO#N} --external "{REPOSITORY}:{KEY}={Title}" --edge "{BLOCKER}>{BLOCKED}"
10
10
  ```
11
11
 
12
- Write a GitHub ticket as `OWNER/REPO#N`, taking the repository from the ticket's URL. Repeat each flag once per ticket or edge. Each side of an edge is `OWNER/REPO#N` or a key that an `--external` declares, and the blocked side is a listed ticket. On a non-zero exit, report the helper's stderr and do not print the list: A list that lacks a ticket misstates the order.
12
+ Write a GitHub ticket as `OWNER/REPO#N`, taking the repository from the ticket's URL. For a ticket outside GitHub, `{REPOSITORY}` is the repository in which the ticket is implemented, as `OWNER/NAME` when the owner is known and `NAME` otherwise; it gives the ticket that repository's prefix. Omit `{REPOSITORY}:` only when the repository is not known. Repeat each flag once per ticket or edge. Each side of an edge is `OWNER/REPO#N` or the key, without its repository, that an `--external` declares, and the blocked side is a listed ticket. On a non-zero exit, report the helper's stderr and do not print the list: A list that lacks a ticket misstates the order.
13
13
 
14
- The helper prints `{"tickets": [...], "omitted": [...], "cycle": [...]}`. `tickets` is in list order. `omitted` names the closed tickets, which the list leaves out.
14
+ The helper prints `{"tickets": [...], "omitted": [...], "cycle": [...]}`. `tickets` is in list order. `omitted` names each ticket that the list leaves out, with its `reason`: `closed`, or `umbrella` for an open ticket that has sub-issues.
15
15
 
16
16
  2. **Shorten each title** to at most the ticket's `titleBudget` characters. Cut words rather than end with an ellipsis, and keep the leading verb. Leave a title that already fits as it is.
17
17
 
@@ -0,0 +1 @@
1
+ **Merge-settled criterion convention:** When writing a ticket whose work is a code change, state only the criteria that its pull request can satisfy or falsify. The test is whether the pull request's tests, checks, or review can show the criterion to hold or to fail at merge. A criterion that fails the test is an operational step, which depends on elapsed time, on deployed state, or on a run against shared data, such as "a deployed agent, run a day after seeding, places every fixture in its expected section". Move such a step to the ticket that consumes the change, or propose a ticket of its own for it when the tracker does not contain one that consumes the change, so that the code ticket can close when its pull request merges.
@@ -60,7 +60,7 @@
60
60
 
61
61
  **Per-task documentation placement:** When a task writes or revises guidance or documentation, its key decisions name the source that defines each fact that the task documents, and the task writes a pointer to that source rather than a copy, per the "Documentation placement" section of the shared agent instructions.
62
62
 
63
- **Per-task interface guidance:** When a task defines colour tokens, styles or writes interface text, or builds a page, a prototype, or a UI component, consult {rulebook:accessibility-conventions} and {rulebook:ui-copy-conventions} while planning the task. Its key decisions state the contrast and size floors and the contrast check, the interaction states that each interactive element shows, the model, the placement, and the state attribute of each control that reveals a region or toggles a setting, the cue that marks each state for which a reader scans a list, and the copy rules and the copy budget, so that the constraints are available to an implementer that cannot load the rulebooks. When the plan changes a visible component, its `## Verification` includes the rulebook's browser check of each new or changed interactive element.
63
+ **Per-task interface guidance:** When a task defines colour tokens, styles or writes interface text, or builds a page, a prototype, or a UI component, consult {rulebook:accessibility-conventions}, {rulebook:visual-design-conventions}, and {rulebook:ui-copy-conventions} while planning the task. Its key decisions state the contrast and size floors and the contrast check, the interaction states that each interactive element shows, the model, the placement, and the state attribute of each control that reveals a region or toggles a setting, the explanation of each action whose consequence is not evident from its label and the form that it takes, the cue that marks each state for which a reader scans a list, the spacing, alignment, mark, role, and identity rules, and the copy rules and the copy budget, so that the constraints are available to an implementer that cannot load the rulebooks. When the plan changes a visible component, its `## Verification` includes the browser check of each new or changed interactive element that the accessibility rulebook states and the browser check of each new or changed view that the visual-design rulebook states.
64
64
 
65
65
  **Data-change guidance:** When the work changes the shape of persisted data or writes to shared state, consult {rulebook:shared-data-conventions} while planning. Scope the plan to one step of the expand, migrate, contract sequence, and name that step in the key decisions of each task that touches the data. A task or verification check does not run a migration or another write against shared state before merge. When a verdict from an agent decides such a write, the acceptance criteria of the task that implements the verdict name the evidence and the script that checks it before the write. When the work adds or changes a skill that writes to shared state, `## Verification` runs the skill against the real data up to its approval checkpoint or as a dry run, and reviews each verdict that the run would act on.
66
66
 
@@ -1,9 +1,9 @@
1
- 1. **Get context**: Invoke `node {harness_home_dir}/skills/derive-session-context/derive-session-context.mjs` via Bash. The bundle emits the session-context manifest JSON to stdout; extract `branch_name`, `default_branch`, `ticket_id`, `ticket_ref`, `ticket_url`, `scm`, `project_slug`, and `artifact_base_dir` from it.
1
+ 1. **Get context**: Invoke `node {harness_home_dir}/skills/derive-session-context/derive-session-context.mjs` via Bash. The bundle emits the session-context manifest JSON to stdout; extract `branch_name`, `default_branch`, `ticket_id`, `ticket_ref`, `ticket_url`, `scm`, and `ticket_dir` from it.
2
2
 
3
3
  2. **Resolve the plan**: Stop at the first source that yields one:
4
4
  - **Explicit `--plan=<path>`**: Read it.
5
5
  - **Already in context**: This session produced or read the plan. Use it as-is; do not re-read the file.
6
- - **Newest plan for the ticket**: The newest of `*_plan.md` and `*_plan-v*.md` under `{artifact_base_dir}/projects/{project_slug}/tickets/{ticket_id}/` (run subdirectories included), by the greatest `YYYYMMDD-HHMMSSZ` filename prefix. Both forms have that prefix, so they sort chronologically together and the lexicographically greatest is the newest across the two. Because `refine-plan` writes its revision as `_plan-v2.md` under a later prefix than the plan that it revises, matching both forms lets a refined plan take precedence over the original that it supersedes. Do not widen to `*_plan*.md`, which also matches the `_plan-review.md` artifact written beside the revision.
6
+ - **Newest plan for the ticket**: The newest of `*_plan.md` and `*_plan-v*.md` under `{ticket_dir}/` (run subdirectories included), by the greatest `YYYYMMDD-HHMMSSZ` filename prefix. Both forms have that prefix, so they sort chronologically together and the lexicographically greatest is the newest across the two. Because `refine-plan` writes its revision as `_plan-v2.md` under a later prefix than the plan that it revises, matching both forms lets a refined plan take precedence over the original that it supersedes. Do not widen to `*_plan*.md`, which also matches the `_plan-review.md` artifact written beside the revision.
7
7
  - **Ask**: The sources above do not resolve a plan. Ask the user for a path rather than working from the ticket alone: A caller who invoked this skill has a plan in mind.
8
8
 
9
9
  Announce the resolved path and its timestamp before executing anything. Several plans can exist for one ticket, and the newest is not always the intended one: This announcement is how the user catches a superseded plan while the choice can still change without cost. It is not ceremony, and it is not skippable when the resolution was unambiguous.
@@ -1,3 +1,3 @@
1
- **Create the tickets.** Create the pieces in order with `{skill:create-ticket}`. With three or more pieces, pass `--parent` naming the originating ticket. For a piece that depends on an earlier piece being merged first, pass `--blocked-by` naming that piece's reference, which exists by then.
1
+ **Create the tickets.** Create the pieces in order with `{skill:create-ticket}`. With three or more pieces, pass `--parent` naming the originating ticket. On Jira, the children of an originating ticket at level 0, such as a `Task`, are created as its subtasks, as `{skill:create-ticket}` states for `--parent`: Each child then stays in the umbrella's project and sprint and cannot have children of its own. The originating ticket's type is not changed to an epic instead, because Jira handles a change across hierarchy levels as a move, which `acli` does not expose, and an epic cannot keep the originating ticket's existing epic as its parent. For a piece that depends on an earlier piece being merged first, pass `--blocked-by` naming that piece's reference, which exists by then.
2
2
 
3
3
  **Rewrite the originating ticket.** Write the originating ticket's new body per the platform-specific write in [ticket source resolution](../_data/ticket-source-resolution.md#platform-specific-write).
@@ -1,3 +1,5 @@
1
+ <!-- include: merge-settled-criterion.md / -->
2
+
1
3
  **Test criterion convention:** When writing a ticket that changes testable behavior, include a test criterion in its acceptance criteria that asks for coverage at the cheapest tier that observes the behavior, per the placement rules in the `testing-conventions` skill (e.g., "New/modified behavior in this change is covered by tests at the cheapest tier that observes it"). Omit it when the change falls entirely within the carve-outs defined in the `testing-conventions` skill, or when the only tests that it would require are ones that fail that skill's bar for earning a place.
2
4
 
3
5
  **Documentation criterion convention:** When writing a ticket that adds, removes, or renames user-facing surface (CLI flags, commands, API endpoints, configuration keys, environment variables), include in its acceptance criteria the corresponding updates to documentation, help text, and usage examples, including removal of references to anything that no longer exists.
@@ -96,11 +96,11 @@ The skill writes two artifacts: the ticket of record on its platform, and a loca
96
96
 
97
97
  ### Path resolution
98
98
 
99
- Invoke `node {harness_home_dir}/skills/derive-session-context/derive-session-context.mjs` via Bash. The bundle emits the session-context manifest JSON to stdout; read `artifact_base_dir`, `project_slug`, and `ticket_id` from it (the same invocation in step 1 already populated the manifest file, so this is a fast-path read).
99
+ Invoke `node {harness_home_dir}/skills/derive-session-context/derive-session-context.mjs` via Bash. The bundle emits the session-context manifest JSON to stdout; read `ticket_dir` from it (the same invocation in step 1 already populated the manifest file, so this is a fast-path read).
100
100
 
101
101
  Follow [artifact conventions](../_data/artifact-conventions.md).
102
102
 
103
- Ticket directory: `{artifact_base_dir}/projects/{project_slug}/tickets/{ticket_id}/`
103
+ Ticket directory: `{ticket_dir}/`, or the directory that {skill:save-artifact} states when `ticket_dir` is null
104
104
 
105
105
  Artifact type: `ticket`. Filename format:
106
106
 
@@ -99,4 +99,4 @@ Save the document with {skill:save-artifact} as a ticket-level `performance-find
99
99
 
100
100
  ### 7. Report
101
101
 
102
- Once the developer approves the findings, give the artifact's path and one line of counts: pages measured, metrics failing by class, and improvements by effort. Name {skill:triage-spike-findings} as the next step, with the artifact's path as its input. Improvements above the ceiling of a [findings batch](../_data/spike-conventions.md#findings-batches) are triaged in several batches, each on its own ticket.
102
+ Once the developer approves the findings, give the artifact's path and one line of counts: pages measured, metrics failing by class, and improvements by effort. When the ticket is on a [triage platform](../_data/spike-conventions.md#triage-platforms), name {skill:triage-spike-findings} as the next step, with the artifact's path as its input; otherwise, name the improvements left for disposal by hand. Improvements above the ceiling of a [findings batch](../_data/spike-conventions.md#findings-batches) are triaged in several batches, each on its own ticket.
@@ -9,7 +9,7 @@ supported-harnesses: [claude]
9
9
 
10
10
  Find the code and tests in one unit of a codebase that would be written differently if they were written afresh today, and propose one change for each. Each lens is a {subagent:code-health-assessor} that reads the unit without seeing any other lens's report. You run the sensors, write the brief that every lens reads, dispatch the lenses, check every proposal's evidence against the tree, and merge the proposals into one findings artifact.
11
11
 
12
- The skill does not grade anything: The findings artifact is the input of `triage-spike-findings`, which grades each proposal, has a challenger argue against every grade, and decides what becomes a ticket. When the findings leave nothing to triage, its remote writes are the [closing post](../_data/spike-conventions.md#closing-post) on the ticket and the ticket's close, both made on one consent from the developer; otherwise the triage round makes both.
12
+ The skill does not grade anything: The findings artifact is the input of `triage-spike-findings`, which grades each proposal, has a challenger argue against every grade, and decides what becomes a ticket. When the findings leave nothing to triage, or the ticket is not on a [triage platform](../_data/spike-conventions.md#triage-platforms), its remote writes are the [closing post](../_data/spike-conventions.md#closing-post) on the ticket and the ticket's close, both made on one consent from the developer; otherwise the triage round makes both.
13
13
 
14
14
  ## Inputs
15
15
 
@@ -100,7 +100,7 @@ As each lens returns:
100
100
  Merge the passed proposals of every lens into one list, and write it to `{ticket_dir}/code-health/proposals.json`:
101
101
 
102
102
  - **Merge** proposals that share a key: Keep the first source ID as the merged entry's `id`, which the schema limits to one, and list every source ID with the proposal in the findings document. Keep the union of paths and evidence, the strongest strength (`sensor`, then `rule`, then `reading`), the largest size, and the largest reach.
103
- - **Tracked.** Run `check-tracked --proposals {ticket_dir}/code-health/proposals.json` with one `--prior` for each `*_dispositions.md` under `{artifact_base_dir}/projects/{project_slug}/tickets/`. Move every proposal that it lists under `tracked` out of the ranking, into a **Tracked** section with its source and reason. When `tracker.checked` is false, record its reason under residual unknowns.
103
+ - **Tracked.** Run `check-tracked --proposals {ticket_dir}/code-health/proposals.json` with one `--prior` for each `*_dispositions.md` under `{project_artifact_dir}/tickets/`. Move every proposal that it lists under `tracked` out of the ranking, into a **Tracked** section with its source and reason. When `tracker.checked` is false, record its reason under residual unknowns.
104
104
  - **Rank** the rest by reach, then by the best hotspot rank among the proposal's paths (a proposal without a ranked path sorts last), then by ID.
105
105
 
106
106
  Write the findings document:
@@ -122,8 +122,8 @@ Save the document with {skill:save-artifact} as a ticket-level `code-health-find
122
122
 
123
123
  Give the developer the findings artifact's path and one line of counts: proposals ranked, tracked, and dropped.
124
124
 
125
- When the findings rank any proposal, name `triage-spike-findings` as the next step, with the findings artifact's path as its input, and do not offer the closing post: The triage round ends the spike and offers it, as [Closing post](../_data/spike-conventions.md#closing-post) states.
125
+ When the findings rank any proposal and the ticket is on a [triage platform](../_data/spike-conventions.md#triage-platforms), name `triage-spike-findings` as the next step, with the findings artifact's path as its input, and do not offer the closing post: The triage round ends the spike and offers it, as [Closing post](../_data/spike-conventions.md#closing-post) states.
126
126
 
127
- Otherwise, offer to close the ticket with the closing post in the same response's action-items block. The post's contents, the consent, and the checks that a rerun relies on are stated in [Closing post](../_data/spike-conventions.md#closing-post). For an assessment, the answers that the post gives are the counts, and the post names the proposals that a prior disposition or an issue already tracks.
127
+ Otherwise, name the proposals left for disposal by hand when there are any, and offer to close the ticket with the closing post in the same response's action-items block. The post's contents, the consent, and the checks that a rerun relies on are stated in [Closing post](../_data/spike-conventions.md#closing-post). For an assessment, the answers that the post gives are the counts, and the post names the proposals that a prior disposition or an issue already tracks.
128
128
 
129
129
  <!-- guidance-hook: implementation-preferences -->