noskills 4.5.2 → 5.0.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 (223) hide show
  1. package/README.md +497 -18
  2. package/noskills.js +145 -1
  3. package/package.json +14 -1
  4. package/{chunks/ajan-bridge-BNPC757J.js → ts/chunks/ajan-bridge-6UUIUFAV.js} +1 -1
  5. package/ts/chunks/anthropic-ICVQ5GK6.js +1 -0
  6. package/ts/chunks/approve-R7MCYHCS.js +1 -0
  7. package/ts/chunks/ask-GBLFPNFX.js +2 -0
  8. package/ts/chunks/block-YEKLMXHR.js +1 -0
  9. package/ts/chunks/cancel-7NS4WM2N.js +1 -0
  10. package/ts/chunks/chunk-2CLD527I.js +1 -0
  11. package/ts/chunks/chunk-34AWV7DB.js +1 -0
  12. package/ts/chunks/chunk-3M26Y3NG.js +27 -0
  13. package/{chunks/chunk-J25XTDQQ.js → ts/chunks/chunk-3QVRJO3V.js} +1 -1
  14. package/ts/chunks/chunk-5ALJRBMW.js +22 -0
  15. package/ts/chunks/chunk-5NMDE2VZ.js +4 -0
  16. package/ts/chunks/chunk-6BKTY7SA.js +4 -0
  17. package/ts/chunks/chunk-6M7PCVUR.js +1 -0
  18. package/ts/chunks/chunk-6O2RXYTM.js +3 -0
  19. package/ts/chunks/chunk-7DIQYKPL.js +3 -0
  20. package/ts/chunks/chunk-7J6R2D2K.js +2 -0
  21. package/ts/chunks/chunk-AW3XJGEP.js +1 -0
  22. package/ts/chunks/chunk-BRC46A3N.js +39 -0
  23. package/ts/chunks/chunk-C5LYQDQH.js +368 -0
  24. package/ts/chunks/chunk-CCYWFSXR.js +3 -0
  25. package/{chunks/chunk-OAWYVETM.js → ts/chunks/chunk-CL55MNGD.js} +1 -1
  26. package/ts/chunks/chunk-CSP2GUD4.js +29 -0
  27. package/{chunks/chunk-EROZRDGT.js → ts/chunks/chunk-D2UKX2VW.js} +1 -1
  28. package/ts/chunks/chunk-DGYDUGTM.js +1 -0
  29. package/ts/chunks/chunk-FB3Z7XYQ.js +1 -0
  30. package/ts/chunks/chunk-FLLYK5FU.js +1 -0
  31. package/{chunks/chunk-EJYSOUEA.js → ts/chunks/chunk-GCPGG4YB.js} +1 -1
  32. package/{chunks/chunk-FYFUEK4U.js → ts/chunks/chunk-HLDPASM6.js} +1 -1
  33. package/ts/chunks/chunk-HNQA5O2S.js +2 -0
  34. package/ts/chunks/chunk-HUP7XWW6.js +1 -0
  35. package/ts/chunks/chunk-J3XNDEMU.js +4 -0
  36. package/ts/chunks/chunk-K6FVY52W.js +5 -0
  37. package/ts/chunks/chunk-KQJGXVWX.js +91 -0
  38. package/ts/chunks/chunk-M4U4Y3XQ.js +7 -0
  39. package/ts/chunks/chunk-M6CAJL36.js +1 -0
  40. package/ts/chunks/chunk-MPHTBN7E.js +1 -0
  41. package/ts/chunks/chunk-NYIFCLEG.js +1 -0
  42. package/ts/chunks/chunk-RRDWQKZY.js +1 -0
  43. package/ts/chunks/chunk-RVNSKPFL.js +1 -0
  44. package/ts/chunks/chunk-S5F2DAAG.js +5 -0
  45. package/ts/chunks/chunk-SCYP2G2T.js +3 -0
  46. package/ts/chunks/chunk-SWP6BJR6.js +147 -0
  47. package/{chunks/chunk-XDRX4ZBJ.js → ts/chunks/chunk-SWRVSRYY.js} +1 -1
  48. package/ts/chunks/chunk-T2X4E35X.js +1 -0
  49. package/ts/chunks/chunk-TDLTCTV4.js +1 -0
  50. package/ts/chunks/chunk-TKBGNLNV.js +1 -0
  51. package/ts/chunks/chunk-UY4YFVSW.js +3 -0
  52. package/ts/chunks/chunk-V5ZXCJPI.js +2 -0
  53. package/ts/chunks/chunk-W46BJM2F.js +1 -0
  54. package/ts/chunks/chunk-W7KQFMHV.js +1 -0
  55. package/ts/chunks/chunk-XGRZPTAD.js +24 -0
  56. package/ts/chunks/chunk-XTQFSF6C.js +1 -0
  57. package/ts/chunks/chunk-YN3SHWBR.js +1 -0
  58. package/ts/chunks/chunk-ZAY6LSJD.js +2 -0
  59. package/ts/chunks/chunk-ZGVXR3EC.js +8 -0
  60. package/ts/chunks/chunk-ZW5C5IGT.js +32 -0
  61. package/ts/chunks/claude-code-J2V5WSGZ.js +1 -0
  62. package/ts/chunks/concern-EDWQHU4H.js +1 -0
  63. package/ts/chunks/config-E7BDBHPK.js +1 -0
  64. package/ts/chunks/decision-ledger-5QXKZSV2.js +1 -0
  65. package/ts/chunks/delegate-LVQQ3GCV.js +1 -0
  66. package/ts/chunks/diagrams-2F5ZYXA7.js +1 -0
  67. package/ts/chunks/diagrams-H62JGTIS.js +1 -0
  68. package/ts/chunks/done-U3TOSZIX.js +1 -0
  69. package/ts/chunks/followup-J2HJU3ZT.js +1 -0
  70. package/ts/chunks/free-73WMLMCT.js +1 -0
  71. package/ts/chunks/gemini-GA6P4M7D.js +1 -0
  72. package/ts/chunks/init-6CVDGRY2.js +1 -0
  73. package/ts/chunks/invoke-hook-2TMKWL7I.js +15 -0
  74. package/ts/chunks/kiro-BJSKSAUC.js +1 -0
  75. package/ts/chunks/learn-7Q2VWZMI.js +7 -0
  76. package/ts/chunks/ledger-XR4AHZRX.js +2 -0
  77. package/ts/chunks/list-CUQCPXZH.js +1 -0
  78. package/ts/chunks/manager-WTLJ5C2I.js +3 -0
  79. package/ts/chunks/mod-BZA5TFW7.js +1 -0
  80. package/ts/chunks/mod-RWA5ZPYH.js +1 -0
  81. package/ts/chunks/mod-X372UNSQ.js +1 -0
  82. package/ts/chunks/mod-XVE4ZWPY.js +1 -0
  83. package/ts/chunks/next-CEYZSYGB.js +20 -0
  84. package/ts/chunks/node-33JV5VS3.js +15 -0
  85. package/ts/chunks/node-XYP2DQHR.js +74 -0
  86. package/{chunks/node-2XIHQ2M4.js → ts/chunks/node-ZSGIX7K3.js} +1 -1
  87. package/ts/chunks/ollama-X6OGN5BW.js +1 -0
  88. package/ts/chunks/openai-TV7KLQ2C.js +1 -0
  89. package/ts/chunks/openai-YPM2E7QS.js +30 -0
  90. package/ts/chunks/opencode-AK6WWZRF.js +1 -0
  91. package/ts/chunks/pack-EOUSZGJT.js +5 -0
  92. package/ts/chunks/plan-export-ZBINRAAS.js +3 -0
  93. package/ts/chunks/purge-GPMC5A6Y.js +5 -0
  94. package/ts/chunks/reopen-LPVNZN5I.js +1 -0
  95. package/ts/chunks/reset-RNLPXGWQ.js +1 -0
  96. package/ts/chunks/review-ZGAY5XCN.js +1 -0
  97. package/ts/chunks/rule-SNBQ4VZD.js +6 -0
  98. package/ts/chunks/run-4TDP4C7Z.js +3 -0
  99. package/ts/chunks/sdk-MEVPL5WT.js +1 -0
  100. package/ts/chunks/session-J7TSLNEH.js +1 -0
  101. package/ts/chunks/spec-3NSPFDIC.js +1 -0
  102. package/ts/chunks/status-DIEA2OGR.js +1 -0
  103. package/ts/chunks/sync-HZNKILSP.js +1 -0
  104. package/ts/chunks/validate-MWHDOF2F.js +1 -0
  105. package/ts/chunks/vertexai-ARXI4AMJ.js +1 -0
  106. package/ts/chunks/watch-P6HABMAS.js +7 -0
  107. package/ts/chunks/web-BMIC3VJQ.js +1 -0
  108. package/ts/chunks/wontfix-6UKEYTVB.js +1 -0
  109. package/ts/noskills.js +2 -0
  110. package/chunks/anthropic-ZKOMTKX2.js +0 -1
  111. package/chunks/approve-3TKOHYHH.js +0 -1
  112. package/chunks/ask-UB26SBWQ.js +0 -2
  113. package/chunks/block-Q4WAIX7X.js +0 -1
  114. package/chunks/browser-BGFD24RX.js +0 -1
  115. package/chunks/bun-WZ7BVR7Y.js +0 -1
  116. package/chunks/cancel-DY76ADX4.js +0 -1
  117. package/chunks/chunk-34RPTI4K.js +0 -29
  118. package/chunks/chunk-3JTDWOAJ.js +0 -2
  119. package/chunks/chunk-5FX4EBFY.js +0 -5
  120. package/chunks/chunk-5RLCKUIF.js +0 -2
  121. package/chunks/chunk-7PBHRFOZ.js +0 -3
  122. package/chunks/chunk-7PPUGTKL.js +0 -4
  123. package/chunks/chunk-AB3N327V.js +0 -1
  124. package/chunks/chunk-AUZWXMWA.js +0 -27
  125. package/chunks/chunk-BYPCI5VU.js +0 -1
  126. package/chunks/chunk-CH6A3LES.js +0 -91
  127. package/chunks/chunk-CKIZYL4O.js +0 -3
  128. package/chunks/chunk-CTTMQSHF.js +0 -1
  129. package/chunks/chunk-DEHRWREM.js +0 -1
  130. package/chunks/chunk-DYCGJ4RY.js +0 -4
  131. package/chunks/chunk-ENP4P2YH.js +0 -0
  132. package/chunks/chunk-EVJYA7S3.js +0 -21
  133. package/chunks/chunk-FE4MKOI4.js +0 -1
  134. package/chunks/chunk-GNMOE7H3.js +0 -48
  135. package/chunks/chunk-HB62UGZI.js +0 -2
  136. package/chunks/chunk-IFE5SYGK.js +0 -1
  137. package/chunks/chunk-IM73MYMS.js +0 -1
  138. package/chunks/chunk-JYVB6UAV.js +0 -1
  139. package/chunks/chunk-KJLEPI7T.js +0 -1
  140. package/chunks/chunk-KRRPOVQG.js +0 -1
  141. package/chunks/chunk-LGQEWL5X.js +0 -1
  142. package/chunks/chunk-LJEWPIEI.js +0 -1
  143. package/chunks/chunk-LKZZ4JN5.js +0 -110
  144. package/chunks/chunk-NGCBWJML.js +0 -2
  145. package/chunks/chunk-NPWXEWRN.js +0 -4
  146. package/chunks/chunk-O4KKKYCH.js +0 -1
  147. package/chunks/chunk-ONJVI5AZ.js +0 -23
  148. package/chunks/chunk-OP4XAIGW.js +0 -1
  149. package/chunks/chunk-PSX63TYP.js +0 -2
  150. package/chunks/chunk-Q4TI7EYT.js +0 -5
  151. package/chunks/chunk-SLO22P65.js +0 -1
  152. package/chunks/chunk-T6NZVA6P.js +0 -7
  153. package/chunks/chunk-TCSIXKUD.js +0 -3
  154. package/chunks/chunk-VJRCTYGL.js +0 -1
  155. package/chunks/chunk-VXU6XZ66.js +0 -39
  156. package/chunks/chunk-WDKWHGJU.js +0 -146
  157. package/chunks/chunk-XDPATEP5.js +0 -1
  158. package/chunks/chunk-Y45DQJSS.js +0 -3
  159. package/chunks/chunk-Y5E7ZCCX.js +0 -1
  160. package/chunks/chunk-YUTDPPXX.js +0 -1
  161. package/chunks/chunk-Z7OYXH3J.js +0 -1
  162. package/chunks/claude-code-OQJIUKZP.js +0 -1
  163. package/chunks/cmd-46ZIHXLB.js +0 -1
  164. package/chunks/concern-UIGVWDFS.js +0 -1
  165. package/chunks/config-72Z4PIJN.js +0 -1
  166. package/chunks/decision-ledger-5IPPTRT7.js +0 -1
  167. package/chunks/delegate-OV6NY434.js +0 -1
  168. package/chunks/deno-YM5PW6ZM.js +0 -1
  169. package/chunks/diagrams-CBCUA47B.js +0 -1
  170. package/chunks/diagrams-OX4FBDGP.js +0 -1
  171. package/chunks/done-V54GSSTY.js +0 -1
  172. package/chunks/followup-NL7EPIGF.js +0 -1
  173. package/chunks/free-KD344KRL.js +0 -1
  174. package/chunks/gemini-23EOEXSF.js +0 -1
  175. package/chunks/init-WDRNFT57.js +0 -1
  176. package/chunks/invoke-hook-I3NTD36Q.js +0 -13
  177. package/chunks/kiro-TPAAIMY6.js +0 -1
  178. package/chunks/learn-WBWNJEB2.js +0 -7
  179. package/chunks/ledger-QYK252DV.js +0 -1
  180. package/chunks/list-WO6RS7JX.js +0 -1
  181. package/chunks/loader-command-3A5FK2RF.js +0 -1
  182. package/chunks/loader-reactor-YZM7HO4G.js +0 -1
  183. package/chunks/manager-ZSPRC5R4.js +0 -3
  184. package/chunks/mod-7VTKN6Q5.js +0 -1
  185. package/chunks/mod-B6LBGYON.js +0 -1
  186. package/chunks/mod-MMHDQRNF.js +0 -1
  187. package/chunks/mod-RBGAMGZA.js +0 -1
  188. package/chunks/mod-SFSUQWSB.js +0 -8
  189. package/chunks/mod-SV4VELMH.js +0 -1
  190. package/chunks/next-QXCLZ7P3.js +0 -15
  191. package/chunks/node-BXYZKSJY.js +0 -15
  192. package/chunks/node-DMUOWFGA.js +0 -69
  193. package/chunks/node-J4GTOSL2.js +0 -1
  194. package/chunks/ollama-MXRDGQDF.js +0 -1
  195. package/chunks/openai-LE47IWMQ.js +0 -30
  196. package/chunks/openai-MSJF4B6H.js +0 -1
  197. package/chunks/opencode-ZDHKR2P6.js +0 -1
  198. package/chunks/pack-NS64WU6M.js +0 -5
  199. package/chunks/plan-export-HECAF7D4.js +0 -3
  200. package/chunks/purge-PSQNN42H.js +0 -4
  201. package/chunks/reopen-L37M5XUI.js +0 -1
  202. package/chunks/reset-OOTZXW6Q.js +0 -1
  203. package/chunks/review-QLD6WSOB.js +0 -1
  204. package/chunks/rule-OOANQBHB.js +0 -6
  205. package/chunks/run-YHCIRY7Z.js +0 -3
  206. package/chunks/sdk-OQIHH3OY.js +0 -1
  207. package/chunks/session-OWWDH7KA.js +0 -1
  208. package/chunks/spec-O7F525UN.js +0 -1
  209. package/chunks/status-SZZXY7V3.js +0 -1
  210. package/chunks/sync-3RYRGTEA.js +0 -1
  211. package/chunks/unstable_chmod-44MCKF3B.js +0 -1
  212. package/chunks/validate-UZD6JBSG.js +0 -1
  213. package/chunks/vertexai-CVCRCO24.js +0 -1
  214. package/chunks/watch-5DNM646U.js +0 -8
  215. package/chunks/web-662LNB3K.js +0 -1
  216. package/chunks/wontfix-UDCTLHNB.js +0 -1
  217. package/chunks/workerd-I7MLRCLJ.js +0 -1
  218. /package/{chunks/chunk-5OTECUN7.js → ts/chunks/chunk-ATNTR7M5.js} +0 -0
  219. /package/{chunks → ts/chunks}/chunk-HISXAZ4Y.js +0 -0
  220. /package/{chunks → ts/chunks}/chunk-I4Z2RF7L.js +0 -0
  221. /package/{chunks → ts/chunks}/dist-3MH5UCQU.js +0 -0
  222. /package/{chunks → ts/chunks}/multipart-parser-DKDFOZKD.js +0 -0
  223. /package/{chunks → ts/chunks}/src-HXQVVTGQ.js +0 -0
