noskills 4.1.40 → 4.1.41

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 (41) hide show
  1. package/README.md +40 -12
  2. package/chunks/approve-R5UDYN3P.js +1 -0
  3. package/chunks/block-P7TM5EPZ.js +1 -0
  4. package/chunks/cancel-TU3C6MKE.js +1 -0
  5. package/chunks/{chunk-KJH7Q57A.js → chunk-CIYGCZTM.js} +1 -1
  6. package/chunks/chunk-GBSAQ2FM.js +3 -0
  7. package/chunks/chunk-KDWUWWE5.js +81 -0
  8. package/chunks/chunk-M7KSO4EF.js +1 -0
  9. package/chunks/chunk-RIME26D6.js +144 -0
  10. package/chunks/chunk-U2T4X5EN.js +11 -0
  11. package/chunks/{concern-FGNG32KU.js → concern-E56E2MFL.js} +1 -1
  12. package/chunks/done-NQMUXJYO.js +1 -0
  13. package/chunks/{init-M7SJOVPZ.js → init-3O7FXLIZ.js} +1 -1
  14. package/chunks/{invoke-hook-VXIVDDQG.js → invoke-hook-MPDIOIHR.js} +3 -3
  15. package/chunks/next-5LH223G2.js +8 -0
  16. package/chunks/{purge-6DEK2ZSI.js → purge-6T4L2FXI.js} +1 -1
  17. package/chunks/reopen-JIHLM3KX.js +1 -0
  18. package/chunks/reset-4RHO7MSF.js +1 -0
  19. package/chunks/{rule-OVSBPSYO.js → rule-UDTLRXFA.js} +1 -1
  20. package/chunks/run-77R3ANIQ.js +3 -0
  21. package/chunks/spec-DPDGDRW2.js +1 -0
  22. package/chunks/status-4YV2X73D.js +1 -0
  23. package/chunks/{sync-MWQWXN2C.js → sync-QYUBOAMK.js} +1 -1
  24. package/chunks/watch-XVGIYX6X.js +8 -0
  25. package/chunks/wontfix-VCV45TPJ.js +1 -0
  26. package/noskills.js +1 -1
  27. package/package.json +1 -1
  28. package/chunks/approve-GSSSUQWC.js +0 -1
  29. package/chunks/block-LVQNJU4P.js +0 -1
  30. package/chunks/chunk-4XOSXARZ.js +0 -9
  31. package/chunks/chunk-EMHZF6ZY.js +0 -144
  32. package/chunks/chunk-IAR3DEWR.js +0 -1
  33. package/chunks/chunk-RYQPPQNO.js +0 -3
  34. package/chunks/chunk-XADY6SXR.js +0 -67
  35. package/chunks/done-5IX2F6V7.js +0 -1
  36. package/chunks/next-GGVR6JM2.js +0 -8
  37. package/chunks/reset-JEIUVTWV.js +0 -1
  38. package/chunks/run-7MZATQML.js +0 -3
  39. package/chunks/spec-J7KC4VFM.js +0 -1
  40. package/chunks/status-BISV6DFB.js +0 -1
  41. package/chunks/watch-AP5GGXG6.js +0 -8
package/README.md CHANGED
@@ -9,15 +9,18 @@ the state machine does.
9
9
 
10
10
  noskills is in active beta. We've battle-tested it with Claude Code — the
11
11
  discovery flow, sub-agent orchestration, verification backpressure, and the full
12
- spec lifecycle are working in production use. Other platforms (Cursor, Kiro,
13
- Copilot, Windsurf) have sync support but haven't been tested end-to-end yet.
12
+ spec lifecycle are working in production use. Kiro has full integration
13
+ (steering files, hooks, custom agents, spec projection, MCP registration) but
14
+ needs end-to-end testing. Other platforms (Cursor, Copilot, Windsurf) have rule
15
+ sync support.
14
16
 
15
17
  If you want to test noskills with a platform other than Claude Code, reach out —
16
18
  we'd love early feedback. Find me at [github.com/eser](https://github.com/eser)
