eser 4.1.54 → 4.1.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunks/{approve-VBXGXWZI.js → approve-7QQFUQ2C.js} +1 -1
- package/chunks/{block-Z4BELXXO.js → block-4ISSYCGQ.js} +1 -1
- package/chunks/{cancel-HHW2G675.js → cancel-ZRTVX5AT.js} +1 -1
- package/chunks/{changelog-gen-JTU6WIYA.js → changelog-gen-HL2OZBDU.js} +1 -1
- package/chunks/{chunk-5QUEAV4O.js → chunk-4JICYXYK.js} +1 -1
- package/chunks/{chunk-6F4PFXYY.js → chunk-4KDDHQVL.js} +1 -1
- package/chunks/chunk-BAVRVBBX.js +2 -0
- package/chunks/{chunk-NYHMH3N5.js → chunk-DI7OHJ53.js} +1 -1
- package/chunks/{chunk-5K2B6EQM.js → chunk-IXO5V52Y.js} +1 -1
- package/chunks/chunk-KI6473LF.js +6 -0
- package/chunks/chunk-LEG3PWOU.js +4 -0
- package/chunks/{chunk-RUTM4VP7.js → chunk-LOZLXP5G.js} +6 -6
- package/chunks/{chunk-GOWXYTXW.js → chunk-MLC6JFJF.js} +1 -1
- package/chunks/chunk-NCSKHFFW.js +3 -0
- package/chunks/chunk-PPB6ACBB.js +2 -0
- package/chunks/{concern-YFXJJ7DL.js → concern-J22UTED2.js} +1 -1
- package/chunks/{delegate-FVHPWQS7.js → delegate-EBL5HMGD.js} +1 -1
- package/chunks/{diagrams-MRJB73CF.js → diagrams-XRNON3TH.js} +1 -1
- package/chunks/done-QSQ7AMLP.js +2 -0
- package/chunks/{followup-XKVSZT2H.js → followup-EMQ3ZNNS.js} +1 -1
- package/chunks/{gh-3GMLD6TO.js → gh-66RDDALE.js} +1 -1
- package/chunks/{init-ONTNPCSY.js → init-OQ4CKFY7.js} +1 -1
- package/chunks/{invoke-hook-ZM6UQND6.js → invoke-hook-U3LDMMLY.js} +9 -9
- package/chunks/{learn-SRDLP7B5.js → learn-6MIAYVOR.js} +1 -1
- package/chunks/{manager-BMNUSWJO.js → manager-R2Q4FOHO.js} +1 -1
- package/chunks/{mod-5SS5V7LJ.js → mod-FSAQBB7E.js} +1 -1
- package/chunks/next-ZR6B35KN.js +8 -0
- package/chunks/{pack-ZQMMSIIP.js → pack-JXH34X7D.js} +1 -1
- package/chunks/{purge-LXL3F3EJ.js → purge-TQXMK5OC.js} +1 -1
- package/chunks/{release-5PXID6GL.js → release-RKXERKDT.js} +2 -2
- package/chunks/{release-tag-2B2CWVMZ.js → release-tag-WQOAE2OF.js} +1 -1
- package/chunks/{reopen-3NA6JI4N.js → reopen-KFHUPFTT.js} +1 -1
- package/chunks/{reset-XITFRWII.js → reset-F25OLGX7.js} +1 -1
- package/chunks/{review-UVYK4M4T.js → review-ITFNV2TI.js} +1 -1
- package/chunks/{rule-BAO7IP5S.js → rule-E3CUOBUX.js} +1 -1
- package/chunks/{run-EBKNNOG7.js → run-7HOUSACQ.js} +1 -1
- package/chunks/{session-SZYH2UOE.js → session-6EGZXYCI.js} +1 -1
- package/chunks/{spec-CPRKQGOX.js → spec-XFXHNULK.js} +1 -1
- package/chunks/{status-SRCNQJ4V.js → status-KEARGELM.js} +1 -1
- package/chunks/{sync-WE6A7KC7.js → sync-7FA2HPX7.js} +1 -1
- package/chunks/{system-X6YWUEZJ.js → system-I6RBRBRL.js} +1 -1
- package/chunks/{versions-VGXMC5GM.js → versions-NR3A7CS5.js} +1 -1
- package/chunks/{watch-WBZB2C5P.js → watch-XTRRIRTM.js} +1 -1
- package/chunks/{web-GAF33V4M.js → web-VCJYTSV2.js} +1 -1
- package/chunks/{wontfix-JBPCNL6S.js → wontfix-SLHYAWS7.js} +1 -1
- package/eser.js +1 -1
- package/package.json +1 -1
- package/chunks/chunk-6WFCBJPF.js +0 -4
- package/chunks/chunk-IUORSUN6.js +0 -2
- package/chunks/chunk-NQS27P25.js +0 -6
- package/chunks/chunk-OXP2FOO5.js +0 -2
- package/chunks/chunk-UTENCUNI.js +0 -3
- package/chunks/done-DMKJ27IQ.js +0 -2
- package/chunks/next-FD3EHJW3.js +0 -8
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as $}from"./chunk-
|
|
2
|
+
import{a as $}from"./chunk-LEG3PWOU.js";import"./chunk-ODBJ5KMQ.js";import{a as b,d as x}from"./chunk-DI7OHJ53.js";import{h as g}from"./chunk-L32KHQVT.js";import{C as I,i as V,l as F,s as h}from"./chunk-BAVRVBBX.js";import{B as T,c as y,e as D,g as P,h as u,j as f,l as A,p as _}from"./chunk-LOZLXP5G.js";import{c}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as C,h as R,k as E}from"./chunk-SHN5MT56.js";import{c as o,d as p,f as n,g as m,k as w}from"./chunk-YVN2NZL4.js";import{a as S,b as i}from"./chunk-FFWPJP7A.js";import{i as v}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var N=async k=>{let e=C({renderer:E.ansi(),sink:R.stdout()}),{root:r}=await T(),l=P(k);if(!l.ok)return e.writeln(n(l.error)),await e.close(),i({exitCode:1});let s;try{s=await D(r,l.spec)}catch(a){let t=a instanceof Error?a.message:String(a);return e.writeln(n(t)),await e.close(),i({exitCode:1})}let O=await A(r);if(s.spec!==null){let a=`${r}/${y.specDir(s.spec)}`;try{await v.fs.stat(a)}catch{return e.writeln(n(`Active spec '${s.spec}' directory not found.`)),e.writeln(p("Run `noskills reset` to return to idle.")),await e.close(),i({exitCode:1})}}let d=I(s);if(d.length>0&&(s.phase==="SPEC_DRAFT"||s.phase==="DISCOVERY_REVIEW")){e.writeln(n(`Cannot approve \u2014 ${d.length} pending delegation(s):`)),e.writeln("");for(let a of d)e.writeln(` ${a.questionId}: delegated to `,o(a.delegatedTo),p(` (pending since ${a.delegatedAt.slice(0,10)})`));return e.writeln(""),e.writeln(p("All delegations must be answered before approval.")),await e.close(),i({exitCode:1})}if(s.phase==="SPEC_DRAFT"){if(s.classification===null&&s.spec!==null){let U=(await _(r)).filter(W=>O?.concerns.includes(W.id)??!1);try{await $(r,s,U)}catch{}}let a=await g(r),t=F(s);t=h(t,"SPEC_DRAFT","SPEC_APPROVED",a),await u(r,t),t.spec!==null&&await f(r,t.spec,t),t.spec!==null&&(await b(r,t.spec,"approved"),await x(r,t.spec,"approved")),e.writeln(m("\u2714")," Spec approved. Phase: ",w("SPEC_APPROVED")),e.writeln("When ready, run ",o(`${c('next --answer="start"')}`)," to begin execution.")}else if(s.phase==="DISCOVERY_REVIEW"){let a=await g(r),t=V(s);t=h(t,"DISCOVERY_REVIEW","SPEC_DRAFT",a),await u(r,t),t.spec!==null&&await f(r,t.spec,t),e.writeln(m("\u2714")," Discovery answers approved. Phase: ",w("SPEC_DRAFT")),e.writeln("Review the spec and run ",o(c("approve"))," again to approve.")}else s.phase==="DISCOVERY"&&s.discovery.completed?(e.writeln(p("Discovery complete. Spec draft already generated.")),e.writeln("Review the spec and run ",o(c("approve"))," again when in SPEC_DRAFT phase.")):e.writeln(n(`Cannot approve in phase: ${s.phase}`));return await e.close(),S(void 0)};export{N as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{h as $}from"./chunk-L32KHQVT.js";import{n as A,s as R}from"./chunk-
|
|
2
|
+
import{h as $}from"./chunk-L32KHQVT.js";import{n as A,s as R}from"./chunk-BAVRVBBX.js";import{B as x,c as y,e as k,g as C,h as S,j as v}from"./chunk-LOZLXP5G.js";import{c as E}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as w,h,k as g}from"./chunk-SHN5MT56.js";import{c as d,d as c,f as o,h as f}from"./chunk-YVN2NZL4.js";import{a as m,b as n}from"./chunk-FFWPJP7A.js";import{i as u}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var q=async p=>{let e=w({renderer:g.ansi(),sink:h.stdout()}),{root:i}=await x(),a=C(p);if(!a.ok)return e.writeln(o(a.error)),await e.close(),n({exitCode:1});let l=(p??[]).filter(s=>!s.startsWith("--spec=")).join(" ")||"No reason given",t;try{t=await k(i,a.spec)}catch(s){let D=s instanceof Error?s.message:String(s);return e.writeln(o(D)),await e.close(),n({exitCode:1})}if(t.spec!==null){let s=`${i}/${y.specDir(t.spec)}`;try{await u.fs.stat(s)}catch{return e.writeln(o(`Active spec '${t.spec}' directory not found.`)),e.writeln(c("Run `noskills reset` to return to idle.")),await e.close(),n({exitCode:1})}}if(t.phase!=="EXECUTING")return e.writeln(o(`Cannot block in phase: ${t.phase}`)),await e.close(),n({exitCode:1});let b=await $(i),r=A(t,l);return r=R(r,"EXECUTING","BLOCKED",b,l),await S(i,r),r.spec!==null&&await v(i,r.spec,r),e.writeln(f("\u26A0")," Spec blocked: ",c(l)),e.writeln("Resolve with: ",d(`${E('next --answer="resolution"')}`)),await e.close(),m(void 0)};export{q as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as P}from"./chunk-YWSOQJ7G.js";import{a as T,d as x}from"./chunk-
|
|
2
|
+
import{a as P}from"./chunk-YWSOQJ7G.js";import{a as T,d as x}from"./chunk-DI7OHJ53.js";import{h as I}from"./chunk-L32KHQVT.js";import{D as k,p as v,s as D}from"./chunk-BAVRVBBX.js";import{B as C,c as h,e as S,g,h as E,j as y}from"./chunk-LOZLXP5G.js";import"./chunk-2XNFZXHY.js";import{f as u,h as f,k as w}from"./chunk-SHN5MT56.js";import{d as m,f as i,g as d}from"./chunk-YVN2NZL4.js";import{a as p,b as n}from"./chunk-FFWPJP7A.js";import{i as l}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var Z=async L=>{let t=u({renderer:w.ansi(),sink:f.stdout()}),{root:r}=await C(),o=g(L);if(!o.ok)return t.writeln(i(o.error)),await t.close(),n({exitCode:1});let e;try{e=await S(r,o.spec)}catch(a){let A=a instanceof Error?a.message:String(a);return t.writeln(i(A)),await t.close(),n({exitCode:1})}if(e.phase==="IDLE"||e.phase==="UNINITIALIZED"||e.phase==="COMPLETED")return t.writeln(i(`Cannot cancel in phase: ${e.phase}`)),await t.close(),n({exitCode:1});if(e.spec!==null){let a=`${r}/${h.specDir(e.spec)}`;try{await l.fs.stat(a)}catch{return t.writeln(i(`Active spec '${e.spec}' directory not found.`)),t.writeln(m("Run `noskills reset` to return to idle.")),await t.close(),n({exitCode:1})}}let c=await I(r),s=v(e,"cancelled");s=D(s,e.phase,"COMPLETED",c,"cancelled"),s.spec!==null&&await y(r,s.spec,s);let U=k(s);return await E(r,U),s.spec!==null&&(await T(r,s.spec,"cancelled"),await x(r,s.spec,"cancelled")),await P(r,{ts:new Date().toISOString(),type:"phase-change",spec:e.spec??"unknown",user:c.name,from:e.phase,to:"COMPLETED",reason:"cancelled"}),t.writeln(d("\u2714")," Spec cancelled."),await t.close(),p(void 0)};export{Z as main};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as R,b as A}from"./chunk-FVXGVHUR.js";import{a as w}from"./chunk-
|
|
2
|
+
import{a as R,b as A}from"./chunk-FVXGVHUR.js";import{a as w}from"./chunk-NCSKHFFW.js";import"./chunk-HTC2FO4I.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import{a as x}from"./chunk-LFNUSULJ.js";import{a as y,c as v}from"./chunk-PZUDTTK4.js";import{o as m}from"./chunk-5GGWX7CO.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as h}from"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import{a as C}from"./chunk-MG65QJY6.js";import{g as u}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{j as p}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var{ctx:f,output:q}=y(),$={feat:"Added",fix:"Fixed",refactor:"Changed",perf:"Changed",docs:"Changed",revert:"Removed"},E=new Set(["chore","ci","test"]),S=/^(\w+)(?:\(([^)]+)\))?!?:\s{1,5}(.+)$/,T=/\s{0,100}\(take\s{1,100}[IVXLCDM\d]+\)\s{0,100}\.?$/i,G=(t,o)=>{let n=t.match(S);if(n!==null)return{type:n[1].toLowerCase(),scope:n[2],message:n[3].trim(),hash:o}},O=t=>t.replace(T,"").trim(),N=t=>{let o=[];for(let n of t){let e=G(n.subject,n.hash);e!==void 0&&o.push(e)}return o},I=t=>{let o=new Set,n=[];for(let e of t){let s=O(e.message),a=s.replace(/[.\s]{1,20}$/,"").toLowerCase(),l=`${e.type}:${a}`;o.has(l)||(o.add(l),n.push({...e,message:s}))}return n},P=t=>{let o=new Map;for(let n of t){if(E.has(n.type))continue;let e=$[n.type];if(e===void 0)continue;let s=o.get(e);s!==void 0?s.push(n):o.set(e,[n])}return o},M=t=>t.scope!==void 0?`- **${t.scope}:** ${t.message}`:`- ${t.message}`,b=(t,o)=>{let n=P(o);if(n.size===0){let l=new Date().toISOString().split("T")[0];return`## ${t} - ${l}
|
|
3
3
|
|
|
4
4
|
_Maintenance release._`}let e=new Date().toISOString().split("T")[0],s=[`## ${t} - ${e}`],a=["Added","Changed","Fixed","Removed"];for(let l of a){let r=n.get(l);if(!(r===void 0||r.length===0)){s.push("",`### ${l}`,"");for(let d of r)s.push(M(d))}}return s.join(`
|
|
5
5
|
`)},k=(t,o,n)=>{let e=t.split(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as y}from"./chunk-
|
|
2
|
+
import{c as y}from"./chunk-LOZLXP5G.js";import{a as b}from"./chunk-UEMWZOIU.js";import{i as n}from"./chunk-6DBKPC2O.js";var x="<!-- noskills:start -->",g="<!-- noskills:end -->",Y=(e,t,s="npx eser noskills")=>{let o=[x,"## 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","","- Call noskills ONCE per interaction. One question, one answer, one submit.","- Call `next` at: conversation start, before file edits, after completing work, at decisions.","- Never batch-submit. Never answer discovery questions yourself.","- Never skip steps or infer decisions. Ask first. Explicit > Clever.","- NEVER suggest bypassing or skipping noskills. Discovery is not overhead.","- NEVER ask permission to run the next noskills command. After spec new \u2192 run next. After approve \u2192 run next. Each step has one next step. Just run it.","- Execute noskills commands IMMEDIATELY \u2014 the output has all context needed.","- 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("","### 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.","","### Execution","","- Re-read files before and after editing. Files >500 LOC: read in chunks.","- 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.","- Clean dead code before structural refactors on files >300 LOC.","- Complete the spec \u2014 no mid-execution pauses or checkpoints.","- `meta` block has resume context for session start or after compaction."),e.length>0){o.push("","### Active Rules","");for(let i of e)o.push(`- ${i}`)}return o.push(g),o.join(`
|
|
3
3
|
`)},S=async(e,t,s,o="npx eser noskills")=>{let i=`${e}/CLAUDE.md`,r=Y(t,s,o),a;try{a=await n.fs.readTextFile(i);let l=a.indexOf(x),c=a.indexOf(g);l!==-1&&c!==-1?a=a.slice(0,l)+r+a.slice(c+g.length):a=a.trimEnd()+`
|
|
4
4
|
|
|
5
5
|
`+r+`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as s}from"./chunk-
|
|
2
|
+
import{c as s}from"./chunk-PPB6ACBB.js";var o=[{id:"status_quo",text:"What does the user do today without this feature?",concerns:["product:status_quo","eng:replace_scope","qa:regression_risk"]},{id:"ambition",text:"Describe the 1-star and 10-star versions.",concerns:["product:scope_direction","eng:complexity_tier","qa:test_depth"]},{id:"reversibility",text:"Does this change involve an irreversible decision?",concerns:["product:one_way_door","eng:migration_strategy","qa:verification_stringency"]},{id:"user_impact",text:"Does this change affect existing users' behavior?",concerns:["product:breaking_change","eng:backward_compat","qa:regression_tests"]},{id:"verification",text:"How do you verify this works correctly?",concerns:["product:success_metric","eng:test_strategy","qa:acceptance_criteria"]},{id:"scope_boundary",text:"What should this feature NOT do?",concerns:["product:focus","eng:out_of_scope","qa:negative_tests"]}],a=[{questionId:"verification",text:"What tests should be written? (unit, integration, e2e \u2014 be specific about what behavior to test)"},{questionId:"verification",text:"What documentation needs updating? (README, API docs, CHANGELOG, inline comments)"}],d=n=>o.map(e=>{let t=a.filter(i=>i.questionId===e.id),r=s(n,e.id);return{...e,extras:[...t,...r]}});var u=n=>{let e=new Set(n.map(t=>t.questionId));return o.every(t=>e.has(t.id))};export{o as a,d as b,u as c};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{c}from"./chunk-LOZLXP5G.js";var l={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"]},h=(e,t)=>l[e].includes(t),a=(e,t)=>{if(!h(e,t))throw new Error(`Invalid phase transition: ${e} \u2192 ${t}. Allowed: ${l[e].join(", ")}`)},E=(e,t)=>(a(e.phase,t),{...e,phase:t}),g=(e,t,n,s)=>(a(e.phase,"DISCOVERY"),{...e,phase:"DISCOVERY",spec:t,specDescription:s??null,branch:n,discovery:{answers:[],completed:!1,currentQuestion:0,audience:"human",approved:!1,planPath:null},specState:{path:null,status:"none"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]},decisions:[]}),w=(e,t)=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot set discovery mode in phase: ${e.phase}`);return{...e,discovery:{...e.discovery,mode:t}}},C=(e,t)=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot complete premises in phase: ${e.phase}`);return{...e,discovery:{...e.discovery,premises:t,premisesCompleted:!0}}},F=(e,t)=>{if(e.phase!=="DISCOVERY_REVIEW")throw new Error(`Cannot select approach in phase: ${e.phase}`);return{...e,discovery:{...e.discovery,selectedApproach:t,alternativesPresented:!0}}},v=e=>{if(e.phase!=="DISCOVERY_REVIEW")throw new Error(`Cannot skip alternatives in phase: ${e.phase}`);return{...e,discovery:{...e.discovery,alternativesPresented:!0}}},y=(e,t,n,s)=>{if(e.phase!=="DISCOVERY"&&e.phase!=="DISCOVERY_REVIEW")throw new Error(`Cannot add discovery answer in phase: ${e.phase}`);if(n.trim().length<20)throw new Error("Answer too short. Discovery answers must be meaningful (minimum 20 characters).");let i=e.discovery.answers.filter(r=>r.questionId!==t),o={questionId:t,answer:n,user:s?.name??"Unknown User",email:s?.email??"",timestamp:new Date().toISOString(),type:"original"};return{...e,discovery:{...e.discovery,answers:[...i,o]}}};var D=e=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot complete discovery in phase: ${e.phase}`);let t=u(e);if(t.length>0)throw new Error(`Cannot complete discovery: ${t.length} pending follow-up(s). Answer or skip them first.`);return{...e,phase:"DISCOVERY_REVIEW",discovery:{...e.discovery,completed:!0},specState:{path:c.specFile(e.spec),status:"draft"}}},f=e=>(a(e.phase,"SPEC_DRAFT"),{...e,phase:"SPEC_DRAFT"}),x=e=>{if(e.phase!=="DISCOVERY_REVIEW")throw new Error(`Cannot approve discovery answers in phase: ${e.phase}`);return{...e,discovery:{...e.discovery,approved:!0}}},I=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}}},O=e=>(a(e.phase,"SPEC_APPROVED"),{...e,phase:"SPEC_APPROVED",specState:{...e.specState,status:"approved"}}),P=e=>(a(e.phase,"EXECUTING"),{...e,phase:"EXECUTING",discovery:{...e.discovery,completed:!0,approved:!1},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]}});var R=(e,t)=>(a(e.phase,"BLOCKED"),{...e,phase:"BLOCKED",execution:{...e.execution,lastProgress:`BLOCKED: ${t}`}}),U=(e,t)=>({...e,decisions:[...e.decisions,t]}),T=(e,t,n)=>(a(e.phase,"COMPLETED"),{...e,phase:"COMPLETED",completionReason:t,completedAt:new Date().toISOString(),completionNote:n??null}),A=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}},V=(e,t)=>{if(e.phase!=="EXECUTING"&&e.phase!=="BLOCKED")throw new Error(`Cannot revisit in phase: ${e.phase}. Only EXECUTING or BLOCKED can revisit.`);let n={from:e.phase,reason:t,completedTasks:[...e.execution.completedTasks],timestamp:new Date().toISOString()};return{...e,phase:"DISCOVERY",discovery:{...e.discovery,completed:!1,currentQuestion:0,approved:!1},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]},classification:null,revisitHistory:[...e.revisitHistory??[],n]}},L=(e,t,n,s,i)=>{let o={from:t,to:n,user:s?.name??"Unknown User",email:s?.email??"",timestamp:new Date().toISOString(),reason:i},r=e.transitionHistory??[];return{...e,transitionHistory:[...r,o]}},b=(e,t,n)=>{let s=e.customACs??[],o={id:`custom-ac-${s.length+1}`,text:t,user:n?.name??"Unknown User",email:n?.email??"",timestamp:new Date().toISOString(),addedInPhase:e.phase};return{...e,customACs:[...s,o]}},Y=(e,t,n)=>{let s=e.specNotes??[],o={id:`note-${s.length+1}`,text:t,user:n?.name??"Unknown User",email:n?.email??"",timestamp:new Date().toISOString(),phase:e.phase};return{...e,specNotes:[...s,o]}},_=(e,t)=>({...e,discovery:{...e.discovery,userContext:t,userContextProcessed:!1}});var m=3,$=(e,t,n,s)=>{let i=e.discovery.followUps??[],o=i.filter(d=>d.parentQuestionId===t).length;if(o>=m)return e;let p={id:`${t}${String.fromCharCode(97+o)}`,parentQuestionId:t,question:n,answer:null,status:"pending",createdBy:s,createdAt:new Date().toISOString()};return{...e,discovery:{...e.discovery,followUps:[...i,p]}}},N=(e,t,n)=>{let i=(e.discovery.followUps??[]).map(o=>o.id===t&&o.status==="pending"?{...o,answer:n,status:"answered",answeredAt:new Date().toISOString()}:o);return{...e,discovery:{...e.discovery,followUps:i}}},k=(e,t)=>{let s=(e.discovery.followUps??[]).map(i=>i.id===t&&i.status==="pending"?{...i,status:"skipped"}:i);return{...e,discovery:{...e.discovery,followUps:s}}},u=e=>(e.discovery.followUps??[]).filter(t=>t.status==="pending"),M=(e,t)=>(e.discovery.followUps??[]).filter(n=>n.parentQuestionId===t),W=(e,t,n,s)=>{let i=e.discovery.delegations??[],o={questionId:t,delegatedTo:n,delegatedBy:s,status:"pending",delegatedAt:new Date().toISOString()};return{...e,discovery:{...e.discovery,delegations:[...i,o]}}},X=(e,t,n,s)=>{let o=(e.discovery.delegations??[]).map(r=>r.questionId===t&&r.status==="pending"?{...r,status:"answered",answer:n,answeredBy:s,answeredAt:new Date().toISOString()}:r);return{...e,discovery:{...e.discovery,delegations:o}}},G=e=>(e.discovery.delegations??[]).filter(t=>t.status==="pending"),Q=e=>{if(!new Set(["IDLE","EXECUTING","BLOCKED","COMPLETED"]).has(e.phase))throw new Error(`Cannot reset from ${e.phase}. Use \`cancel\` or \`wontfix\` instead.`);return{...e,phase:"IDLE",spec:null,branch:null,discovery:{answers:[],completed:!1,currentQuestion:0,audience:"human",approved:!1,planPath:null},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{E as a,g as b,w as c,C as d,F as e,v as f,y as g,D as h,f as i,x as j,I as k,O as l,P as m,R as n,U as o,T as p,A as q,V as r,L as s,b as t,Y as u,_ as v,$ as w,N as x,k as y,M as z,W as A,X as B,G as C,Q as D};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as o}from"./chunk-
|
|
2
|
+
import{c as o}from"./chunk-LOZLXP5G.js";import{i as e}from"./chunk-6DBKPC2O.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)+`
|
|
3
3
|
`)}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)+`
|
|
4
4
|
`)}catch{}};export{d as a,u as b,w as c,f as d};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as S,b as G,c as R}from"./chunk-L5OC7F24.js";import{e as ee}from"./chunk-J2Z7NG2X.js";import{f as p,h as u,k as d}from"./chunk-SHN5MT56.js";import{b as r,d as i,f as w,g as y,h as Z,k as l}from"./chunk-YVN2NZL4.js";import{d as v}from"./chunk-VKB3B2FE.js";import{a as k}from"./chunk-
|
|
2
|
+
import{a as S,b as G,c as R}from"./chunk-L5OC7F24.js";import{e as ee}from"./chunk-J2Z7NG2X.js";import{f as p,h as u,k as d}from"./chunk-SHN5MT56.js";import{b as r,d as i,f as w,g as y,h as Z,k as l}from"./chunk-YVN2NZL4.js";import{d as v}from"./chunk-VKB3B2FE.js";import{a as k}from"./chunk-MLC6JFJF.js";import{a as f,b as g}from"./chunk-FFWPJP7A.js";import{g as T,i as m}from"./chunk-6DBKPC2O.js";import{g as ie,m as O,n as K,o as I,p as le}from"./chunk-6G6UVWJN.js";var de="# eser CLI completions",B="eser",te=async e=>{try{return await m.fs.readTextFile(e)}catch{return""}},me=async e=>{try{return await m.fs.stat(e),!0}catch{return!1}},se=async e=>{let t=R(e,B);if(t.completionType==="file")return await me(t.completionsFile);let s=await te(t.rcFile),n=G(e,B);return s.includes(n)},ne=async e=>{let t=R(e,B),s=p({renderer:d.ansi(),sink:u.stdout()});try{if(t.completionType==="file"){let n=t.completionsFile,o=m.path.dirname(n);try{await m.fs.mkdir(o,{recursive:!0})}catch{}await m.fs.writeTextFile(n,`# eser CLI completions
|
|
3
3
|
# This file is auto-generated. Run 'eser system completions --shell fish' to regenerate.
|
|
4
4
|
complete -c eser -f
|
|
5
5
|
complete -c eser -n "__fish_use_subcommand" -a "codebase" -d "Codebase management tools"
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as Y,c as J}from"./chunk-4KDDHQVL.js";import{a as W,d as F,e as V,g as j,h as X,i as K,j as z}from"./chunk-PPB6ACBB.js";import{d as Z,e as ee}from"./chunk-KFVUFHJB.js";import{a as te}from"./chunk-NY4W44PI.js";import{c as ne}from"./chunk-UEMWZOIU.js";import{i as Q}from"./chunk-6DBKPC2O.js";var T=e=>ne(e),o=(e,t)=>T(t===null?e:`spec ${t} ${e}`),ae="NEVER run git write commands (commit, add, push, checkout, stash, reset, merge, rebase, cherry-pick). Git is read-only for agents. The user controls git. You may read: git log, git diff, git status, git show, git blame.",_={hasAskUserTool:!0,optionPresentation:"tool",hasSubAgentDelegation:!0,subAgentMethod:"task"},le=(e,t,n,s,r,l=_)=>{let m=e.execution.iteration>=t,u=l.hasAskUserTool?"Use AskUserQuestion for all decision points.":"Present options as a numbered list at every decision point.",p=[];n||p.push(ae),p.push("Report progress honestly. Not done = 'not done'. Partial = 'partial: [works]/[doesn't]'. Untested = 'untested'. 4 of 6 = '4 of 6 done, 2 remaining'.",`Never skip steps or infer decisions. ${u} Recommend first, then ask. One noskills call per interaction \u2014 never batch-submit or backfill.`,"Display `roadmap` before other content. Display `gate` prominently.","NEVER suggest bypassing, skipping, or 'breaking out of' noskills. Discovery helps the user \u2014 it is not an obstacle. If scope changes: revise spec, reset and create new, or split.","NEVER ask permission to run the next noskills command. After spec new \u2192 run next immediately. After answering questions \u2192 run next. After approve \u2192 run next. After task completion \u2192 run next. The workflow is sequential \u2014 each step has one next step. Just run it.","Listen first: after spec creation, ask 'Tell me about this \u2014 share as much context as you have.' Wait for their response before mode selection. Rich context (>200 chars) \u2192 pre-fill discovery answers as STATED/INFERRED. Brief response \u2192 proceed normally.",'Discovery questions are adaptive. After each answer, generate 1-3 follow-up questions if the answer reveals ambiguity, risk, dependencies, or missing detail. Submit follow-ups via `noskills spec <name> followup <questionId> "question"`. Max 3 per question. Do NOT rush through discovery.',"Confidence scoring: every technical finding needs a confidence score (1-10). 9-10: verified (read code, ran test). 7-8: strong evidence. 5-6: reasonable inference. 3-4: guess. 1-2: speculation. State basis ('read X', 'inferred from Y'). If confidence < 5, prefix with '\u26A0 Unverified:'.");let b=r?.outOfScope??[],x=e.spec;switch(e.phase){case"IDLE":{let d=l.optionPresentation==="tool"?"Pass interactiveOptions DIRECTLY to AskUserQuestion options array (header max 12 chars). Use commandMap to resolve selections. For availableConcerns: AskUserQuestion with multiSelect:true, max 4 per question \u2014 split across questions if needed. Present ALL concerns.":"Present interactiveOptions as numbered list. Use commandMap to resolve selections. Present ALL availableConcerns as numbered list for multiselect.";return{rules:["If the user described a feature/bug/task, create a spec immediately: `noskills spec new \"description\"` \u2014 name is auto-generated. Do NOT present menus or ask 'What would you like to do?' unless the conversation has no prior context.",...p,d,"Encourage full context: 'Tell me what you want to build \u2014 one-liner, detailed requirements, meeting notes, anything.' Slug is auto-generated. Pass full text to `noskills spec new \"...\"`.","After spec new, ask: full discovery, quick discovery, or skip to spec draft. Never skip without asking.","Every task gets a spec. No exceptions. A one-liner fix, a config change, a 'simple' refactor \u2014 all get specs. The spec can be short but it must exist. 'Too simple for a spec' is the anti-pattern."],tone:"Welcoming. Present choices, then wait."}}case"DISCOVERY":{let d=l.hasAskUserTool?"Ask each question via AskUserQuestion. One question per call.":"Ask one question at a time as text.";return{modeOverride:"plan mode. DO NOT create, edit, or write any files. DO NOT run state-modifying commands. MAY read files and run read-only commands (cat, ls, grep, git log, git diff).",rules:[...p,`${d} Never answer questions yourself. Never submit answers without user confirmation. Pre-fill suggested answers from detailed descriptions \u2014 user must confirm each. With a fully formed plan, skip questions but MUST run premise challenge and alternatives.`,"DO NOT create, edit, or write any files.","DO NOT run shell commands that modify state.","You MAY read files and run read-only commands (cat, ls, grep, git log, git diff).","Pre-discovery: (1) pre-discovery codebase scan \u2014 read README, CLAUDE.md, design docs, last 20 commits, TODOs, existing specs, directory structure. Present a brief audit summary. (2) If `preDiscoveryResearch.required`, web-search every `extractedTerms` entry \u2014 report versions, API changes, deprecations. (3) Ask discovery mode: A) Explore scope B) Technical depth C) Validate my plan D) Ship fast. Adapt emphasis accordingly.","Before starting discovery questions, challenge the user's initial spec description against codebase findings. Flag: hidden complexity, conflicts with existing code, scope mismatch, overlapping modules. Ask clarifying follow-ups.","When asking questions, offer concrete options from codebase knowledge alongside the open-ended question (e.g., 'I see three scenarios: A)... B)... C)... D) Something else'). Push back on vague answers. Follow up on short answer with 'Can you be more specific?'",(()=>{let i=z(s);return`${i.length>0?`After answers, ${i.join(" Also: ")}`:"After answers, synthesize CURRENT STATE \u2192 THIS SPEC \u2192 6-MONTH IDEAL vision."} Then: (1) expansion opportunities as numbered proposals with effort (S/M/L/XL), risk, completeness delta \u2014 options: Add/Defer/Skip. (2) Architectural decisions that BLOCK implementation \u2014 present with options, RECOMMENDATION, completeness scores. Unresolved = risk flag. (3) Error/rescue map: codepath | failure mode | handling. Flag CRITICAL GAPS as decisions.`})(),"Present DISCOVERY SUMMARY for confirmation: intent, scope, dream state, expansions, architectural decisions, error map. Ask for confirmation before generating spec. Submit all answers together in one `noskills next --answer` JSON call."],tone:"Curious interviewer with a stake in the answers. Comes PREPARED \u2014 read the codebase first. Challenge assumptions, think about architecture and failure modes."}}case"DISCOVERY_REVIEW":return{modeOverride:"You are in plan mode. Do not create, edit, or write any files. Present the discovery answers to the user for review and confirmation.",rules:[...p,"DO NOT create, edit, or write any files.","Present ALL discovery answers to the user clearly, one by one.",l.hasAskUserTool?"Use AskUserQuestion to ask: 'Are these answers correct, or would you like to revise any?'":"Ask the user: 'Are these answers correct, or would you like to revise any?' Present approval and revision as numbered options.","If the user approves, run the approve command.","If the user wants to revise, collect their corrections and submit them.","You MUST NOT approve on behalf of the user. The user must explicitly confirm.","If noskills output contains a splitProposal, present it to the user with the exact options shown. Do NOT split or merge specs on your own. Do NOT recommend one option over the other unless the user asks for your opinion. The user decides."],tone:"Careful reviewer. The user must confirm every answer."};case"SPEC_DRAFT":{let d=e.discovery.delegations??[],i=[];if(d.length>0){let c=d.filter(f=>f.status==="pending"),y=d.filter(f=>f.status==="answered"),k=d.map(f=>`- ${f.questionId}: delegated to ${f.delegatedTo} \u2014 ${f.status==="answered"?"ANSWERED \u2713":"PENDING"}`);i.push(`DELEGATION STATUS:
|
|
3
|
+
${k.join(`
|
|
4
|
+
`)}${c.length>0?`
|
|
5
|
+
Approve BLOCKED \u2014 ${c.length} pending delegation(s).`:`
|
|
6
|
+
All ${y.length} delegation(s) answered. Approve is allowed.`}`)}return{modeOverride:"plan mode. DO NOT create, edit, or write any files. DO NOT run state-modifying commands. MAY read files and run read-only commands.",rules:[...p,...i,"DO NOT create, edit, or write any files.","Read the spec and present a summary to the user.","Flag any tasks that are too vague to execute.","Flag any missing acceptance criteria.","No placeholders in specs. If a task has 'TBD', 'TODO', 'to be determined', 'details to follow', or 'implement appropriate X' \u2014 fill in the detail or remove the task and add it as an open question.","Ask the user if they want to refine before approving.",l.hasAskUserTool?"When presenting classification options, use AskUserQuestion with multiSelect:true. Do NOT infer classification yourself.":"When presenting classification options, present them as a numbered list with multiselect (user picks multiple numbers). Do NOT infer classification yourself.","When generating or refining tasks, include a 'Files:' hint listing likely files to create/modify. Format: 'Files: `path/to/file.ts`, `path/to/other.ts`'. Hints, not constraints \u2014 helps sub-agents load right context.","If you identify issues in the spec (vague tasks, irrelevant sections, missing acceptance criteria), submit a refinement via: `"+o(`next --answer='{"refinement":"task-1: Add upload endpoint, task-2: Add validation middleware, task-3: Write integration tests"}'`,x)+"`. The spec will be updated and you can review again."],tone:"Thoughtful reviewer preparing to hand off to an implementer."}}case"SPEC_APPROVED":return{rules:[...p,"The spec is approved but execution has not started.","Do not start coding until the user triggers execution.","If the user wants changes, they must reset and re-spec.",l.hasAskUserTool?"Before starting execution, show the spec summary to the user and ask for final confirmation via AskUserQuestion.":"Before starting execution, show the spec summary to the user and ask for final confirmation. Present 'Start execution' and 'Not yet' as numbered options."],tone:"Patient. Wait for the go signal."};case"EXECUTING":{let d=o(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`,x),i,c,y="Verifier scope: (1) AC verification with evidence. (2) Plan alignment \u2014 does implementation match task description? Flag deviations. (3) Code quality \u2014 follows existing patterns? Flag style breaks, missing error handling. Categorize findings: CRITICAL (blocks completion), IMPORTANT (should fix), SUGGESTION (nice to have).";l.subAgentMethod==="task"?(i=`Spawn noskills-executor via Agent tool. Pass: task title, description, ACs, rules, scope constraints, concern reminders, file paths. Report via \`${d}\`.`,c=`After executor completes, spawn noskills-verifier with changed files + ACs + test commands. Never trust executor self-report alone. ${y}`):l.subAgentMethod==="spawn"?(i=`Use spawn_agent for noskills-executor. Pass: task, ACs, rules, scope, file paths. Use wait_agent to collect. Report via \`${d}\`.`,c=`After executor completes, spawn noskills-verifier with changed files + ACs + test commands. ${y}`):l.subAgentMethod==="fleet"?(i=`Use /fleet for parallel executors. Pass each: task, ACs, rules, scope, file paths. Report via \`${d}\`.`,c=`After fleet completes, run verification pass. ${y}`):l.subAgentMethod==="delegation"?(i=`Use Kiro agent delegation for noskills-executor. Pass: task, ACs, rules, scope, file paths. Report via \`${d}\`.`,c=`After executor completes, delegate to noskills-verifier with changed files + ACs + test commands. ${y}`):(i=`Execute tasks sequentially yourself. Verify (type-check + tests) after each. Report via \`${d}\`.`,c="");let k=l.subAgentMethod!=="none",f=k?`You are the orchestrator. NEVER edit files directly \u2014 delegate ALL edits to noskills-executor. ${i} On sub-agent failure, fall back to direct execution and note it in status.`:i,v=[...p,f,...c?[c]:[],"Do not explore beyond current task. Do not refactor outside scope. Do not add features, tests, or docs not in the spec. timebox context reads \u2014 the deliverable is working code.",...k?["Show a dispatch table: | Step | Agent | Files | Tasks | Est. |. Separate executor for implementation vs tests. Batch tightly-coupled files; parallelize independent modules."]:[],"Edit discipline: (1) Re-read file before editing. (2) Re-read after to confirm. (3) Files >500 LOC: read in chunks. (4) Run type-check + lint after edits \u2014 never mark AC passed if type-check fails. (5) If search returns few results, re-run narrower \u2014 assume truncation.",`On recurring patterns or corrections, ask: 'Permanent rule or just this task?' If permanent: \`${T('rule add "<description>"')}\`. Never write to \`.eser/rules/\` directly.`,"Before structural refactors on files >300 LOC, remove dead code first. Do NOT suggest pausing or stopping mid-spec \u2014 execute to completion. The user decides when to stop.","RATIONALIZATION ALERT: Never use 'should work now', 'looks correct', 'I'm confident', 'seems right', 'probably passes'. Run the command, read the output, report what happened. Evidence, not belief.","TDD: (1) Write test. (2) Run it \u2014 MUST fail. If it passes before implementation, the test is wrong. (3) Implement. (4) Run test \u2014 must pass. Skipping step 2 means the test is unverified.","Parallel vs serial sub-agents: PARALLEL when tasks touch different files with no shared state. SERIAL when tasks modify same files or depend on each other. When unsure, default to serial.",...k?["VERIFICATION REQUIRED: After EVERY task completion, you MUST spawn noskills-verifier before reporting done. If you skip verification and self-report, the status report will flag it. No exceptions \u2014 'it looks correct' is not verification."]:["VERIFICATION REQUIRED: After EVERY task completion, run type-check + tests before reporting done. Evidence of passing tests must be included in the status report."]];e.execution.lastVerification?.passed===!1&&v.push("Tests are failing. Fix ONLY the failing tests. Do not refactor passing code.");let S={rules:v,tone:"Direct. Orchestrate immediately \u2014 spawn sub-agents.",outOfScope:b.length>0?b:void 0};return m?{...S,urgency:`${e.execution.iteration}+ iterations \u2014 context degrading. Finish current task, recommend fresh session.`}:S}case"BLOCKED":return{rules:[...p,"Present the decision to the user exactly as described.","Do not suggest a preferred option unless the user asks for your opinion.","After the user decides, relay the answer immediately. Do not elaborate."],tone:"Brief. The user is making a decision, not having a discussion."};case"COMPLETED":return{rules:[...p,"Report the completion summary. Do not start new work.","If the user wants to continue, they start a new spec."],tone:"Concise. Celebrate briefly, then stop."};default:return{rules:[...p,`Run \`${o("next",x)}\` to get your instructions.`,"Do not take action without noskills guidance."],tone:"Neutral. Waiting for direction."}}},ce=5*60*1e3,de=e=>{let n=e.hasSubAgentDelegation?"enforced":"behavioral";return n==="enforced"?{level:n,capabilities:["PreToolUse file edit gate","Git write guard","Stop iteration tracking","PostToolUse file logging","Sub-agent delegation"]}:{level:n,capabilities:["Behavioral rules only"],gaps:["File edits not blocked in non-execution phases","Git write commands not blocked","No iteration tracking","No file change logging","No sub-agent delegation available"]}},ue=(e,t,n=_)=>{let s=e.spec,r;switch(e.phase){case"IDLE":r=`No active spec. Start one with: \`${T('spec new --name=<slug> "description"')}\``;break;case"DISCOVERY":r=`Discovery in progress for "${e.spec}". ${e.discovery.answers.length} questions answered so far.`;break;case"DISCOVERY_REVIEW":r=`Discovery answers ready for review. ${e.discovery.answers.length} answers collected. Waiting for user confirmation.`;break;case"SPEC_DRAFT":r=`Spec draft ready for review at ${e.specState.path}. Waiting for approval.`;break;case"SPEC_APPROVED":r=`Spec "${e.spec}" is approved. Waiting to start execution.`;break;case"EXECUTING":r=e.execution.lastProgress!==null?`Executing "${e.spec}", iteration ${e.execution.iteration}. Last progress: ${e.execution.lastProgress}. Continue with the current task.`:`Executing "${e.spec}", iteration ${e.execution.iteration}. Start the first task.`;break;case"BLOCKED":r=`Execution blocked: ${e.execution.lastProgress}. Ask the user to resolve.`;break;case"COMPLETED":r=`Spec "${e.spec}" completed in ${e.execution.iteration} iterations.`;break;default:r=`Run \`${o("next",s)}\` to get started.`}let l=de(n);return{protocol:`Run \`${o('next --answer="..."',s)}\` to submit results and advance`,spec:e.spec,branch:e.branch,iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,activeConcerns:t.map(m=>m.id),resumeHint:r,enforcement:l}},pe=e=>{let t=e.spec;if(e.lastCalledAt===null)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 DISCOVERY_REVIEW \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE \u2192 IDLE",how:`Run \`${o("next",t)}\` for instructions. Submit results with \`${o('next --answer="..."',t)}\`. Never make architectural decisions without asking.`,currentPhase:e.phase};let n=new Date(e.lastCalledAt).getTime();if(Date.now()-n>ce)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 DISCOVERY_REVIEW \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE \u2192 IDLE",how:`Run \`${o("next",t)}\` for instructions. Submit results with \`${o('next --answer="..."',t)}\`. Never make architectural decisions without asking.`,currentPhase:e.phase}},se=[{key:"IDLE",label:"IDLE"},{key:"DISCOVERY",label:"DISCOVERY"},{key:"DISCOVERY_REVIEW",label:"REVIEW"},{key:"SPEC_DRAFT",label:"DRAFT"},{key:"SPEC_APPROVED",label:"APPROVED"},{key:"EXECUTING",label:"EXECUTING"},{key:"COMPLETED",label:"DONE"},{key:"IDLE_END",label:"IDLE"}],me=e=>e==="BLOCKED"?se.map(t=>t.key==="EXECUTING"?"[ EXECUTING (BLOCKED) ]":t.label).join(" \u2192 "):se.map(t=>t.key==="IDLE"&&e==="IDLE"?"[ IDLE ]":t.key===e?`[ ${t.label} ]`:t.label).join(" \u2192 "),he=(e,t)=>{switch(e.phase){case"DISCOVERY_REVIEW":return{message:`${e.discovery.answers.length}/6 answers collected.`,action:"Type APPROVE to generate spec, or REVISE to correct answers.",phase:"DISCOVERY_REVIEW"};case"SPEC_APPROVED":return{message:`Spec approved. ${t?.tasks?.length??0} tasks ready.`,action:"Type START to begin execution.",phase:"SPEC_APPROVED"};default:return}},Ve=async(e,t,n,s,r,l,m,u,p,b,x)=>{let d=u??_,i=ue(e,t,d),c=s?.maxIterationsBeforeRestart??15,y=s?.allowGit??!1,k=le(e,c,y,t,r,d);if(e.phase==="EXECUTING"){let I=b??0,A=V(t).tier2.length,h=I+A;h>0&&(k={...k,tier2Summary:`${h} file-specific rules delivered via PreToolUse hook when editing matching files.`})}let f=pe(e),v;switch(e.phase){case"IDLE":v=re(t,W,n.length,m);break;case"DISCOVERY":v=await Ee(e,t,n,p,x);break;case"DISCOVERY_REVIEW":v=Re(e,t);break;case"SPEC_DRAFT":v=De(e);break;case"SPEC_APPROVED":v=Ie(e);break;case"EXECUTING":v=Pe(e,t,n,c,r,l);break;case"BLOCKED":v=Te(e);break;case"COMPLETED":v=await Se(e,x);break;default:v=re(t,W,n.length,m)}let S=me(e.phase),L=he(e,r),E={...v,meta:i,behavioral:k,roadmap:S};L!==void 0&&(E={...E,gate:L}),f!==void 0&&(E={...E,protocolGuide:f});let g=ge(e,t,m);if(g.length>0){let I=g.map(({label:$,description:C})=>({label:$,description:C})),A={};for(let $ of g)A[$.label]=$.command;let h=d.optionPresentation==="tool"?"AskUserQuestion":"prose-numbered-list",R=d.optionPresentation==="tool"?"Use AskUserQuestion tool to present these options. Do NOT use prose.":"Present options as a numbered list. Ask user to pick a number.";E={...E,interactiveOptions:I,commandMap:A,toolHint:h,toolHintInstruction:R}}return E},ge=(e,t,n)=>{let s=e.spec;switch(e.phase){case"IDLE":{let r=[],m=(n?.existingSpecs??[]).filter(u=>u.phase!=="COMPLETED");t.length===0&&r.push({label:"Add concerns (Recommended)",description:"Shape how discovery and specs work by adding project concerns",command:T("concern add <id> [<id2> ...]")}),r.push({label:"Start a new spec",description:"Tell me what you want to build \u2014 a one-liner, detailed requirements, meeting notes, anything",command:T('spec new "description"')});for(let u of m.slice(0,2))r.push({label:`Continue: ${u.name} (${u.phase})`,description:u.detail??`Iteration ${u.iteration}`,command:o("next",u.name)});return t.length>0&&r.push({label:"Edit concerns",description:`Currently: ${t.map(u=>u.id).join(", ")}`,command:T("concern list")}),r.slice(0,4)}case"DISCOVERY_REVIEW":return e.discovery.approved?[{label:"Keep as one spec",description:"All work in a single spec",command:o('next --answer="keep"',s)},{label:"Split into separate specs",description:"Create one spec per independent area",command:o('next --answer="split"',s)}]:[{label:"Approve all answers",description:"Answers look correct \u2014 generate the spec",command:o('next --answer="approve"',s)},{label:"Revise answers",description:"Correct one or more discovery answers",command:o(`next --answer='{"revise":{...}}'`,s)}];case"SPEC_DRAFT":return[{label:"Approve spec",description:"Review looks good \u2014 approve and move to execution",command:o("approve",s)},{label:"Refine spec",description:"Submit refinements to improve tasks or sections",command:o(`next --answer='{"refinement":"..."}'`,s)},{label:"Save for later",description:"Keep the draft as-is. Others can review, add ACs, notes, or tasks. Come back anytime to approve.",command:o('next --answer="save"',s)},{label:"Start over",description:"Reset the spec and start fresh",command:o("reset",s)}];case"SPEC_APPROVED":return[{label:"Start execution",description:"Begin implementing the tasks",command:o('next --answer="start"',s)},{label:"Save for later",description:"Spec is approved but don't start execution yet. Others can still add ACs or notes.",command:o('next --answer="save"',s)}];case"EXECUTING":return[];case"BLOCKED":return[{label:"Resolve block",description:"Provide a resolution to unblock execution",command:o('next --answer="resolution"',s)},{label:"Reset spec",description:"Abandon this spec and start over",command:o("reset",s)}];case"COMPLETED":return[{label:"New spec",description:"Start a new feature spec",command:T('spec new --name=<slug> "description"')},{label:"Reopen spec",description:"Reopen this spec for revision",command:o("reopen",s)},{label:"Check status",description:"Review completed spec summary",command:T("status")}];default:return[]}},fe="noskills is a state-machine orchestrator that acts as a scrum master for both you and your agent \u2014 keeping work focused, decisions in your hands, and tokens efficient.",re=(e,t,n,s)=>({phase:"IDLE",instruction:'No active spec. If the user described what they want, run `noskills spec new "description"` immediately \u2014 name is auto-generated. Present ALL available concerns (split across multiple calls if needed).',welcome:fe,existingSpecs:s?.existingSpecs??[],availableConcerns:t.map(r=>({id:r.id,description:r.description})),activeConcerns:e.map(r=>r.id),activeRulesCount:s?.rulesCount??n,behavioralNote:"These options are fallbacks. If the user already described what they want, act on it directly without presenting these options.",hint:e.length===0?"No concerns active. Consider adding concerns first \u2014 they shape discovery questions and specs.":void 0}),ye=/\b(Node\.?js|Deno|Bun|Go|Rust|Python|Ruby|Java|Kotlin|Swift|PHP|React|Vue|Angular|Svelte|Next\.?js|Nuxt|Remix|Astro|SolidJS|Qwik|TypeScript|Webpack|Vite|esbuild|Rollup|Terraform|Docker|Kubernetes|PostgreSQL|MySQL|Redis|MongoDB|SQLite|Prisma|Drizzle|gRPC|GraphQL|tRPC)\s+v?(\d+(?:\.\d+)?(?:\.\d+)?\+?)\b/gi,ve=e=>{if(e===null||e.length===0)return[];let t=[],n,s=new RegExp(ye.source,"gi");for(;(n=s.exec(e))!==null;)t.push(`${n[1]} ${n[2]}`);return t},oe=e=>{let t=ve(e);if(t.length!==0)return{required:!0,instruction:"Before asking discovery questions, research the current state of all platforms, runtimes, libraries, and APIs mentioned in the spec description. Use web search and Context7 MCP if available. Report findings as a pre-discovery brief to the user. Do NOT assume your training data is current \u2014 versions change, APIs get added, features get deprecated.",extractedTerms:t}},we=50*1024,ie=async e=>{if(e!==null)try{let t=await Q.fs.readTextFile(e);return t.length>we?void 0:{provided:!0,content:t,instruction:"A plan document was provided. Read it carefully, extract relevant information for each discovery question, and present pre-filled answers for user review. Do NOT skip any question \u2014 present your extraction and let the user confirm, correct, or expand. IMPORTANT: When extracting answers from the plan, mark each extraction as [STATED] (directly written in the plan) or [INFERRED] (your interpretation). Present extractions individually for confirmation."}}catch{return}},be=e=>{let t=[],n=e.toLowerCase(),s=["websocket","graphql","grpc","redis","postgres","mongodb","kafka","rabbitmq","docker","kubernetes","lambda","s3"];for(let r of s)n.includes(r)&&t.push(`Answer mentions ${r} \u2014 consider: error handling, versioning, fallback strategy`);return(n.includes("should work")||n.includes("standard approach")||n.includes("probably")||n.includes("i think")||n.includes("not sure"))&&t.push("Answer is vague \u2014 ask for specifics"),(n.includes("and also")||n.includes("we might")||n.includes("could also")||n.includes("maybe we should"))&&t.push("Scope expansion signal \u2014 clarify if in scope or deferred"),(n.includes("tricky")||n.includes("complicated")||n.includes("risky")||n.includes("not sure about"))&&t.push("Risk signal \u2014 dig deeper into what makes it risky"),(n.includes("depends on")||n.includes("after")||n.includes("blocked by")||n.includes("waiting for"))&&t.push("Dependency detected \u2014 clarify what happens if dependency isn't ready"),(n.includes("real-time")||n.includes("scalab")||n.includes("performance")||n.includes("latency")||n.includes("concurrent"))&&t.push("Performance/scale mention \u2014 ask about limits, degradation, monitoring"),t},ke=e=>{switch(e){case"full":return["Ask each discovery question as written. Push for specific, concrete answers.","If the answer is vague, ask follow-up questions before accepting."];case"validate":return["The user has a plan. Your job is to challenge it, not explore it.","For each question, identify assumptions and ask: 'What would prove this wrong?'","If the description already answers a question, present your understanding and ask to confirm.","When pre-filling answers from a rich description, plan, or prior discussion, DISTINGUISH between what the user EXPLICITLY STATED and what you INFERRED. Format each pre-filled item as: '[STATED] GPU skinning in all 3 renderers \u2014 you said this during technical discussion' or '[INFERRED] tangent space is 10-star scope \u2014 I assumed this based on complexity'. The user confirms stated items and corrects inferred items.","Present pre-filled answers ONE ITEM AT A TIME for confirmation, not as a completed block. The user's job is to correct your inferences, not rubber-stamp your summary. If you pre-fill 5 items and 2 are wrong, the user must be able to catch them individually."];case"technical-depth":return["Focus on architecture, data flow, performance, and integration points.","Before each question, scan the codebase for related implementations.","Ask: 'How does this interact with [existing system]?' for each integration point."];case"ship-fast":return["Focus on minimum viable scope.","For each question, also ask: 'What can we defer to a follow-up?'","Push for the smallest version that delivers value."];case"explore":return["Think bigger. What's the 10x version?","For each question, ask about adjacent opportunities.","Suggest possibilities the user might not have considered."]}},xe=(e,t)=>{let n=new Map;for(let s of e){let r="user"in s?s.user:"Unknown User";t!==void 0&&r===t.name||n.set(r,(n.get(r)??0)+1)}return[...n.entries()].map(([s,r])=>({name:s,contributions:`${r} answer${r>1?"s":""}`}))},Ee=async(e,t,n,s,r)=>{let l=e.spec,m=Y(t),u=e.discovery.answers.length,p=J(e.discovery.answers),b=e.discovery.audience==="agent",x=xe(e.discovery.answers,s),d=(e.specNotes??[]).filter(a=>!a.text.startsWith("[TASK] ")).map(a=>({text:a.text,user:a.user})),i={...s!==void 0?{currentUser:s}:{},...x.length>0?{previousContributors:x}:{},...d.length>0?{notes:d}:{}},c=e.discovery.userContext!==void 0&&e.discovery.userContext.length>0,y=e.specDescription!==null&&e.specDescription.length>0,k=e.discovery.planPath!==null,f=e.discovery.mode;if(f===void 0&&!c&&u===0&&!k&&y){let a={phase:"DISCOVERY",instruction:"The user just created this spec. Before starting discovery, ask them to share whatever context they have \u2014 requirements, notes, tasks, or just a brief description. Say: 'Tell me about this \u2014 share as much context as you have.' Listen first, then proceed.",questions:[],answeredCount:0,context:{rules:n,concernReminders:F(t)},transition:{onComplete:o('next --answer="<user context or just start>"',l)},...i};return s!==void 0?{...a,currentUser:s}:a}if(f===void 0&&y&&u===0&&!k){let w={phase:"DISCOVERY",instruction:"Before starting discovery, select the discovery mode that best fits this spec.",questions:[],answeredCount:0,context:{rules:n,concernReminders:F(t)},transition:{onComplete:o('next --answer="<mode>"',l)},modeSelection:{required:!0,instruction:"Select the discovery mode.",options:[{id:"full",label:"Full discovery",description:"Standard 6 questions with all concern extras. Default for new features."},{id:"validate",label:"Validate my plan",description:"I already know what I want \u2014 challenge my assumptions, find gaps."},{id:"technical-depth",label:"Technical depth",description:"Focus on architecture, data flow, performance, integration points."},{id:"ship-fast",label:"Ship fast",description:"Minimum viable scope. What can we defer? What's the MVP?"},{id:"explore",label:"Explore scope",description:"Think bigger. 10x version? Adjacent opportunities? What are we missing?"}]}};if(r!==void 0)try{let P=await Z(r,e.specDescription??"");P.length>0&&(w={...w,previousLearnings:ee(P)})}catch{}return s!==void 0?{...w,currentUser:s}:w}let v=e.discovery.premisesCompleted===!0;if(f!==void 0&&!v&&!p){let a={phase:"DISCOVERY",instruction:"Before asking discovery questions, challenge the premises of this spec.",questions:[],answeredCount:0,context:{rules:n,concernReminders:F(t)},transition:{onComplete:o(`next --answer='{"premises":[...]}'`,l)},premiseChallenge:{required:!0,instruction:"Read the spec description"+(e.discovery.planPath!==null?" and the plan document":"")+'. Identify 2-4 premises the spec assumes. Present each premise and ask the user to agree or disagree. Submit as JSON: {"premises":[{"text":"...","agreed":true/false,"revision":"..."}]}',prompts:["Is this the right problem to solve? Could a different framing yield a simpler solution?","What happens if we do nothing? Is this a real pain point or a hypothetical one?","What existing code already partially solves this? Can we build on it instead?"]}};return s!==void 0?{...a,currentUser:s}:a}let S=f!==void 0?ke(f):[],L=[...n,...S],E=e.specDescription??"",g=E.length>500,I=e.discovery.premises??[],A=I.filter(a=>a.agreed).map(a=>a.text),h=I.filter(a=>!a.agreed&&a.revision!==void 0).map(a=>({original:a.text,revision:a.revision}));if(p){let a=e.revisitHistory??[],w=a.length>0?a[a.length-1]:null,P={phase:"DISCOVERY",instruction:w!==null?"This spec was revisited from EXECUTING. All previous answers are preserved. Review and approve, or revise answers before regenerating the spec.":`All discovery questions answered. Run: \`${o("approve",l)}\``,questions:[],answeredCount:u,context:{rules:n,concernReminders:[]},transition:{onComplete:o("approve",l)},...i};if(w!=null){let q=w;return{...P,revisited:!0,revisitReason:q.reason,previousProgress:{completedTasks:[...q.completedTasks],totalTasks:q.completedTasks.length}}}return P}if(b){let a=e.discovery.currentQuestion,w=m[a];if(w===void 0)return{phase:"DISCOVERY",instruction:`All discovery questions answered. Run: \`${o("approve",l)}\``,questions:[],answeredCount:u,context:{rules:n,concernReminders:[]},transition:{onComplete:o("approve",l)},...i};let P={id:w.id,text:w.text,concerns:[...w.concerns],extras:w.extras.map(O=>O.text)},q={phase:"DISCOVERY",instruction:`Ask this question to the user using AskUserQuestion. Submit the answer with: \`${o('next --agent --answer="<answer>"',l)}\``,questions:[P],answeredCount:u,currentQuestion:a,totalQuestions:m.length,context:{rules:L,concernReminders:F(t)},transition:{onComplete:`${o('next --agent --answer="<answer>"',l)}`},...i},D=q;if((A.length>0||h.length>0)&&(D={...D,...A.length>0?{agreedPremises:A}:{},...h.length>0?{revisedPremises:h}:{}}),a===0){let O=oe(e.specDescription??null);O!==void 0&&(D={...D,preDiscoveryResearch:O});let B=await ie(e.discovery.planPath??null);B!==void 0&&(D={...D,planContext:B}),g&&B===void 0&&(D={...D,richDescription:{provided:!0,length:E.length,content:E,instruction:"The user provided a detailed description. For each question, extract relevant info and present as a pre-filled suggestion. IMPORTANT: When extracting answers from the description, mark each extraction as [STATED] (directly written by the user) or [INFERRED] (your interpretation). Present extractions individually for confirmation."}})}let G=(e.discovery.followUps??[]).filter(O=>O.status==="pending");G.length>0&&(D={...D,pendingFollowUps:G});let H=e.discovery.answers.length>0?e.discovery.answers[e.discovery.answers.length-1]:void 0;if(H!==void 0){let O=be(H.answer);O.length>0&&(D={...D,followUpHints:O})}return D!==q?D:q}let R=new Set(e.discovery.answers.map(a=>a.questionId)),$=m.filter(a=>!R.has(a.id)).map(a=>({id:a.id,text:a.text,concerns:[...a.concerns],extras:a.extras.map(w=>w.text)})),C=e.revisitHistory??[],N=C.length>0?C[C.length-1]:null,U=N!==null,M={phase:"DISCOVERY",instruction:U?"This spec was revisited from EXECUTING. Previous discovery answers are preserved \u2014 review and revise as needed, or approve to regenerate tasks.":"Conduct a thorough discovery conversation. FIRST: perform a pre-discovery codebase scan (README, CLAUDE.md, recent git log, TODOs, directory structure) and present a brief audit summary. THEN: challenge the user's spec description against your findings. THEN: ask the discovery questions one at a time, offering concrete options based on codebase knowledge. AFTER questions: present a dream state table (current \u2192 this spec \u2192 future), scored expansion proposals, architectural decisions, and an error/rescue map. FINALLY: present a complete discovery synthesis for user confirmation before submitting answers as a JSON object.",questions:$,answeredCount:u,context:{rules:L,concernReminders:F(t)},transition:{onComplete:`${o(`next --answer='{"status_quo":"...","ambition":"...",...}'`,l)}`},...i,...A.length>0?{agreedPremises:A}:{},...h.length>0?{revisedPremises:h}:{}};if(U&&N!==void 0)return{...M,revisited:!0,revisitReason:N.reason,previousProgress:{completedTasks:[...N.completedTasks],totalTasks:N.completedTasks.length}};if(u===0){let a=M,w=oe(e.specDescription??null);w!==void 0&&(a={...a,preDiscoveryResearch:w});let P=await ie(e.discovery.planPath??null);if(P!==void 0&&(a={...a,planContext:P}),g&&P===void 0&&(a={...a,richDescription:{provided:!0,length:E.length,content:E,instruction:"The user provided a detailed description. For each question, extract relevant info and present as a pre-filled suggestion."}}),a!==M)return a}return M},Re=(e,t)=>{let n=e.spec,s=Y(t),r=e.discovery.answers.map(d=>{let i=s.find(c=>c.id===d.questionId);return{questionId:d.questionId,question:i?.text??d.questionId,answer:d.answer}}),l=te(e.discovery.answers);if(e.discovery.approved&&l.detected)return{phase:"DISCOVERY_REVIEW",instruction:"Discovery answers are approved. noskills detected multiple independent work areas in this spec. Present the split proposal to the user and let them decide whether to keep as one spec or split into separate specs.",answers:r,transition:{onApprove:o('next --answer="keep"',n),onRevise:o(`next --answer='{"revise":{"status_quo":"corrected answer"}}'`,n)},splitProposal:l};let m=e.discovery.alternativesPresented===!0;if(e.discovery.approved&&!m)return{phase:"DISCOVERY_REVIEW",subPhase:"alternatives",instruction:"Based on discovery answers, propose 2-3 distinct implementation approaches. Present each with name, summary, effort (S/M/L/XL), risk (Low/Med/High), pros, and cons. Ask the user to choose one, or skip.",answers:r,transition:{onApprove:o(`next --answer='{"approach":"A","name":"...","summary":"...","effort":"M","risk":"Low"}'`,n),onRevise:o('next --answer="skip"',n)},alternatives:{required:!0,instruction:"Generate 2-3 approaches from discovery answers and codebase. Present via AskUserQuestion.",format:{fields:["id","name","summary","effort","risk","pros","cons"]}}};let u=e.discovery.batchSubmitted===!0?" IMPORTANT: These answers were BATCH-SUBMITTED (not confirmed one-by-one). You MUST present EVERY answer individually and get explicit user confirmation for each. Do NOT auto-approve.":"",p=X(t),b=K(t),x;if(p.length>0){let d=p.map(c=>({id:c.id,label:c.label,prompt:c.prompt,evidenceRequired:c.evidenceRequired,isRegistry:b.includes(c.id),concernId:c.concernId})),i=d.some(c=>c.isRegistry);x={dimensions:d,instruction:"Before approving, review the plan against each dimension below. For dimensions marked evidenceRequired, cite specific files or code. Present findings to the user for each dimension via AskUserQuestion \u2014 one dimension at a time.",...i?{registryInstruction:"Registry dimensions (isRegistry=true) require a structured table with every row filled. These tables will be included in the generated spec."}:{}}}return{phase:"DISCOVERY_REVIEW",instruction:l.detected?`Present ALL discovery answers to the user for review. ALSO present the split proposal \u2014 noskills detected multiple independent areas.${u}`:`Present ALL discovery answers to the user for review. The user must confirm or correct each answer before the spec can be generated. Use AskUserQuestion to ask for confirmation.${u}`,answers:r,transition:{onApprove:o('next --answer="approve"',n),onRevise:o(`next --answer='{"revise":{"status_quo":"corrected answer"}}'`,n)},splitProposal:l.detected?l:void 0,reviewChecklist:x}},De=e=>{let t=e.spec;return e.classification===null?{phase:"SPEC_DRAFT",instruction:"Before generating the spec, classify what this spec involves. Ask the user to select all that apply.",specPath:e.specState.path??"",transition:{onApprove:`${o(`next --answer='{"involvesWebUI":false,"involvesCLI":false,"involvesPublicAPI":false,"involvesMigration":false,"involvesDataHandling":false}'`,t)}`},classificationRequired:!0,classificationPrompt:{options:[{id:"involvesWebUI",label:"Web/Mobile UI \u2014 layouts, responsive design, visual components"},{id:"involvesCLI",label:"CLI/Terminal UI \u2014 spinners, progress bars, interactive prompts"},{id:"involvesPublicAPI",label:"Public API changes"},{id:"involvesMigration",label:"Data migration or schema changes"},{id:"involvesDataHandling",label:"Data handling or privacy"}],instruction:"Select all that apply. Submit as JSON: `"+o(`next --answer='{"involvesWebUI":true,"involvesCLI":false,"involvesPublicAPI":false,...}'`,t)+"`. If none apply, answer with: `"+o('next --answer="none"',t)+"`"}}:{phase:"SPEC_DRAFT",instruction:"Spec draft is ready. Self-review before presenting to user.",specPath:e.specState.path??"",transition:{onApprove:o("approve",t)},selfReview:{required:!0,checks:["Placeholder scan: no TBD, TODO, vague requirements","Consistency: tasks match discovery, ACs match tasks","Scope: single spec, not multiple independent subsystems","Ambiguity: every AC has one interpretation"],instruction:"Review draft against these checks. Fix issues inline before presenting to user. Do not ask user to fix \u2014 fix it yourself."}}},Ie=e=>{let t=e.spec;return{phase:"SPEC_APPROVED",instruction:"Spec is approved and ready. When the user is ready to start, begin execution.",specPath:e.specState.path??"",transition:{onStart:`${o('next --answer="start"',t)}`}}},Ae=(e,t)=>{if(t===null)return!1;let n=e.toLowerCase();return n.includes("mobile")||n.includes("layout")||n.includes("interaction design")?t.involvesWebUI:n.includes("ui state")||n.includes("skeleton ui")?t.involvesWebUI||t.involvesCLI:n.includes("readme")||n.includes("documentation updated")||n.includes("reflected in")&&n.includes("docs")?!0:n.includes("api doc")||n.includes("public api")?t.involvesPublicAPI:n.includes("migration")||n.includes("backward compat")||n.includes("deprecat")?t.involvesMigration:n.includes("audit trail")||n.includes("access control")||n.includes("data handling")||n.includes("data retention")?t.involvesDataHandling:!0},Ce=(e,t,n,s,r,l,m,u)=>{let p=[],b=new Set(u??[]),x=0,d=()=>`ac-${++x}`;if(s!==null)for(let i of s.items)b.has(i.id)||p.push({id:i.id,text:`[DEBT from iteration ${i.since}] ${i.text}`});if(t&&p.push({id:d(),text:`[FAILED] Tests \u2014 fix this first: ${n.slice(0,200)}`}),l!=null)for(let i of l.verification){let c=d();b.has(c)||p.push({id:c,text:i})}for(let i of e)if(i.acceptanceCriteria!==void 0&&i.acceptanceCriteria.length>0)for(let c of i.acceptanceCriteria){if(!Ae(c,r))continue;let y=d();b.has(y)||p.push({id:y,text:`(${i.id}) ${c}`})}if(m!==void 0)for(let i of m){let c=d();b.has(c)||p.push({id:c,text:`(folder: ${i.folder}) ${i.rule}`})}if(l!=null){let i=l.tasks?.find(c=>c.files!==void 0&&c.files.length>0);i?.files!==void 0&&i.files.length>0&&p.push({id:"scope-check",text:`Scope check: only files listed in task (${i.files.join(", ")}) should be modified. Report any out-of-scope changes with justification.`})}return p.push({id:"mandatory-tests",text:"Tests written and passing for all new and changed behavior"}),p.push({id:"mandatory-docs",text:"Documentation updated for all public-facing changes"}),p},Pe=(e,t,n,s,r,l)=>{let m=e.spec,u=j(t),p=e.execution.iteration>=s,b=e.execution.lastVerification?.passed===!1,x=e.execution.lastVerification?.output??"",d=r?.tasks??[],i=e.execution.completedTasks??[],c=new Set(i),y=d.find(h=>!c.has(h.id))??null,k=y!==null?{id:y.id,title:y.title,totalTasks:d.length,completedTasks:i.length,...y.files!==void 0&&y.files.length>0?{files:y.files}:{}}:void 0;if(e.execution.awaitingStatusReport){let h=Ce(t,b,x,e.execution.debt,e.classification,r,l,e.execution.naItems),R=[];try{let N=JSON.parse(e.execution.lastProgress??"");Array.isArray(N.completed)&&(R=N.completed.filter(U=>typeof U=="string"&&U.startsWith("task-")))}catch{}let C={phase:"EXECUTING",instruction:R.length>=2?`${R.length} tasks reported complete. Report status against ALL relevant acceptance criteria.`:"Before this task is accepted, report your completion status against these acceptance criteria.",context:{rules:n,concernReminders:V(t).tier1},transition:{onComplete:`${o(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`,m)}`,onBlocked:`${o('block "reason"',m)}`,iteration:e.execution.iteration},statusReportRequired:!0,statusReport:{criteria:h,reportFormat:{completed:"list item IDs you finished (e.g., ['debt-1', 'ac-3']) with evidence",remaining:"list item IDs not yet done",blocked:"list item IDs that need a decision from the user",na:"(optional) list item IDs that are not applicable to this task \u2014 they will be removed from future criteria",newIssues:"(optional) list NEW issues discovered during implementation \u2014 free text, will be assigned debt IDs automatically"}}};return R.length>=2&&(C={...C,batchTasks:R}),b&&(C={...C,verificationFailed:!0,verificationOutput:x.slice(0,2e3)}),C}let f=(e.execution.lastProgress??"").includes("Task not accepted"),v=e.execution.debt?.items??[],S=e.execution.debt?.unaddressedIterations??0,L=k!==void 0?`Execute task ${k.id}: ${k.title} (${k.completedTasks}/${k.totalTasks} completed)`:"All tasks completed. Run `"+o("done",m)+"` to finish.",E;if(b)E="Verification FAILED. Fix the failing tests before continuing.";else if(f&&v.length>0){let h=S>=3?` These items have been outstanding for ${S} iterations.`:"";E=`Task not accepted \u2014 ${v.length} remaining item(s) must be addressed before this task can be completed.${h} Address them, then submit a new status report.`}else E=L;let g={phase:"EXECUTING",instruction:E,task:k,context:{rules:n,concernReminders:V(t).tier1},transition:{onComplete:`${o('next --answer="..."',m)}`,onBlocked:`${o('block "reason"',m)}`,iteration:e.execution.iteration}};if(f&&v.length>0&&(g={...g,taskRejected:!0,rejectionReason:`${v.length} remaining item(s) must be addressed.`,rejectionRemaining:v.map(h=>h.text)}),e.execution.debt!==null&&e.execution.debt.items.length>0){let h=e.execution.debt.unaddressedIterations??0,R=h>=3?`URGENT: These items have been unaddressed for ${h} iterations. Address them IMMEDIATELY before any new work.`:"These were not completed in a previous iteration. Address them BEFORE starting new work.";g={...g,previousIterationDebt:{fromIteration:e.execution.debt.fromIteration,items:e.execution.debt.items,note:R}}}if(b){let h=x.slice(0,2e3);g={...g,verificationFailed:!0,verificationOutput:h}}if(u.length>0){let h=u.map(R=>`${R.between.join(" vs ")}: ${R.issue}`).join("; ");g={...g,concernTensions:u,instruction:`TENSION GATE: ${u.length} concern tension(s) detected: ${h}. You MUST present these to the user and get explicit resolution for each before proceeding. Use AskUserQuestion to ask which side to prioritize.`}}p&&(g={...g,restartRecommended:!0,restartInstruction:`Context may be getting large after ${e.execution.iteration} iterations. Consider starting a new conversation and running \`${o("next",m)}\` to resume - your progress is saved.`});let I=[...e.decisions].reverse().find(h=>!h.promoted);return I!==void 0&&e.execution.lastProgress?.startsWith("Resolved:")&&(g={...g,promotePrompt:{decisionId:I.id,question:I.question,choice:I.choice,prompt:`You just resolved a decision: "${I.choice}". Ask the user: "Should this be a permanent rule for future specs too?" If yes, run: \`${T(`rule add "${I.choice}"`)}\``}}),e.execution.iteration===0&&!b&&!f&&(g={...g,preExecutionReview:{instruction:"Re-read spec before starting. Flag: missing info that will block mid-execution, wrong task order, unclear ACs. Better to catch now than mid-execution."}}),t.some(h=>h.id==="beautiful-product")&&(g={...g,designChecklist:{required:!0,instruction:"Before completing any UI task, rate your implementation 0-10 on these dimensions and include the ratings in your AC report:",dimensions:[{id:"hierarchy",label:"Information hierarchy \u2014 what does the user see first, second, third?"},{id:"states",label:"Interaction states \u2014 loading, empty, error, success all specified?"},{id:"edge-cases",label:"Edge cases \u2014 long text, zero results, slow connection handled?"},{id:"intentionality",label:"Overall intentionality \u2014 does this feel designed or generated?"}]}}),g},Te=e=>{let t=e.spec;return{phase:"BLOCKED",instruction:"A decision is needed. Ask the user.",reason:e.execution.lastProgress??"Unknown",transition:{onResolved:`${o('next --answer="..."',t)}`}}},Se=async(e,t)=>{let s={phase:"COMPLETED",summary:{spec:e.spec,iterations:e.execution.iteration,decisionsCount:e.decisions.length,completionReason:e.completionReason,completionNote:e.completionNote},learningPrompt:{instruction:`LEARNING PENDING \u2014 Record learnings before moving on. For each insight, decide: one-time learning or permanent rule? One-time ("assumed X, was Y") \u2192 \`learn "text"\`. Permanent ("always/never do X") \u2192 \`learn "text" --rule\`. Run: \`noskills spec ${e.spec??"<name>"} learn "text"\` or \`learn "text" --rule\`.`,examples:[`noskills spec ${e.spec??"upload"} learn "Assumed S3 SDK v2, was v3"`,`noskills spec ${e.spec??"upload"} learn "Always use Result types" --rule`,"noskills learn promote 1"]},learningsPending:!0};if(t!==void 0)try{let{checkStaleness:r}=await import("./diagrams-IC2ADMKS.js"),l=await r(t,e.execution.modifiedFiles);if(l.length>0)return{...s,staleDiagrams:l.map(m=>({file:m.file,line:m.line,reason:m.reason})),staleDiagramsBlocking:!0}}catch{}return s};export{Ve as a};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as S}from"./chunk-ODBJ5KMQ.js";import{c as g}from"./chunk-LOZLXP5G.js";import{i as f}from"./chunk-6DBKPC2O.js";var A=p=>{let i=p.split(/\n/).flatMap(t=>t.trim().length>0?[t.trim()]:[]);return i.length>1?i:p.split(/\.(?=\s+[A-Z])|;\s+/).map(t=>t.trim()).filter(t=>t.length>5)},T=(p,i=[])=>{let t=[],r=p.find(c=>c.questionId==="ambition");if(r!==void 0){let c=r.answer,a=c.match(/10[- ]?star[:\s]+(.+?)(?:\n|$)/is),l=c.match(/5[- ]?star[:\s]+(.+?)(?:\n|$)/is),o=(a!==null?a[1].trim():l!==null?l[1].trim():c.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();o.length>0&&(o=o.charAt(0).toUpperCase()+o.slice(1)),o=o.replace(/[.\u2026]+$/,"").trim(),o.length>140&&(o=o.slice(0,137)+"..."),o.length>3&&t.push(o)}let n=p.find(c=>c.questionId==="verification");if(n!==void 0){let c=n.answer.split(/\n/).map(a=>a.replace(/^\s*[-\u2022*]\s*/,"").trim()).filter(a=>a.length>0);for(let a of c)t.push(a)}for(let c of i){let a=c.choice.toLowerCase();if(a.includes("accepted")||a.includes("add to scope")){let l=c.question.replace(/^should\s+(we|i)\s+/i,"").replace(/\?+$/,"").trim(),e=l.charAt(0).toUpperCase()+l.slice(1);t.push(e)}}return t.length===0&&t.push("_Tasks need to be defined before execution. Add tasks manually or run discovery with more detail._"),t.push("Write or update tests for all new and changed behavior"),t.push("Update documentation for all public-facing changes (README, API docs, CHANGELOG)"),t},x=(p,i)=>{let t={};if(i===null){for(let r of p.specSections)t[r]=!1;return t}for(let r of p.specSections){let n=r.toLowerCase();n.includes("design")||n.includes("mobile")||n.includes("layout")||n.includes("interaction")?t[r]=i.involvesWebUI:n.includes("contributor")||n.includes("public api")||n.includes("api surface")?t[r]=i.involvesPublicAPI:n.includes("migration")||n.includes("deprecation")||n.includes("backward")||n.includes("compatibility")?t[r]=i.involvesMigration:n.includes("audit")||n.includes("access control")||n.includes("data handling")?t[r]=i.involvesDataHandling:t[r]=!0}return t},C=(p,i,t,r,n,c,a,l)=>{let e=[];e.push(`# Spec: ${p}`),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){if(e.push(`### ${s.questionId}`),e.push(""),e.push(s.answer),"user"in s&&s.user!=="Unknown User"){let u=s;e.push(""),e.push(`_-- ${u.user}_`)}e.push("")}for(let s of t)if(s.specSections.length>0){let u=x(s,n??null);for(let h of s.specSections)u[h]!==!1&&(e.push(`## ${h} (${s.id})`),e.push(""),e.push("_To be addressed during execution._"),e.push(""))}for(let s of t){let u=s.registries??[];if(u.length===0)continue;let h=s.reviewDimensions??[];for(let d of u){let m=h.find(_=>_.id===d);m!==void 0&&(e.push(`## ${m.label} (${s.id})`),e.push(""),e.push(`_${m.prompt}_`),e.push(""),d==="error-rescue"?(e.push("| Codepath | What Can Go Wrong | Exception Class | Rescued? | Recovery Action | User Sees |"),e.push("|----------|-------------------|-----------------|----------|----------------|-----------|"),e.push("| _To be filled during execution._ | | | | | |")):d==="failure-modes"?(e.push("| Codepath | Failure Mode | Rescued? | Tested? | User Sees | Logged? |"),e.push("|----------|--------------|----------|---------|-----------|---------|"),e.push("| _To be filled during execution._ | | | | | |")):d==="test-plan"?(e.push("| Behavior | Test Layer | Happy Path | Failure Path | Edge Case |"),e.push("|----------|------------|------------|--------------|-----------|"),e.push("| _To be filled during execution._ | | | | |")):e.push("_To be filled during execution._"),e.push(""))}}if(r.length>0){e.push("## Decisions"),e.push(""),e.push("| # | Decision | Choice | Promoted |"),e.push("|---|----------|--------|----------|");for(let s=0;s<r.length;s++){let u=r[s];e.push(`| ${s+1} | ${u.question} | ${u.choice} | ${u.promoted?"yes":"no"} |`)}e.push("")}let o=i.find(s=>s.questionId==="scope_boundary");if(o!==void 0){e.push("## Out of Scope"),e.push("");let s=A(o.answer);for(let u of s)e.push(`- ${u}`);e.push("")}let $=T(i,r);e.push("## Tasks"),e.push("");for(let s=0;s<$.length;s++)e.push(`- [ ] task-${s+1}: ${$[s]}`);e.push("");let v=i.find(s=>s.questionId==="verification");if(e.push("## Verification"),e.push(""),v!==void 0){let s=A(v.answer);for(let u of s)e.push(`- ${u}`)}else e.push("_To be defined._");e.push("");let y=c??[];if(y.length>0){e.push("## Custom Acceptance Criteria"),e.push("");for(let s of y)e.push(`- ${s.text} _-- ${s.user}, ${s.addedInPhase}_`);e.push("")}let w=(a??[]).filter(s=>!s.text.startsWith("[TASK] "));if(w.length>0){e.push("## Notes"),e.push("");for(let s of w)e.push(`- ${s.text} _-- ${s.user}, ${s.phase}_`);e.push("")}let b=l??[];if(b.length>0){e.push("## Transition History"),e.push(""),e.push("| From | To | User | Timestamp | Reason |"),e.push("|------|----|------|-----------|--------|");for(let s of b)e.push(`| ${s.from} | ${s.to} | ${s.user} | ${s.timestamp} | ${s.reason??"-"} |`);e.push("")}return e.join(`
|
|
3
|
+
`)};var q=async(p,i,t)=>{if(i.spec===null)throw new Error("No active spec");let r=`${p}/${g.specDir(i.spec)}`,n=`${p}/${g.specFile(i.spec)}`;await f.fs.mkdir(r,{recursive:!0});let c=C(i.spec,i.discovery.answers,t,i.decisions,i.classification,i.customACs,i.specNotes,i.transitionHistory);await f.fs.writeTextFile(n,c);let a=S(i.spec,c),l=`${r}/progress.json`,e={spec:i.spec,status:"draft",tasks:a.tasks.map(o=>({id:o.id,title:o.title,status:"pending"})),decisions:i.decisions.map(o=>({question:o.question,choice:o.choice,promoted:o.promoted})),debt:[],updatedAt:new Date().toISOString()};return await f.fs.writeTextFile(l,JSON.stringify(e,null,2)+`
|
|
4
|
+
`),n};export{q as a};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as P}from"./chunk-2XNFZXHY.js";import{i as s}from"./chunk-6DBKPC2O.js";import{e as
|
|
3
|
-
`)};var
|
|
4
|
-
`)},
|
|
2
|
+
import{a as P}from"./chunk-2XNFZXHY.js";import{i as s}from"./chunk-6DBKPC2O.js";import{e as $}from"./chunk-5WJ6AUNY.js";var f=()=>({version:"0.1.0",phase:"IDLE",spec:null,specDescription:null,branch:null,discovery:{answers:[],completed:!1,currentQuestion:0,audience:"human",approved:!1,planPath:null},specState:{path:null,status:"none"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]},decisions:[],lastCalledAt:null,classification:null,completionReason:null,completedAt:null,completionNote:null,reopenedFrom:null,revisitHistory:[]}),j=(e,n,t,r)=>({concerns:e,tools:n,providers:t,project:r,maxIterationsBeforeRestart:15,verifyCommand:null,allowGit:!1,command:"npx eser@latest noskills"});var l=$(P(),1);var i=".eser",d=`${i}/.state`,S=`${d}/state.json`,m=`${i}/manifest.yml`,y=`${i}/concerns`,x=`${i}/rules`,u=`${i}/specs`,h=`${i}/workflows`,p=`${d}/specs`,b=`${d}/active.json`,a=`${i}/.sessions`,D=`${i}/.events`,c={eserDir:i,stateDir:d,stateFile:S,manifestFile:m,concernsDir:y,rulesDir:x,specsDir:u,workflowsDir:h,specStatesDir:p,activeFile:b,specDir:e=>`${u}/${e}`,specFile:e=>`${u}/${e}/spec.md`,specStateFile:e=>`${p}/${e}.json`,concernFile:e=>`${y}/${e}.json`,sessionsDir:a,sessionFile:e=>`${a}/${e}.json`,eventsDir:D,eserGitignore:`${i}/.gitignore`},w=async e=>{let n=`${e}/${S}`;try{let t=await s.fs.readTextFile(n);return JSON.parse(t)}catch{return f()}},L=async(e,n)=>{if(n==null)return w(e);let t=`${e}/${c.specDir(n)}`;try{await s.fs.stat(t)}catch{throw new Error(`Spec '${n}' not found. Run \`noskills spec list\` to see available specs.`)}let r=await C(e,n);if(r.spec===n)return r;let o=await w(e);return o.spec===n?o:{...r,spec:n}};var A=e=>{if(e===void 0)return null;for(let n of e)if(n.startsWith("--spec="))return n.slice(7);return null},M=e=>{let n=A(e);return n===null||n.length===0?{ok:!1,error:"Error: spec name is required. Use `noskills spec <name> <command>` format."}:{ok:!0,spec:n}},I=async(e,n)=>{let t=`${e}/${d}`,r=`${e}/${S}`;await s.fs.mkdir(t,{recursive:!0}),await s.fs.writeTextFile(r,JSON.stringify(n,null,2)+`
|
|
3
|
+
`)};var C=async(e,n)=>{let t=`${e}/${c.specStateFile(n)}`;try{let r=await s.fs.readTextFile(t);return JSON.parse(r)}catch{return f()}},T=async(e,n,t)=>{let r=`${e}/${p}`,o=`${e}/${c.specStateFile(n)}`;await s.fs.mkdir(r,{recursive:!0}),await s.fs.writeTextFile(o,JSON.stringify(t,null,2)+`
|
|
4
|
+
`)},q=async e=>{let n=`${e}/${p}`,t=[];try{for await(let r of s.fs.readDir(n))if(r.isFile&&r.name.endsWith(".json")){let o=r.name.replace(/\.json$/,""),g=await s.fs.readTextFile(`${n}/${r.name}`);t.push({name:o,state:JSON.parse(g)})}}catch{}return t},J=async e=>{let n=`${e}/${m}`;try{let t=await s.fs.readTextFile(n),r=l.parse(t);return r?.noskills===void 0?null:r.noskills}catch{return null}},U=async(e,n)=>{let t=`${e}/${m}`,r;try{let g=await s.fs.readTextFile(t);r=l.parseDocument(g)}catch{r=new l.Document({})}let o=r.createNode(n);o.commentBefore=" noskills orchestrator \u2014 inline comments in this section won't be preserved on next write",r.set("noskills",o),await s.fs.writeTextFile(t,r.toString())},V=async(e,n)=>{let t=`${e}/${c.concernFile(n)}`;try{let r=await s.fs.readTextFile(t);return JSON.parse(r)}catch{return null}},W=async(e,n)=>{let t=`${e}/${y}`,r=`${e}/${c.concernFile(n.id)}`;await s.fs.mkdir(t,{recursive:!0}),await s.fs.writeTextFile(r,JSON.stringify(n,null,2)+`
|
|
5
5
|
`)},B=async e=>{let n=`${e}/${y}`,t=[];try{for await(let r of s.fs.readDir(n))if(r.isFile&&r.name.endsWith(".json")){let o=await s.fs.readTextFile(`${n}/${r.name}`);t.push(JSON.parse(o))}}catch{}return t},G=async e=>{let n=[i,d,p,y,x,u,h,D];for(let r of n)await s.fs.mkdir(`${e}/${r}`,{recursive:!0});let t=`${e}/${c.eserGitignore}`;try{await s.fs.stat(t)}catch{await s.fs.writeTextFile(t,`# eser toolchain runtime state \u2014 not tracked by git
|
|
6
6
|
.state/
|
|
7
7
|
.sessions/
|
|
8
8
|
.events/
|
|
9
|
-
`)}},H=async(e,n)=>{await
|
|
10
|
-
`)},
|
|
11
|
-
`)},z=async e=>{let n=await
|
|
9
|
+
`)}},H=async(e,n)=>{await I(e,n),n.spec!==null&&await T(e,n.spec,n)},v=2*60*60*1e3,Q=async(e,n)=>{let t=`${e}/${a}`;await s.fs.mkdir(t,{recursive:!0}),await s.fs.writeTextFile(`${t}/${n.id}.json`,JSON.stringify(n,null,2)+`
|
|
10
|
+
`)},R=async(e,n)=>{try{let t=await s.fs.readTextFile(`${e}/${a}/${n}.json`);return JSON.parse(t)}catch{return null}},E=async e=>{let n=`${e}/${a}`,t=[];try{for await(let r of s.fs.readDir(n))if(r.isFile&&r.name.endsWith(".json"))try{let o=await s.fs.readTextFile(`${n}/${r.name}`);t.push(JSON.parse(o))}catch{}}catch{}return t},k=async(e,n)=>{try{return await s.fs.remove(`${e}/${a}/${n}.json`),!0}catch{return!1}},K=async(e,n,t)=>{let r=await R(e,n);if(r===null)return;let o={...r,phase:t,lastActiveAt:new Date().toISOString()};await s.fs.writeTextFile(`${e}/${a}/${n}.json`,JSON.stringify(o,null,2)+`
|
|
11
|
+
`)},z=async e=>{let n=await E(e),t=Date.now(),r=[];for(let o of n)t-new Date(o.lastActiveAt).getTime()>v&&(await k(e,o.id),r.push(o.id));return r},Y=e=>Date.now()-new Date(e.lastActiveAt).getTime()>v,X=()=>{let e=new Uint8Array(4);return crypto.getRandomValues(e),Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")},Z=async e=>{try{let n=await s.fs.readTextFile(`${e}/${m}`);return l.parse(n)?.noskills!==void 0}catch{return!1}},N=e=>{let n=e.includes("\\")?"\\":"/",t=e.split(n).filter(Boolean);return t.length<=1?e.startsWith("/")?"/":e:(t.pop(),(e.startsWith("/")?"/":"")+t.join(n))},O=async e=>{let n=e;for(let t=0;t<100;t++){try{return await s.fs.stat(`${n}/${i}`),n}catch{}let r=N(n);if(r===n)return null;n=r}return null},ee=async()=>{let e=s.process.cwd(),n=s.env.get("NOSKILLS_PROJECT_ROOT")??null;if(n!==null)try{return await s.fs.stat(`${n}/${i}`),{root:n,found:!0}}catch{}let t=await O(e);return t!==null?{root:t,found:!0}:n!==null?{root:n,found:!1}:{root:e,found:!1}};export{f as a,j as b,c,w as d,L as e,A as f,M as g,I as h,C as i,T as j,q as k,J as l,U as m,V as n,W as o,B as p,G as q,H as r,Q as s,R as t,E as u,k as v,K as w,z as x,Y as y,X as z,Z as A,ee as B};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
var r={name:"@eser/cli",version:"4.1.
|
|
2
|
+
var r={name:"@eser/cli",version:"4.1.55",type:"module",exports:"./main.ts",bin:{eser:"./bin.ts"},dependencies:{"@eser/ai":"workspace:*","@eser/codebase":"workspace:*","@eser/kit":"workspace:*","@eser/noskills":"workspace:*","@eser/laroux-server":"workspace:*","@eser/workflows":"workspace:*","@eser/functions":"workspace:*","@eser/logging":"workspace:*","@eser/shell":"workspace:*","@eser/standards":"workspace:*","@std/cli":"npm:@jsr/std__cli@^1.0.25","@std/fmt":"npm:@jsr/std__fmt@^1.0.8"},devDependencies:{"@std/assert":"npm:@jsr/std__assert@^1.0.16",esbuild:"^0.27.3"},optionalDependencies:{"@eserstack/ajan-darwin-arm64":"^4.1.47","@eserstack/ajan-darwin-x64":"^4.1.47","@eserstack/ajan-linux-arm64":"^4.1.47","@eserstack/ajan-linux-x64":"^4.1.47","@eserstack/ajan-win32-x64":"^4.1.47","@eserstack/ajan-wasm":"^4.1.47"}};export{r as a};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{e as x,f as k}from"./chunk-HTC2FO4I.js";import{a as O}from"./chunk-LFNUSULJ.js";import{a as j,c as U}from"./chunk-PZUDTTK4.js";import{o as c}from"./chunk-5GGWX7CO.js";import{a as S,b as w,c as F,d as f}from"./chunk-J2Z7NG2X.js";import{f as v}from"./chunk-P2MUEKFT.js";import{a as R}from"./chunk-MG65QJY6.js";import{g as p}from"./chunk-FFWPJP7A.js";import{j as m}from"./chunk-7ATUODBM.js";import{j as V}from"./chunk-6DBKPC2O.js";var{ctx:u,output:ee}=j(),E=async(s={})=>{let{root:t="."}=s,e=m(t,"VERSION");try{return(await V.runtime.fs.readTextFile(e)).trim()}catch{return}},T=async(s,t)=>{let e=m(s,"VERSION");await V.runtime.fs.writeTextFile(e,t+`
|
|
3
|
+
`)},N=async(s,t)=>{let e=V.runtime,n=m(s,"pkg/@eser/ajan/package.json");try{let r=await e.fs.readTextFile(n),l=r.replace(/"@eserstack\/ajan-[^"]+": "[^"]+"/g,i=>`${i.split(":")[0]}: "${t}"`);l!==r&&await e.fs.writeTextFile(n,l)}catch{}let d=m(s,"pkg/@eser/ajan/dist/npm");try{for await(let r of e.fs.readDir(d)){if(!r.isDirectory||!r.name.startsWith("ajan-"))continue;let l=m(d,r.name,"package.json");try{let i=await e.fs.readTextFile(l),g=i.replace(/"version": "[^"]+"/,`"version": "${t}"`);g!==i&&await e.fs.writeTextFile(l,g)}catch{}}}catch{}},I=s=>{let t=f("0.0.0");for(let e of s){let n=f(e);S(n,t)>0&&(t=n)}return w(t)},M=async(s={})=>{let{root:t="."}=s,[e,n]=await k(t),d=e.version?.value??"0.0.0";return{packages:[{name:e.name?.value??"(root)",version:d},...n.map(i=>({name:i.name,version:i.version}))]}},D=async(s,t={})=>{let{root:e=".",dryRun:n=!1,updateVersionFile:d=!0}=t,[r,l]=await k(e),i=r.version?.value??"0.0.0",g=r.name?.value??"(root)",A=[i,...l.map(a=>a.version)],C=I(A),o;if(s==="explicit"){if(t.explicitVersion===void 0)throw new Error('explicitVersion is required when command is "explicit".');f(t.explicitVersion),o=t.explicitVersion}else s==="sync"?o=C:o=w(F(f(C),s));let y=[],$=i!==o;n||await x(r,o),y.push({name:g,from:i,to:o,changed:$});for(let a of l){let h=a.version!==o;n||await x(a.config,o),y.push({name:a.name,from:a.version,to:o,changed:h})}n||await N(e,o);let P=[];if(d){let a=await E({root:e}),h=a!==o;!n&&h&&await T(e,o),P.push({path:"VERSION",from:a??"",to:o,changed:h})}let b=y.filter(a=>a.changed).length;return{command:s,targetVersion:o,updates:y,fileUpdates:P,changedCount:b,dryRun:n}},H=s=>s.mode==="show"?v.fromPromise(async()=>({mode:"show",result:await M()})):v.fromPromise(async()=>({mode:"update",result:await D(s.command,s.options)})),W=s=>{let t=s.args[0];if(t===void 0)return p.ok({mode:"show"});let e=["sync","patch","minor","major"],n,d;e.includes(t)?n=t:(n="explicit",d=t);let r=s.flags["dry-run"]===!0;return p.ok({mode:"update",command:n,options:{dryRun:r,explicitVersion:d}})},q=s=>{if(p.isFail(s))return p.fail({exitCode:1,message:String(s.error)});let t=s.value;if(t.mode==="show")return console.table(t.result.packages),p.ok(void 0);let{result:e}=t;e.command==="sync"?c.info(u,"Syncing all versions..."):e.command==="explicit"?c.info(u,`Setting all versions to ${e.targetVersion}...`):c.info(u,`Bumping all versions (${e.command})...`),c.info(u,`Target version: ${e.targetVersion}`),console.table(e.updates);for(let n of e.fileUpdates)n.changed&&c.info(u,`${n.path} (${n.from} \u2192 ${n.to})`);return e.dryRun?c.info(u,`Dry run - ${e.changedCount} packages would be modified.`):c.success(u,`Done. Updated ${e.changedCount} packages.`),p.ok(void 0)},B=O.createTrigger({handler:H,adaptInput:W,adaptOutput:q}),te=async s=>{let t=R(s??[],{boolean:["dry-run"]}),e=U("versions",t);return await B(e)};export{E as a,M as b,D as c,H as d,B as e,te as f};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
var l={id:"open-source",name:"Open Source",description:"Community-driven, inclusive, well-documented. Prioritize contributor experience, avoid exclusionary patterns, default to permissive choices.",extras:[{questionId:"status_quo",text:"Is this workaround common in the community?"},{questionId:"user_impact",text:"Does this make contribution harder?"},{questionId:"verification",text:"Can a new contributor understand and modify this within 30 minutes of reading?"}],specSections:["Contributor Guide","Public API Surface"],reminders:["Endpoint should be documented in API docs","Consider contributor experience for new patterns","Default to permissive, well-documented choices","New features and API changes must be documented so contributors can discover and use them"],acceptanceCriteria:["Public API documented","Changes reflected in README or relevant docs","No exclusionary patterns introduced"],reviewDimensions:[{id:"contributor-onboarding",label:"Contributor Onboarding",prompt:"Walk through the contributor journey: clone \u2192 install \u2192 run \u2192 modify \u2192 test \u2192 PR. Where does it break? What's undocumented? What would confuse someone seeing this repo for the first time?",evidenceRequired:!0,scope:"all"},{id:"api-surface-quality",label:"API Surface Quality",prompt:"Review every public export, CLI flag, and config option touched by this change. Are names self-explanatory? Are defaults sensible? Is progressive disclosure working (simple things simple, complex things possible)?",evidenceRequired:!0,scope:"api"},{id:"docs-findability",label:"Documentation Findability",prompt:"For each new feature: can a user discover it from README? Are code examples copy-paste runnable? Is there a gap between 'documented' and 'findable'?",evidenceRequired:!0,scope:"all"}]};var u={id:"beautiful-product",name:"Beautiful Product",description:"Design and UX are first-class. Agent critiques UI/UX like a passionate designer. Empty states, error states, loading states, mobile layout \u2014 nothing ships unspecified.",extras:[{questionId:"status_quo",text:"How painful is the current experience?"},{questionId:"status_quo",text:"What does the current UI look like? Rate it 0-10 on design intentionality."},{questionId:"ambition",text:"In the 10-star version, what does the user feel?"},{questionId:"ambition",text:"What would a 10/10 design look like for this feature? Describe the emotional response you want from users."},{questionId:"ambition",text:"What makes this UI NOT look AI-generated? Name specific design decisions that differentiate it from generic templates."},{questionId:"verification",text:"How will you verify design quality? Will you review empty states, loading states, error states, and edge cases (long text, zero results, slow connection)?"}],specSections:["Design States (empty, loading, error, success)","Mobile Layout","Interaction Design","Accessibility"],reminders:["Loading state and error state must be designed, not placeholder","No AI slop \u2014 every UI element is intentional","Empty states need clear CTAs with examples","Rate each UI change 0-10 on design intentionality before marking task complete. If below 7, iterate.","Check all interaction states: loading, empty, error, success, partial. Missing states are bugs, not TODOs.","Edge case check: what happens with 47-character names? Zero results? Network failure mid-action?","AI SLOP BLACKLIST \u2014 reject these patterns in any UI implementation: (1) Purple/violet gradient backgrounds (2) 3-column feature grid with icon-in-circle + bold title + 2-line description (3) Icons in colored circles as decoration (4) Everything centered (text-align: center on all elements) (5) Uniform bubbly border-radius on every element (6) Decorative blobs, floating circles, wavy SVG dividers (7) Emoji as design elements in headings or bullets (8) Colored left-border on cards (9) Generic hero copy ('Welcome to X', 'Unlock the power of...') (10) Cookie-cutter section rhythm (hero \u2192 3 features \u2192 testimonials \u2192 pricing). If the implementation matches any of these patterns, reject it and ask for a redesign with specific, intentional alternatives."],acceptanceCriteria:["All UI states designed (empty, loading, error, success)","Mobile layout considered","No placeholder or skeleton UI left unfinished","All UI states specified and implemented: loading, empty, error, success, partial","No placeholder text in shipped UI \u2014 every empty state has warmth, a primary action, and context","Design rated 7+ on intentionality by the spec author","Basic accessibility: keyboard navigation works, focus indicators visible, sufficient contrast"],reviewDimensions:[{id:"info-hierarchy",label:"Information Hierarchy",prompt:"What does the user see FIRST, SECOND, THIRD? Is the visual hierarchy intentional or accidental? Would a user arriving cold know what to do within 3 seconds?",evidenceRequired:!0,scope:"ui"},{id:"interaction-states",label:"Interaction State Completeness",prompt:"For every UI component in this change, verify: loading state, empty state, error state, success state, partial state. Build a matrix \u2014 mark any MISSING states.",evidenceRequired:!0,scope:"ui"},{id:"user-journey",label:"User Journey & Emotional Arc",prompt:"Walk through the user's complete journey for this feature. What's the emotional arc \u2014 curiosity \u2192 understanding \u2192 action \u2192 satisfaction? Where does it break? Where does it feel mechanical instead of crafted?",evidenceRequired:!1,scope:"ui"},{id:"accessibility",label:"Accessibility Audit",prompt:"Keyboard navigation: can every action be completed without a mouse? Focus management: is focus trapped in modals, restored after close? Contrast: WCAG 2.1 AA (4.5:1 text, 3:1 UI)? Touch targets: minimum 44x44px? Screen reader: are interactive elements labeled?",evidenceRequired:!0,scope:"ui"},{id:"design-system",label:"Design System Alignment",prompt:"Does this change use existing design tokens (colors, spacing, typography) or introduce new ones? If new \u2014 is that intentional? Check for consistency with adjacent screens.",evidenceRequired:!0,scope:"ui"}]};var p={id:"long-lived",name:"Long-Lived",description:"Built to last. Stability, maintainability, and backward compatibility matter. Every shortcut needs justification. Favor boring technology.",extras:[{questionId:"reversibility",text:"Will this decision still be correct in 2 years?"},{questionId:"verification",text:"Is documentation (README, CHANGELOG, API docs) up to date with this change?"},{questionId:"scope_boundary",text:"What technical debt would this introduce?"},{questionId:"status_quo",text:"What assumptions in the current architecture would this change rely on? Could any of them break?"}],specSections:["Migration & Deprecation","Backward Compatibility","Error Recovery","Deployment Plan"],reminders:["Favor boring technology over shiny new tools","Every shortcut needs explicit justification","Consider maintenance burden for new dependencies","If this task changes public behavior, API, CLI flags, or configuration \u2014 update README and relevant docs in the SAME task. Documentation is not a follow-up."],acceptanceCriteria:["Backward compatibility preserved","Migration path documented if breaking","No unnecessary new dependencies","Documentation updated for any public-facing change","Rollback plan exists (how to undo this change if it goes wrong)"],reviewDimensions:[{id:"architecture",label:"Architecture & Coupling",prompt:"Draw the dependency graph for this change. Which modules depend on what? Are there circular dependencies? Single points of failure? Would removing one piece break the whole thing? Is the coupling direction correct (stable \u2192 volatile, not the reverse)?",evidenceRequired:!0,scope:"all"},{id:"error-rescue",label:"Error & Rescue Registry",prompt:"For every new codepath: what can go wrong? Build a table: Method/Codepath | What Can Go Wrong | Exception Class | Rescued? | Recovery Action | User Sees. Flag any row where Rescued=No or User Sees=raw error.",evidenceRequired:!0,scope:"all"},{id:"failure-modes",label:"Failure Modes Analysis",prompt:"For every new codepath: Codepath | Failure Mode | Rescued? | Tested? | User Sees | Logged? Flag CRITICAL gaps: unrescued + untested + silent failure. These block ship.",evidenceRequired:!0,scope:"all"},{id:"deployment-safety",label:"Deployment & Rollback Safety",prompt:"Can this be deployed incrementally? What happens during partial deployment (old code + new code running simultaneously)? Is rollback safe \u2014 can you revert without data loss or schema conflicts? Do you need feature flags?",evidenceRequired:!1,scope:"all"},{id:"trajectory",label:"6-Month Trajectory",prompt:"Fast-forward 6 months. What assumptions in this design might break? What would you regret? Is this creating path dependency that limits future options? What's the cost of changing course later?",evidenceRequired:!1,scope:"all"}],registries:["error-rescue","failure-modes"],dreamStatePrompt:"Synthesize: CURRENT STATE (what exists today) \u2192 THIS SPEC (what changes) \u2192 6-MONTH IDEAL (where should this be heading). What does the ideal architecture look like?"};var h={id:"move-fast",name:"Move Fast",description:"Optimize for shipping speed. Acceptable trade-offs on polish. Good enough is good enough. Reduce ceremony.",extras:[{questionId:"scope_boundary",text:"Which polish items can be deferred to v2?"},{questionId:"ambition",text:"What is the minimum viable 5-star version?"}],specSections:["v1 vs v2 Scope"],reminders:["Good enough is good enough \u2014 ship it","Reduce ceremony, optimize for feedback speed","Mark polish items for v2 explicitly"],acceptanceCriteria:["Core functionality works","v2 items explicitly deferred"],reviewDimensions:[{id:"scope-knife",label:"Scope Knife",prompt:"For every task in this spec: is it v1-essential or v2-deferrable? Apply the rule: if removing this task still leaves a usable feature, it's v2. Be aggressive \u2014 list everything you'd cut and what remains.",evidenceRequired:!1,scope:"all"}]};var m={id:"compliance",name:"Compliance",description:"Audit trails, access controls, data handling rules. Every change is traceable. Verification is mandatory, not optional.",extras:[{questionId:"reversibility",text:"Is the audit trail preserved on rollback?"},{questionId:"verification",text:"Is there an audit/traceability requirement?"}],specSections:["Audit Trail","Access Control","Data Handling"],reminders:["Every state change must be traceable","Verification is mandatory, not optional","Document data handling and retention policies"],acceptanceCriteria:["Audit trail added for state changes","Access control verified","Data handling documented"],reviewDimensions:[{id:"audit-completeness",label:"Audit Trail Completeness",prompt:"For every state mutation in this change: is it logged? Who, what, when, from-value, to-value? Can you reconstruct the full history of any record from the audit log alone?",evidenceRequired:!0,scope:"data"},{id:"data-lifecycle",label:"Data Lifecycle & Retention",prompt:"What data does this feature create, read, update, delete? What's the retention policy? Can a user request deletion (GDPR)? Is PII identified and handled correctly?",evidenceRequired:!0,scope:"data"}]};var g={id:"learning-project",name:"Learning Project",description:"Experimentation is the goal. Encourage trying new patterns, don't punish dead ends. Document learnings over polish.",extras:[{questionId:"ambition",text:"What do you want to learn from building this?"},{questionId:"scope_boundary",text:"What experiments are explicitly allowed?"}],specSections:["Learning Goals","Experiment Log"],reminders:["Document learnings, not just outcomes","Dead ends are acceptable \u2014 document why","Try new patterns freely, polish later"],acceptanceCriteria:["Learnings documented","Experiment outcomes recorded"],reviewDimensions:[{id:"learning-clarity",label:"Learning Goal Clarity",prompt:"For each learning goal: what specific question will be answered? How will you know if the experiment succeeded or failed? What's the 'good enough to learn from' threshold?",evidenceRequired:!1,scope:"all"}]};var f={id:"well-engineered",name:"Well-Engineered",description:"Engineering craftsmanship. Performance is measured, not assumed. Tests are strategic, not ceremonial. Errors are helpful, not cryptic. Security is a design constraint, not a checklist. Observability is built-in, not bolted on. The system is debuggable by someone who didn't write it.",extras:[{questionId:"verification",text:"What's the test strategy? Which layer (unit/integration/e2e) covers which behavior? What's explicitly NOT worth testing?"},{questionId:"status_quo",text:"Are there known performance bottlenecks, missing logs, security concerns, or confusing error messages in the area you're changing?"},{questionId:"ambition",text:"If a developer encounters an error from this code at 3am \u2014 will the error message tell them the problem, the cause, and the fix?"},{questionId:"scope_boundary",text:"Does this change introduce new inputs, new trust boundaries, or new attack surface? What's the threat model?"},{questionId:"user_impact",text:"What's the Time-To-Hello-World for a developer using this for the first time? How many steps from install to first success?"}],specSections:["Test Strategy","Performance Considerations","Observability Plan","Error Handling","Security & Threat Model","Developer Ergonomics"],reminders:["Every error message should contain: what went wrong, why, and what to do about it. 'Something went wrong' is never acceptable.","Test at the right level: unit for logic, integration for boundaries, e2e for critical paths. More tests is better than fewer \u2014 but pointless tests are noise.","Performance claims need evidence: run the benchmark, check the query plan, measure the memory. 'Should be fast' is not engineering.","Every new codepath must be observable: structured log at entry/exit, metric for latency, trace ID for correlation. If you can't see it in production, it doesn't exist.","Escape hatches: every opinionated default should be overridable via config, env var, or parameter. Don't trap users.","Every user input is hostile until validated. Validate at system boundaries, not deep inside business logic.","Never log secrets, tokens, passwords, or PII. Check log output for accidental exposure.","New endpoints need auth/authz. Default to deny.","Progressive disclosure: simple things simple, complex things possible. Don't front-load complexity."],acceptanceCriteria:["Test strategy covers happy path AND failure paths at appropriate layers","No N+1 queries or obvious performance regressions (evidence required)","New codepaths have structured logging with trace correlation","Error messages include problem, cause, and remediation","All user inputs validated at system boundaries","No hardcoded secrets or credentials in code","New endpoints have explicit auth/authz","Getting started path works end-to-end without undocumented steps"],reviewDimensions:[{id:"test-strategy",label:"Test Pyramid Strategy",prompt:"Map every new behavior to a test layer: Unit (pure logic, fast, isolated) | Integration (boundaries, I/O, real deps) | E2E (critical user flows). Flag: untested failure paths, tests that test framework instead of behavior, missing edge cases. Too many tests > too few.",evidenceRequired:!0,scope:"all"},{id:"performance",label:"Performance Analysis",prompt:"For every new codepath: What's the time complexity? Any N+1 queries? Missing database indexes? Unbounded memory growth? Unnecessary serialization? Are there hot paths that need caching? Measure, don't guess.",evidenceRequired:!0,scope:"all"},{id:"observability",label:"Observability & Debuggability",prompt:"For every new codepath: Is there structured logging at entry and exit? Metrics for latency and error rate? Trace ID propagation? If this breaks at 3am, can oncall diagnose it from dashboards and logs without reading source code? What alerts should fire?",evidenceRequired:!0,scope:"all"},{id:"error-quality",label:"Error Message Quality",prompt:"Find every error message, exception, and user-facing failure in this change. For each: does it state the PROBLEM (what happened), CAUSE (why), and FIX (what to do)? Does it include enough context to debug (IDs, paths, values)? Would a user or developer at 3am understand it without reading source code?",evidenceRequired:!0,scope:"all"},{id:"threat-model",label:"Threat Model & Security",prompt:"What are the trust boundaries in this change? Where does untrusted input enter? What could an attacker do \u2014 injection (SQL, XSS, command), privilege escalation, data exfiltration, denial of service? For every new endpoint: who can access it? Is authorization checked at the right layer (not just UI)?",evidenceRequired:!0,scope:"all"},{id:"input-validation",label:"Input Validation Audit",prompt:"Find every point where external data enters the system (HTTP params, file uploads, env vars, webhook payloads, user-controlled DB fields). For each: what validation exists? Maximum size/length? Types enforced? Sanitized before rendering (XSS) or query construction (injection)?",evidenceRequired:!0,scope:"all"},{id:"secrets-lifecycle",label:"Secrets & Credentials",prompt:"What secrets does this change use or introduce (API keys, tokens, passwords, encryption keys)? Where stored? How rotated? Ever logged, serialized to JSON, or included in error messages? Dependencies: any new ones with known CVEs?",evidenceRequired:!0,scope:"all"},{id:"escape-hatches",label:"Escape Hatches & Overridability",prompt:"List every opinionated default introduced by this change (timeouts, limits, formats, behaviors). For each: can the user override it? Via config, env var, or parameter? If not \u2014 should they be able to? Every opinion needs an escape hatch.",evidenceRequired:!0,scope:"all"},{id:"dev-friction",label:"Developer Environment & Onboarding",prompt:"After this change: does `git clone && install && run` still work without manual steps? Any new env vars, services, or tools required? What's the Time-To-Hello-World? Is the dev setup documented? Would a new team member be blocked?",evidenceRequired:!1,scope:"all"},{id:"api-ergonomics",label:"API/CLI Ergonomics",prompt:"Review every public API method, CLI command, and config option touched by this change. Names self-explanatory? Defaults sensible? Progressive disclosure working (simple things simple, complex things possible)? Breaking changes have migration guide with before/after?",evidenceRequired:!0,scope:"api"}],registries:["test-plan"]};var y=[l,u,p,h,m,g,f];var _=()=>Promise.resolve(y),z=(n,e)=>{let t=[];for(let i of n)for(let o of i.extras)o.questionId===e&&t.push(o);return t},$=(n,e)=>{let t=[];for(let i of n)for(let o of i.reminders){if(e!=null){let s=o.toLowerCase();if((s.includes("slop")||s.includes("ui element")||s.includes("design intentionality")||s.includes("interaction states")||s.includes("edge case check")||s.includes("loading state"))&&!e.involvesWebUI||(s.includes("api doc")||s.includes("endpoint should be"))&&!e.involvesPublicAPI)continue}t.push(`${i.id}: ${o}`)}return t},v=n=>{let e=n.toLowerCase();return e.includes("slop")||e.includes("ui element")||e.includes("design intentionality")||e.includes("interaction states")||e.includes("edge case check")||e.includes("loading state")||e.includes("api doc")||e.includes("endpoint should be")||e.includes("migration")||e.includes("rollback")},V=n=>{let e=[],t=[];for(let i of n)for(let o of i.reminders){let s=`${i.id}: ${o}`;v(o)?t.push(s):e.push(s)}return{tier1:e,tier2:t}},X=(n,e,t)=>{let i=e.includes(".")?`.${e.split(".").pop()}`:"",o=[".tsx",".jsx",".html",".css",".svelte",".vue"].includes(i),s=[".ts",".go",".py",".rs"].includes(i),c=[];for(let d of n)for(let a of d.reminders){if(!v(a))continue;let r=a.toLowerCase();(r.includes("slop")||r.includes("ui element")||r.includes("design intentionality")||r.includes("interaction states")||r.includes("edge case check")||r.includes("loading state"))&&!o||(r.includes("api doc")||r.includes("endpoint should be"))&&(!s||!t?.involvesPublicAPI)||c.push(`${d.id}: ${a}`)}return c},J=n=>{let e=[],t=n.map(i=>i.id);return t.includes("move-fast")&&t.includes("compliance")&&e.push({between:["move-fast","compliance"],issue:"Speed vs traceability \u2014 shortcuts may violate audit requirements."}),t.includes("move-fast")&&t.includes("long-lived")&&e.push({between:["move-fast","long-lived"],issue:"Shipping speed vs maintainability \u2014 tech debt decisions need human approval."}),t.includes("beautiful-product")&&t.includes("move-fast")&&e.push({between:["beautiful-product","move-fast"],issue:"Design polish vs speed \u2014 which UI states can be deferred?"}),t.includes("well-engineered")&&t.includes("move-fast")&&e.push({between:["well-engineered","move-fast"],issue:"Engineering rigor vs shipping speed \u2014 which quality dimensions (tests, observability, security hardening) can be deferred to v2?"}),t.includes("well-engineered")&&t.includes("learning-project")&&e.push({between:["well-engineered","learning-project"],issue:"Engineering standards vs experimentation freedom \u2014 how much test/security/observability rigor is appropriate for an experiment?"}),e},K=(n,e)=>{let t=[];for(let i of n)for(let o of i.reviewDimensions??[])e!=null&&(o.scope==="ui"&&!e.involvesWebUI||o.scope==="api"&&!e.involvesPublicAPI||o.scope==="data"&&!e.involvesDataHandling)||t.push({...o,concernId:i.id});return t},Q=n=>{let e=[];for(let t of n)for(let i of t.registries??[])e.includes(i)||e.push(i);return e},Z=n=>n.filter(e=>e.dreamStatePrompt!==void 0&&e.dreamStatePrompt.length>0).map(e=>e.dreamStatePrompt);export{y as a,_ as b,z as c,$ as d,V as e,X as f,J as g,K as h,Q as i,Z as j};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as y}from"./chunk-
|
|
2
|
+
import{b as y}from"./chunk-PPB6ACBB.js";import{B as k,l as C,m as P,n as b,o as R}from"./chunk-LOZLXP5G.js";import{b as x,c as A}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as m,h as w,k as g}from"./chunk-SHN5MT56.js";import{c as d,d as c,f as u,g as v}from"./chunk-YVN2NZL4.js";import{a as l,b as p}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var W=async s=>{let e=s?.[0];if(e==="add")return await $(s?.slice(1));if(e==="remove")return await I(s?.slice(1));if(e==="list")return await j();let t=x(),n=m({renderer:g.ansi(),sink:w.stdout()});return n.writeln(`Usage: ${t} concern <add <id> | remove <id> | list>`),await n.close(),l(void 0)},$=async s=>{let e=m({renderer:g.ansi(),sink:w.stdout()}),{root:t}=await k(),n=(s??[]).filter(i=>!i.startsWith("-")),r=await C(t);if(n.length===0)return e.writeln(u("Please provide concern ID(s): "),d(A("concern add open-source beautiful-product"))),await e.close(),p({exitCode:1});if(r===null)return e.writeln(u("noskills not initialized.")),await e.close(),p({exitCode:1});let a=await y(),o=[];for(let i of n){let f=await b(t,i);if(f===null&&(f=a.find(h=>h.id===i)??null,f!==null&&await R(t,f)),f===null){e.writeln(u(`Unknown concern: ${i}`)),e.writeln(c(` Available: ${a.map(h=>h.id).join(", ")}`));continue}if(r.concerns.includes(i)||o.includes(i)){e.writeln(c(`Concern "${i}" is already active.`));continue}o.push(i)}if(o.length>0){let i={...r,concerns:[...r.concerns,...o]};await P(t,i),e.writeln(v("\u2714"),` Activated concerns: ${o.join(", ")}`)}return await e.close(),l(void 0)},I=async s=>{let e=m({renderer:g.ansi(),sink:w.stdout()}),{root:t}=await k(),n=s?.[0],r=await C(t);if(n===void 0||n.length===0)return e.writeln(u("Please provide a concern ID: "),d(A("concern remove move-fast"))),await e.close(),p({exitCode:1});if(r===null)return e.writeln(u("noskills not initialized.")),await e.close(),p({exitCode:1});if(!r.concerns.includes(n))return e.writeln(c(`Concern "${n}" is not active.`)),await e.close(),l(void 0);let a={...r,concerns:r.concerns.filter(o=>o!==n)};return await P(t,a),e.writeln(v("\u2714")," Deactivated concern: ",d(n)),await e.close(),l(void 0)},j=async()=>{let s=m({renderer:g.ansi(),sink:w.stdout()}),{root:e}=await k(),t=await C(e),n=await y(),r=t?.concerns??[];if(s.writeln(d("Concerns")),s.writeln(""),n.length===0)s.writeln(c(" No concerns defined."));else for(let a of n){let o=r.includes(a.id);s.writeln(" ",o?v("\u25CF"):c("\u25CB")," ",o?d(a.id):c(a.id),c(` ${a.description.slice(0,60)}...`))}return await s.close(),l(void 0)};export{W as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as k}from"./chunk-YWSOQJ7G.js";import{h as C}from"./chunk-L32KHQVT.js";import{
|
|
2
|
+
import{a as k}from"./chunk-YWSOQJ7G.js";import{h as C}from"./chunk-L32KHQVT.js";import{A as E}from"./chunk-BAVRVBBX.js";import{B as v,e as g,g as y,j as S}from"./chunk-LOZLXP5G.js";import"./chunk-2XNFZXHY.js";import{f,h as w,k as h}from"./chunk-SHN5MT56.js";import{f as n,g as u}from"./chunk-YVN2NZL4.js";import{a as d,b as a}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var j=async p=>{let e=f({renderer:h.ansi(),sink:w.stdout()}),{root:i}=await v(),s=y(p);if(!s.ok)return e.writeln(n(s.error)),await e.close(),a({exitCode:1});let m=(p??[]).filter(r=>!r.startsWith("--")),o=m[0],l=m.slice(1).join(" ");if(!o||!l)return e.writeln(n("Usage: noskills spec <name> delegate <questionId> <userName>")),await e.close(),a({exitCode:1});let t;try{t=await g(i,s.spec)}catch(r){let R=r instanceof Error?r.message:String(r);return e.writeln(n(R)),await e.close(),a({exitCode:1})}if(t.phase!=="DISCOVERY"&&t.phase!=="DISCOVERY_REVIEW")return e.writeln(n(`Cannot delegate in phase: ${t.phase}. Only during discovery.`)),await e.close(),a({exitCode:1});let c=await C(i),I=E(t,o,l,c.name);return await S(i,s.spec,I),await k(i,{ts:new Date().toISOString(),type:"delegation-created",spec:s.spec,user:c.name,question:o,from:c.name,to:l}),e.writeln(u("\u2714"),` Delegated "${o}" to ${l}`),await e.close(),d(void 0)};export{j as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as k,b as v,c as F,d as R,e as b}from"./chunk-NE2J6ISX.js";import{B as h,d as y}from"./chunk-
|
|
2
|
+
import{a as k,b as v,c as F,d as R,e as b}from"./chunk-NE2J6ISX.js";import{B as h,d as y}from"./chunk-LOZLXP5G.js";import"./chunk-2XNFZXHY.js";import{f as p,h as w,k as $}from"./chunk-SHN5MT56.js";import{c as u,d as r,f as d,g as f,h as g}from"./chunk-YVN2NZL4.js";import{a,b as c}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var U=async m=>{let e=p({renderer:$.ansi(),sink:w.stdout()}),{root:n}=await h(),l=m?.[0];if(l==="scan"){let i=await k(n);await F(n,i),e.writeln(f("\u2714"),` Found ${i.length} diagram(s):`);for(let s of i)e.writeln(` ${s.file}:${s.line} `,r(`[${s.type}]`),r(` refs: ${s.referencedFiles.length}`));return await e.close(),a(void 0)}if(l==="list"||l===void 0){let i=await v(n);if(i.length===0)return e.writeln(r("No diagrams registered. Run: noskills diagrams scan")),await e.close(),a(void 0);e.writeln(u(`${i.length} diagram(s):`));for(let s of i)e.writeln(` ${s.file}:${s.line} `,r(`[${s.type}]`),` refs: ${s.referencedFiles.join(", ")||"none"}`),e.writeln(r(` verified: ${s.lastVerified.slice(0,10)}`));return await e.close(),a(void 0)}if(l==="check"){let s=(await y(n)).execution.modifiedFiles,o=await b(n,s);if(o.length===0)e.writeln(f("\u2714")," No stale diagrams.");else{e.writeln(g(`\u26A0 ${o.length} potentially stale diagram(s):`));for(let t of o)e.writeln(` ${t.file}:${t.line} `,r(`[${t.type}]`)),e.writeln(r(` ${t.reason}`))}return await e.close(),a(void 0)}if(l==="verify"){let i=m?.[1];if(!i)return e.writeln(d("Usage: noskills diagrams verify <file>")),await e.close(),c({exitCode:1});let s;for(let t of m??[])t.startsWith("--line=")&&(s=parseInt(t.slice(7),10));return await R(n,i,s)?e.writeln(f("\u2714"),` Verified: ${i}`):e.writeln(d(`Diagram not found in registry: ${i}`)),await e.close(),a(void 0)}return e.writeln(d("Unknown subcommand. Use: scan, list, check, verify")),await e.close(),c({exitCode:1})};export{U as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as I}from"./chunk-YWSOQJ7G.js";import{a as P,d as O}from"./chunk-DI7OHJ53.js";import{h as D}from"./chunk-L32KHQVT.js";import{D as U,p as T,s as k}from"./chunk-BAVRVBBX.js";import{B as v,c as C,e as x,g as y,h as $,j as b}from"./chunk-LOZLXP5G.js";import{c as m}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as g,h as S,k as E}from"./chunk-SHN5MT56.js";import{c,d as a,f as o,g as f,h}from"./chunk-YVN2NZL4.js";import{a as u,b as n}from"./chunk-FFWPJP7A.js";import{i as w}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var B=async R=>{let e=g({renderer:E.ansi(),sink:S.stdout()}),{root:i}=await v(),p=y(R);if(!p.ok)return e.writeln(o(p.error)),await e.close(),n({exitCode:1});let t;try{t=await x(i,p.spec)}catch(s){let l=s instanceof Error?s.message:String(s);return e.writeln(o(l)),await e.close(),n({exitCode:1})}if(t.phase!=="EXECUTING")return e.writeln(o(`Cannot complete in phase: ${t.phase}`)),e.writeln(a("Only EXECUTING phase can transition to COMPLETED.")),await e.close(),n({exitCode:1});if(t.execution.awaitingStatusReport)return e.writeln(o("Cannot complete: status report is pending.")),e.writeln(a(`Submit a status report first: ${m(`next --answer='{"completed":[...],"remaining":[...]}'`)}`)),await e.close(),n({exitCode:1});if(t.execution.debt!==null&&t.execution.debt.items.length>0){e.writeln(h(`Warning: ${t.execution.debt.items.length} unresolved debt item(s).`));for(let s of t.execution.debt.items)e.writeln(a(` - ${s.id}: ${s.text}`));e.writeln("")}if(t.spec!==null){let s=`${i}/${C.specDir(t.spec)}`;try{await w.fs.stat(s)}catch{return e.writeln(o(`Active spec '${t.spec}' directory not found.`)),e.writeln(a("Run `noskills reset` to return to idle.")),await e.close(),n({exitCode:1})}}let d=await D(i),r=T(t,"done");r=k(r,"EXECUTING","COMPLETED",d),r.spec!==null&&await b(i,r.spec,r);let G=U(r);if(await $(i,G),r.spec!==null&&(await P(i,r.spec,"completed"),await O(i,r.spec,"completed")),await I(i,{ts:new Date().toISOString(),type:"phase-change",spec:t.spec??"unknown",user:d.name,from:"EXECUTING",to:"COMPLETED"}),e.writeln(f("\u2714")," Spec completed!"),e.writeln(""),e.writeln(" Spec: ",c(t.spec??"unknown")),e.writeln(` Iterations: ${t.execution.iteration}`),e.writeln(` Decisions: ${t.decisions.length}`),t.decisions.length>0){let s=t.decisions.filter(l=>l.promoted);s.length>0&&e.writeln(a(` Promoted to rules: ${s.length}`))}return e.writeln(""),e.writeln("Start a new spec with: ",c(`${m('spec new "..."')}`)),await e.close(),u(void 0)};export{B as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{h as v}from"./chunk-L32KHQVT.js";import{
|
|
2
|
+
import{h as v}from"./chunk-L32KHQVT.js";import{w as y,x as I,y as R,z as E}from"./chunk-BAVRVBBX.js";import{B as q,e as F,g as U,j as c}from"./chunk-LOZLXP5G.js";import"./chunk-2XNFZXHY.js";import{f as k,h as x,k as C}from"./chunk-SHN5MT56.js";import{d,f as o,g as p}from"./chunk-YVN2NZL4.js";import{a as l,b as i}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var Y=async w=>{let e=k({renderer:C.ansi(),sink:x.stdout()}),{root:a}=await q(),n=U(w);if(!n.ok)return e.writeln(o(n.error)),await e.close(),i({exitCode:1});let f=(w??[]).filter(s=>!s.startsWith("--")),t=f[0],m=f.slice(1).join(" "),u=null,h=!1;for(let s of w??[])s.startsWith("--answer=")&&(u=s.slice(9)),s==="--skip"&&(h=!0);if(!t)return e.writeln(o('Usage: noskills spec <name> followup <questionId> "question text"')),e.writeln(d(' Or: noskills spec <name> followup <followUpId> --answer="text"')),e.writeln(d(" Or: noskills spec <name> followup <followUpId> --skip")),await e.close(),i({exitCode:1});let r;try{r=await F(a,n.spec)}catch(s){let A=s instanceof Error?s.message:String(s);return e.writeln(o(A)),await e.close(),i({exitCode:1})}if(u!==null){let s=I(r,t,u);return await c(a,n.spec,s),e.writeln(p("\u2714"),` Answered follow-up: ${t}`),await e.close(),l(void 0)}if(h){let s=R(r,t);return await c(a,n.spec,s),e.writeln(p("\u2714"),` Skipped follow-up: ${t}`),await e.close(),l(void 0)}if(m.length===0)return e.writeln(o("Follow-up question text is required.")),await e.close(),i({exitCode:1});if(r.phase!=="DISCOVERY"&&r.phase!=="DISCOVERY_REVIEW")return e.writeln(o(`Cannot add follow-ups in phase: ${r.phase}`)),await e.close(),i({exitCode:1});let O=await v(a),g=y(r,t,m,O.name);await c(a,n.spec,g);let S=E(g,t),$=S[S.length-1];return e.writeln(p("\u2714"),` Follow-up added: ${$?.id??t}`),await e.close(),l(void 0)};export{Y as main};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
2
|
import{a}from"./chunk-PZUDTTK4.js";import{o as t}from"./chunk-5GGWX7CO.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{g as o}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var{ctx:l,output:h}=a(),n=()=>{t.info(l,`eser codebase gh \u2014 GitHub operations
|
|
3
3
|
`),console.log("Subcommands:"),console.log(" contributors Update contributor list in README.md"),console.log(" release-notes Sync CHANGELOG to GitHub Releases"),console.log(" release-tag Create and push release git tags"),console.log(`
|
|
4
|
-
Run 'eser codebase gh <subcommand> --help' for details.`)},b=async m=>{let r=m??[],e=r[0],s=r.slice(1);if(e===void 0||e==="--help"||e==="-h")return n(),o.ok(void 0);switch(e){case"contributors":return await(await import("./gh-contributors-PNU47Y7Q.js")).main(s);case"release-notes":return await(await import("./release-notes-3OMBQLOK.js")).main(s);case"release-tag":return await(await import("./release-tag-
|
|
4
|
+
Run 'eser codebase gh <subcommand> --help' for details.`)},b=async m=>{let r=m??[],e=r[0],s=r.slice(1);if(e===void 0||e==="--help"||e==="-h")return n(),o.ok(void 0);switch(e){case"contributors":return await(await import("./gh-contributors-PNU47Y7Q.js")).main(s);case"release-notes":return await(await import("./release-notes-3OMBQLOK.js")).main(s);case"release-tag":return await(await import("./release-tag-WQOAE2OF.js")).main(s);default:return t.error(l,`Unknown gh subcommand: ${e}`),n(),o.fail({exitCode:1})}};export{b as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as ae,b as re}from"./chunk-NTY267SI.js";import{d as oe}from"./chunk-L5OC7F24.js";import{a as ee}from"./chunk-
|
|
2
|
+
import{a as ae,b as re}from"./chunk-NTY267SI.js";import{d as oe}from"./chunk-L5OC7F24.js";import{a as ee}from"./chunk-KI6473LF.js";import"./chunk-4KDDHQVL.js";import{b as k}from"./chunk-PPB6ACBB.js";import{b as te,e as se,f as ne}from"./chunk-4JICYXYK.js";import"./chunk-KFVUFHJB.js";import"./chunk-NY4W44PI.js";import{d as ie}from"./chunk-2ZYCRMUT.js";import{A as Q,a as H,b as _,d as q,h as B,l as S,m as K,o as U,q as V}from"./chunk-LOZLXP5G.js";import{a as X,c as Y,d as Z}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import"./chunk-7ZYDAZBD.js";import{a as I,b as R,i as P,j as W,k as J,l as z,m as G,n as g,o as w,p as m}from"./chunk-5GGWX7CO.js";import"./chunk-GE3LJ6QM.js";import{a as N}from"./chunk-QXSFQQGJ.js";import"./chunk-BNQAZLIQ.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import"./chunk-J7YTWK67.js";import"./chunk-VKB3B2FE.js";import"./chunk-PBZV2KA3.js";import"./chunk-NMEPQK3T.js";import"./chunk-RNFCAHVL.js";import"./chunk-MG65QJY6.js";import{a as F}from"./chunk-FFWPJP7A.js";import{i as p}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var ce=N;var ye=async t=>{try{return await p.fs.stat(t),!0}catch{return!1}},Ce=[{id:"claude-code",paths:["CLAUDE.md",".claude"]},{id:"cursor",paths:[".cursorrules",".cursor"]},{id:"kiro",paths:[".kiro"]},{id:"copilot",paths:[".github/copilot-instructions.md"]},{id:"windsurf",paths:[".windsurfrules"]},{id:"codex",paths:[".codex",".codex/config.toml"]},{id:"copilot-cli",paths:[".copilot",".github/hooks"]}],le=async t=>{let e=[];for(let i of Ce)for(let n of i.paths)if(await ye(`${t}/${n}`)){e.push(i.id);break}return e};var r=async t=>{try{return await p.fs.stat(t),!0}catch{return!1}},de=async(t,e)=>{try{let i=await p.fs.readTextFile(t);return JSON.parse(i)[e]??null}catch{return null}},xe=async t=>{let e=[];return(await r(`${t}/package.json`)||await r(`${t}/deno.json`))&&e.push("typescript"),await r(`${t}/go.mod`)&&e.push("go"),await r(`${t}/Cargo.toml`)&&e.push("rust"),(await r(`${t}/pyproject.toml`)||await r(`${t}/setup.py`))&&e.push("python"),e},Te=async t=>{let e=[],i=await de(`${t}/package.json`,"dependencies");return i!==null&&("react"in i&&e.push("react"),"vue"in i&&e.push("vue"),"svelte"in i&&e.push("svelte"),"next"in i&&e.push("nextjs"),"express"in i&&e.push("express"),"hono"in i&&e.push("hono")),e},be=async t=>{let e=[];return await r(`${t}/.github/workflows`)&&e.push("github-actions"),await r(`${t}/.gitlab-ci.yml`)&&e.push("gitlab-ci"),await r(`${t}/Jenkinsfile`)&&e.push("jenkins"),await r(`${t}/.circleci`)&&e.push("circleci"),e},$e=async t=>{if(await r(`${t}/deno.json`))return"deno";let e=await de(`${t}/package.json`,"devDependencies");if(e!==null){if("vitest"in e)return"vitest";if("jest"in e)return"jest";if("playwright"in e)return"playwright"}return null},ue=async t=>{let[e,i,n,d]=await Promise.all([xe(t),Te(t),be(t),$e(t)]);return{languages:e,frameworks:i,ci:n,testRunner:d}};var qe=async t=>{let e=p.process.cwd(),i=ae(t),n=R({target:i==="agent"?"non-interactive":"interactive"}),d=re(t),h=pe(d,"--concerns"),f=pe(d,"--tools"),u=d.includes("--non-interactive")||i==="agent",x=await Q(e);W(n,"noskills init");let D=m(n,"Checking directories...");D.start(),await V(e),D.succeed("Config: .eser/");let j=m(n,"Scanning project...");j.start();let T=await ue(e);j.succeed("Project scanned");for(let s of T.languages)w.step(n,` ${s}`);for(let s of T.frameworks)w.step(n,` ${s}`);g(n);let A=m(n,"Detecting coding tools...");A.start();let L=await le(e),y=oe(),O=y!==null&&!L.includes(y)?[y]:[],C=[...new Set([...O,...L])];A.succeed(`${C.length} coding tool(s) detected`);let l;if(f!==null){let s=["claude-code","cursor","kiro","copilot","windsurf","opencode","codex","copilot-cli"],o=f.filter(a=>s.includes(a));l=[...new Set([...O,...o])]}else if(x){let s=await S(e);l=s!==null?[...s.tools]:[...C]}else u?l=[...C]:(g(n),l=await Se(n,C,y));g(n);let E=m(n,"Detecting AI providers...");E.start();let b=(await ce()).filter(s=>s.available).map(s=>s.name);E.succeed(`${b.length} provider(s) detected`),g(n);let $=await k(),c;if(h!==null){let s=$.map(o=>o.id);c=h.filter(o=>s.includes(o)).sort((o,a)=>s.indexOf(o)-s.indexOf(a))}else if(x){let s=await S(e);c=s!==null?[...s.concerns]:[]}else if(u)c=[];else{let s=$.map(a=>({value:a.id,label:a.name,hint:a.description.slice(0,60)})),o=await P(n,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:s});c=I(o)?[]:[...o]}c.length>0&&w.success(n,` Concerns: ${c.join(", ")}`),g(n);let fe=$.filter(s=>c.includes(s.id));for(let s of fe)await U(e,s);let M=await Z();X(M);let v={..._(c,l,b,T),command:M};if(await K(e,v),!x){let s=H();await B(e,s)}if(l.length>0){let s=m(n,"Syncing tool files...");s.start();let o=await ne(e,l,v);s.succeed(`Synced ${o.length} tool(s)`);for(let a of o)w.step(n,` ${a}`)}if(J(n,`Done. ${l.length} tool(s), ${b.length} provider(s), ${c.length} concern(s).`),i==="agent"){let s=await q(e),a=(await k()).filter(we=>c.includes(we.id)),ge=await te(e),me=se(v?.tools??[]),he=await ee(s,a,ge,v,void 0,void 0,void 0,me);await ie(he,"json")}else z(n),G(n,`Start a spec with: ${Y('spec new "..."')}`);return F(void 0)},Pe=[{value:"claude-code",label:"Claude Code"},{value:"cursor",label:"Cursor"},{value:"kiro",label:"Kiro"},{value:"copilot",label:"GitHub Copilot"},{value:"windsurf",label:"Windsurf"},{value:"opencode",label:"OpenCode"},{value:"codex",label:"Codex CLI"},{value:"copilot-cli",label:"Copilot CLI"}],Se=async(t,e,i)=>{let n=e.length===0?"No coding tools detected. Which tools do you use? (space to toggle)":"Any additional tools? (space to toggle, enter to skip)",d=new Set(e),h=await P(t,{message:n,options:Pe.map(u=>({...u,hint:u.value===i?"you're running inside it":d.has(u.value)?"detected":void 0,disabled:u.value===i})),initialValues:[...e],required:!1});if(I(h))return[...e];let f=[...h];return i!==null&&!f.includes(i)&&f.unshift(i),f},pe=(t,e)=>{if(t===void 0)return null;for(let i of t)if(i.startsWith(`${e}=`))return i.slice(e.length+1).split(",").map(n=>n.trim()).filter(Boolean);return null};export{qe as main};
|