@@ -0,0 +1,368 @@
1
+ import{a as z,b as Q,c as D,d as Z,e as ee,f as te,g as se,i as M,j as oe,k as ne}from"./chunk-AW3XJGEP.js";import{a as h,b as f}from"./chunk-FLLYK5FU.js";import{a as X}from"./chunk-W7KQFMHV.js";import{r as N}from"./chunk-SWP6BJR6.js";import{C as r}from"./chunk-M4U4Y3XQ.js";var Rs=".eser/.state/bin",Ne=3,P=30,re=2,F=124,bs=e=>oe(e)?"read":ne(e)?"push":M(e).subcommand==="clone"?"clone":"write",Ts=e=>{let{subcommand:t}=M(e);return`noskills: refused "git ${t}". This agent session may only read git while allowGit is false in .eser/manifest.yml. The user controls git, the agent controls files.`},ie=e=>e.split(":").filter(t=>t.length>0),xs=(e,t)=>[t,...ie(e).filter(s=>s!==t)].join(":"),Os=(e,t)=>ie(e).filter(s=>s!==t).join(":"),C=e=>`'${e.replaceAll("'","'\\''")}'`,As=e=>`export PATH=${C(e)}:"$PATH"
2
+ `,y=e=>[...e].map(t=>t===""?"''":t).join("|"),Es=e=>{let t=e.checkTimeoutSeconds??P;if(!Number.isInteger(t)||t<=0)throw new Error(`checkTimeoutSeconds must be a positive whole number of seconds, got ${t}`);let s=y(D),o=y([...D,...Z].filter(d=>d.startsWith("--")).map(d=>`${d}=*`)),n=y(ee),i=y(["",...z,...te,"clone"]),a=[...Q].map(([d,b])=>` ${d})
3
+ case $first_arg in
4
+ ${y(b)}) exec "$real_git" "$@" ;;
5
+ esac
6
+ ;;`).join(`
7
+ `),c=y(se),l=C(e.projectRoot);return`#!/bin/sh
8
+ # Generated by noskills when an agent session starts; edits are overwritten.
9
+ #
10
+ # Agent sessions find this file first on PATH, so every git process they start
11
+ # runs through it. Reads, clones and commands on other repositories run
12
+ # directly. Everything else is checked by noskills, which refuses git writes to
13
+ # the project's repository, and pushes from anywhere, while allowGit is false.
14
+
15
+ real_git=${C(e.realGit)}
16
+ project_git_dir=${C(e.projectGitDir)}
17
+
18
+ # Find the subcommand and its first argument after git's own options.
19
+ subcommand=''
20
+ first_arg=''
21
+ found=0
22
+ takes_value=0
23
+ for arg in "$@"; do
24
+ if [ "$found" = 1 ]; then
25
+ first_arg=$arg
26
+ break
27
+ fi
28
+ if [ "$takes_value" = 1 ]; then
29
+ takes_value=0
30
+ continue
31
+ fi
32
+ case $arg in
33
+ ${s}) takes_value=1 ;;
34
+ -C?*|-c?*|${o}) ;;
35
+ ${n}) ;;
36
+ *)
37
+ subcommand=$arg
38
+ found=1
39
+ ;;
40
+ esac
41
+ done
42
+
43
+ case $subcommand in
44
+ ${i}) exec "$real_git" "$@" ;;
45
+ ${a}
46
+ esac
47
+
48
+ # A write with no option before the subcommand acts on the repository that the
49
+ # working directory (or GIT_DIR) selects. Outside the project it runs directly.
50
+ # An option this script does not know stands where the subcommand would be;
51
+ # the options after it may name any repository, so noskills decides.
52
+ case $subcommand in
53
+ ${c}|-*) ;;
54
+ *)
55
+ if [ "$1" = "$subcommand" ]; then
56
+ target_git_dir=$("$real_git" rev-parse --path-format=absolute --git-common-dir 2>/dev/null) || target_git_dir=''
57
+ if [ "$target_git_dir" != "$project_git_dir" ]; then
58
+ exec "$real_git" "$@"
59
+ fi
60
+ fi
61
+ ;;
62
+ esac
63
+
64
+ # The command may change directory before noskills starts (pnpm run does), so
65
+ # the working directory git would run in travels as NOSKILLS_GIT_CWD.
66
+ git_cwd=$(pwd -P)
67
+
68
+ # The check may never answer (npx can wait on the registry), so a watcher stops
69
+ # it after ${t} seconds: SIGTERM, then SIGKILL ${re} seconds later.
70
+ # The check writes to a file rather than to this script's stderr, so a process
71
+ # it leaves behind cannot keep the caller's pipe open.
72
+ check_log=$(mktemp "\${TMPDIR:-/tmp}/noskills-git-check.XXXXXX") || {
73
+ printf '%s\\n' "noskills: could not create a temporary file to check \\"git $subcommand\\", so it did not run." >&2
74
+ exit 1
75
+ }
76
+ NOSKILLS_REAL_GIT=$real_git NOSKILLS_GIT_CWD=$git_cwd NOSKILLS_PROJECT_ROOT=${l} ${e.commandPrefix} invoke-hook git-exec "$@" </dev/null >"$check_log" 2>&1 &
77
+ check_pid=$!
78
+ (
79
+ watch_status=0
80
+ trap 'kill "$nap_pid" 2>/dev/null; exit "$watch_status"' TERM
81
+ sleep ${t} &
82
+ nap_pid=$!
83
+ wait "$nap_pid"
84
+ watch_status=${F}
85
+ kill -TERM "$check_pid" 2>/dev/null
86
+ sleep ${re} &
87
+ nap_pid=$!
88
+ wait "$nap_pid"
89
+ kill -KILL "$check_pid" 2>/dev/null
90
+ exit ${F}
91
+ ) </dev/null >/dev/null 2>&1 &
92
+ watch_pid=$!
93
+ trap 'kill "$check_pid" "$watch_pid" 2>/dev/null; rm -f "$check_log"; exit 1' HUP INT TERM
94
+ # The shell's notice for a stopped job would reach the agent; the message below
95
+ # says what happened instead.
96
+ wait "$check_pid" 2>/dev/null
97
+ status=$?
98
+ kill "$watch_pid" 2>/dev/null
99
+ wait "$watch_pid" 2>/dev/null
100
+ watch_status=$?
101
+ trap - HUP INT TERM
102
+ cat "$check_log" >&2
103
+ rm -f "$check_log"
104
+
105
+ if [ "$status" -ne 0 ]; then
106
+ if [ "$watch_status" -eq ${F} ]; then
107
+ printf '%s\\n' "noskills: the check for \\"git $subcommand\\" did not answer within ${t} seconds, so it did not run. When command in .eser/manifest.yml starts noskills through npx, install noskills and set command to the installed one, so the check does not wait on the network." >&2
108
+ elif [ "$status" -ne ${Ne} ]; then
109
+ printf '%s\\n' "noskills: could not check \\"git $subcommand\\" (exit status $status), so it did not run." >&2
110
+ fi
111
+ exit 1
112
+ fi
113
+ exec "$real_git" "$@"
114
+ `};var Me=["session-start","pre-tool-use","post-file-write","post-bash","post-ask-user-question","stop"],u={"session-start":5,"pre-tool-use":P,"post-file-write":3,"post-bash":3,"post-ask-user-question":3,stop:10},g=(e,t,s=[])=>[e,"invoke-hook",t,...s].join(" "),Fe=new RegExp(`\\binvoke-hook (?:${Me.join("|")})(?:\\s|$)`),G=e=>typeof e=="string"&&Fe.test(e),L=e=>e instanceof Object&&!Array.isArray(e),$=e=>{let t={};if(!L(e))return t;for(let[s,o]of Object.entries(e)){if(!Array.isArray(o))continue;let n=o.flatMap(i=>{if(!L(i)||!Array.isArray(i.hooks))return[i];let a=i.hooks.filter(c=>!(L(c)&&G(c.command)));return a.length===0?[]:[{...i,hooks:a}]});n.length>0&&(t[s]=n)}return t},k=(e,t)=>{let s={};for(let[o,n]of Object.entries(e))s[o]=[...n];for(let[o,n]of Object.entries(t))s[o]=[...s[o]??[],...n];return s},Pe=new Set(["npx","pnpx","bunx"]),Le=new Map([["npm",new Set(["exec","x"])],["pnpm",new Set(["dlx"])],["yarn",new Set(["dlx"])]]),Ge=/^(?:jsr|npm|https?):/,He=e=>{let t=e.trim().split(/\s+/),s=t.findIndex(a=>!/^[A-Za-z_][A-Za-z0-9_]*=/.test(a));if(s===-1)return null;let[o="",n="",...i]=t.slice(s);if(Pe.has(o))return o;if(Le.get(o)?.has(n)===!0)return`${o} ${n}`;if(o==="deno"&&(n==="run"||n==="x")){let a=i.find(c=>Ge.test(c));return a===void 0?null:`deno ${n} ${a}`}return null},Cs=e=>{let t=He(e);return t===null?null:`The hooks run noskills as "${e}", and ${t} can wait on the network before noskills starts. Claude Code, Codex, Copilot CLI and Kiro let a tool call go ahead when its PreToolUse hook does not answer within ${u["pre-tool-use"]} seconds, so the git guard and the protected-file check would not apply to that call. Install the eser CLI (npm install -g eser) and run "eser noskills init" so the hooks call the installed command.`};var je="AGENTS.md",ae="<!-- noskills:start -->",H="<!-- noskills:end -->",Ue=(e,t)=>{let s=["## noskills Protocol","","# Generated by noskills \u2014 do not edit manually","","### What is noskills","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/rules/`, `.eser/specs/`, or concern files directly.","noskills gives you exactly what you need via JSON output.","","### Protocol","",` ${e} spec <name> next # get current instruction`,` ${e} spec <name> next --answer="your response" # submit result and advance`,"","Every noskills command that operates on a spec MUST include `spec <name>`.",`Never omit it. Use \`${e} spec list\` to see available specs.`,"","### Why noskills calls matter","","noskills is not a form to fill out. It is a live state machine that the user","watches in real-time. Every `"+e+" next --answer` call:","","- Updates the spec file on disk (the user sees it change)","- Updates the terminal dashboard if `noskills watch` is running","- Advances the state machine to the next phase","- Records the decision permanently in the project history","",h(),"Do not answer discovery questions yourself: the user's input is the data.",f(`${e} spec <name> next --answer`),"","### When to call noskills next","",`You MUST call \`${e} next\` in these situations:`,"","1. At the **START** of every conversation (first thing you do)","2. **BEFORE** creating or modifying any file (to verify you have an active task)","3. **AFTER** completing a logical unit of work (to report progress)","4. When you encounter a **DECISION** that affects architecture or scope","5. When you are **UNSURE** what to do next","","NEVER proceed with implementation without checking noskills first.","NEVER make architectural decisions independently \u2014 noskills routes them to the user."];return(t?.allowGit??!1)||s.push("","### Git is read-only","","You MUST NOT run git write commands: commit, add, push, checkout, stash,","reset, merge, rebase, cherry-pick. The user controls git. You control files.","You MAY read from git: log, diff, status, show, blame."),s.push("","### Interactive choices","","Present choices as numbered lists. Users select by number.","When interactiveOptions are present in noskills output, present each as a","numbered item with its label and description. Ask the user to pick a number.","Use the `commandMap` to resolve the user's selection to a CLI command.","","### Decision principle: Explicit > Clever","","You NEVER skip steps, bypass questions, or make assumptions on behalf of the user.","- Discovery questions \u2192 ask the user, don't answer yourself","- Classification \u2192 ask the user, don't infer","- Spec approval \u2192 ask the user, don't auto-approve","- Task refinement \u2192 ask the user, don't self-assign","- Rule promotion \u2192 ask the user, don't decide",`If you think something can be skipped, ASK "would you like to skip this?" \u2014 don't skip it.`,"NEVER suggest bypassing or skipping noskills. Discovery is not overhead.","Run the next noskills command as soon as the current step is done; each step has exactly one next step, so there is nothing to ask permission for.","","### Command execution","","Run noskills commands as soon as you are told to. Their output carries the","context you need, so do not read noskills source or `.eser/` files first.","","### JSON output","","noskills returns JSON with a `phase` field and phase-specific instructions.","The `meta` block contains resume context - use it to orient yourself,","especially after compaction or at the start of a new session.","Follow the `instruction` field. Use `transition` commands to advance state.",""),s.join(`
115
+ `)},We=e=>["### Convention discovery","","When you discover a pattern, receive a correction, or identify a recurring",'preference from the user, ask: "Should this be a permanent rule for this',`project, or just for this task?" If permanent, run: \`${e} rule add`,'"<description>"`. If just this task, note it and move on.',"Never write to `.eser/rules/` directly.","","### How to promote rules","","When a convention should be permanent, use the noskills CLI to register it:","",` ${e} rule add "<description of the rule>"`,"","This stores the rule in `.eser/rules/` and ensures it is synced to all","coding tools on the next `noskills sync`. Never edit `.eser/rules/` directly.",""].join(`
116
+ `),Ke=e=>{let t=["### Active Rules",""];for(let s of e)t.push(`- ${s}`);return t.push(""),t.join(`
117
+ `)},Ye=(e,t,s)=>{let o=[ae,Ue(t,s),We(t)];return e.length>0&&o.push(Ke(e)),o.push(H),o.join(`
118
+ `)},v=async(e,t)=>{let s=`${e.root}/${je}`,o=Ye(e.rules,e.commandPrefix,t),n;try{n=await r.fs.readTextFile(s);let i=n.indexOf(ae),a=n.indexOf(H);i!==-1&&a!==-1?n=n.slice(0,i)+o+n.slice(a+H.length):n=n.trimEnd()+`
119
+
120
+ `+o+`
121
+ `}catch{n=o+`
122
+ `}await r.fs.writeTextFile(s,n)};var ce="Take these commands from the project itself: its README, task runner (package.json scripts, deno.json tasks, Makefile) or CI config.",p=["1. Run the project's type check on the modified files (skip this step when the project has none)","2. Run the project's tests that cover the changed code","3. If the type check or tests fail, fix the issues before reporting",ce],m=["1. Read each modified file and verify the changes are correct","2. Run the project's type check on the modified files (skip this step when the project has none)","3. Run the project's tests that cover the changed code","4. Check each acceptance criterion against actual file contents",ce];var Je=".codex",Ve="hooks.json",Be=".codex/agents",qe=".codex/config.toml",O=(e,t)=>({type:"command",command:g(e,t),timeout:u[t]}),Xe=e=>({SessionStart:[{hooks:[O(e,"session-start")]}],PreToolUse:[{matcher:"^(Bash|apply_patch)$",hooks:[O(e,"pre-tool-use")]}],PostToolUse:[{matcher:"^apply_patch$",hooks:[O(e,"post-file-write")]},{matcher:"^Bash$",hooks:[O(e,"post-bash")]}],Stop:[{hooks:[O(e,"stop")]}]}),ue=e=>e instanceof Object&&!Array.isArray(e),ze=e=>{if(!Array.isArray(e))return $(e);let t={};for(let s of e){if(!ue(s)||s._noskills===!0)continue;let o=s.event,n=s.command;typeof o=="string"&&typeof n=="string"&&(t[o]??=[]).push({hooks:[{type:"command",command:n}]})}return t},Qe=(e,t)=>{let s=ue(e)?e:{};return{...s,hooks:k(ze(s.hooks),Xe(t))}},Ze=e=>['name = "noskills-executor"','description = "Executes a single noskills task. Follows spec behavioral rules and reports structured results."','developer_instructions = """',["You are executing a single task from a noskills spec.","Your ONLY job is to complete the task described in the prompt.","Follow all behavioral rules provided in the prompt.","Do NOT start new tasks, explore unrelated code, or make architectural decisions.","If the task is too vague to execute, say so immediately.","","## Self-Verification","After completing the task, you MUST verify your own work before reporting:",...p,"","## Reporting","When finished, provide a structured JSON summary:",'{"completed": ["<item IDs done>"], "remaining": ["<item IDs not done>"],',' "blocked": ["<item IDs needing decisions>"], "filesModified": ["<paths>"],',' "verification": {"typeCheck": "pass|fail", "tests": "pass|fail"}}',"","Do NOT return raw test output \u2014 summarize it in the verification field.",`The orchestrator will submit this to \`${e} next --answer\` on your behalf.`].join(`
123
+ `),'"""',""].join(`
124
+ `),et=()=>['name = "noskills-verifier"',`description = "Independently verifies completed task work. Read-only. Never sees the executor's context."`,'developer_instructions = """',["You are verifying another agent's work. You have NO context about how it was done.","Read the changed files. Run the test suite. Check each acceptance criterion independently.","","For each acceptance criterion:","- PASS: with evidence \u2014 show the grep result, the test output, or the file content that proves it","- FAIL: with specific reason \u2014 what's missing, what's wrong, what doesn't match","","Be skeptical. Don't assume anything works \u2014 verify it yourself.","You CANNOT edit files. Read-only access only.","","## Verification Steps",...m,"","## Report Format","When finished, provide a structured JSON summary:",'{"results": [{"id": "ac-1", "status": "PASS", "evidence": "..."},',' {"id": "ac-2", "status": "FAIL", "reason": "..."}]}',"","The orchestrator will use this report for the noskills status report."].join(`
125
+ `),'"""',""].join(`
126
+ `),le=e=>`"${e.replace(/[\\"\u0000-\u001f\u007f]/g,t=>{switch(t){case"\\":return"\\\\";case'"':return'\\"';case`
127
+ `:return"\\n";case" ":return"\\t";case"\r":return"\\r";default:return`\\u${t.charCodeAt(0).toString(16).padStart(4,"0")}`}})}"`,tt=e=>{let t=e.split(/\s+/),s=t[0]??"npx",o=[...t.slice(1),"mcp-serve"].map(le).join(", ");return`[mcp_servers.noskills]
128
+ command = ${le(s)}
129
+ args = [${o}]
130
+ `},st=/^\s*\[\[?\s*([A-Za-z0-9_.-]+)\s*\]\]?\s*(?:#.*)?$/,de="mcp_servers.noskills",ot=e=>{let t=!1;return e.split(`
131
+ `).filter(s=>{let o=st.exec(s);if(o!==null){let n=o[1]??"";t=n===de||n.startsWith(`${de}.`)}return!t}).join(`
132
+ `)},nt=async e=>{try{return await r.fs.stat(e),!0}catch{return!1}},pe={id:"codex",capabilities:{rules:!0,hooks:!0,agents:!0,specs:!1,mcp:!0,interaction:{hasAskUserTool:!1,optionPresentation:"prose",hasSubAgentDelegation:!0,subAgentMethod:"spawn"}},syncRules:async(e,t)=>{await v(e,t)},syncHooks:async(e,t)=>{let s=`${e.root}/${Je}`,o=`${s}/${Ve}`;await r.fs.mkdir(s,{recursive:!0});let n={};try{n=JSON.parse(await r.fs.readTextFile(o))}catch{}await r.fs.writeTextFile(o,JSON.stringify(Qe(n,e.commandPrefix),null,2)+`
133
+ `)},syncAgents:async(e,t)=>{let s=`${e.root}/${Be}`;await r.fs.mkdir(s,{recursive:!0}),await r.fs.writeTextFile(`${s}/noskills-executor.toml`,Ze(e.commandPrefix)),await r.fs.writeTextFile(`${s}/noskills-verifier.toml`,et())},syncMcp:async e=>{let t=`${e.root}/${qe}`;await r.fs.mkdir(`${e.root}/.codex`,{recursive:!0});let s="";if(await nt(t))try{s=await r.fs.readTextFile(t)}catch{}let o=ot(s).trimEnd(),n=tt(e.commandPrefix),i=o+(o.length>0?`
134
+
135
+ `:"")+n;await r.fs.writeTextFile(t,i)}};var me="<!-- noskills:start -->",W="<!-- noskills:end -->",it=(e,t,s="npx eser noskills")=>{let o=[me,"## noskills orchestrator","","State-driven orchestration. Do NOT read `.eser/` files directly \u2014 noskills provides everything via JSON.","","### Protocol","",` ${s} spec <name> next # get instruction`,` ${s} spec <name> next --answer="response" # submit and advance`,` ${s} spec new "description" # create spec (name auto-generated)`,"","Every spec command MUST include `spec <name>`. Use `"+s+" spec list` for available specs.","","### Core rules","",`- ${h()}`,"- Never answer discovery questions yourself.","- Call `next` at: conversation start, before file edits, after completing work, at decisions.",`- ${f(`${s} spec <name> next --answer`)}`,"- Never skip steps or infer decisions. Ask first. Explicit > Clever.","- NEVER suggest bypassing or skipping noskills. Discovery is not overhead.","- Run the next noskills command as soon as the current step is done; each step has exactly one next step, so there is nothing to ask permission for.","- Run noskills commands as soon as you are told to; their output has the context you need.","- Display `roadmap` before content. Display `gate` prominently.","","### Interactive choices","","- Use AskUserQuestion for `interactiveOptions`. Use `commandMap` to resolve selections.","- On recurring patterns or corrections: ask 'Permanent rule?' \u2192 `"+s+' rule add "description"`.'];if((t?.allowGit??!1)||o.push("","### Git","","Read-only: log, diff, status, show, blame. No write commands (commit, push, checkout, etc.)."),o.push("","### Spec Creation","","When the user wants a spec:",'1. Ask "What do you want to build?" \u2014 nothing else.',"2. Take their full answer as the description.",`3. Run: ${s} spec new "their answer"`,"Do NOT suggest names. Do NOT analyze before creating. Just ask, take the answer, create.","","### Concern Management","",'When user says "add concerns" or "manage concerns":',`- Run \`${s} concern list\` immediately. Do NOT analyze which concerns are appropriate.`,"- Present list via AskUserQuestion with multiSelect:true, max 4 options per question.",`- Add all selected concerns in ONE command: ${s} concern add open-source well-engineered long-lived`,"","### Discovery","","Listen first: after spec creation, ask user to share context before mode selection.","Modes: full (default), validate, technical-depth, ship-fast, explore.","Pre-scan codebase before questions. Challenge premises. Propose alternatives.","With --from-plan: extract answers, present for user confirmation.","","### Mode Management","","noskills manages Claude Code plan mode transitions automatically.","Follow the `modeDirective` field in each `noskills next` output.","","| Phase | Mode |","|-------|------|","| IDLE | plan mode optional \u2014 no active spec |","| DISCOVERY, DISCOVERY_REFINEMENT, SPEC_PROPOSAL | **plan mode** \u2014 read-only, no file edits |","| EXECUTING | **normal mode** \u2014 full write access for sub-agents |","| BLOCKED | **plan mode** \u2014 analyze the blocker, do not edit |","| COMPLETED | plan mode optional |","","Non-Claude-Code platforms: `modeDirective` is advisory. Hooks enforce file restrictions mechanically.","","### Execution","","- Run type-check + lint after every edit. Never mark AC passed if type-check fails.","- If search returns few results, re-run narrower \u2014 assume truncation.","- Work through the spec's tasks to the end; the user decides when to stop.","- `meta` block has resume context for session start or after compaction."),e.length>0){o.push("","### Active Rules","");for(let n of e)o.push(`- ${n}`)}return o.push(W),o.join(`
136
+ `)},he=async(e,t,s,o="npx eser noskills")=>{let n=`${e}/CLAUDE.md`,i=it(t,s,o),a;try{a=await r.fs.readTextFile(n);let c=a.indexOf(me),l=a.indexOf(W);c!==-1&&l!==-1?a=a.slice(0,c)+i+a.slice(l+W.length):a=a.trimEnd()+`
137
+
138
+ `+i+`
139
+ `}catch{a=i+`
140
+ `}await r.fs.writeTextFile(n,a)};var S=(e,t)=>({type:"command",command:g(e,t),timeout:u[t]}),ct=e=>({PreToolUse:[{matcher:"Write|Edit|MultiEdit|Bash",hooks:[S(e,"pre-tool-use")]}],PostToolUse:[{matcher:"Write|Edit|MultiEdit",hooks:[S(e,"post-file-write")]},{matcher:"Bash",hooks:[S(e,"post-bash")]},{matcher:"AskUserQuestion",hooks:[S(e,"post-ask-user-question")]}],Stop:[{hooks:[S(e,"stop")]}],SessionStart:[{hooks:[S(e,"session-start")]}]}),fe=async(e,t="npx eser@latest noskills")=>{let s=`${e}/.claude/settings.json`,o={};try{let i=await r.fs.readTextFile(s),a=JSON.parse(i);a!==null&&typeof a=="object"&&!Array.isArray(a)&&(o=a)}catch{}let n={...o,hooks:k($(o.hooks),ct(t))};await r.fs.mkdir(`${e}/.claude`,{recursive:!0}),await r.fs.writeTextFile(s,JSON.stringify(n,null,2)+`
141
+ `)};var dt=async(e,t)=>{let s=`${e}/.claude/agents`;await r.fs.mkdir(s,{recursive:!0});let o=`---
142
+ name: noskills-executor
143
+ description: "Executes a single noskills task."
144
+ tools: Read, Edit, MultiEdit, Write, Bash, Grep, Glob, LS
145
+ ---
146
+
147
+ You are executing a single task from a noskills spec.
148
+ Your ONLY job is to complete the task described in the prompt.
149
+ Follow all behavioral rules provided in the prompt.
150
+ Do NOT start new tasks, explore unrelated code, or make architectural decisions.
151
+ If the task is too vague to execute, say so immediately.
152
+
153
+ ## Self-Verification
154
+ After completing the task, you MUST verify your own work before reporting:
155
+ ${p.join(`
156
+ `)}
157
+
158
+ ## Reporting
159
+ When finished, provide a structured JSON summary:
160
+ \`\`\`json
161
+ {"completed": ["<item IDs done>"], "remaining": ["<item IDs not done>"], "blocked": ["<item IDs needing decisions>"], "filesModified": ["<paths>"], "verification": {"typeCheck": "pass|fail", "tests": "pass|fail (N passed, M failed)"}}
162
+ \`\`\`
163
+
164
+ Do NOT return raw test output \u2014 summarize it in the verification field.
165
+ The orchestrator will submit this to \`${t} next --answer\` on your behalf.
166
+ `;await r.fs.writeTextFile(`${s}/noskills-executor.md`,o)},ut=async(e,t)=>{let s=`${e}/.claude/agents`;await r.fs.mkdir(s,{recursive:!0});let o=`---
167
+ name: noskills-verifier
168
+ description: "Independently verifies completed task work. Read-only. Never sees the executor's context."
169
+ tools: Read, Bash, Grep, Glob, LS
170
+ ---
171
+
172
+ You are verifying another agent's work. You have NO context about how it was done.
173
+ Read the changed files. Run the test suite. Check each acceptance criterion independently.
174
+
175
+ For each acceptance criterion:
176
+ - PASS: with evidence \u2014 show the grep result, the test output, or the file content that proves it
177
+ - FAIL: with specific reason \u2014 what's missing, what's wrong, what doesn't match
178
+
179
+ Be skeptical. Don't assume anything works \u2014 verify it yourself.
180
+ You CANNOT edit files. Read-only access only.
181
+
182
+ ## Verification Steps
183
+ ${m.join(`
184
+ `)}
185
+
186
+ ## Report Format
187
+ When finished, provide a structured JSON summary:
188
+ \`\`\`json
189
+ {"results": [{"id": "ac-1", "status": "PASS", "evidence": "..."}, {"id": "ac-2", "status": "FAIL", "reason": "..."}]}
190
+ \`\`\`
191
+
192
+ The orchestrator will use this report for the noskills status report.
193
+ `;await r.fs.writeTextFile(`${s}/noskills-verifier.md`,o)},K={id:"claude-code",capabilities:{rules:!0,hooks:!0,agents:!0,specs:!1,mcp:!1,interaction:{hasAskUserTool:!0,optionPresentation:"tool",hasSubAgentDelegation:!0,subAgentMethod:"task",planModeShortcut:"Shift+Tab"}},syncRules:async(e,t)=>{await he(e.root,e.rules,t,e.commandPrefix)},syncHooks:async(e,t)=>{await fe(e.root,e.commandPrefix)},syncAgents:async(e,t)=>{await dt(e.root,e.commandPrefix),await ut(e.root,e.commandPrefix)}};var mt=(e,t)=>{let s=`${t} spec <name> next`,o=["# Generated by noskills \u2014 do not edit manually","","## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/specs/` or `.eser/rules/` directly. noskills gives you what you need.","",`Run \`${s}\` to get your current instruction.`,`Submit results with \`${s} --answer="..."\`.`,"","Every noskills command that works on a spec MUST include `spec <name>`; noskills refuses it without the name while a spec is active.",`Use \`${t} spec list\` to see the specs. With no spec yet, run \`${t} next\`, or create one with \`${t} spec new "description"\`.`,"","## Why noskills calls matter","","noskills is not a form to fill out. It is a live state machine that the user",`watches in real-time. Every \`${s} --answer\` call:`,"","- Updates the spec file on disk (the user sees it change)",`- Updates the terminal dashboard if \`${t} watch\` is running`,"- Advances the state machine to the next phase","- Records the decision permanently in the project history","",h(),"Do not answer discovery questions yourself: the user's input is the data.",f(`${s} --answer`),"","## When to call noskills next","","1. At the START of every conversation","2. BEFORE creating or modifying any file","3. AFTER completing a logical unit of work","4. When you encounter a DECISION that affects architecture","5. When you are UNSURE what to do next","","NEVER proceed with implementation without checking noskills first.","NEVER suggest bypassing or skipping noskills. Discovery is not overhead.","Run the next noskills command as soon as the current step is done; each step has exactly one next step, so there is nothing to ask permission for.","","## Interactive choices","","Present choices as numbered lists. Users select by number.","When interactiveOptions are present in noskills output, present each as a","numbered item with its label and description. Ask the user to pick a number.","","## Execution model","","Execute tasks sequentially in this context. Do not attempt to spawn sub-agents.",""];if(e.length>0){o.push("## Rules","");for(let n of e)o.push(`- ${n}`);o.push("")}return o.join(`
194
+ `)},R=async(e,t,s,o)=>{let n=r.path.join(e,t);await r.fs.mkdir(r.path.dirname(n),{recursive:!0}),await r.fs.writeTextFile(n,mt(s,o))};var ht=".cursorrules",ge=async(e,t,s)=>{await R(e,ht,t,s)};var ye={id:"cursor",capabilities:{rules:!0,hooks:!1,agents:!1,specs:!1,mcp:!1,interaction:{hasAskUserTool:!1,optionPresentation:"prose",hasSubAgentDelegation:!1,subAgentMethod:"none"}},syncRules:async e=>{await ge(e.root,e.rules,e.commandPrefix)}};var yt=".kiro/steering",ke=".kiro/settings",kt=".kiro/hooks",wt=".kiro/agents",vt=".kiro/specs",St="noskills.json",Rt="hooks.json",bt="mcp.json",Tt="noskills-protocol.md",xt="noskills-coaching.md",J="noskills-rules.md",we="conventions.md",Ot="noskills-executor.json",At="noskills-verifier.json",Et=(e,t)=>{let s=["---","inclusion: always","---","","# noskills Protocol","","# Generated by noskills \u2014 do not edit manually","","## What is noskills","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/rules/`, `.eser/specs/`, or concern files directly.","noskills gives you exactly what you need via JSON output.","","## Protocol","",` ${e} spec <name> next # get current instruction`,` ${e} spec <name> next --answer="your response" # submit result and advance`,"","Every noskills command that operates on a spec MUST include `spec <name>`.",`Never omit it. Use \`${e} spec list\` to see available specs.`,"","## Why noskills calls matter","","noskills is not a form to fill out. It is a live state machine that the user","watches in real-time. Every `"+e+" next --answer` call:","","- Updates the spec file on disk (the user sees it change)","- Updates the terminal dashboard if `noskills watch` is running","- Advances the state machine to the next phase","- Records the decision permanently in the project history","",h(),"Do not answer discovery questions yourself: the user's input is the data.",f(`${e} spec <name> next --answer`),"","## When to call noskills next","",`You MUST call \`${e} next\` in these situations:`,"","1. At the **START** of every conversation (first thing you do)","2. **BEFORE** creating or modifying any file (to verify you have an active task)","3. **AFTER** completing a logical unit of work (to report progress)","4. When you encounter a **DECISION** that affects architecture or scope","5. When you are **UNSURE** what to do next","","NEVER proceed with implementation without checking noskills first.","NEVER make architectural decisions independently \u2014 noskills routes them to the user."];return(t?.allowGit??!1)||s.push("","## Git is read-only","","You MUST NOT run git write commands: commit, add, push, checkout, stash,","reset, merge, rebase, cherry-pick. The user controls git. You control files.","You MAY read from git: log, diff, status, show, blame."),s.push("","## Interactive choices","","Present choices as numbered lists. Users select by number.","When interactiveOptions are present in noskills output, present each as a","numbered item with its label and description. Ask the user to pick a number.","Use the `commandMap` to resolve the user's selection to a CLI command.","","## Decision principle: Explicit > Clever","","You NEVER skip steps, bypass questions, or make assumptions on behalf of the user.","- Discovery questions \u2192 ask the user, don't answer yourself","- Classification \u2192 ask the user, don't infer","- Spec approval \u2192 ask the user, don't auto-approve","- Task refinement \u2192 ask the user, don't self-assign","- Rule promotion \u2192 ask the user, don't decide",`If you think something can be skipped, ASK "would you like to skip this?" \u2014 don't skip it.`,"NEVER suggest bypassing or skipping noskills. Discovery is not overhead.","Run the next noskills command as soon as the current step is done; each step has exactly one next step, so there is nothing to ask permission for.","","## Command execution","","Run noskills commands as soon as you are told to. Their output carries the","context you need, so do not read noskills source or `.eser/` files first.","","## JSON output","","noskills returns JSON with a `phase` field and phase-specific instructions.","The `meta` block contains resume context - use it to orient yourself,","especially after compaction or at the start of a new session.","Follow the `instruction` field. Use `transition` commands to advance state.",""),s.join(`
195
+ `)},Ct=e=>["---","inclusion: auto","name: noskills-coaching",'description: "Guidance for noskills spec-driven development workflow, including convention discovery and rule promotion"',"---","","# noskills Coaching","","# Generated by noskills \u2014 do not edit manually","","## Convention discovery","","When you discover a pattern, receive a correction, or identify a recurring",'preference from the user, ask: "Should this be a permanent rule for this',`project, or just for this task?" If permanent, run: \`${e} rule add`,'"<description>"`. If just this task, note it and move on.',"Never write to `.eser/rules/` directly.","","## How to promote rules","","When a convention should be permanent, use the noskills CLI to register it:","",` ${e} rule add "<description of the rule>"`,"","This stores the rule in `.eser/rules/` and ensures it is synced to all","coding tools on the next `noskills sync`. Never edit `.eser/rules/` directly.",""].join(`
196
+ `),$t=e=>{let t=["---","inclusion: always","---","","# noskills Rules","","# Generated by noskills \u2014 do not edit manually","","## Active Rules",""];for(let s of e)t.push(`- ${s}`);return t.push(""),t.join(`
197
+ `)},ve=["write","fs_write","fsWrite","fs_append","str_replace","delete_file"],Se=["shell","execute_bash","execute_cmd"],V=e=>`^(${e.join("|")})$`,A=(e,t,s,o,n)=>({name:`noskills-${t}`,description:o,trigger:s,...n===void 0?{}:{matcher:n},action:{type:"command",command:g(e,t)},timeout:u[t]}),_t=e=>({version:"v1",hooks:[A(e,"session-start","SessionStart","Generated by noskills: gives the agent the current noskills instruction."),A(e,"pre-tool-use","PreToolUse","Generated by noskills: refuses git writes, changes to the noskills settings and file edits the spec's phase does not allow.",V([...ve,...Se])),A(e,"post-file-write","PostToolUse","Generated by noskills: logs the files the agent changed.",V(ve)),A(e,"post-bash","PostToolUse","Generated by noskills: logs the noskills commands the agent ran.",V(Se)),A(e,"stop","Stop","Generated by noskills: records the iteration when the agent stops.")]}),It=e=>{let t=e.split(/\s+/),s=t[0]??"npx",o=[...t.slice(1),"mcp-serve"];return{mcpServers:{noskills:{command:s,args:o,env:{},autoApprove:["noskills_next","noskills_status"],disabled:!1}}}},Nt=e=>({name:"noskills-executor",description:"Executes a single noskills task. Follows spec behavioral rules and reports structured results.",tools:["read","write","glob","grep","shell","delegate"],allowedTools:["read","write","glob","grep","shell","delegate"],resources:["file://.kiro/steering/noskills-protocol.md"],prompt:["You are executing a single task from a noskills spec.","Your ONLY job is to complete the task described in the prompt.","Follow all behavioral rules provided in the prompt.","Do NOT start new tasks, explore unrelated code, or make architectural decisions.","If the task is too vague to execute, say so immediately.","","## Self-Verification","After completing the task, you MUST verify your own work before reporting:",...p,"","## Reporting","When finished, provide a structured JSON summary:","```json",'{"completed": ["<item IDs done>"], "remaining": ["<item IDs not done>"], "blocked": ["<item IDs needing decisions>"], "filesModified": ["<paths>"], "verification": {"typeCheck": "pass|fail", "tests": "pass|fail (N passed, M failed)"}}',"```","","Do NOT return raw test output \u2014 summarize it in the verification field.",`The orchestrator will submit this to \`${e} next --answer\` on your behalf.`].join(`
198
+ `)}),Dt=()=>({name:"noskills-verifier",description:"Independently verifies completed task work. Read-only. Never sees the executor's context.",tools:["read","glob","grep","shell","use_subagent"],allowedTools:["read","glob","grep","shell"],resources:["file://.kiro/steering/noskills-protocol.md"],prompt:["You are verifying another agent's work. You have NO context about how it was done.","Read the changed files. Run the test suite. Check each acceptance criterion independently.","","For each acceptance criterion:","- PASS: with evidence \u2014 show the grep result, the test output, or the file content that proves it","- FAIL: with specific reason \u2014 what's missing, what's wrong, what doesn't match","","Be skeptical. Don't assume anything works \u2014 verify it yourself.","You CANNOT edit files. Read-only access only.","","## Verification Steps",...m,"","## Report Format","When finished, provide a structured JSON summary:","```json",'{"results": [{"id": "ac-1", "status": "PASS", "evidence": "..."}, {"id": "ac-2", "status": "FAIL", "reason": "..."}]}',"```","","The orchestrator will use this report for the noskills status report."].join(`
199
+ `)}),Mt=async e=>{let t;try{t=JSON.parse(await r.fs.readTextFile(e))}catch{return}if(!(t instanceof Object)||Array.isArray(t))return;let s=t,o=s.hooks;if(!Array.isArray(o))return;let n=o.filter(i=>!(i instanceof Object&&i._noskills===!0));if(n.length!==o.length){if(n.length===0&&Object.keys(s).length===1){await r.fs.remove(e);return}await r.fs.writeTextFile(e,JSON.stringify({...s,hooks:n},null,2)+`
200
+ `)}},Re=async e=>{try{return await r.fs.stat(e),!0}catch{return!1}},Ft=e=>{let s=e.match(/^# Spec:\s*(.+)$/m)?.[1]?.trim()??"Untitled",o=new Map,n=e.split(/^## /m);for(let a of n){let c=a.indexOf(`
201
+ `);if(c===-1)continue;let l=a.slice(0,c).trim().toLowerCase(),d=a.slice(c+1).trim();o.set(l,d)}let i=a=>{for(let[c,l]of o)if(c.startsWith(a.toLowerCase()))return l;return""};return{title:s,concerns:i("concerns"),discoveryAnswers:i("discovery answers"),contributorGuide:i("contributor guide"),publicApi:i("public api"),outOfScope:i("out of scope"),tasks:i("tasks"),verification:i("verification")}},Pt=e=>{let t=[`# Feature: ${e.title}`,"","## Overview","",e.discoveryAnswers===""?"(no discovery answers yet)":e.discoveryAnswers,"","## Requirements",""],s=e.discoveryAnswers.split(`
202
+ `).filter(o=>o.startsWith("### "));if(s.length>0)for(let o of s)t.push(`- ${o.replace(/^###\s*/,"")}`);else e.discoveryAnswers!==""?t.push("- See overview for details"):t.push("- (none yet)");if(t.push("","## Acceptance Criteria",""),e.verification!==""){let o=e.verification.split(`
203
+ `).filter(n=>n.trim()!=="");for(let n of o){let i=n.replace(/^[-*]\s*/,"").trim();i!==""&&t.push(`- [ ] ${i}`)}}else t.push("- [ ] (none yet)");return t.push("","## Out of Scope",""),t.push(e.outOfScope===""?"(nothing listed)":e.outOfScope),t.push(""),t.join(`
204
+ `)},Lt=e=>{let t=[`# Design: ${e.title}`,"","## Architecture",""];return e.discoveryAnswers!==""?t.push(e.discoveryAnswers):t.push("(no architecture decisions yet)"),t.push("","## Concerns",""),e.concerns!==""?t.push(e.concerns):t.push("(no active concerns)"),t.push("","## Decisions",""),e.contributorGuide!==""||e.publicApi!==""?(e.contributorGuide!==""&&t.push("### Contributor Guide","",e.contributorGuide,""),e.publicApi!==""&&t.push("### Public API Surface","",e.publicApi,"")):t.push("(no decisions yet)"),t.push(""),t.join(`
205
+ `)},Gt=e=>{let t=[`# Tasks: ${e.title}`,""];return e.tasks!==""?t.push(e.tasks):t.push("(no tasks yet)"),t.push(""),t.join(`
206
+ `)},be={id:"kiro",capabilities:{rules:!0,hooks:!0,agents:!0,specs:!0,mcp:!0,interaction:{hasAskUserTool:!1,optionPresentation:"prose",hasSubAgentDelegation:!0,subAgentMethod:"delegation"}},syncRules:async(e,t)=>{let s=`${e.root}/${yt}`;await r.fs.mkdir(s,{recursive:!0}),await r.fs.writeTextFile(`${s}/${Tt}`,Et(e.commandPrefix,t)),await r.fs.writeTextFile(`${s}/${xt}`,Ct(e.commandPrefix)),e.rules.length>0?await r.fs.writeTextFile(`${s}/${J}`,$t(e.rules)):await Re(`${s}/${J}`)&&await r.fs.remove(`${s}/${J}`),await Re(`${s}/${we}`)&&await r.fs.remove(`${s}/${we}`)},syncHooks:async(e,t)=>{let s=`${e.root}/${kt}`;await r.fs.mkdir(s,{recursive:!0}),await r.fs.writeTextFile(`${s}/${St}`,JSON.stringify(_t(e.commandPrefix),null,2)+`
207
+ `),await Mt(`${e.root}/${ke}/${Rt}`)},syncAgents:async(e,t)=>{let s=`${e.root}/${wt}`;await r.fs.mkdir(s,{recursive:!0});let o=Nt(e.commandPrefix);await r.fs.writeTextFile(`${s}/${Ot}`,JSON.stringify(o,null,2)+`
208
+ `);let n=Dt();await r.fs.writeTextFile(`${s}/${At}`,JSON.stringify(n,null,2)+`
209
+ `)},syncSpecs:async(e,t)=>{let s;try{s=await r.fs.readTextFile(t)}catch{return}if(s.trim()==="")return;let o=t.split("/"),n=o[o.length-2]??"unknown",i=Ft(s),a=`${e.root}/${vt}/${n}`;await r.fs.mkdir(a,{recursive:!0}),await r.fs.writeTextFile(`${a}/requirements.md`,Pt(i)),await r.fs.writeTextFile(`${a}/design.md`,Lt(i)),await r.fs.writeTextFile(`${a}/tasks.md`,Gt(i))},syncMcp:async e=>{let t=`${e.root}/${ke}`,s=`${t}/${bt}`;await r.fs.mkdir(t,{recursive:!0});let o={mcpServers:{}};try{let a=await r.fs.readTextFile(s),c=JSON.parse(a);c.mcpServers!==void 0&&c.mcpServers!==null&&(o=c)}catch{}let n=It(e.commandPrefix),i={...o,mcpServers:{...o.mcpServers,...n.mcpServers}};await r.fs.writeTextFile(s,JSON.stringify(i,null,2)+`
210
+ `)}};var jt=".github/copilot-instructions.md",_=async(e,t,s)=>{await R(e,jt,t,s)};var xe={id:"copilot",capabilities:{rules:!0,hooks:!1,agents:!1,specs:!1,mcp:!1,interaction:{hasAskUserTool:!1,optionPresentation:"prose",hasSubAgentDelegation:!1,subAgentMethod:"none"}},syncRules:async e=>{await _(e.root,e.rules,e.commandPrefix)}};var Wt=".windsurfrules",Oe=async(e,t,s)=>{await R(e,Wt,t,s)};var Ae={id:"windsurf",capabilities:{rules:!0,hooks:!1,agents:!1,specs:!1,mcp:!1,interaction:{hasAskUserTool:!1,optionPresentation:"prose",hasSubAgentDelegation:!1,subAgentMethod:"none"}},syncRules:async e=>{await Oe(e.root,e.rules,e.commandPrefix)}};var Jt=".opencode/plugins",Vt=".opencode/agents",Bt=".opencode/skills",qt="opencode.json",Xt=e=>{let t=u;return`// Generated by noskills. Do not edit by hand: \`noskills init\` rewrites it.
211
+ //
212
+ // Runs the noskills hooks in OpenCode (opencode.ai/docs/plugins). Before a
213
+ // shell or file tool runs, the call goes to \`invoke-hook pre-tool-use\` on
214
+ // stdin, and the tool call is refused when noskills refuses it or does not
215
+ // answer in time.
216
+ import { spawn } from "node:child_process";
217
+ import process from "node:process";
218
+
219
+ const COMMAND = ${JSON.stringify(e)};
220
+
221
+ // Seconds each hook may take.
222
+ const TIMEOUT_SECONDS: Record<string, number> = {
223
+ "session-start": ${t["session-start"]},
224
+ "pre-tool-use": ${t["pre-tool-use"]},
225
+ "post-file-write": ${t["post-file-write"]},
226
+ "post-bash": ${t["post-bash"]},
227
+ stop: ${t.stop},
228
+ };
229
+
230
+ // OpenCode's shell tool and the tools that write files (opencode.ai/docs/tools).
231
+ const SHELL_TOOLS = new Set(["bash"]);
232
+ const FILE_TOOLS = new Set(["edit", "write", "apply_patch"]);
233
+
234
+ // Exit code with which invoke-hook refuses a tool call.
235
+ const DENIED = 2;
236
+
237
+ type HookResult = {
238
+ readonly status: number | null;
239
+ readonly stderr: string;
240
+ readonly failure: string | null;
241
+ };
242
+
243
+ const runHook = (
244
+ directory: string,
245
+ event: string,
246
+ payload: unknown,
247
+ ): Promise<HookResult> =>
248
+ new Promise((resolve) => {
249
+ const seconds = TIMEOUT_SECONDS[event] ?? 10;
250
+ const child = spawn(\`\${COMMAND} invoke-hook \${event}\`, {
251
+ shell: true,
252
+ cwd: directory,
253
+ env: { ...process.env, NOSKILLS_PROJECT_ROOT: directory },
254
+ stdio: ["pipe", "ignore", "pipe"],
255
+ });
256
+
257
+ let stderr = "";
258
+ let settled = false;
259
+ // Called from the timer and the child's events, which come after timer
260
+ // is set.
261
+ const settle = (result: HookResult): void => {
262
+ if (settled) return;
263
+ settled = true;
264
+ clearTimeout(timer);
265
+ resolve(result);
266
+ };
267
+ const timer = setTimeout(() => {
268
+ child.kill();
269
+ settle({
270
+ status: null,
271
+ stderr,
272
+ failure: \`did not answer within \${seconds} seconds\`,
273
+ });
274
+ }, seconds * 1000);
275
+
276
+ child.stderr?.on("data", (chunk: unknown) => {
277
+ stderr += String(chunk);
278
+ });
279
+ child.on("error", (error: Error) => {
280
+ settle({ status: null, stderr, failure: error.message });
281
+ });
282
+ child.on("close", (status: number | null) => {
283
+ settle({ status, stderr, failure: null });
284
+ });
285
+ // The hook may exit before it reads its input.
286
+ child.stdin?.on("error", () => {});
287
+ child.stdin?.end(JSON.stringify(payload));
288
+ });
289
+
290
+ const guard = async (
291
+ directory: string,
292
+ tool: string,
293
+ sessionID: string,
294
+ args: unknown,
295
+ ): Promise<void> => {
296
+ const result = await runHook(directory, "pre-tool-use", {
297
+ hook_event_name: "PreToolUse",
298
+ session_id: sessionID,
299
+ cwd: directory,
300
+ tool_name: tool,
301
+ tool_input: args,
302
+ });
303
+
304
+ if (result.status === 0) return;
305
+ if (result.status === DENIED) {
306
+ throw new Error(result.stderr.trim() || "noskills refused this tool call.");
307
+ }
308
+
309
+ const cause = result.failure ??
310
+ \`exited with code \${result.status}: \${result.stderr.trim()}\`;
311
+ throw new Error(
312
+ \`noskills: the PreToolUse check \${cause}, so this call was refused. When command in .eser/manifest.yml starts noskills through npx, install noskills and run its init again, so the check does not wait on the network.\`,
313
+ );
314
+ };
315
+
316
+ const hooksFor = (directory: string) => ({
317
+ event: async ({ event }: { event: { type: string } }) => {
318
+ if (event.type === "session.created") {
319
+ await runHook(directory, "session-start", {});
320
+ } else if (event.type === "session.idle") {
321
+ await runHook(directory, "stop", {
322
+ hook_event_name: "Stop",
323
+ cwd: directory,
324
+ });
325
+ }
326
+ },
327
+ "tool.execute.before": async (
328
+ input: { tool: string; sessionID: string },
329
+ output: { args: unknown },
330
+ ) => {
331
+ if (SHELL_TOOLS.has(input.tool) || FILE_TOOLS.has(input.tool)) {
332
+ await guard(directory, input.tool, input.sessionID, output.args);
333
+ }
334
+ },
335
+ "tool.execute.after": async (
336
+ input: { tool: string; sessionID: string; args: unknown },
337
+ ) => {
338
+ const event = FILE_TOOLS.has(input.tool)
339
+ ? "post-file-write"
340
+ : SHELL_TOOLS.has(input.tool)
341
+ ? "post-bash"
342
+ : null;
343
+ if (event === null) return;
344
+
345
+ await runHook(directory, event, {
346
+ hook_event_name: "PostToolUse",
347
+ session_id: input.sessionID,
348
+ cwd: directory,
349
+ tool_name: input.tool,
350
+ tool_input: input.args,
351
+ });
352
+ },
353
+ });
354
+
355
+ export const NoskillsPlugin = ({ directory }: { directory: string }) =>
356
+ Promise.resolve(hooksFor(directory));
357
+ `},zt=e=>["---","name: noskills-executor",'description: "Executes a single noskills task. Follows spec behavioral rules and reports structured results."',"tools:"," read: true"," write: true"," glob: true"," grep: true"," shell: true"," delegate: true","---","","You are executing a single task from a noskills spec.","Your ONLY job is to complete the task described in the prompt.","Follow all behavioral rules provided in the prompt.","Do NOT start new tasks, explore unrelated code, or make architectural decisions.","If the task is too vague to execute, say so immediately.","","## Self-Verification","After completing the task, you MUST verify your own work before reporting:",...p,"","## Reporting","When finished, provide a structured JSON summary:","```json",'{"completed": ["<item IDs done>"], "remaining": ["<item IDs not done>"], "blocked": ["<item IDs needing decisions>"], "filesModified": ["<paths>"], "verification": {"typeCheck": "pass|fail", "tests": "pass|fail (N passed, M failed)"}}',"```","","Do NOT return raw test output \u2014 summarize it in the verification field.",`The orchestrator will submit this to \`${e} next --answer\` on your behalf.`,""].join(`
358
+ `),Qt=()=>["---","name: noskills-verifier",`description: "Independently verifies completed task work. Read-only. Never sees the executor's context."`,"tools:"," read: true"," glob: true"," grep: true"," shell: true","---","","You are verifying another agent's work. You have NO context about how it was done.","Read the changed files. Run the test suite. Check each acceptance criterion independently.","","For each acceptance criterion:","- PASS: with evidence \u2014 show the grep result, the test output, or the file content that proves it","- FAIL: with specific reason \u2014 what's missing, what's wrong, what doesn't match","","Be skeptical. Don't assume anything works \u2014 verify it yourself.","You CANNOT edit files. Read-only access only.","","## Verification Steps",...m,"","## Report Format","When finished, provide a structured JSON summary:","```json",'{"results": [{"id": "ac-1", "status": "PASS", "evidence": "..."}, {"id": "ac-2", "status": "FAIL", "reason": "..."}]}',"```","","The orchestrator will use this report for the noskills status report.",""].join(`
359
+ `),Zt=e=>{let s=e.match(/^# Spec:\s*(.+)$/m)?.[1]?.trim()??"Untitled",o=new Map,n=e.split(/^## /m);for(let a of n){let c=a.indexOf(`
360
+ `);if(c===-1)continue;let l=a.slice(0,c).trim().toLowerCase(),d=a.slice(c+1).trim();o.set(l,d)}let i=a=>{for(let[c,l]of o)if(c.startsWith(a.toLowerCase()))return l;return""};return{title:s,concerns:i("concerns"),discoveryAnswers:i("discovery answers"),contributorGuide:i("contributor guide"),publicApi:i("public api"),outOfScope:i("out of scope"),tasks:i("tasks"),verification:i("verification")}},es=e=>{let t=["---",`name: ${e.title}`,`description: "noskills spec: ${e.title}"`,"---","",`# ${e.title}`,""];return e.discoveryAnswers!==""&&t.push("## Overview","",e.discoveryAnswers,""),e.concerns!==""&&t.push("## Concerns","",e.concerns,""),e.contributorGuide!==""&&t.push("## Contributor Guide","",e.contributorGuide,""),e.publicApi!==""&&t.push("## Public API","",e.publicApi,""),e.outOfScope!==""&&t.push("## Out of Scope","",e.outOfScope,""),e.tasks!==""&&t.push("## Tasks","",e.tasks,""),e.verification!==""&&t.push("## Verification","",e.verification,""),t.join(`
361
+ `)},ts=async e=>{try{return await r.fs.stat(e),!0}catch{return!1}},Ee={id:"opencode",capabilities:{rules:!0,hooks:!0,agents:!0,specs:!0,mcp:!0,interaction:{hasAskUserTool:!1,optionPresentation:"prose",hasSubAgentDelegation:!0,subAgentMethod:"delegation"}},syncRules:async(e,t)=>{await v(e,t)},syncHooks:async(e,t)=>{let s=`${e.root}/${Jt}`;await r.fs.mkdir(s,{recursive:!0}),await r.fs.writeTextFile(`${s}/noskills.ts`,Xt(e.commandPrefix))},syncAgents:async(e,t)=>{let s=`${e.root}/${Vt}`;await r.fs.mkdir(s,{recursive:!0}),await r.fs.writeTextFile(`${s}/noskills-executor.md`,zt(e.commandPrefix)),await r.fs.writeTextFile(`${s}/noskills-verifier.md`,Qt())},syncSpecs:async(e,t)=>{let s;try{s=await r.fs.readTextFile(t)}catch{return}if(s.trim()==="")return;let o=t.split("/"),n=o[o.length-2]??"unknown",i=Zt(s),a=`${e.root}/${Bt}`;await r.fs.mkdir(a,{recursive:!0}),await r.fs.writeTextFile(`${a}/${n}.md`,es(i))},syncMcp:async e=>{let t=`${e.root}/${qt}`,s={};if(await ts(t))try{let a=await r.fs.readTextFile(t),c=JSON.parse(a);c!==null&&typeof c=="object"&&!Array.isArray(c)&&(s=c)}catch{}let n=[...e.commandPrefix.split(/\s+/),"mcp-serve"],i={...s,mcp:{...s.mcp,noskills:{type:"local",command:n,enabled:!0}}};await r.fs.writeTextFile(t,JSON.stringify(i,null,2)+`
362
+ `)}};var os=".github/hooks",ns="noskills.json",rs=".github/agents",is=".copilot",as="mcp.json",Ce="bash|powershell",$e="create|edit|str_replace_editor|apply_patch",E=(e,t,s,o=[])=>({type:"command",...s===void 0?{}:{matcher:s},command:g(e,t,o),timeoutSec:u[t]}),cs=e=>({sessionStart:[E(e,"session-start",void 0,["--tool=copilot-cli"])],preToolUse:[E(e,"pre-tool-use",`${Ce}|${$e}`)],postToolUse:[E(e,"post-file-write",$e),E(e,"post-bash",Ce)],agentStop:[E(e,"stop")]}),B=e=>e instanceof Object&&!Array.isArray(e),ls=(e,t)=>{let s=B(e)?e:{},o=B(s.hooks)?s.hooks:{},n={};for(let[i,a]of Object.entries(o)){if(!Array.isArray(a))continue;let c=a.filter(l=>!(B(l)&&["command","bash","powershell"].some(d=>G(l[d]))));c.length>0&&(n[i]=c)}return{...s,version:1,hooks:k(n,cs(t))}},ds=e=>["---","name: noskills-executor",'description: "Executes a single noskills task. Follows spec behavioral rules and reports structured results."',"tools:"," - read"," - write"," - glob"," - grep"," - shell","---","","You are executing a single task from a noskills spec.","Your ONLY job is to complete the task described in the prompt.","Follow all behavioral rules provided in the prompt.","Do NOT start new tasks, explore unrelated code, or make architectural decisions.","If the task is too vague to execute, say so immediately.","","## Self-Verification","After completing the task, you MUST verify your own work before reporting:",...p,"","## Reporting","When finished, provide a structured JSON summary:","```json",'{"completed": ["<item IDs done>"], "remaining": ["<item IDs not done>"], "blocked": ["<item IDs needing decisions>"], "filesModified": ["<paths>"], "verification": {"typeCheck": "pass|fail", "tests": "pass|fail (N passed, M failed)"}}',"```","","Do NOT return raw test output \u2014 summarize it in the verification field.",`The orchestrator will submit this to \`${e} next --answer\` on your behalf.`,""].join(`
363
+ `),us=()=>["---","name: noskills-verifier",`description: "Independently verifies completed task work. Read-only. Never sees the executor's context."`,"tools:"," - read"," - glob"," - grep"," - shell","---","","You are verifying another agent's work. You have NO context about how it was done.","Read the changed files. Run the test suite. Check each acceptance criterion independently.","","For each acceptance criterion:","- PASS: with evidence \u2014 show the grep result, the test output, or the file content that proves it","- FAIL: with specific reason \u2014 what's missing, what's wrong, what doesn't match","","Be skeptical. Don't assume anything works \u2014 verify it yourself.","You CANNOT edit files. Read-only access only.","","## Verification Steps",...m,"","## Report Format","When finished, provide a structured JSON summary:","```json",'{"results": [{"id": "ac-1", "status": "PASS", "evidence": "..."}, {"id": "ac-2", "status": "FAIL", "reason": "..."}]}',"```","","The orchestrator will use this report for the noskills status report.",""].join(`
364
+ `),ps=e=>{let t=e.split(/\s+/),s=t[0]??"npx",o=[...t.slice(1),"mcp-serve"];return{mcpServers:{noskills:{type:"local",command:s,args:o,tools:["*"]}}}},ms=async e=>{try{return await r.fs.stat(e),!0}catch{return!1}},_e={id:"copilot-cli",capabilities:{rules:!0,hooks:!0,agents:!0,specs:!1,mcp:!0,interaction:{hasAskUserTool:!1,optionPresentation:"prose",hasSubAgentDelegation:!0,subAgentMethod:"fleet"}},syncRules:async(e,t)=>{await v(e,t),await _(e.root,e.rules,e.commandPrefix)},syncHooks:async(e,t)=>{let s=`${e.root}/${os}`,o=`${s}/${ns}`;await r.fs.mkdir(s,{recursive:!0});let n={};try{n=JSON.parse(await r.fs.readTextFile(o))}catch{}await r.fs.writeTextFile(o,JSON.stringify(ls(n,e.commandPrefix),null,2)+`
365
+ `)},syncAgents:async(e,t)=>{let s=`${e.root}/${rs}`;await r.fs.mkdir(s,{recursive:!0}),await r.fs.writeTextFile(`${s}/noskills-executor.agent.md`,ds(e.commandPrefix)),await r.fs.writeTextFile(`${s}/noskills-verifier.agent.md`,us())},syncMcp:async e=>{let t=`${e.root}/${is}`,s=`${t}/${as}`;await r.fs.mkdir(t,{recursive:!0});let o={mcpServers:{}};if(await ms(s))try{let a=await r.fs.readTextFile(s),c=JSON.parse(a);c.mcpServers!==void 0&&c.mcpServers!==null&&(o=c)}catch{}let n=ps(e.commandPrefix),i={...o,mcpServers:{...o.mcpServers,...n.mcpServers}};await r.fs.writeTextFile(s,JSON.stringify(i,null,2)+`
366
+ `)}};var fs=e=>{let t=e.trim();if(!t.startsWith("---"))return{meta:{},body:t};let s=t.indexOf("---",3);if(s===-1)return{meta:{},body:t};let o=t.slice(3,s).trim(),n=t.slice(s+3).trim(),i={};for(let a of o.split(`
367
+ `)){let c=a.indexOf(":");if(c===-1)continue;let l=a.slice(0,c).trim(),d=a.slice(c+1).trim();if(d.startsWith("[")&&d.endsWith("]")){let b=d.slice(1,-1).split(",").map(I=>I.trim().replace(/^["']|["']$/g,"")).filter(I=>I.length>0);i[l]=b}else i[l]=d.replace(/^["']|["']$/g,"")}return{meta:i,body:n}},gs=async e=>{let t=`${e}/${N.rulesDir}`,s=[];try{for await(let o of r.fs.readDir(t))if(o.isFile&&(o.name.endsWith(".md")||o.name.endsWith(".txt"))){let n;try{n=await r.fs.readTextFile(`${t}/${o.name}`)}catch{continue}let{meta:i,body:a}=fs(n),c=a.split(`
368
+ `)[0]??a;s.push({text:c,phases:Array.isArray(i.phases)?i.phases:void 0,appliesTo:Array.isArray(i.applies_to)?i.applies_to:void 0})}}catch{}return s};var ys=async e=>(await gs(e)).map(s=>s.text),Ms=(e,t)=>{let s=[],o=0;for(let n of e)n.phases!==void 0&&n.phases.length>0&&!n.phases.includes(t)||(n.appliesTo!==void 0&&n.appliesTo.length>0?o++:s.push(n.text));return{tier1:s,tier2Count:o}},ks=(e,t)=>{let s=t.startsWith("*.")?t.slice(1):null;return s!==null?e.endsWith(s):e.includes(t.replace(/\*/g,""))},Fs=(e,t,s)=>e.filter(o=>o.phases!==void 0&&o.phases.length>0&&!o.phases.includes(t)||o.appliesTo===void 0||o.appliesTo.length===0?!1:o.appliesTo.some(n=>ks(s,n))).map(o=>o.text),q=[K,ye,be,xe,Ae,Ee,pe,_e],Ie=K.capabilities.interaction,ws=e=>q.find(s=>s.id===e)?.capabilities.interaction??Ie,Ps=e=>e.filter(t=>q.find(s=>s.id===t)?.capabilities.hooks===!0),Ls=e=>{let t=e[0];return t===void 0?Ie:ws(t)},vs=async(e,t,s)=>{if(await e.syncRules(t,s),e.capabilities.hooks&&e.syncHooks!==void 0&&await e.syncHooks(t,s),e.capabilities.agents&&e.syncAgents!==void 0&&await e.syncAgents(t,s),e.capabilities.specs&&e.syncSpecs!==void 0){let o=`${t.root}/${N.specsDir}`;try{for await(let n of r.fs.readDir(o))if(n.isDirectory){let i=`${o}/${n.name}/spec.md`;await e.syncSpecs(t,i)}}catch{}}e.capabilities.mcp&&e.syncMcp!==void 0&&await e.syncMcp(t)},Gs=async(e,t,s)=>{let o=await ys(e),n=[],i={allowGit:s?.allowGit===!0},a=s?.command??"npx eser@latest noskills";X(a);for(let c of t){let l=q.find(b=>b.id===c);if(l===void 0)continue;await vs(l,{root:e,rules:o,commandPrefix:a},i),n.push(c)}return t.includes("claude-code")&&n.push("hooks"),n};export{Rs as a,Ne as b,bs as c,Ts as d,xs as e,Os as f,As as g,Es as h,G as i,$ as j,Cs as k,ot as l,gs as m,ys as n,Ms as o,Fs as p,ws as q,Ps as r,Ls as s,Gs as t};
@@ -0,0 +1,3 @@
1
+ import{b as f,c as y}from"./chunk-UY4YFVSW.js";import{a as d}from"./chunk-YN3SHWBR.js";var w=async(r,t)=>{let e=t.properties?.binPath;if(e!==void 0)return e;try{let n=await y`which ${r}`.noThrow().text();if(n.length>0)return n}catch{}throw new d(`Binary "${r}" not found. Set properties.binPath in config or ensure it is on PATH.`,{provider:r})},b=(r,t,e)=>{let n=e?.stdinData!==void 0,s=new f(r,[...t],{stdin:n?"piped":"null",stdout:"piped",stderr:"piped",cwd:e?.cwd,env:e?.env}).child();if(n&&s.stdin!==null){let i=new TextEncoder,g=s.stdin.getWriter();g.write(i.encode(e.stdinData)).then(()=>g.close()).catch(()=>{})}let a=e?.signal,c=!1,l=i=>{c||s.kill(i??"SIGTERM")},p=()=>l(),m=s.status.then(i=>(c=!0,a?.removeEventListener("abort",p),i));return a?.aborted===!0?l():a?.addEventListener("abort",p,{once:!0}),{stdout:s.stdout,stderr:s.stderr,waitForExit:async()=>{let i=await m;return{code:i.code,success:i.success}},kill:l}},k=async(r,t)=>{r.kill();try{await t}catch{}},u=new TextDecoder;async function*P(r){let t=r.getReader(),e="";try{let n=await t.read();for(;n.done!==!0;){e+=u.decode(n.value,{stream:!0});let s=e.split(`
2
+ `);e=s.pop()??"";for(let a of s){let c=a.trim();if(c.length!==0)try{yield JSON.parse(c)}catch{}}n=await t.read()}let o=e.trim();if(o.length>0)try{yield JSON.parse(o)}catch{}}finally{t.releaseLock()}}var A=async(r,t)=>{let e=[];for await(let o of r)e.push(u.decode(o,{stream:!0}));return{content:[{kind:"text",text:e.join("").trim()}],stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0},modelId:t}},E=async r=>{let t=[];for await(let e of r)t.push(u.decode(e,{stream:!0}));return t.join("").trim()},S=(r,t,e)=>{if(t===0)return null;let n=e.length>0?`${r} exited with code ${t}: ${e}`:`${r} exited with code ${t}`;return t===1?new d(n,{provider:r}):t===126||t===127?new d(`${r} binary not found or not executable (exit code ${t})`,{provider:r}):new d(n,{provider:r})},R=(r,t)=>{let e=[];t!==void 0&&(e.push(t),e.push(""));for(let n of r)for(let o of n.content)o.kind==="text"&&e.push(o.text);return e.join(`
3
+ `)};export{w as a,b,k as c,P as d,A as e,E as f,S as g,R as h};
@@ -1 +1 @@
1
- var t=r=>({_tag:"Ok",value:r,*[Symbol.iterator](){return yield this}}),n=r=>({_tag:"Fail",error:r,*[Symbol.iterator](){return yield this}}),E=r=>r._tag==="Ok",a=r=>r._tag==="Fail",T=(r,e)=>E(r)?t(e(r.value)):r;var s=(r,e)=>E(r)?e.ok(r.value):e.fail(r.error),l=async(r,e=o=>o)=>{try{return t(await r)}catch(o){return n(e(o))}};export{t as a,n as b,a as c,T as d,s as e,l as f};
1
+ var t=r=>({_tag:"Ok",value:r,*[Symbol.iterator](){return yield this}}),n=r=>({_tag:"Fail",error:r,*[Symbol.iterator](){return yield this}}),E=r=>r._tag==="Ok",a=r=>r._tag==="Fail",T=(r,e)=>E(r)?t(e(r.value)):r;var s=(r,e)=>E(r)?e.ok(r.value):e.fail(r.error),l=async(r,e=o=>o)=>{try{return t(await r)}catch(o){return n(e(o))}};export{t as a,n as b,E as c,a as d,T as e,s as f,l as g};