17
19
  or [@eserozvataf](https://x.com/eserozvataf).
18
20
 
19
- **Coming next:** deeper rule management, concern customization, and platform
20
- integrations beyond Claude Code. Star the repo and watch for updates.
21
+ **Coming next:** deeper rule management, concern customization, and richer
22
+ integrations for Cursor, Copilot, and Windsurf. Star the repo and watch for
23
+ updates.
21
24
 
22
25
  ## Why
23
26
 
@@ -224,12 +227,27 @@ If `eser` CLI is not installed:
224
227
 
225
228
  Run `npx eser@latest noskills init` — it will scaffold your project and guide you through setup.
226
229
 
227
- That's it. The init command detects Claude Code, sets up hooks, generates
228
- `CLAUDE.md`, and presents your next options automatically.
230
+ That's it. The init command detects Claude Code, sets up hooks, instructions,
231
+ and agent helpers automatically.
229
232
 
230
233
  If you want to add this to an existing project where teammates also use
231
234
  noskills, the init scaffolds `.eser/` which should be committed to your repo.
232
235
 
236
+ ## Getting Started with Kiro
237
+
238
+ Open a Kiro session and paste:
239
+
240
+ Run `eser noskills init` — it will scaffold your project and guide you through setup.
241
+
242
+ If `eser` CLI is not installed:
243
+
244
+ Run `npx eser@latest noskills init` — it will scaffold your project and guide you through setup.
245
+
246
+ noskills detects the `.kiro` directory automatically and generates steering
247
+ files, hooks, custom agents, spec projection, and MCP registration — all from
248
+ the same `.eser/` source of truth. Your teammates on different tools get
249
+ identical orchestration quality.
250
+
233
251
  ## Quick Start
234
252
 
235
253
  noskills works with any AI coding agent. Here's how to get started in a few
@@ -616,8 +634,9 @@ noskills next --answer='{"involvesWebUI":true,"involvesCLI":false,"involvesPubli
616
634
 
617
635
  ### Hooks — Zero-Token Bookkeeping
618
636
 
619
- noskills installs Claude Code hooks that handle state bookkeeping without
620
- spending LLM tokens:
637
+ noskills installs hooks for Claude Code (`.claude/settings.json`) and Kiro
638
+ (`.kiro/settings/hooks.json`) that handle state bookkeeping without spending LLM
639
+ tokens. Claude Code hooks:
621
640
 
622
641
  | Hook | Event | What it does |
623
642
  | ------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -627,6 +646,9 @@ spending LLM tokens:
627
646
  | **post-bash** | PostToolUse | Logs noskills CLI invocations for observability |
628
647
  | **session-start** | SessionStart | Runs `noskills next` at session start so the agent is immediately oriented. No CLAUDE.md reading needed — the hook delivers the current instruction. |
629
648
 
649
+ Kiro hooks map the same behavioral guarantees to Kiro-native triggers (Pre Tool
650
+ Use, Post Tool Use, Agent Stop, Prompt Submit) using Run Command actions.
651
+
630
652
  Hooks are CLI subcommands (`noskills invoke-hook <name>`), not generated script
631
653
  files. This avoids ESM/CJS issues — the same Deno entry point handles
632
654
  everything.
@@ -642,11 +664,17 @@ noskills generates instruction files for every AI tool your team uses:
642
664
  ```
643
665
  .eser/ (single source of truth)
644
666
  +-- noskills sync
645
- |-- -> CLAUDE.md (Claude Code)
646
- |-- -> .cursorrules (Cursor)
647
- |-- -> .kiro/steering/ (Kiro)
667
+ |-- -> CLAUDE.md (Claude Code)
668
+ |-- -> .claude/settings.json (Claude Code hooks)
669
+ |-- -> .claude/agents/ (Claude Code agents)
670
+ |-- -> .cursorrules (Cursor)
671
+ |-- -> .kiro/steering/*.md (Kiro steering files)
672
+ |-- -> .kiro/settings/hooks.json (Kiro hooks)
673
+ |-- -> .kiro/settings/mcp.json (Kiro MCP registration)
674
+ |-- -> .kiro/agents/*.json (Kiro custom agents)
675
+ |-- -> .kiro/specs/ (Kiro spec projection)
648
676
  |-- -> .github/copilot-instructions.md (GitHub Copilot)
649
- +-- -> .windsurfrules (Windsurf)
677
+ +-- -> .windsurfrules (Windsurf)
650
678
  ```
651
679
 
652
680
  Write your rules once in `.eser/rules/`, run `noskills sync`, and every tool
@@ -0,0 +1 @@
1
+ import{a as E}from"./chunk-GBSAQ2FM.js";import{a as P,d as A}from"./chunk-CIYGCZTM.js";import"./chunk-VPXOI7CR.js";import{c as n}from"./chunk-YK6UG66R.js";import{e as D,g as R}from"./chunk-M7KSO4EF.js";import{d as v,f as S,g,h as d,m as y,q as C}from"./chunk-RIME26D6.js";import{c as a,d as i,f as o,g as c,k as l,o as u,q as f,r as h}from"./chunk-Y6AFIAJP.js";import{a as m,b as w}from"./chunk-2N4GTHXQ.js";import{b as p}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var M=async F=>{let s=u({renderer:h.ansi(),sink:f.stdout()}),t=p.process.cwd(),_=g(F),e=await S(t,_),$=await y(t);if(e.spec!==null){let r=`${t}/${v.specDir(e.spec)}`;try{await p.fs.stat(r)}catch{return s.writeln(o(`Active spec '${e.spec}' directory not found.`)),s.writeln(i("Run `noskills reset` to return to IDLE.")),await s.close(),w({exitCode:1})}}if(e.phase==="SPEC_DRAFT"){if(e.classification===null&&e.spec!==null){let b=(await C(t)).filter(k=>$?.concerns.includes(k.id)??!1);try{await E(t,e,b)}catch{}}let r=R(e);await d(t,r),r.spec!==null&&(await P(t,r.spec,"approved"),await A(t,r.spec,"approved")),s.writeln(c("\u2714")," Spec approved. Phase: ",l("SPEC_APPROVED")),s.writeln("When ready, run ",a(`${n('next --answer="start"')}`)," to begin execution.")}else if(e.phase==="DISCOVERY_REVIEW"){let r=D(e);await d(t,r),s.writeln(c("\u2714")," Discovery answers approved. Phase: ",l("SPEC_DRAFT")),s.writeln("Review the spec and run ",a(n("approve"))," again to approve.")}else e.phase==="DISCOVERY"&&e.discovery.completed?(s.writeln(i("Discovery complete. Spec draft already generated.")),s.writeln("Review the spec and run ",a(n("approve"))," again when in SPEC_DRAFT phase.")):s.writeln(o(`Cannot approve in phase: ${e.phase}`));return await s.close(),m(void 0)};export{M as main};
@@ -0,0 +1 @@
1
+ import{c as v}from"./chunk-YK6UG66R.js";import{i as x}from"./chunk-M7KSO4EF.js";import{d as h,f as g,g as k,h as y}from"./chunk-RIME26D6.js";import{c as m,d as i,f as a,h as d,o as u,q as f,r as w}from"./chunk-Y6AFIAJP.js";import{a as p,b as o}from"./chunk-2N4GTHXQ.js";import{b as n}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var N=async c=>{let e=u({renderer:w.ansi(),sink:f.stdout()}),t=n.process.cwd(),A=k(c),l=(c??[]).filter(r=>!r.startsWith("--spec=")).join(" ")||"No reason given",s=await g(t,A);if(s.spec!==null){let r=`${t}/${h.specDir(s.spec)}`;try{await n.fs.stat(r)}catch{return e.writeln(a(`Active spec '${s.spec}' directory not found.`)),e.writeln(i("Run `noskills reset` to return to IDLE.")),await e.close(),o({exitCode:1})}}if(s.phase!=="EXECUTING")return e.writeln(a(`Cannot block in phase: ${s.phase}`)),await e.close(),o({exitCode:1});let C=x(s,l);return await y(t,C),e.writeln(d("\u26A0")," Spec blocked: ",i(l)),e.writeln("Resolve with: ",m(`${v('next --answer="resolution"')}`)),await e.close(),p(void 0)};export{N as main};
@@ -0,0 +1 @@
1
+ import{a as g,d as D}from"./chunk-CIYGCZTM.js";import{k as S}from"./chunk-M7KSO4EF.js";import{d as u,f,g as w,h}from"./chunk-RIME26D6.js";import{d as p,f as c,g as o,o as l,q as m,r as d}from"./chunk-Y6AFIAJP.js";import{a as i,b as a}from"./chunk-2N4GTHXQ.js";import{b as n}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var x=async I=>{let s=l({renderer:d.ansi(),sink:m.stdout()}),t=n.process.cwd(),y=w(I),e=await f(t,y);if(e.phase==="IDLE"||e.phase==="UNINITIALIZED"||e.phase==="COMPLETED")return s.writeln(c(`Cannot cancel in phase: ${e.phase}`)),await s.close(),a({exitCode:1});if(e.spec!==null){let C=`${t}/${u.specDir(e.spec)}`;try{await n.fs.stat(C)}catch{return s.writeln(c(`Active spec '${e.spec}' directory not found.`)),s.writeln(p("Run `noskills reset` to return to IDLE.")),await s.close(),a({exitCode:1})}}let r=S(e,"cancelled");return await h(t,r),r.spec!==null&&(await g(t,r.spec,"cancelled"),await D(t,r.spec,"cancelled")),s.writeln(o("\u2714")," Spec cancelled."),await s.close(),i(void 0)};export{x as main};
@@ -1,3 +1,3 @@
1
- import{d as o}from"./chunk-EMHZF6ZY.js";import{b as e}from"./chunk-MNEZ5QGX.js";var d=async(r,i,n)=>{let s=`${r}/${o.specFile(i)}`;try{let t=await e.fs.readTextFile(s);t=t.replace(/^## Status: .+$/m,`## Status: ${n}`),await e.fs.writeTextFile(s,t)}catch{}},u=async(r,i,n)=>{let s=`${r}/${o.specFile(i)}`;try{let t=await e.fs.readTextFile(s),a=new RegExp(`^(- )\\[ \\]( ${n}:.*)$`,"m");t=t.replace(a,"$1[x]$2"),await e.fs.writeTextFile(s,t)}catch{}},w=async(r,i,n,s)=>{let t=`${r}/${o.specDir(i)}/progress.json`;try{let a=await e.fs.readTextFile(t),c=JSON.parse(a);for(let p of c.tasks)p.id===n&&(p.status=s);c.updatedAt=new Date().toISOString(),await e.fs.writeTextFile(t,JSON.stringify(c,null,2)+`
1
+ import{d as o}from"./chunk-RIME26D6.js";import{b as e}from"./chunk-MNEZ5QGX.js";var d=async(r,i,n)=>{let s=`${r}/${o.specFile(i)}`;try{let t=await e.fs.readTextFile(s);t=t.replace(/^## Status: .+$/m,`## Status: ${n}`),await e.fs.writeTextFile(s,t)}catch{}},u=async(r,i,n)=>{let s=`${r}/${o.specFile(i)}`;try{let t=await e.fs.readTextFile(s),a=new RegExp(`^(- )\\[ \\]( ${n}:.*)$`,"m");t=t.replace(a,"$1[x]$2"),await e.fs.writeTextFile(s,t)}catch{}},w=async(r,i,n,s)=>{let t=`${r}/${o.specDir(i)}/progress.json`;try{let a=await e.fs.readTextFile(t),c=JSON.parse(a);for(let p of c.tasks)p.id===n&&(p.status=s);c.updatedAt=new Date().toISOString(),await e.fs.writeTextFile(t,JSON.stringify(c,null,2)+`
2
2
  `)}catch{}},f=async(r,i,n)=>{let s=`${r}/${o.specDir(i)}/progress.json`;try{let t=await e.fs.readTextFile(s),a=JSON.parse(t);a.status=n,a.updatedAt=new Date().toISOString(),await e.fs.writeTextFile(s,JSON.stringify(a,null,2)+`
3
3
  `)}catch{}};export{d as a,u as b,w as c,f as d};
@@ -0,0 +1,3 @@
1
+ import{b as f}from"./chunk-VPXOI7CR.js";import{d}from"./chunk-RIME26D6.js";import{b as u}from"./chunk-MNEZ5QGX.js";var m=r=>{let i=r.split(/\n/).flatMap(t=>t.trim().length>0?[t.trim()]:[]);return i.length>1?i:r.split(/\.(?=\s+[A-Z])|;\s+/).map(t=>t.trim()).filter(t=>t.length>5)},v=(r,i=[])=>{let t=[],o=r.find(e=>e.questionId==="ambition");if(o!==void 0){let e=o.answer,c=e.match(/10[- ]?star[:\s]+(.+?)(?:\n|$)/is),a=e.match(/5[- ]?star[:\s]+(.+?)(?:\n|$)/is),s=(c!==null?c[1].trim():a!==null?a[1].trim():e.replace(/1[- ]?star[:\s]+[^.]*\.\s*/i,"").trim()).replace(/^(the|a|an|with|plus|also)\s+/i,"").replace(/^(the\s+)?(target|goal|objective)[:\s]+/i,"").trim();s.length>0&&(s=s.charAt(0).toUpperCase()+s.slice(1)),s=s.replace(/[.\u2026]+$/,"").trim(),s.length>140&&(s=s.slice(0,137)+"..."),s.length>3&&t.push(s)}let n=r.find(e=>e.questionId==="verification");if(n!==void 0){let e=n.answer.split(/\n/).map(c=>c.replace(/^\s*[-\u2022*]\s*/,"").trim()).filter(c=>c.length>0);for(let c of e)t.push(c)}for(let e of i){let c=e.choice.toLowerCase();if(c.includes("accepted")||c.includes("add to scope")){let a=e.question.replace(/^should\s+(we|i)\s+/i,"").replace(/\?+$/,"").trim(),l=a.charAt(0).toUpperCase()+a.slice(1);t.push(l)}}return t.length===0&&t.push("_Tasks need to be defined before execution. Add tasks manually or run discovery with more detail._"),t},w=(r,i)=>{let t={};if(i===null){for(let o of r.specSections)t[o]=!1;return t}for(let o of r.specSections){let n=o.toLowerCase();n.includes("design")||n.includes("mobile")||n.includes("layout")||n.includes("interaction")?t[o]=i.involvesWebUI:n.includes("contributor")||n.includes("public api")||n.includes("api surface")?t[o]=i.involvesPublicAPI:n.includes("migration")||n.includes("deprecation")||n.includes("backward")||n.includes("compatibility")?t[o]=i.involvesMigration:n.includes("audit")||n.includes("access control")||n.includes("data handling")?t[o]=i.involvesDataHandling:t[o]=!0}return t},g=(r,i,t,o,n)=>{let e=[];e.push(`# Spec: ${r}`),e.push(""),e.push("## Status: draft"),e.push(""),t.length>0&&(e.push(`## Concerns: ${t.map(s=>s.id).join(", ")}`),e.push("")),e.push("## Discovery Answers"),e.push("");for(let s of i)e.push(`### ${s.questionId}`),e.push(""),e.push(s.answer),e.push("");for(let s of t)if(s.specSections.length>0){let p=w(s,n??null);for(let h of s.specSections)p[h]!==!1&&(e.push(`## ${h} (${s.id})`),e.push(""),e.push("_To be addressed during execution._"),e.push(""))}if(o.length>0){e.push("## Decisions"),e.push(""),e.push("| # | Decision | Choice | Promoted |"),e.push("|---|----------|--------|----------|");for(let s=0;s<o.length;s++){let p=o[s];e.push(`| ${s+1} | ${p.question} | ${p.choice} | ${p.promoted?"yes":"no"} |`)}e.push("")}let c=i.find(s=>s.questionId==="scope_boundary");if(c!==void 0){e.push("## Out of Scope"),e.push("");let s=m(c.answer);for(let p of s)e.push(`- ${p}`);e.push("")}let a=v(i,o);e.push("## Tasks"),e.push("");for(let s=0;s<a.length;s++)e.push(`- [ ] task-${s+1}: ${a[s]}`);e.push("");let l=i.find(s=>s.questionId==="verification");if(e.push("## Verification"),e.push(""),l!==void 0){let s=m(l.answer);for(let p of s)e.push(`- ${p}`)}else e.push("_To be defined._");return e.push(""),e.join(`
2
+ `)};var D=async(r,i,t)=>{if(i.spec===null)throw new Error("No active spec");let o=`${r}/${d.specDir(i.spec)}`,n=`${r}/${d.specFile(i.spec)}`;await u.fs.mkdir(o,{recursive:!0});let e=g(i.spec,i.discovery.answers,t,i.decisions,i.classification);await u.fs.writeTextFile(n,e);let c=f(i.spec,e),a=`${o}/progress.json`,l={spec:i.spec,status:"draft",tasks:c.tasks.map(s=>({id:s.id,title:s.title,status:"pending"})),decisions:i.decisions.map(s=>({question:s.question,choice:s.choice,promoted:s.promoted})),debt:[],updatedAt:new Date().toISOString()};return await u.fs.writeTextFile(a,JSON.stringify(l,null,2)+`
3
+ `),n};export{D as a};
@@ -0,0 +1,81 @@
1
+ import{a as y}from"./chunk-YK6UG66R.js";import{d as p}from"./chunk-RIME26D6.js";import{b as n}from"./chunk-MNEZ5QGX.js";var k="<!-- noskills:start -->",m="<!-- noskills:end -->",F=(e,t,s="npx eser noskills")=>{let o=[k,"## noskills orchestrator","","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","",` ${s} next # get current instruction`,` ${s} next --answer="your response" # submit result and advance`,"","### When to call noskills next","",`You MUST call \`${s} 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."];if((t?.allowGit??!1)||o.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."),o.push("","### 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: \`${s} rule add`,'"<description>"`. If just this task, note it and move on.',"Never write to `.eser/rules/` directly.","","### 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.`,"","### Command execution","","When told to run a noskills command, execute it IMMEDIATELY. Do not explore,","research, read source code, or plan first. The command output contains all the","context you need. Exploring noskills internals wastes tokens and delays the user.","","### 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."),e.length>0){o.push("","### Active Rules","");for(let i of e)o.push(`- ${i}`)}return o.push(m),o.join(`
2
+ `)},g=async(e,t,s,o="npx eser noskills")=>{let i=`${e}/CLAUDE.md`,r=F(t,s,o),a;try{a=await n.fs.readTextFile(i);let l=a.indexOf(k),c=a.indexOf(m);l!==-1&&c!==-1?a=a.slice(0,l)+r+a.slice(c+m.length):a=a.trimEnd()+`
3
+
4
+ `+r+`
5
+ `}catch{a=r+`
6
+ `}await n.fs.writeTextFile(i,a)};var M=e=>({hooks:{PreToolUse:[{matcher:"Write|Edit|MultiEdit|Bash",hooks:[{type:"command",command:`${e} invoke-hook pre-tool-use`,timeout:5}]}],PostToolUse:[{matcher:"Write|Edit|MultiEdit",hooks:[{type:"command",command:`${e} invoke-hook post-file-write`,timeout:3}]},{matcher:"Bash",hooks:[{type:"command",command:`${e} invoke-hook post-bash`,timeout:3}]}],Stop:[{hooks:[{type:"command",command:`${e} invoke-hook stop`,timeout:10}]}],SessionStart:[{hooks:[{type:"command",command:`${e} invoke-hook session-start`,timeout:5}]}]}}),w=async(e,t="npx eser@latest noskills")=>{let s=`${e}/.claude/settings.json`,o={};try{let a=await n.fs.readTextFile(s);o=JSON.parse(a)}catch{}let i=M(t),r={...o,...i};await n.fs.mkdir(`${e}/.claude`,{recursive:!0}),await n.fs.writeTextFile(s,JSON.stringify(r,null,2)+`
7
+ `)};var j=async(e,t)=>{let s=`${e}/.claude/agents`;await n.fs.mkdir(s,{recursive:!0});let o=`---
8
+ name: noskills-executor
9
+ description: "Executes a single noskills task."
10
+ tools: Read, Edit, MultiEdit, Write, Bash, Grep, Glob, LS
11
+ ---
12
+
13
+ You are executing a single task from a noskills spec.
14
+ Your ONLY job is to complete the task described in the prompt.
15
+ Follow all behavioral rules provided in the prompt.
16
+ Do NOT start new tasks, explore unrelated code, or make architectural decisions.
17
+ If the task is too vague to execute, say so immediately.
18
+
19
+ ## Self-Verification
20
+ After completing the task, you MUST verify your own work before reporting:
21
+ 1. Run type check: \`deno check\` on all modified files
22
+ 2. Run test suite: \`deno test\` on the relevant test files
23
+ 3. If type check or tests fail, fix the issues before reporting
24
+
25
+ ## Reporting
26
+ When finished, provide a structured JSON summary:
27
+ \\\`\\\`\\\`json
28
+ {"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)"}}
29
+ \\\`\\\`\\\`
30
+
31
+ Do NOT return raw test output \u2014 summarize it in the verification field.
32
+ The orchestrator will submit this to \`${t} next --answer\` on your behalf.
33
+ `;await n.fs.writeTextFile(`${s}/noskills-executor.md`,o)},W=async(e,t)=>{let s=`${e}/.claude/agents`;await n.fs.mkdir(s,{recursive:!0}),await n.fs.writeTextFile(`${s}/noskills-verifier.md`,`---
34
+ name: noskills-verifier
35
+ description: "Independently verifies completed task work. Read-only. Never sees the executor's context."
36
+ tools: Read, Bash, Grep, Glob, LS
37
+ ---
38
+
39
+ You are verifying another agent's work. You have NO context about how it was done.
40
+ Read the changed files. Run the test suite. Check each acceptance criterion independently.
41
+
42
+ For each acceptance criterion:
43
+ - PASS: with evidence \u2014 show the grep result, the test output, or the file content that proves it
44
+ - FAIL: with specific reason \u2014 what's missing, what's wrong, what doesn't match
45
+
46
+ Be skeptical. Don't assume anything works \u2014 verify it yourself.
47
+ You CANNOT edit files. Read-only access only.
48
+
49
+ ## Verification Steps
50
+ 1. Read each modified file and verify the changes are correct
51
+ 2. Run type check: \\\`deno check\\\` on modified files
52
+ 3. Run tests: \\\`deno test\\\` on relevant test files
53
+ 4. Check each acceptance criterion against actual file contents
54
+
55
+ ## Report Format
56
+ When finished, provide a structured JSON summary:
57
+ \\\`\\\`\\\`json
58
+ {"results": [{"id": "ac-1", "status": "PASS", "evidence": "..."}, {"id": "ac-2", "status": "FAIL", "reason": "..."}]}
59
+ \\\`\\\`\\\`
60
+
61
+ The orchestrator will use this report for the noskills status report.
62
+ `)},S={id:"claude-code",capabilities:{rules:!0,hooks:!0,agents:!0,specs:!1,mcp:!1},async syncRules(e,t){await g(e.root,e.rules,t,e.commandPrefix)},async syncHooks(e,t){await w(e.root,e.commandPrefix)},async syncAgents(e,t){await j(e.root,e.commandPrefix),await W(e.root,e.commandPrefix)}};var R=async(e,t,s="npx eser noskills")=>{let 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} next\` to get your current instruction.`,`Submit results with \`${s} next --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.",""];if(t.length>0){o.push("## Rules","");for(let i of t)o.push(`- ${i}`);o.push("")}await n.fs.writeTextFile(`${e}/.cursorrules`,o.join(`
63
+ `))};var x={id:"cursor",capabilities:{rules:!0,hooks:!1,agents:!1,specs:!1,mcp:!1},async syncRules(e){await R(e.root,e.rules,e.commandPrefix)}};var U=".kiro/steering",T=".kiro/settings",Y=".kiro/agents",H=".kiro/specs",K="hooks.json",J="mcp.json",V="noskills-protocol.md",B="noskills-coaching.md",h="noskills-rules.md",b="conventions.md",q="noskills-executor.json",z="noskills-verifier.json",X=(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} next # get current instruction`,` ${e} next --answer="your response" # submit result and advance`,"","## 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("","## 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.`,"","## Command execution","","When told to run a noskills command, execute it IMMEDIATELY. Do not explore,","research, read source code, or plan first. The command output contains all the","context you need. Exploring noskills internals wastes tokens and delays the user.","","## 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(`
64
+ `)},Q=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(`
65
+ `),Z=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(`
66
+ `)},ee=e=>({hooks:[{_noskills:!0,trigger:"Prompt Submit",action:{type:"Run Command",command:`${e} invoke-hook session-start`},timeout:5e3},{_noskills:!0,trigger:"Pre Tool Use",condition:{toolNames:["write","shell"]},action:{type:"Run Command",command:`${e} invoke-hook pre-tool-use`},timeout:5e3},{_noskills:!0,trigger:"Post Tool Use",condition:{toolNames:["write"]},action:{type:"Run Command",command:`${e} invoke-hook post-file-write`},timeout:3e3},{_noskills:!0,trigger:"Post Tool Use",condition:{toolNames:["shell"]},action:{type:"Run Command",command:`${e} invoke-hook post-bash`},timeout:3e3},{_noskills:!0,trigger:"Agent Stop",action:{type:"Run Command",command:`${e} invoke-hook stop`},timeout:1e4}]}),te=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}}}},se=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:","1. Run type check: `deno check` on all modified files","2. Run test suite: `deno test` on the relevant test files","3. If type check or tests fail, fix the issues before reporting","","## 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(`
67
+ `)}),oe=()=>({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","1. Read each modified file and verify the changes are correct","2. Run type check: `deno check` on modified files","3. Run tests: `deno test` on relevant test files","4. Check each acceptance criterion against actual file contents","","## 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(`
68
+ `)}),A=async e=>{try{return await n.fs.stat(e),!0}catch{return!1}},ne=e=>{let s=e.match(/^# Spec:\s*(.+)$/m)?.[1]?.trim()??"Untitled",o=new Map,i=e.split(/^## /m);for(let a of i){let l=a.indexOf(`
69
+ `);if(l===-1)continue;let c=a.slice(0,l).trim().toLowerCase(),u=a.slice(l+1).trim();o.set(c,u)}let r=a=>{for(let[l,c]of o)if(l.startsWith(a.toLowerCase()))return c;return""};return{title:s,concerns:r("concerns"),discoveryAnswers:r("discovery answers"),contributorGuide:r("contributor guide"),publicApi:r("public api"),outOfScope:r("out of scope"),tasks:r("tasks"),verification:r("verification")}},ie=e=>{let t=[`# Feature: ${e.title}`,"","## Overview","",e.discoveryAnswers||"(no discovery answers yet)","","## Requirements",""],s=e.discoveryAnswers.split(`
70
+ `).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(`
71
+ `).filter(i=>i.trim());for(let i of o){let r=i.replace(/^[-*]\s*/,"").trim();r&&t.push(`- [ ] ${r}`)}}else t.push("- [ ] (none yet)");return t.push("","## Out of Scope",""),t.push(e.outOfScope||"(nothing listed)"),t.push(""),t.join(`
72
+ `)},re=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(`
73
+ `)},ae=e=>{let t=[`# Tasks: ${e.title}`,""];return e.tasks?t.push(e.tasks):t.push("(no tasks yet)"),t.push(""),t.join(`
74
+ `)},$={id:"kiro",capabilities:{rules:!0,hooks:!0,agents:!0,specs:!0,mcp:!0},async syncRules(e,t){let s=`${e.root}/${U}`;await n.fs.mkdir(s,{recursive:!0}),await n.fs.writeTextFile(`${s}/${V}`,X(e.commandPrefix,t)),await n.fs.writeTextFile(`${s}/${B}`,Q(e.commandPrefix)),e.rules.length>0?await n.fs.writeTextFile(`${s}/${h}`,Z(e.rules)):await A(`${s}/${h}`)&&await n.fs.remove(`${s}/${h}`),await A(`${s}/${b}`)&&await n.fs.remove(`${s}/${b}`)},async syncHooks(e,t){let s=`${e.root}/${T}`,o=`${s}/${K}`;await n.fs.mkdir(s,{recursive:!0});let i=[];try{let c=await n.fs.readTextFile(o),u=JSON.parse(c);Array.isArray(u.hooks)&&(i=u.hooks)}catch{}let r=i.filter(c=>!c._noskills),a=ee(e.commandPrefix),l={hooks:[...r,...a.hooks]};await n.fs.writeTextFile(o,JSON.stringify(l,null,2)+`
75
+ `)},async syncAgents(e,t){let s=`${e.root}/${Y}`;await n.fs.mkdir(s,{recursive:!0});let o=se(e.commandPrefix);await n.fs.writeTextFile(`${s}/${q}`,JSON.stringify(o,null,2)+`
76
+ `);let i=oe();await n.fs.writeTextFile(`${s}/${z}`,JSON.stringify(i,null,2)+`
77
+ `)},async syncSpecs(e,t){let s;try{s=await n.fs.readTextFile(t)}catch{return}if(s.trim()==="")return;let o=t.split("/"),i=o[o.length-2]??"unknown",r=ne(s),a=`${e.root}/${H}/${i}`;await n.fs.mkdir(a,{recursive:!0}),await n.fs.writeTextFile(`${a}/requirements.md`,ie(r)),await n.fs.writeTextFile(`${a}/design.md`,re(r)),await n.fs.writeTextFile(`${a}/tasks.md`,ae(r))},async syncMcp(e){let t=`${e.root}/${T}`,s=`${t}/${J}`;await n.fs.mkdir(t,{recursive:!0});let o={mcpServers:{}};try{let a=await n.fs.readTextFile(s),l=JSON.parse(a);l.mcpServers!==void 0&&l.mcpServers!==null&&(o=l)}catch{}let i=te(e.commandPrefix),r={...o,mcpServers:{...o.mcpServers,...i.mcpServers}};await n.fs.writeTextFile(s,JSON.stringify(r,null,2)+`
78
+ `)}};var E=async(e,t,s="npx eser noskills")=>{let 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} next\` to get your current instruction.`,`Submit results with \`${s} next --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.",""];if(t.length>0){o.push("## Rules","");for(let i of t)o.push(`- ${i}`);o.push("")}await n.fs.mkdir(`${e}/.github`,{recursive:!0}),await n.fs.writeTextFile(`${e}/.github/copilot-instructions.md`,o.join(`
79
+ `))};var O={id:"copilot",capabilities:{rules:!0,hooks:!1,agents:!1,specs:!1,mcp:!1},async syncRules(e){await E(e.root,e.rules,e.commandPrefix)}};var N=async(e,t,s="npx eser noskills")=>{let 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} next\` to get your current instruction.`,`Submit results with \`${s} next --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.",""];if(t.length>0){o.push("## Rules","");for(let i of t)o.push(`- ${i}`);o.push("")}await n.fs.writeTextFile(`${e}/.windsurfrules`,o.join(`
80
+ `))};var C={id:"windsurf",capabilities:{rules:!0,hooks:!1,agents:!1,specs:!1,mcp:!1},async syncRules(e){await N(e.root,e.rules,e.commandPrefix)}};var me=async e=>{let t=`${e}/${p.rulesDir}`,s=[];try{for await(let o of n.fs.readDir(t))if(o.isFile&&(o.name.endsWith(".md")||o.name.endsWith(".txt"))){let i=await n.fs.readTextFile(`${t}/${o.name}`),r=i.trim().split(`
81
+ `)[0]??i.trim();s.push(r)}}catch{}return s},he=[S,x,$,O,C],Re=async(e,t,s)=>{let o=await me(e),i=[],r={allowGit:s?.allowGit??!1},a=s?.command??"npx eser@latest noskills";y(a);for(let l of t){let c=he.find(d=>d.id===l);if(c===void 0)continue;let u={root:e,rules:o,commandPrefix:a};if(await c.syncRules(u,r),c.capabilities.hooks&&c.syncHooks!==void 0&&await c.syncHooks(u,r),c.capabilities.agents&&c.syncAgents!==void 0&&await c.syncAgents(u,r),c.capabilities.specs&&c.syncSpecs!==void 0){let d=`${e}/${p.specsDir}`;try{for await(let f of n.fs.readDir(d))if(f.isDirectory){let I=`${d}/${f.name}/spec.md`;await c.syncSpecs(u,I)}}catch{}}c.capabilities.mcp&&c.syncMcp!==void 0&&await c.syncMcp(u),i.push(l)}return t.includes("claude-code")&&i.push("hooks"),i};export{me as a,Re as b};
@@ -0,0 +1 @@
1
+ import{d as o}from"./chunk-RIME26D6.js";var a={UNINITIALIZED:["IDLE"],IDLE:["DISCOVERY","COMPLETED"],DISCOVERY:["DISCOVERY_REVIEW","COMPLETED"],DISCOVERY_REVIEW:["DISCOVERY_REVIEW","SPEC_DRAFT","COMPLETED"],SPEC_DRAFT:["SPEC_DRAFT","SPEC_APPROVED","COMPLETED"],SPEC_APPROVED:["EXECUTING","COMPLETED"],EXECUTING:["COMPLETED","BLOCKED"],BLOCKED:["EXECUTING","COMPLETED"],COMPLETED:["IDLE","DISCOVERY"]},c=(e,t)=>a[e].includes(t),s=(e,t)=>{if(!c(e,t))throw new Error(`Invalid phase transition: ${e} \u2192 ${t}. Allowed: ${a[e].join(", ")}`)},h=(e,t)=>(s(e.phase,t),{...e,phase:t}),E=(e,t,n)=>(s(e.phase,"DISCOVERY"),{...e,phase:"DISCOVERY",spec:t,branch:n,discovery:{answers:[],completed:!1,currentQuestion:0,audience:"human"},specState:{path:null,status:"none"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]},decisions:[]}),u=(e,t,n)=>{if(e.phase!=="DISCOVERY"&&e.phase!=="DISCOVERY_REVIEW")throw new Error(`Cannot add discovery answer in phase: ${e.phase}`);let i=[...e.discovery.answers.filter(r=>r.questionId!==t),{questionId:t,answer:n}];return{...e,discovery:{...e.discovery,answers:i}}},m=e=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot complete discovery in phase: ${e.phase}`);return{...e,phase:"DISCOVERY_REVIEW",discovery:{...e.discovery,completed:!0},specState:{path:o.specFile(e.spec),status:"draft"}}},d=e=>(s(e.phase,"SPEC_DRAFT"),{...e,phase:"SPEC_DRAFT"}),S=e=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot advance discovery question in phase: ${e.phase}`);return{...e,discovery:{...e.discovery,currentQuestion:e.discovery.currentQuestion+1}}},C=e=>(s(e.phase,"SPEC_APPROVED"),{...e,phase:"SPEC_APPROVED",specState:{...e.specState,status:"approved"}}),D=e=>(s(e.phase,"EXECUTING"),{...e,phase:"EXECUTING",discovery:{answers:[],completed:!0,currentQuestion:0,audience:"human"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]}});var I=(e,t)=>(s(e.phase,"BLOCKED"),{...e,phase:"BLOCKED",execution:{...e.execution,lastProgress:`BLOCKED: ${t}`}}),P=(e,t)=>({...e,decisions:[...e.decisions,t]}),R=(e,t,n)=>(s(e.phase,"COMPLETED"),{...e,phase:"COMPLETED",completionReason:t,completedAt:new Date().toISOString(),completionNote:n??null}),F=e=>{if(e.phase!=="COMPLETED")throw new Error(`Cannot reopen in phase: ${e.phase}`);return{...e,phase:"DISCOVERY",reopenedFrom:e.completionReason,completionReason:null,completedAt:null,completionNote:null,discovery:{...e.discovery,completed:!1,currentQuestion:0},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]},classification:null}},O=e=>({...e,phase:"IDLE",spec:null,branch:null,discovery:{answers:[],completed:!1,currentQuestion:0,audience:"human"},specState:{path:null,status:"none"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]},decisions:[],classification:null,completionReason:null,completedAt:null,completionNote:null,reopenedFrom:null});export{h as a,E as b,u as c,m as d,d as e,S as f,C as g,D as h,I as i,P as j,R as k,F as l,O as m};