noskills 4.1.30 → 4.1.32

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.
@@ -1 +1 @@
1
- import{b as o}from"./chunk-6QFROYLO.js";var n=[{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=t=>n.map(e=>({...e,extras:o(t,e.id)})),c=(t,e)=>{let r=new Set(e.map(s=>s.questionId));for(let s of t)if(!r.has(s.id))return s;return null},d=t=>{let e=new Set(t.map(r=>r.questionId));return n.every(r=>e.has(r.id))};export{n as a,a as b,c,d};
1
+ import{b as o}from"./chunk-PSXXTDLU.js";var n=[{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=t=>n.map(e=>({...e,extras:o(t,e.id)})),c=(t,e)=>{let r=new Set(e.map(s=>s.questionId));for(let s of t)if(!r.has(s.id))return s;return null},d=t=>{let e=new Set(t.map(r=>r.questionId));return n.every(r=>e.has(r.id))};export{n as a,a as b,c,d};
@@ -0,0 +1 @@
1
+ var s={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?"}],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"],acceptanceCriteria:["Public API documented","Changes reflected in README or API docs","No exclusionary patterns introduced"]};var r={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:"ambition",text:"In the 10-star version, what does the user feel?"}],specSections:["Design States (empty, loading, error, success)","Mobile Layout","Interaction Design"],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"],acceptanceCriteria:["All UI states designed (empty, loading, error, success)","Mobile layout considered","No placeholder or skeleton UI left unfinished"]};var a={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:"scope_boundary",text:"What technical debt would this introduce?"}],specSections:["Migration & Deprecation","Backward Compatibility"],reminders:["Favor boring technology over shiny new tools","Every shortcut needs explicit justification","Consider maintenance burden for new dependencies"],acceptanceCriteria:["Backward compatibility preserved","Migration path documented if breaking","No unnecessary new dependencies"]};var c={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"]};var d={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"]};var l={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"]};var u=[s,r,a,c,d,l];var N=()=>Promise.resolve(u),U=(t,n)=>{let e=[];for(let i of t)for(let o of i.extras)o.questionId===n&&e.push(o);return e},F=t=>{let n=[];for(let e of t)for(let i of e.reminders)n.push(`${e.id}: ${i}`);return n},_=t=>{let n=[],e=t.map(i=>i.id);return e.includes("move-fast")&&e.includes("compliance")&&n.push({between:["move-fast","compliance"],issue:"Speed vs traceability \u2014 shortcuts may violate audit requirements."}),e.includes("move-fast")&&e.includes("long-lived")&&n.push({between:["move-fast","long-lived"],issue:"Shipping speed vs maintainability \u2014 tech debt decisions need human approval."}),e.includes("beautiful-product")&&e.includes("move-fast")&&n.push({between:["beautiful-product","move-fast"],issue:"Design polish vs speed \u2014 which UI states can be deferred?"}),n};export{N as a,U as b,F as c,_ as d};
@@ -1 +1 @@
1
- import{b as P,d as R}from"./chunk-I6ISQXVP.js";import{c as k,d as C}from"./chunk-6QFROYLO.js";import{a as S}from"./chunk-UXRWSNVZ.js";var I=null,n=e=>S(e,I),$="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.",T=(e,o,r,i)=>{let l=e.execution.iteration>=o,s=r?[]:[$],u=i?.outOfScope??[];switch(e.phase){case"DISCOVERY":return{rules:[...s,"Ask the question exactly as written. Do not rephrase or add your own questions.","Relay the user's answer back verbatim. Do not interpret or summarize.","Do not start coding or exploring the codebase. Discovery is conversation only."],tone:"Conversational. You are a messenger between noskills and the user."};case"SPEC_DRAFT":return{rules:[...s,"Present the spec to the user for review. Do not modify it.","If the user requests changes, relay them \u2014 do not implement them.","Do not start coding. The spec must be approved first."],tone:"Brief. The user is reviewing, not discussing."};case"SPEC_APPROVED":return{rules:[...s,"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."],tone:"Patient. Wait for the go signal."};case"EXECUTING":{let a=[...s,"Do not explore the codebase beyond what the current task requires.","Do not refactor, improve, or modify code outside this task's scope.","Do not add features, tests, or documentation not specified in the spec.","If you need to read files to understand context, timebox it \u2014 then write code.","The deliverable is working code, not a plan or analysis.","Complete the task, then report progress. The user handles git.",`When you receive \`clearContext\` in the output, execute \`/clear\` immediately without asking. After clearing, read \`CLAUDE.md\` and run \`${n("next")}\`.`,`When you discover a pattern, receive a correction, or identify a recurring preference from the user, ask: 'Should this be a permanent rule for this project, or just for this task?' If permanent, run: \`${n('rule add "<description>"')}\`. If just this task, note it and move on. Never write to \`.eser/rules/\` directly.`];e.execution.lastVerification?.passed===!1&&a.push("Tests are failing. Fix ONLY the failing tests. Do not refactor passing code.");let t={rules:a,tone:"Direct. No preamble. Start coding immediately.",outOfScope:u.length>0?u:void 0};return l?{...t,urgency:`You have been in this session for ${e.execution.iteration}+ iterations. Your context is degrading. Finish the current task and recommend the user start a fresh session. Do not start new tasks.`}:t}case"BLOCKED":return{rules:[...s,"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"DONE":return{rules:[...s,"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:[...s,`Run \`${n("next")}\` to get your instructions.`,"Do not take action without noskills guidance."],tone:"Neutral. Waiting for direction."}}},B=5*60*1e3,N=(e,o)=>{let r;switch(e.phase){case"IDLE":r=`No active spec. Start one with: \`${n("spec new")}\``;break;case"DISCOVERY":r=`Discovery in progress for "${e.spec}". ${e.discovery.answers.length} questions answered so far.`;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"DONE":r=`Spec "${e.spec}" completed in ${e.execution.iteration} iterations.`;break;default:r=`Run \`${n("next")}\` to get started.`}return{protocol:`Run \`${n('next --answer="..."')}\` to submit results and advance`,spec:e.spec,branch:e.branch,iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,activeConcerns:o.map(i=>i.id),resumeHint:r}},F=e=>{if(e.lastCalledAt===null)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE",how:`Run \`${n("next")}\` for instructions. Submit results with \`${n('next --answer="..."')}\`. Never make architectural decisions without asking.`,currentPhase:e.phase};let o=new Date(e.lastCalledAt).getTime();if(Date.now()-o>B)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE",how:`Run \`${n("next")}\` for instructions. Submit results with \`${n('next --answer="..."')}\`. Never make architectural decisions without asking.`,currentPhase:e.phase}},H=(e,o,r,i,l,s)=>{I=i??null;let u=N(e,o),a=i?.maxIterationsBeforeRestart??15,t=i?.allowGit??!1,h=T(e,a,t,l),f=F(e),d;switch(e.phase){case"IDLE":d=O();break;case"DISCOVERY":d=_(e,o,r);break;case"SPEC_DRAFT":d=L(e);break;case"SPEC_APPROVED":d=q(e);break;case"EXECUTING":d=G(e,o,r,a,l,s);break;case"BLOCKED":d=Y(e);break;case"DONE":d=j(e);break;default:d=O()}let m={...d,meta:u,behavioral:h};return f!==void 0&&(m={...m,protocolGuide:f}),e.pendingClear&&(m={...m,clearContext:{action:"clear_context",reason:`Task complete. Run \`/clear\` now. After clearing, read \`CLAUDE.md\` and run \`${n("next")}\` to continue.`},instruction:`Task accepted. Run \`/clear\` immediately to start fresh for the next task. After clearing, run \`${n("next")}\`.`}),m},O=()=>({phase:"IDLE",instruction:`No active spec. Start one with: \`${n('spec new "description"')}\``}),_=(e,o,r)=>{let i=P(o),l=e.discovery.answers.length;if(R(e.discovery.answers))return{phase:"DISCOVERY",instruction:`All discovery questions answered. Run: \`${n("approve")}\``,questions:[],answeredCount:l,context:{rules:r,concernReminders:[]},transition:{onComplete:n("approve")}};let u=new Set(e.discovery.answers.map(t=>t.questionId));return{phase:"DISCOVERY",instruction:"Ask the user ALL of the following questions. Collect answers for each, then submit them all at once as a JSON object.",questions:i.filter(t=>!u.has(t.id)).map(t=>({id:t.id,text:t.text,concerns:[...t.concerns],extras:t.extras.map(h=>h.text)})),answeredCount:l,context:{rules:r,concernReminders:k(o)},transition:{onComplete:`${n(`next --answer='{"status_quo":"...","ambition":"...",...}'`)}`}}},L=e=>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:`${n(`next --answer='{"involvesUI":false,"involvesPublicAPI":false,"involvesMigration":false,"involvesDataHandling":false}'`)}`},classificationRequired:!0,classificationPrompt:{options:[{id:"involvesUI",label:"User-facing UI"},{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: `"+n(`next --answer='{"involvesUI":true,"involvesPublicAPI":false,...}'`)+"`"}}:{phase:"SPEC_DRAFT",instruction:"Spec draft is ready for review. Ask the user to review and approve.",specPath:e.specState.path??"",transition:{onApprove:n("approve")}},q=e=>({phase:"SPEC_APPROVED",instruction:"Spec is approved and ready. When the user is ready to start, begin execution.",specPath:e.specState.path??"",transition:{onStart:`${n('next --answer="start"')}`}}),U=(e,o)=>{if(o===null)return!1;switch(e){case"beautiful-product":return o.involvesUI;case"open-source":return o.involvesPublicAPI;case"long-lived":return o.involvesMigration;case"compliance":return o.involvesDataHandling;default:return!0}},V=(e,o,r,i,l,s,u)=>{let a=[];if(i!==null)for(let t of i.items)a.push(`[DEBT from iteration ${i.fromIteration}] ${t}`);if(o&&a.push(`[FAILED] Tests \u2014 fix this first: ${r.slice(0,200)}`),s!=null)for(let t of s.verification)a.push(t);for(let t of e)if(U(t.id,l)&&t.acceptanceCriteria!==void 0&&t.acceptanceCriteria.length>0)for(let h of t.acceptanceCriteria)a.push(`(${t.id}) ${h}`);if(u!==void 0)for(let t of u)a.push(`(folder: ${t.folder}) ${t.rule}`);return a},G=(e,o,r,i,l,s)=>{let u=C(o),a=e.execution.iteration>=i,t=e.execution.lastVerification?.passed===!1,h=e.execution.lastVerification?.output??"",f=l?.tasks??[],d=e.execution.completedTasks??[],m=new Set(d),D=f.find(p=>!m.has(p.id))??null,y=D!==null?{id:D.id,title:D.title,totalTasks:f.length,completedTasks:d.length}:void 0;if(e.execution.awaitingStatusReport){let p=V(o,t,h,e.execution.debt,e.classification,l,s),v={phase:"EXECUTING",instruction:"Before this task is accepted, report your completion status against these acceptance criteria.",context:{rules:r,concernReminders:k(o)},transition:{onComplete:`${n(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`)}`,onBlocked:`${n('block "reason"')}`,iteration:e.execution.iteration},statusReportRequired:!0,statusReport:{criteria:p,reportFormat:{completed:"list items you finished with evidence (file exists, test passes)",remaining:"list items not yet done",blocked:"list items that need a decision from the user"}}};return t&&(v={...v,verificationFailed:!0,verificationOutput:h.slice(0,2e3)}),v}let w=(e.execution.lastProgress??"").includes("Task not accepted"),x=e.execution.debt?.items??[],E=e.execution.debt?.unaddressedIterations??0,A=y!==void 0?`Execute task ${y.id}: ${y.title} (${y.completedTasks}/${y.totalTasks} completed)`:"All tasks completed. Run `"+n("done")+"` to finish.",b;if(t)b="Verification FAILED. Fix the failing tests before continuing.";else if(w&&x.length>0){let p=E>=3?` These items have been outstanding for ${E} iterations.`:"";b=`Task not accepted \u2014 ${x.length} remaining item(s) must be addressed before this task can be completed.${p} Address them, then submit a new status report.`}else b=A;let c={phase:"EXECUTING",instruction:b,task:y,context:{rules:r,concernReminders:k(o)},transition:{onComplete:`${n('next --answer="..."')}`,onBlocked:`${n('block "reason"')}`,iteration:e.execution.iteration}};if(w&&x.length>0&&(c={...c,taskRejected:!0,rejectionReason:`${x.length} remaining item(s) must be addressed.`,rejectionRemaining:x}),e.execution.debt!==null&&e.execution.debt.items.length>0){let p=e.execution.debt.unaddressedIterations??0,v=p>=3?`URGENT: These items have been unaddressed for ${p} iterations. Address them IMMEDIATELY before any new work.`:"These were not completed in a previous iteration. Address them BEFORE starting new work.";c={...c,previousIterationDebt:{fromIteration:e.execution.debt.fromIteration,items:e.execution.debt.items,note:v}}}if(t){let p=h.slice(0,2e3);c={...c,verificationFailed:!0,verificationOutput:p}}u.length>0&&(c={...c,concernTensions:u}),a&&(c={...c,restartRecommended:!0,restartInstruction:`Context may be getting large after ${e.execution.iteration} iterations. Consider starting a new conversation and running \`${n("next")}\` to resume - your progress is saved.`});let g=[...e.decisions].reverse().find(p=>!p.promoted);return g!==void 0&&e.execution.lastProgress?.startsWith("Resolved:")&&(c={...c,promotePrompt:{decisionId:g.id,question:g.question,choice:g.choice,prompt:`You just resolved a decision: "${g.choice}". Ask the user: "Should this be a permanent rule for future specs too?" If yes, run: \`${n(`rule add "${g.choice}"`)}\``}}),c},Y=e=>({phase:"BLOCKED",instruction:"A decision is needed. Ask the user.",reason:e.execution.lastProgress??"Unknown",transition:{onResolved:`${n('next --answer="..."')}`}}),j=e=>({phase:"DONE",summary:{spec:e.spec,iterations:e.execution.iteration,decisionsCount:e.decisions.length}});export{H as a};
1
+ import{b as P,d as R}from"./chunk-BLHOTPRB.js";import{c as k,d as C}from"./chunk-PSXXTDLU.js";import{a as S}from"./chunk-UXRWSNVZ.js";var I=null,n=e=>S(e,I),$="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.",T=(e,o,r,i)=>{let l=e.execution.iteration>=o,s=r?[]:[$],u=i?.outOfScope??[];switch(e.phase){case"DISCOVERY":return{rules:[...s,"Ask the question exactly as written. Do not rephrase or add your own questions.","Relay the user's answer back verbatim. Do not interpret or summarize.","Do not start coding or exploring the codebase. Discovery is conversation only."],tone:"Conversational. You are a messenger between noskills and the user."};case"SPEC_DRAFT":return{rules:[...s,"Present the spec to the user for review. Do not modify it.","If the user requests changes, relay them \u2014 do not implement them.","Do not start coding. The spec must be approved first."],tone:"Brief. The user is reviewing, not discussing."};case"SPEC_APPROVED":return{rules:[...s,"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."],tone:"Patient. Wait for the go signal."};case"EXECUTING":{let a=[...s,"Do not explore the codebase beyond what the current task requires.","Do not refactor, improve, or modify code outside this task's scope.","Do not add features, tests, or documentation not specified in the spec.","If you need to read files to understand context, timebox it \u2014 then write code.","The deliverable is working code, not a plan or analysis.","Complete the task, then report progress. The user handles git.",`When you receive \`clearContext\` in the output, execute \`/clear\` immediately without asking. After clearing, read \`CLAUDE.md\` and run \`${n("next")}\`.`,`When you discover a pattern, receive a correction, or identify a recurring preference from the user, ask: 'Should this be a permanent rule for this project, or just for this task?' If permanent, run: \`${n('rule add "<description>"')}\`. If just this task, note it and move on. Never write to \`.eser/rules/\` directly.`];e.execution.lastVerification?.passed===!1&&a.push("Tests are failing. Fix ONLY the failing tests. Do not refactor passing code.");let t={rules:a,tone:"Direct. No preamble. Start coding immediately.",outOfScope:u.length>0?u:void 0};return l?{...t,urgency:`You have been in this session for ${e.execution.iteration}+ iterations. Your context is degrading. Finish the current task and recommend the user start a fresh session. Do not start new tasks.`}:t}case"BLOCKED":return{rules:[...s,"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"DONE":return{rules:[...s,"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:[...s,`Run \`${n("next")}\` to get your instructions.`,"Do not take action without noskills guidance."],tone:"Neutral. Waiting for direction."}}},B=5*60*1e3,N=(e,o)=>{let r;switch(e.phase){case"IDLE":r=`No active spec. Start one with: \`${n("spec new")}\``;break;case"DISCOVERY":r=`Discovery in progress for "${e.spec}". ${e.discovery.answers.length} questions answered so far.`;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"DONE":r=`Spec "${e.spec}" completed in ${e.execution.iteration} iterations.`;break;default:r=`Run \`${n("next")}\` to get started.`}return{protocol:`Run \`${n('next --answer="..."')}\` to submit results and advance`,spec:e.spec,branch:e.branch,iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,activeConcerns:o.map(i=>i.id),resumeHint:r}},F=e=>{if(e.lastCalledAt===null)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE",how:`Run \`${n("next")}\` for instructions. Submit results with \`${n('next --answer="..."')}\`. Never make architectural decisions without asking.`,currentPhase:e.phase};let o=new Date(e.lastCalledAt).getTime();if(Date.now()-o>B)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE",how:`Run \`${n("next")}\` for instructions. Submit results with \`${n('next --answer="..."')}\`. Never make architectural decisions without asking.`,currentPhase:e.phase}},H=(e,o,r,i,l,s)=>{I=i??null;let u=N(e,o),a=i?.maxIterationsBeforeRestart??15,t=i?.allowGit??!1,h=T(e,a,t,l),f=F(e),d;switch(e.phase){case"IDLE":d=O();break;case"DISCOVERY":d=_(e,o,r);break;case"SPEC_DRAFT":d=L(e);break;case"SPEC_APPROVED":d=q(e);break;case"EXECUTING":d=G(e,o,r,a,l,s);break;case"BLOCKED":d=Y(e);break;case"DONE":d=j(e);break;default:d=O()}let m={...d,meta:u,behavioral:h};return f!==void 0&&(m={...m,protocolGuide:f}),e.pendingClear&&(m={...m,clearContext:{action:"clear_context",reason:`Task complete. Run \`/clear\` now. After clearing, read \`CLAUDE.md\` and run \`${n("next")}\` to continue.`},instruction:`Task accepted. Run \`/clear\` immediately to start fresh for the next task. After clearing, run \`${n("next")}\`.`}),m},O=()=>({phase:"IDLE",instruction:`No active spec. Start one with: \`${n('spec new "description"')}\``}),_=(e,o,r)=>{let i=P(o),l=e.discovery.answers.length;if(R(e.discovery.answers))return{phase:"DISCOVERY",instruction:`All discovery questions answered. Run: \`${n("approve")}\``,questions:[],answeredCount:l,context:{rules:r,concernReminders:[]},transition:{onComplete:n("approve")}};let u=new Set(e.discovery.answers.map(t=>t.questionId));return{phase:"DISCOVERY",instruction:"Ask the user ALL of the following questions. Collect answers for each, then submit them all at once as a JSON object.",questions:i.filter(t=>!u.has(t.id)).map(t=>({id:t.id,text:t.text,concerns:[...t.concerns],extras:t.extras.map(h=>h.text)})),answeredCount:l,context:{rules:r,concernReminders:k(o)},transition:{onComplete:`${n(`next --answer='{"status_quo":"...","ambition":"...",...}'`)}`}}},L=e=>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:`${n(`next --answer='{"involvesUI":false,"involvesPublicAPI":false,"involvesMigration":false,"involvesDataHandling":false}'`)}`},classificationRequired:!0,classificationPrompt:{options:[{id:"involvesUI",label:"User-facing UI"},{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: `"+n(`next --answer='{"involvesUI":true,"involvesPublicAPI":false,...}'`)+"`"}}:{phase:"SPEC_DRAFT",instruction:"Spec draft is ready for review. Ask the user to review and approve.",specPath:e.specState.path??"",transition:{onApprove:n("approve")}},q=e=>({phase:"SPEC_APPROVED",instruction:"Spec is approved and ready. When the user is ready to start, begin execution.",specPath:e.specState.path??"",transition:{onStart:`${n('next --answer="start"')}`}}),U=(e,o)=>{if(o===null)return!1;switch(e){case"beautiful-product":return o.involvesUI;case"open-source":return o.involvesPublicAPI;case"long-lived":return o.involvesMigration;case"compliance":return o.involvesDataHandling;default:return!0}},V=(e,o,r,i,l,s,u)=>{let a=[];if(i!==null)for(let t of i.items)a.push(`[DEBT from iteration ${i.fromIteration}] ${t}`);if(o&&a.push(`[FAILED] Tests \u2014 fix this first: ${r.slice(0,200)}`),s!=null)for(let t of s.verification)a.push(t);for(let t of e)if(U(t.id,l)&&t.acceptanceCriteria!==void 0&&t.acceptanceCriteria.length>0)for(let h of t.acceptanceCriteria)a.push(`(${t.id}) ${h}`);if(u!==void 0)for(let t of u)a.push(`(folder: ${t.folder}) ${t.rule}`);return a},G=(e,o,r,i,l,s)=>{let u=C(o),a=e.execution.iteration>=i,t=e.execution.lastVerification?.passed===!1,h=e.execution.lastVerification?.output??"",f=l?.tasks??[],d=e.execution.completedTasks??[],m=new Set(d),D=f.find(p=>!m.has(p.id))??null,y=D!==null?{id:D.id,title:D.title,totalTasks:f.length,completedTasks:d.length}:void 0;if(e.execution.awaitingStatusReport){let p=V(o,t,h,e.execution.debt,e.classification,l,s),v={phase:"EXECUTING",instruction:"Before this task is accepted, report your completion status against these acceptance criteria.",context:{rules:r,concernReminders:k(o)},transition:{onComplete:`${n(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`)}`,onBlocked:`${n('block "reason"')}`,iteration:e.execution.iteration},statusReportRequired:!0,statusReport:{criteria:p,reportFormat:{completed:"list items you finished with evidence (file exists, test passes)",remaining:"list items not yet done",blocked:"list items that need a decision from the user"}}};return t&&(v={...v,verificationFailed:!0,verificationOutput:h.slice(0,2e3)}),v}let w=(e.execution.lastProgress??"").includes("Task not accepted"),x=e.execution.debt?.items??[],E=e.execution.debt?.unaddressedIterations??0,A=y!==void 0?`Execute task ${y.id}: ${y.title} (${y.completedTasks}/${y.totalTasks} completed)`:"All tasks completed. Run `"+n("done")+"` to finish.",b;if(t)b="Verification FAILED. Fix the failing tests before continuing.";else if(w&&x.length>0){let p=E>=3?` These items have been outstanding for ${E} iterations.`:"";b=`Task not accepted \u2014 ${x.length} remaining item(s) must be addressed before this task can be completed.${p} Address them, then submit a new status report.`}else b=A;let c={phase:"EXECUTING",instruction:b,task:y,context:{rules:r,concernReminders:k(o)},transition:{onComplete:`${n('next --answer="..."')}`,onBlocked:`${n('block "reason"')}`,iteration:e.execution.iteration}};if(w&&x.length>0&&(c={...c,taskRejected:!0,rejectionReason:`${x.length} remaining item(s) must be addressed.`,rejectionRemaining:x}),e.execution.debt!==null&&e.execution.debt.items.length>0){let p=e.execution.debt.unaddressedIterations??0,v=p>=3?`URGENT: These items have been unaddressed for ${p} iterations. Address them IMMEDIATELY before any new work.`:"These were not completed in a previous iteration. Address them BEFORE starting new work.";c={...c,previousIterationDebt:{fromIteration:e.execution.debt.fromIteration,items:e.execution.debt.items,note:v}}}if(t){let p=h.slice(0,2e3);c={...c,verificationFailed:!0,verificationOutput:p}}u.length>0&&(c={...c,concernTensions:u}),a&&(c={...c,restartRecommended:!0,restartInstruction:`Context may be getting large after ${e.execution.iteration} iterations. Consider starting a new conversation and running \`${n("next")}\` to resume - your progress is saved.`});let g=[...e.decisions].reverse().find(p=>!p.promoted);return g!==void 0&&e.execution.lastProgress?.startsWith("Resolved:")&&(c={...c,promotePrompt:{decisionId:g.id,question:g.question,choice:g.choice,prompt:`You just resolved a decision: "${g.choice}". Ask the user: "Should this be a permanent rule for future specs too?" If yes, run: \`${n(`rule add "${g.choice}"`)}\``}}),c},Y=e=>({phase:"BLOCKED",instruction:"A decision is needed. Ask the user.",reason:e.execution.lastProgress??"Unknown",transition:{onResolved:`${n('next --answer="..."')}`}}),j=e=>({phase:"DONE",summary:{spec:e.spec,iterations:e.execution.iteration,decisionsCount:e.decisions.length}});export{H as a};
@@ -1 +1 @@
1
- import{a as C}from"./chunk-6QFROYLO.js";import{a as y,b as P}from"./chunk-UXRWSNVZ.js";import{k as g,l as b,m as A,n as x}from"./chunk-OJUA2UZK.js";import{c,d as o,f as u,g as v,o as p,q as m,r as w}from"./chunk-4IFPLK7L.js";import{a,b as d}from"./chunk-2N4GTHXQ.js";import{a as f}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var q=async r=>{let e=r?.[0];if(e==="add")return await $(r?.slice(1));if(e==="remove")return await M(r?.slice(1));if(e==="list")return await I();let i=await g(f.process.cwd()),n=P(i),s=p({renderer:w.ansi(),sink:m.stdout()});return s.writeln(`Usage: ${n} concern <add <id> | remove <id> | list>`),await s.close(),a(void 0)},$=async r=>{let e=p({renderer:w.ansi(),sink:m.stdout()}),i=f.process.cwd(),n=r?.[0],s=await g(i);if(n===void 0||n.length===0)return e.writeln(u("Please provide a concern ID: "),c(y("concern add open-source",s))),await e.close(),d({exitCode:1});let t=await A(i,n);if(t===null&&(t=(await C()).find(h=>h.id===n)??null,t!==null&&await x(i,t)),t===null){let k=await C();return e.writeln(u(`Unknown concern: ${n}`)),k.length>0&&e.writeln(o(` Available: ${k.map(h=>h.id).join(", ")}`)),await e.close(),d({exitCode:1})}if(s===null)return e.writeln(u("noskills not initialized.")),await e.close(),d({exitCode:1});if(s.concerns.includes(n))return e.writeln(o(`Concern "${n}" is already active.`)),await e.close(),a(void 0);let l={...s,concerns:[...s.concerns,n]};return await b(i,l),e.writeln(v("\u2714")," Activated concern: ",c(n)),e.writeln(o(` ${t.description}`)),await e.close(),a(void 0)},M=async r=>{let e=p({renderer:w.ansi(),sink:m.stdout()}),i=f.process.cwd(),n=r?.[0],s=await g(i);if(n===void 0||n.length===0)return e.writeln(u("Please provide a concern ID: "),c(y("concern remove move-fast",s))),await e.close(),d({exitCode:1});if(s===null)return e.writeln(u("noskills not initialized.")),await e.close(),d({exitCode:1});if(!s.concerns.includes(n))return e.writeln(o(`Concern "${n}" is not active.`)),await e.close(),a(void 0);let t={...s,concerns:s.concerns.filter(l=>l!==n)};return await b(i,t),e.writeln(v("\u2714")," Deactivated concern: ",c(n)),await e.close(),a(void 0)},I=async()=>{let r=p({renderer:w.ansi(),sink:m.stdout()}),e=f.process.cwd(),i=await g(e),n=await C(),s=i?.concerns??[];if(r.writeln(c("Concerns")),r.writeln(""),n.length===0)r.writeln(o(" No concerns defined."));else for(let t of n){let l=s.includes(t.id);r.writeln(" ",l?v("\u25CF"):o("\u25CB")," ",l?c(t.id):o(t.id),o(` ${t.description.slice(0,60)}...`))}return await r.close(),a(void 0)};export{q as main};
1
+ import{a as C}from"./chunk-PSXXTDLU.js";import{a as y,b as P}from"./chunk-UXRWSNVZ.js";import{k as g,l as b,m as A,n as x}from"./chunk-OJUA2UZK.js";import{c,d as o,f as u,g as v,o as p,q as m,r as w}from"./chunk-4IFPLK7L.js";import{a,b as d}from"./chunk-2N4GTHXQ.js";import{a as f}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var q=async r=>{let e=r?.[0];if(e==="add")return await $(r?.slice(1));if(e==="remove")return await M(r?.slice(1));if(e==="list")return await I();let i=await g(f.process.cwd()),n=P(i),s=p({renderer:w.ansi(),sink:m.stdout()});return s.writeln(`Usage: ${n} concern <add <id> | remove <id> | list>`),await s.close(),a(void 0)},$=async r=>{let e=p({renderer:w.ansi(),sink:m.stdout()}),i=f.process.cwd(),n=r?.[0],s=await g(i);if(n===void 0||n.length===0)return e.writeln(u("Please provide a concern ID: "),c(y("concern add open-source",s))),await e.close(),d({exitCode:1});let t=await A(i,n);if(t===null&&(t=(await C()).find(h=>h.id===n)??null,t!==null&&await x(i,t)),t===null){let k=await C();return e.writeln(u(`Unknown concern: ${n}`)),k.length>0&&e.writeln(o(` Available: ${k.map(h=>h.id).join(", ")}`)),await e.close(),d({exitCode:1})}if(s===null)return e.writeln(u("noskills not initialized.")),await e.close(),d({exitCode:1});if(s.concerns.includes(n))return e.writeln(o(`Concern "${n}" is already active.`)),await e.close(),a(void 0);let l={...s,concerns:[...s.concerns,n]};return await b(i,l),e.writeln(v("\u2714")," Activated concern: ",c(n)),e.writeln(o(` ${t.description}`)),await e.close(),a(void 0)},M=async r=>{let e=p({renderer:w.ansi(),sink:m.stdout()}),i=f.process.cwd(),n=r?.[0],s=await g(i);if(n===void 0||n.length===0)return e.writeln(u("Please provide a concern ID: "),c(y("concern remove move-fast",s))),await e.close(),d({exitCode:1});if(s===null)return e.writeln(u("noskills not initialized.")),await e.close(),d({exitCode:1});if(!s.concerns.includes(n))return e.writeln(o(`Concern "${n}" is not active.`)),await e.close(),a(void 0);let t={...s,concerns:s.concerns.filter(l=>l!==n)};return await b(i,t),e.writeln(v("\u2714")," Deactivated concern: ",c(n)),await e.close(),a(void 0)},I=async()=>{let r=p({renderer:w.ansi(),sink:m.stdout()}),e=f.process.cwd(),i=await g(e),n=await C(),s=i?.concerns??[];if(r.writeln(c("Concerns")),r.writeln(""),n.length===0)r.writeln(o(" No concerns defined."));else for(let t of n){let l=s.includes(t.id);r.writeln(" ",l?v("\u25CF"):o("\u25CB")," ",l?c(t.id):o(t.id),o(` ${t.description.slice(0,60)}...`))}return await r.close(),a(void 0)};export{q as main};
@@ -1 +1 @@
1
- import{a as G,b as z}from"./chunk-M2ZPJN26.js";import{a as $,b as R,e as T,f as M,g as j,h as r,i as u}from"./chunk-AB4ZUDV6.js";import{b as q}from"./chunk-QEEZKZXM.js";import"./chunk-AGPCY6XP.js";import{a as v}from"./chunk-RVIPYZ7F.js";import{a as U}from"./chunk-6QFROYLO.js";import{a as w}from"./chunk-UXRWSNVZ.js";import{a as I,b as D,f as E,k as J,l as L,n as F,p as O,r as N}from"./chunk-OJUA2UZK.js";import"./chunk-4IFPLK7L.js";import"./chunk-5MN3MWQN.js";import"./chunk-OLM5RTFK.js";import{a as A}from"./chunk-LZSLKXJE.js";import{a as b}from"./chunk-2N4GTHXQ.js";import"./chunk-6C2MLMD6.js";import{a as l}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var Y=new A({description:"AI provider interface \u2014 ask questions, generate content",modules:{ask:{description:"Send a prompt to an AI provider",load:()=>import("./ask-TR4ZPBU5.js")},list:{description:"List available AI providers",load:()=>import("./list-UT3MSC6R.js")}}});var W=v;var te=async t=>{try{return await l.fs.stat(t),!0}catch{return!1}},oe=[{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"]}],_=async t=>{let e=[];for(let n of oe)for(let o of n.paths)if(await te(`${t}/${o}`)){e.push(n.id);break}return e};var i=async t=>{try{return await l.fs.stat(t),!0}catch{return!1}},H=async(t,e)=>{try{let n=await l.fs.readTextFile(t);return JSON.parse(n)[e]??null}catch{return null}},ne=async t=>{let e=[];return(await i(`${t}/package.json`)||await i(`${t}/deno.json`))&&e.push("typescript"),await i(`${t}/go.mod`)&&e.push("go"),await i(`${t}/Cargo.toml`)&&e.push("rust"),(await i(`${t}/pyproject.toml`)||await i(`${t}/setup.py`))&&e.push("python"),e},re=async t=>{let e=[],n=await H(`${t}/package.json`,"dependencies");return n!==null&&("react"in n&&e.push("react"),"vue"in n&&e.push("vue"),"svelte"in n&&e.push("svelte"),"next"in n&&e.push("nextjs"),"express"in n&&e.push("express"),"hono"in n&&e.push("hono")),e},ie=async t=>{let e=[];return await i(`${t}/.github/workflows`)&&e.push("github-actions"),await i(`${t}/.gitlab-ci.yml`)&&e.push("gitlab-ci"),await i(`${t}/Jenkinsfile`)&&e.push("jenkins"),await i(`${t}/.circleci`)&&e.push("circleci"),e},ae=async t=>{if(await i(`${t}/deno.json`))return"deno";let e=await H(`${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},K=async t=>{let[e,n,o,f]=await Promise.all([ne(t),re(t),ie(t),ae(t)]);return{languages:e,frameworks:n,ci:o,testRunner:f}};var at=async t=>{let e=l.process.cwd(),n=G(t),o=R({target:n==="agent"?"non-interactive":"interactive"}),f=z(t),x=le(f,"--concerns"),Q=f.includes("--non-interactive")||n==="agent";if(await N(e)){let s=await J(e);return r.warn(o,"noskills is already initialized in this project."),r.info(o,`Run \`${w("sync",s)}\` to regenerate tool files.`),b(void 0)}M(o,"noskills init");let C=u(o,"Scanning project...");C.start();let d=await K(e);C.succeed("Project scanned");for(let s of d.languages)r.step(o,` ${s}`);for(let s of d.frameworks)r.step(o,` ${s}`);for(let s of d.ci)r.step(o,` ${s}`);d.testRunner!==null&&r.step(o,` test runner: ${d.testRunner}`);let B=u(o,"Detecting coding tools...");B.start();let p=await _(e);B.succeed(`${p.length} coding tool(s) detected`);for(let s of p)r.step(o,` ${s}`);let P=u(o,"Detecting AI providers...");P.start();let m=(await W()).filter(s=>s.available).map(s=>s.name);P.succeed(`${m.length} provider(s) detected`);let h=await U(),c;if(x!==null){let s=h.map(a=>a.id);c=x.filter(a=>s.includes(a)).sort((a,g)=>s.indexOf(a)-s.indexOf(g))}else if(Q)c=[];else{let s=h.map(g=>({value:g.id,label:g.name,hint:g.description.slice(0,60)})),a=await T(o,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:s});c=$(a)?[]:[...a]}c.length>0?r.success(o,`Concerns: ${c.join(", ")}`):r.info(o,"No concerns selected. Add later with `concern add <id>`.");let k=de(),S=u(o,"Initializing...");S.start(),await O(e);let V=h.filter(s=>c.includes(s.id));for(let s of V)await F(e,s);let y={...D(c,p,m,d),command:k};await L(e,y);let X=I();if(await E(e,X),S.succeed("Scaffolded `.eser/`"),p.length>0){let s=u(o,"Syncing tool files...");s.start();let a=await q(e,p,y);s.succeed(`Synced ${a.length} tool(s)`)}return r.success(o,`Done. ${p.length} tool(s), ${m.length} provider(s), ${c.length} concern(s).`),r.info(o,`Command prefix: ${k}`),j(o,`Start a spec with: ${w('spec new "..."',y)}`),b(void 0)},le=(t,e)=>{if(t===void 0)return null;for(let n of t)if(n.startsWith(`${e}=`))return n.slice(e.length+1).split(",").map(o=>o.trim()).filter(Boolean);return null},de=()=>{try{let e=l.process.args.join(" ");if(e.includes("jsr:@eser/noskills"))return"deno run jsr:@eser/noskills";if(e.includes("noskills/main.ts"))return"deno run --allow-all ./pkg/@eser/noskills/main.ts";if(e.includes("eser")&&e.includes("nos")&&!e.includes("noskills"))return"eser nos";if(e.includes("eser")&&e.includes("noskills"))return"eser noskills"}catch{}return"npx eser noskills"};export{at as main};
1
+ import{a as G,b as z}from"./chunk-M2ZPJN26.js";import{a as $,b as R,e as T,f as M,g as j,h as r,i as u}from"./chunk-AB4ZUDV6.js";import{b as q}from"./chunk-QEEZKZXM.js";import"./chunk-AGPCY6XP.js";import{a as v}from"./chunk-RVIPYZ7F.js";import{a as U}from"./chunk-PSXXTDLU.js";import{a as w}from"./chunk-UXRWSNVZ.js";import{a as I,b as D,f as E,k as J,l as L,n as F,p as O,r as N}from"./chunk-OJUA2UZK.js";import"./chunk-4IFPLK7L.js";import"./chunk-5MN3MWQN.js";import"./chunk-OLM5RTFK.js";import{a as A}from"./chunk-LZSLKXJE.js";import{a as b}from"./chunk-2N4GTHXQ.js";import"./chunk-6C2MLMD6.js";import{a as l}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var Y=new A({description:"AI provider interface \u2014 ask questions, generate content",modules:{ask:{description:"Send a prompt to an AI provider",load:()=>import("./ask-TR4ZPBU5.js")},list:{description:"List available AI providers",load:()=>import("./list-UT3MSC6R.js")}}});var W=v;var te=async t=>{try{return await l.fs.stat(t),!0}catch{return!1}},oe=[{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"]}],_=async t=>{let e=[];for(let n of oe)for(let o of n.paths)if(await te(`${t}/${o}`)){e.push(n.id);break}return e};var i=async t=>{try{return await l.fs.stat(t),!0}catch{return!1}},H=async(t,e)=>{try{let n=await l.fs.readTextFile(t);return JSON.parse(n)[e]??null}catch{return null}},ne=async t=>{let e=[];return(await i(`${t}/package.json`)||await i(`${t}/deno.json`))&&e.push("typescript"),await i(`${t}/go.mod`)&&e.push("go"),await i(`${t}/Cargo.toml`)&&e.push("rust"),(await i(`${t}/pyproject.toml`)||await i(`${t}/setup.py`))&&e.push("python"),e},re=async t=>{let e=[],n=await H(`${t}/package.json`,"dependencies");return n!==null&&("react"in n&&e.push("react"),"vue"in n&&e.push("vue"),"svelte"in n&&e.push("svelte"),"next"in n&&e.push("nextjs"),"express"in n&&e.push("express"),"hono"in n&&e.push("hono")),e},ie=async t=>{let e=[];return await i(`${t}/.github/workflows`)&&e.push("github-actions"),await i(`${t}/.gitlab-ci.yml`)&&e.push("gitlab-ci"),await i(`${t}/Jenkinsfile`)&&e.push("jenkins"),await i(`${t}/.circleci`)&&e.push("circleci"),e},ae=async t=>{if(await i(`${t}/deno.json`))return"deno";let e=await H(`${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},K=async t=>{let[e,n,o,f]=await Promise.all([ne(t),re(t),ie(t),ae(t)]);return{languages:e,frameworks:n,ci:o,testRunner:f}};var at=async t=>{let e=l.process.cwd(),n=G(t),o=R({target:n==="agent"?"non-interactive":"interactive"}),f=z(t),x=le(f,"--concerns"),Q=f.includes("--non-interactive")||n==="agent";if(await N(e)){let s=await J(e);return r.warn(o,"noskills is already initialized in this project."),r.info(o,`Run \`${w("sync",s)}\` to regenerate tool files.`),b(void 0)}M(o,"noskills init");let C=u(o,"Scanning project...");C.start();let d=await K(e);C.succeed("Project scanned");for(let s of d.languages)r.step(o,` ${s}`);for(let s of d.frameworks)r.step(o,` ${s}`);for(let s of d.ci)r.step(o,` ${s}`);d.testRunner!==null&&r.step(o,` test runner: ${d.testRunner}`);let B=u(o,"Detecting coding tools...");B.start();let p=await _(e);B.succeed(`${p.length} coding tool(s) detected`);for(let s of p)r.step(o,` ${s}`);let P=u(o,"Detecting AI providers...");P.start();let m=(await W()).filter(s=>s.available).map(s=>s.name);P.succeed(`${m.length} provider(s) detected`);let h=await U(),c;if(x!==null){let s=h.map(a=>a.id);c=x.filter(a=>s.includes(a)).sort((a,g)=>s.indexOf(a)-s.indexOf(g))}else if(Q)c=[];else{let s=h.map(g=>({value:g.id,label:g.name,hint:g.description.slice(0,60)})),a=await T(o,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:s});c=$(a)?[]:[...a]}c.length>0?r.success(o,`Concerns: ${c.join(", ")}`):r.info(o,"No concerns selected. Add later with `concern add <id>`.");let k=de(),S=u(o,"Initializing...");S.start(),await O(e);let V=h.filter(s=>c.includes(s.id));for(let s of V)await F(e,s);let y={...D(c,p,m,d),command:k};await L(e,y);let X=I();if(await E(e,X),S.succeed("Scaffolded `.eser/`"),p.length>0){let s=u(o,"Syncing tool files...");s.start();let a=await q(e,p,y);s.succeed(`Synced ${a.length} tool(s)`)}return r.success(o,`Done. ${p.length} tool(s), ${m.length} provider(s), ${c.length} concern(s).`),r.info(o,`Command prefix: ${k}`),j(o,`Start a spec with: ${w('spec new "..."',y)}`),b(void 0)},le=(t,e)=>{if(t===void 0)return null;for(let n of t)if(n.startsWith(`${e}=`))return n.slice(e.length+1).split(",").map(o=>o.trim()).filter(Boolean);return null},de=()=>{try{let e=l.process.args.join(" ");if(e.includes("jsr:@eser/noskills"))return"deno run jsr:@eser/noskills";if(e.includes("noskills/main.ts"))return"deno run --allow-all ./pkg/@eser/noskills/main.ts";if(e.includes("eser")&&e.includes("nos")&&!e.includes("noskills"))return"eser nos";if(e.includes("eser")&&e.includes("noskills"))return"eser noskills"}catch{}return"npx eser noskills"};export{at as main};
@@ -1,3 +1,3 @@
1
- import{a as _}from"./chunk-5ORUHRWF.js";import{a as v}from"./chunk-7ADGJB4H.js";import{a as B,b as H,c as Q,d as z}from"./chunk-KBNVVXFC.js";import{a as A}from"./chunk-LBOCIPVF.js";import{a as j,c as b,d as G,f as J,h as W}from"./chunk-HLQNHWXS.js";import{a as P}from"./chunk-QEEZKZXM.js";import{a as q,b as M,d as x}from"./chunk-TGA7MX5P.js";import{b as L,c as N,d as V}from"./chunk-I6ISQXVP.js";import"./chunk-6QFROYLO.js";import{a as U}from"./chunk-UXRWSNVZ.js";import{d as O,e as E,k as I,o as $,q as y,r as T}from"./chunk-OJUA2UZK.js";import{a as F,b as D}from"./chunk-2N4GTHXQ.js";import{a as h}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var Z=o=>o.split(`
1
+ import{a as _}from"./chunk-5ORUHRWF.js";import{a as v}from"./chunk-7ADGJB4H.js";import{a as B,b as H,c as Q,d as z}from"./chunk-KBNVVXFC.js";import{a as A}from"./chunk-S5PUIY3F.js";import{a as j,c as b,d as G,f as J,h as W}from"./chunk-HLQNHWXS.js";import{a as P}from"./chunk-QEEZKZXM.js";import{a as q,b as M,d as x}from"./chunk-TGA7MX5P.js";import{b as L,c as N,d as V}from"./chunk-BLHOTPRB.js";import"./chunk-PSXXTDLU.js";import{a as U}from"./chunk-UXRWSNVZ.js";import{d as O,e as E,k as I,o as $,q as y,r as T}from"./chunk-OJUA2UZK.js";import{a as F,b as D}from"./chunk-2N4GTHXQ.js";import{a as h}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var Z=o=>o.split(`
2
2
  `).map(e=>e.replace(/^[-*]\s+/,"").trim()).filter(e=>e.length>0&&!e.startsWith("#")),ee=async(o,e)=>{let i=[],n=(e.startsWith(o)?e.slice(o.length+1):e).split("/");n.pop();for(let t=n.length;t>=0;t--){let r=`${t===0?o:`${o}/${n.slice(0,t).join("/")}`}/.folder-rules.md`,c=t===0?".":n.slice(0,t).join("/");try{let p=await h.fs.readTextFile(r),g=Z(p);for(let f of g)i.push({folder:c,rule:f})}catch{}}return i},k=async(o,e)=>{let i=new Set,a=[];for(let n of e){let t=await ee(o,n);for(let s of t){let r=`${s.folder}::${s.rule}`;i.has(r)||(i.add(r),a.push(s))}}return a};var ye=async o=>{let e=h.process.cwd(),i=q(o),a=M(o);if(!await T(e)){let l=await I(e);return await x({error:`noskills not initialized. Run: ${U("init",l)}`},i),D({exitCode:1})}let n=null;for(let l of a)l.startsWith("--answer=")&&(n=l.slice(9));let t=await E(e),s=await I(e);if(t.pendingClear&&(t={...t,pendingClear:!1},await y(e,t)),s===null)return await x({error:"No config found"},i),D({exitCode:1});let c=(await $(e)).filter(l=>s.concerns.includes(l.id));if(n!==null){let l=await se(e,t,s,c,n);await y(e,l);let u={...l,lastCalledAt:new Date().toISOString()};await y(e,u);let m=await P(e),d=u.spec!==null?await v(e,u.spec):null,R=await K(e,u),X=await k(e,R),Y=A(u,c,m,s,d,X);return await x(Y,i),F(void 0)}let p={...t,lastCalledAt:new Date().toISOString()};await y(e,p);let g=await P(e),f=p.spec!==null?await v(e,p.spec):null,w=await K(e,p),C=await k(e,w),S=A(p,c,g,s,f,C);return await x(S,i),F(void 0)},se=async(o,e,i,a,n)=>{switch(e.phase){case"DISCOVERY":{let t=null;try{let r=JSON.parse(n);typeof r=="object"&&r!==null&&!Array.isArray(r)&&(t=r)}catch{}let s=e;if(t!==null)for(let[r,c]of Object.entries(t))typeof c=="string"&&c.length>0&&(s=b(s,r,c));else{let r=L(a),c=N(r,s.discovery.answers);if(c===null)return e;s=b(s,c.id,n)}return V(s.discovery.answers)&&(s=G(s)),s}case"SPEC_DRAFT":{if(e.classification===null){let t;try{let r=JSON.parse(n);t={involvesUI:r.involvesUI===!0,involvesPublicAPI:r.involvesPublicAPI===!0,involvesMigration:r.involvesMigration===!0,involvesDataHandling:r.involvesDataHandling===!0}}catch{t={involvesUI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1}}let s={...e,classification:t};try{await _(o,s,a)}catch{}return s}return e}case"SPEC_APPROVED":{let t=J(e);return t.spec!==null&&(await B(o,t.spec,"executing"),await z(o,t.spec,"executing")),t}case"EXECUTING":{if(!e.execution.awaitingStatusReport){let t={...e,execution:{...e.execution,lastProgress:n}};if(i.verifyCommand!==null&&i.verifyCommand!==void 0&&i.verifyCommand.length>0){let s=await ie(o,i.verifyCommand);if(t={...t,execution:{...t.execution,lastVerification:s}},!s.passed)return t}return t={...t,execution:{...t.execution,awaitingStatusReport:!0}},t}return await ne(o,e,n,a)}case"BLOCKED":{let t=e.execution.lastProgress??"Unknown",s={id:`d${e.decisions.length+1}`,question:t.replace(/^BLOCKED:\s*/,""),choice:n,promoted:!1,timestamp:new Date().toISOString()},r=W(e,s);return r=j(r,"EXECUTING"),r={...r,execution:{...r.execution,lastProgress:`Resolved: ${n}`}},r}default:return e}},ne=async(o,e,i,a)=>{let n;try{n=JSON.parse(i)}catch{return{...e,execution:{...e.execution,lastProgress:i,awaitingStatusReport:!1}}}let t=n.completed??[],s=n.remaining??[],r=n.blocked??[],c=[...s,...r],p=e.execution.debt?.unaddressedIterations??0,g=c.length>0?{items:c,fromIteration:e.execution.iteration,unaddressedIterations:1}:null,f=g;if(e.execution.debt!==null&&g!==null){let l=new Set(t.map(d=>d.toLowerCase().trim())),u=e.execution.debt.items.filter(d=>!l.has(d.toLowerCase().trim())),m=[...new Set([...u,...c])];f=m.length>0?{items:m,fromIteration:e.execution.debt.fromIteration,unaddressedIterations:u.length>0?p+1:1}:null}else if(e.execution.debt!==null&&g===null){let l=new Set(t.map(m=>m.toLowerCase().trim())),u=e.execution.debt.items.filter(m=>!l.has(m.toLowerCase().trim()));f=u.length>0?{items:u,fromIteration:e.execution.debt.fromIteration,unaddressedIterations:p+1}:null}let w=t.length>0?`Completed: ${t.join(", ")}`:"Status report submitted",C=e.execution.lastVerification===null||e.execution.lastVerification.passed===!0,S=f===null&&C;if(S&&e.spec!==null){let l=await v(o,e.spec);if(l!==null){let u=e.execution.completedTasks??[],m=new Set(u),d=l.tasks.find(R=>!m.has(R.id));if(d!==void 0)return await H(o,e.spec,d.id),await Q(o,e.spec,d.id,"done"),{...e,pendingClear:!0,execution:{...e.execution,lastProgress:`Task ${d.id} accepted: ${w}`,awaitingStatusReport:!1,debt:f,completedTasks:[...u,d.id]}}}}return{...e,pendingClear:S,execution:{...e.execution,lastProgress:S?w:`Task not accepted \u2014 remaining items must be addressed first. ${w}`,awaitingStatusReport:!1,debt:f}}},ie=async(o,e)=>{try{let{execSync:i}=await import("node:child_process"),a=i(e,{cwd:o,encoding:"utf-8",timeout:6e4,stdio:["pipe","pipe","pipe"]});return{passed:!0,output:String(a).slice(0,4e3),timestamp:new Date().toISOString()}}catch(i){let a=i,n=((a.stdout??"")+(a.stderr??"")).slice(0,4e3);return a.status!==void 0?{passed:!1,output:n||"Verification failed with no output",timestamp:new Date().toISOString()}:{passed:!1,output:`Verification command failed to execute: ${i instanceof Error?i.message:String(i)}`,timestamp:new Date().toISOString()}}},K=async(o,e)=>{let i=[...e.execution.modifiedFiles??[]],a=await re(o);return[...new Set([...i,...a])]},re=async o=>{let e=`${o}/${O.stateDir}/files-changed.jsonl`;try{let a=(await h.fs.readTextFile(e)).trim().split(`
3
3
  `).filter(Boolean),n=[];for(let t of a)try{let s=JSON.parse(t);n.includes(s.file)||n.push(s.file)}catch{}return n}catch{return[]}};export{ye as main};
@@ -1,3 +1,3 @@
1
- import{a as L}from"./chunk-LBOCIPVF.js";import{a as V,f as B}from"./chunk-HLQNHWXS.js";import{a as D,b as A,d as N}from"./chunk-AB4ZUDV6.js";import{a as G}from"./chunk-QEEZKZXM.js";import"./chunk-I6ISQXVP.js";import"./chunk-6QFROYLO.js";import{a as M,b as C}from"./chunk-UXRWSNVZ.js";import{e as x,f as g,k as $,o as F,r as U}from"./chunk-OJUA2UZK.js";import{c as P,d as r,f as u,g as v,h,k as I,o as R,q as O,r as T}from"./chunk-4IFPLK7L.js";import{a as S,b as w}from"./chunk-2N4GTHXQ.js";import{a as y}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var ae=async n=>{let t=R({renderer:T.ansi(),sink:O.stdout()}),e=y.process.cwd(),a=n?.includes("--unattended")??!1,s=W(n,"--max-turns")??10,o=W(n,"--max-iterations")??50;if(!await U(e)){let i=await $(e);return t.writeln(u(`noskills not initialized. Run: ${M("init",i)}`)),await t.close(),w({exitCode:1})}let p=await x(e);if(p.phase!=="EXECUTING"&&p.phase!=="SPEC_APPROVED")return t.writeln(u(`Cannot run from phase: ${p.phase}`)),t.writeln(r("Must be in SPEC_APPROVED or EXECUTING to start.")),await t.close(),w({exitCode:1});if(p.phase==="SPEC_APPROVED"){t.writeln(r("Starting execution from approved spec..."));let i=B(p);await g(e,i)}let c=await $(e);if(c===null)return t.writeln(u("Config not found.")),await t.close(),w({exitCode:1});t.writeln(P(`${C(c)} run`)),t.writeln(r(`Mode: ${a?"unattended":"interactive"}, max-turns: ${s}, max-iterations: ${o}`)),t.writeln("");let m=0,d=0;for(;m<o;){m++;let i=await x(e);if(i.phase==="DONE"){t.writeln(""),t.writeln(v("\u2714")," Spec completed!"),t.writeln(` Iterations: ${i.execution.iteration}`),t.writeln(` Decisions: ${i.decisions.length}`);break}if(i.phase==="BLOCKED"){let l=i.execution.lastProgress??"Unknown";if(t.writeln(""),t.writeln(h("\u26A0")," Execution blocked: ",r(l)),a){await H(e,l,m),t.writeln(r("Logged to .eser/.state/blocked.log. Resolve and re-run.")),d=1;break}let E=A(),f=await N(E,{message:"Enter resolution (or leave empty to stop):"});if(D(f)||f===""){t.writeln(r("Stopped by user."));break}let k=V(i,"EXECUTING");await g(e,{...k,execution:{...k.execution,lastProgress:`Resolved: ${f}`}});continue}if(i.phase!=="EXECUTING"){t.writeln(u(`Unexpected phase: ${i.phase}. Stopping.`)),d=1;break}i.pendingClear&&await g(e,{...i,pendingClear:!1});let X=(await F(e)).filter(l=>c.concerns.includes(l.id)),_=await G(e),j=L(i,X,_,c),z=q(j,c);t.writeln(I(`\u2500\u2500 Iteration ${m}`),r(` (execution: ${i.execution.iteration}, debt: ${i.execution.debt?.items.length??0})`)),i.execution.lastProgress!==null&&t.writeln(r(` Last: ${i.execution.lastProgress}`)),i.execution.lastVerification?.passed===!1&&t.writeln(u(" Verification failed \u2014 agent will fix")),i.execution.debt!==null&&t.writeln(h(` Debt: ${i.execution.debt.items.length} items`)),t.writeln(r(" Spawning agent..."));try{await(await import("./mod-LUIKS5KC.js")).exec`claude -p ${z} --max-turns ${String(s)} --output-format json`.noThrow().text()}catch{t.writeln(u(" Failed to spawn claude CLI. Is it installed?")),d=1;break}t.writeln(r(" Agent exited. Stop hook captured state."));let b=await x(e);if(c.autoCommit===!0&&c.allowGit!==!1)try{let l=await import("./mod-LUIKS5KC.js");if((await l.exec`git diff --name-only`.noThrow().text()).trim().length>0){await l.exec`git add -A`.noThrow().text();let f=`noskills: iteration ${b.execution.iteration} \u2014 ${b.execution.lastProgress??"progress"}`;await l.exec`git commit -m ${f}`.noThrow().text(),t.writeln(r(" Auto-committed."))}}catch{t.writeln(r(" Auto-commit failed (non-fatal)."))}}return m>=o&&(t.writeln(""),t.writeln(h("\u26A0"),` Max iterations (${o}) reached. Stopping.`),d=2),await t.close(),d!==0?w({exitCode:d}):S(void 0)},q=(n,t)=>{let e=[];if(e.push(n.meta.resumeHint),e.push(""),n.meta.spec!==null&&(e.push(`Working on spec: ${n.meta.spec}`),e.push("")),"instruction"in n&&(e.push(n.instruction),e.push("")),"previousIterationDebt"in n){let s=n.previousIterationDebt;if(s!==void 0){e.push(`DEBT from iteration ${s.fromIteration} (address first):`);for(let o of s.items)e.push(`- ${o}`);e.push("")}}if("statusReportRequired"in n){let s=n.statusReport;if(s!==void 0){e.push("Report against these acceptance criteria:");for(let o of s.criteria)e.push(`- ${o}`);e.push("")}}if("verificationFailed"in n&&n.verificationFailed===!0&&(e.push("Test output:"),e.push(("verificationOutput"in n?n.verificationOutput:"")??""),e.push("")),n.behavioral.rules.length>0){e.push("Rules:");for(let s of n.behavioral.rules)e.push(`- ${s}`);e.push("")}if("context"in n){let s=n.context;if(s.concernReminders.length>0){e.push("Reminders:");for(let o of s.concernReminders)e.push(`- ${o}`);e.push("")}}let a=C(t);return e.push(`When done, report progress: ${a} next --answer="your progress"`),e.push(`If blocked, run: ${a} block "reason"`),e.push(`When all tasks are complete: ${a} done`),e.join(`
1
+ import{a as L}from"./chunk-S5PUIY3F.js";import{a as V,f as B}from"./chunk-HLQNHWXS.js";import{a as D,b as A,d as N}from"./chunk-AB4ZUDV6.js";import{a as G}from"./chunk-QEEZKZXM.js";import"./chunk-BLHOTPRB.js";import"./chunk-PSXXTDLU.js";import{a as M,b as C}from"./chunk-UXRWSNVZ.js";import{e as x,f as g,k as $,o as F,r as U}from"./chunk-OJUA2UZK.js";import{c as P,d as r,f as u,g as v,h,k as I,o as R,q as O,r as T}from"./chunk-4IFPLK7L.js";import{a as S,b as w}from"./chunk-2N4GTHXQ.js";import{a as y}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var ae=async n=>{let t=R({renderer:T.ansi(),sink:O.stdout()}),e=y.process.cwd(),a=n?.includes("--unattended")??!1,s=W(n,"--max-turns")??10,o=W(n,"--max-iterations")??50;if(!await U(e)){let i=await $(e);return t.writeln(u(`noskills not initialized. Run: ${M("init",i)}`)),await t.close(),w({exitCode:1})}let p=await x(e);if(p.phase!=="EXECUTING"&&p.phase!=="SPEC_APPROVED")return t.writeln(u(`Cannot run from phase: ${p.phase}`)),t.writeln(r("Must be in SPEC_APPROVED or EXECUTING to start.")),await t.close(),w({exitCode:1});if(p.phase==="SPEC_APPROVED"){t.writeln(r("Starting execution from approved spec..."));let i=B(p);await g(e,i)}let c=await $(e);if(c===null)return t.writeln(u("Config not found.")),await t.close(),w({exitCode:1});t.writeln(P(`${C(c)} run`)),t.writeln(r(`Mode: ${a?"unattended":"interactive"}, max-turns: ${s}, max-iterations: ${o}`)),t.writeln("");let m=0,d=0;for(;m<o;){m++;let i=await x(e);if(i.phase==="DONE"){t.writeln(""),t.writeln(v("\u2714")," Spec completed!"),t.writeln(` Iterations: ${i.execution.iteration}`),t.writeln(` Decisions: ${i.decisions.length}`);break}if(i.phase==="BLOCKED"){let l=i.execution.lastProgress??"Unknown";if(t.writeln(""),t.writeln(h("\u26A0")," Execution blocked: ",r(l)),a){await H(e,l,m),t.writeln(r("Logged to .eser/.state/blocked.log. Resolve and re-run.")),d=1;break}let E=A(),f=await N(E,{message:"Enter resolution (or leave empty to stop):"});if(D(f)||f===""){t.writeln(r("Stopped by user."));break}let k=V(i,"EXECUTING");await g(e,{...k,execution:{...k.execution,lastProgress:`Resolved: ${f}`}});continue}if(i.phase!=="EXECUTING"){t.writeln(u(`Unexpected phase: ${i.phase}. Stopping.`)),d=1;break}i.pendingClear&&await g(e,{...i,pendingClear:!1});let X=(await F(e)).filter(l=>c.concerns.includes(l.id)),_=await G(e),j=L(i,X,_,c),z=q(j,c);t.writeln(I(`\u2500\u2500 Iteration ${m}`),r(` (execution: ${i.execution.iteration}, debt: ${i.execution.debt?.items.length??0})`)),i.execution.lastProgress!==null&&t.writeln(r(` Last: ${i.execution.lastProgress}`)),i.execution.lastVerification?.passed===!1&&t.writeln(u(" Verification failed \u2014 agent will fix")),i.execution.debt!==null&&t.writeln(h(` Debt: ${i.execution.debt.items.length} items`)),t.writeln(r(" Spawning agent..."));try{await(await import("./mod-LUIKS5KC.js")).exec`claude -p ${z} --max-turns ${String(s)} --output-format json`.noThrow().text()}catch{t.writeln(u(" Failed to spawn claude CLI. Is it installed?")),d=1;break}t.writeln(r(" Agent exited. Stop hook captured state."));let b=await x(e);if(c.autoCommit===!0&&c.allowGit!==!1)try{let l=await import("./mod-LUIKS5KC.js");if((await l.exec`git diff --name-only`.noThrow().text()).trim().length>0){await l.exec`git add -A`.noThrow().text();let f=`noskills: iteration ${b.execution.iteration} \u2014 ${b.execution.lastProgress??"progress"}`;await l.exec`git commit -m ${f}`.noThrow().text(),t.writeln(r(" Auto-committed."))}}catch{t.writeln(r(" Auto-commit failed (non-fatal)."))}}return m>=o&&(t.writeln(""),t.writeln(h("\u26A0"),` Max iterations (${o}) reached. Stopping.`),d=2),await t.close(),d!==0?w({exitCode:d}):S(void 0)},q=(n,t)=>{let e=[];if(e.push(n.meta.resumeHint),e.push(""),n.meta.spec!==null&&(e.push(`Working on spec: ${n.meta.spec}`),e.push("")),"instruction"in n&&(e.push(n.instruction),e.push("")),"previousIterationDebt"in n){let s=n.previousIterationDebt;if(s!==void 0){e.push(`DEBT from iteration ${s.fromIteration} (address first):`);for(let o of s.items)e.push(`- ${o}`);e.push("")}}if("statusReportRequired"in n){let s=n.statusReport;if(s!==void 0){e.push("Report against these acceptance criteria:");for(let o of s.criteria)e.push(`- ${o}`);e.push("")}}if("verificationFailed"in n&&n.verificationFailed===!0&&(e.push("Test output:"),e.push(("verificationOutput"in n?n.verificationOutput:"")??""),e.push("")),n.behavioral.rules.length>0){e.push("Rules:");for(let s of n.behavioral.rules)e.push(`- ${s}`);e.push("")}if("context"in n){let s=n.context;if(s.concernReminders.length>0){e.push("Reminders:");for(let o of s.concernReminders)e.push(`- ${o}`);e.push("")}}let a=C(t);return e.push(`When done, report progress: ${a} next --answer="your progress"`),e.push(`If blocked, run: ${a} block "reason"`),e.push(`When all tasks are complete: ${a} done`),e.join(`
2
2
  `)},W=(n,t)=>{if(n===void 0)return null;let e=`${t}=`;for(let a of n)if(a.startsWith(e)){let s=parseInt(a.slice(e.length),10);if(!isNaN(s)&&s>0)return s}return null},H=async(n,t,e)=>{let a=`${n}/.eser/.state/blocked.log`,s=`[${new Date().toISOString()}] iteration=${e} reason=${t}
3
3
  `;try{let{appendFileSync:o,mkdirSync:p}=await import("node:fs"),{dirname:c}=await import("node:path");p(c(a),{recursive:!0}),o(a,s)}catch{}};export{ae as main};
@@ -1 +1 @@
1
- import{a as I,d as w}from"./chunk-TGA7MX5P.js";import{a as h}from"./chunk-I6ISQXVP.js";import"./chunk-6QFROYLO.js";import{a as f}from"./chunk-UXRWSNVZ.js";import{e as y,k as u,r as D}from"./chunk-OJUA2UZK.js";import{c as i,d as r,f as c,g as b,h as o,k as E,o as p,q as d,r as m}from"./chunk-4IFPLK7L.js";import{a as g,b as C}from"./chunk-2N4GTHXQ.js";import{a as x}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var U=async P=>{let n=x.process.cwd(),a=I(P);if(!await D(n)){if(a==="json")await w({error:"noskills is not initialized"},a);else{let s=p({renderer:m.ansi(),sink:d.stdout()}),l=await u(n);s.writeln(c("noskills is not initialized.")," Run: ",i(f("init",l))),await s.close()}return C({exitCode:1})}let e=await y(n),t=await u(n),k={phase:e.phase,spec:e.spec,branch:e.branch,discovery:e.phase==="DISCOVERY"?{answered:e.discovery.answers.length,total:h.length}:void 0,execution:e.phase==="EXECUTING"||e.phase==="BLOCKED"?{iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,debt:e.execution.debt?.items.length??0,verificationPassed:e.execution.lastVerification?.passed??null}:void 0,concerns:t?.concerns??[],tools:t?.tools??[],decisions:e.decisions.length,pendingClear:e.pendingClear};if(a!=="json"){let s=p({renderer:m.ansi(),sink:d.stdout()});s.writeln(i(`${f("status",t)}`)),s.writeln("");let l=e.phase==="DONE"?b(e.phase):e.phase==="BLOCKED"?c(e.phase):e.phase==="EXECUTING"?E(e.phase):o(e.phase);s.writeln(" Phase: ",l),e.spec!==null&&s.writeln(" Spec: ",i(e.spec)),e.branch!==null&&s.writeln(" Branch: ",e.branch),e.phase==="DISCOVERY"&&s.writeln(` Discovery: ${e.discovery.answers.length}/${h.length} questions answered`),e.phase==="EXECUTING"&&(s.writeln(` Iteration: ${e.execution.iteration}`),e.execution.lastProgress!==null&&s.writeln(" Progress: ",r(e.execution.lastProgress)),e.execution.debt!==null&&s.writeln(o(` Debt: ${e.execution.debt.items.length} items`))),t!==null&&(s.writeln(""),t.concerns.length>0&&s.writeln(" Concerns: ",r(t.concerns.join(", "))),t.tools.length>0&&s.writeln(" Tools: ",r(t.tools.join(", ")))),e.decisions.length>0&&(s.writeln(""),s.writeln(` Decisions: ${e.decisions.length}`)),e.pendingClear&&(s.writeln(""),s.writeln(o(" \u26A0 Context clear pending \u2014 run `/clear`"))),await s.close()}else await w(k,"json");return g(void 0)};export{U as main};
1
+ import{a as I,d as w}from"./chunk-TGA7MX5P.js";import{a as h}from"./chunk-BLHOTPRB.js";import"./chunk-PSXXTDLU.js";import{a as f}from"./chunk-UXRWSNVZ.js";import{e as y,k as u,r as D}from"./chunk-OJUA2UZK.js";import{c as i,d as r,f as c,g as b,h as o,k as E,o as p,q as d,r as m}from"./chunk-4IFPLK7L.js";import{a as g,b as C}from"./chunk-2N4GTHXQ.js";import{a as x}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var U=async P=>{let n=x.process.cwd(),a=I(P);if(!await D(n)){if(a==="json")await w({error:"noskills is not initialized"},a);else{let s=p({renderer:m.ansi(),sink:d.stdout()}),l=await u(n);s.writeln(c("noskills is not initialized.")," Run: ",i(f("init",l))),await s.close()}return C({exitCode:1})}let e=await y(n),t=await u(n),k={phase:e.phase,spec:e.spec,branch:e.branch,discovery:e.phase==="DISCOVERY"?{answered:e.discovery.answers.length,total:h.length}:void 0,execution:e.phase==="EXECUTING"||e.phase==="BLOCKED"?{iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,debt:e.execution.debt?.items.length??0,verificationPassed:e.execution.lastVerification?.passed??null}:void 0,concerns:t?.concerns??[],tools:t?.tools??[],decisions:e.decisions.length,pendingClear:e.pendingClear};if(a!=="json"){let s=p({renderer:m.ansi(),sink:d.stdout()});s.writeln(i(`${f("status",t)}`)),s.writeln("");let l=e.phase==="DONE"?b(e.phase):e.phase==="BLOCKED"?c(e.phase):e.phase==="EXECUTING"?E(e.phase):o(e.phase);s.writeln(" Phase: ",l),e.spec!==null&&s.writeln(" Spec: ",i(e.spec)),e.branch!==null&&s.writeln(" Branch: ",e.branch),e.phase==="DISCOVERY"&&s.writeln(` Discovery: ${e.discovery.answers.length}/${h.length} questions answered`),e.phase==="EXECUTING"&&(s.writeln(` Iteration: ${e.execution.iteration}`),e.execution.lastProgress!==null&&s.writeln(" Progress: ",r(e.execution.lastProgress)),e.execution.debt!==null&&s.writeln(o(` Debt: ${e.execution.debt.items.length} items`))),t!==null&&(s.writeln(""),t.concerns.length>0&&s.writeln(" Concerns: ",r(t.concerns.join(", "))),t.tools.length>0&&s.writeln(" Tools: ",r(t.tools.join(", ")))),e.decisions.length>0&&(s.writeln(""),s.writeln(` Decisions: ${e.decisions.length}`)),e.pendingClear&&(s.writeln(""),s.writeln(o(" \u26A0 Context clear pending \u2014 run `/clear`"))),await s.close()}else await w(k,"json");return g(void 0)};export{U as main};
package/noskills.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{a as t}from"./chunks/chunk-LZSLKXJE.js";import{c as o}from"./chunks/chunk-2N4GTHXQ.js";import{a as s}from"./chunks/chunk-HS6FTDDW.js";import"./chunks/chunk-WV3HK5WR.js";import"./chunks/chunk-FDZP7B5Y.js";import"./chunks/chunk-ACQUINWH.js";import"./chunks/chunk-DXB73IDG.js";var i=new t({description:"noskills \u2014 state-machine orchestrator for AI agents",modules:{init:{description:"Initialize noskills in project",load:()=>import("./chunks/init-HS26Q2YL.js")},status:{description:"Show current state",load:()=>import("./chunks/status-B4YAFCOQ.js")},spec:{description:"Manage specs (new, list)",load:()=>import("./chunks/spec-RTBL43T7.js")},next:{description:"Get next instruction for agent",load:()=>import("./chunks/next-ZZAZ6ZVW.js")},approve:{description:"Approve phase transition",load:()=>import("./chunks/approve-5N5LJ2WQ.js")},block:{description:"Mark spec as blocked",load:()=>import("./chunks/block-WWW3MXHP.js")},reset:{description:"Reset current spec state",load:()=>import("./chunks/reset-VZO7YXM6.js")},done:{description:"Mark spec execution as complete",load:()=>import("./chunks/done-IBA3FUE5.js")},concern:{description:"Manage concerns (add, remove, list)",load:()=>import("./chunks/concern-P4L2VWAE.js")},run:{description:"Autonomous execution loop (Ralph loop)",load:()=>import("./chunks/run-LEX6S5D7.js")},watch:{description:"Live dashboard for monitoring agent progress",load:()=>import("./chunks/watch-7DNXJAAQ.js")},sync:{description:"Regenerate tool-specific files",load:()=>import("./chunks/sync-XMUP5YHZ.js")},purge:{description:"Remove all noskills content (specs, rules, concerns, hooks)",load:()=>import("./chunks/purge-FBZME5ZJ.js")},"invoke-hook":{description:"Internal hook handlers (called by agents)",load:()=>import("./chunks/invoke-hook-JZBFLW46.js")},rule:{description:"Manage rules (add, list, promote)",load:()=>import("./chunks/rule-4D2CRBI4.js")}}});var r={name:"@eser/noskills",version:"4.1.30",type:"module",exports:{".":"./main.ts","./mod":"./mod.ts","./module":"./module.ts"},dependencies:{"@eser/ai":"workspace:*","@eser/primitives":"workspace:*","@eser/shell":"workspace:*","@eser/standards":"workspace:*","@eser/streams":"workspace:*",yaml:"^2"},devDependencies:{"@std/assert":"npm:@jsr/std__assert@^1.0.16","@std/testing":"npm:@jsr/std__testing@^1.0.16"}};var p=i.toCommand("noskills",r.version),d=async()=>await p.parse();if(import.meta.main){let n=await d();o(n,{ok:()=>{},fail:e=>{e.message!==void 0&&console.error(e.message),s.process.setExitCode(e.exitCode)}})}export{d as main};
2
+ import{a as t}from"./chunks/chunk-LZSLKXJE.js";import{c as o}from"./chunks/chunk-2N4GTHXQ.js";import{a as s}from"./chunks/chunk-HS6FTDDW.js";import"./chunks/chunk-WV3HK5WR.js";import"./chunks/chunk-FDZP7B5Y.js";import"./chunks/chunk-ACQUINWH.js";import"./chunks/chunk-DXB73IDG.js";var i=new t({description:"noskills \u2014 state-machine orchestrator for AI agents",modules:{init:{description:"Initialize noskills in project",load:()=>import("./chunks/init-CPEFD2I3.js")},status:{description:"Show current state",load:()=>import("./chunks/status-NFBLYJLR.js")},spec:{description:"Manage specs (new, list)",load:()=>import("./chunks/spec-RTBL43T7.js")},next:{description:"Get next instruction for agent",load:()=>import("./chunks/next-YNV7OZHT.js")},approve:{description:"Approve phase transition",load:()=>import("./chunks/approve-5N5LJ2WQ.js")},block:{description:"Mark spec as blocked",load:()=>import("./chunks/block-WWW3MXHP.js")},reset:{description:"Reset current spec state",load:()=>import("./chunks/reset-VZO7YXM6.js")},done:{description:"Mark spec execution as complete",load:()=>import("./chunks/done-IBA3FUE5.js")},concern:{description:"Manage concerns (add, remove, list)",load:()=>import("./chunks/concern-NGOU3XMP.js")},run:{description:"Autonomous execution loop (Ralph loop)",load:()=>import("./chunks/run-OVIPWV6U.js")},watch:{description:"Live dashboard for monitoring agent progress",load:()=>import("./chunks/watch-7DNXJAAQ.js")},sync:{description:"Regenerate tool-specific files",load:()=>import("./chunks/sync-XMUP5YHZ.js")},purge:{description:"Remove all noskills content (specs, rules, concerns, hooks)",load:()=>import("./chunks/purge-FBZME5ZJ.js")},"invoke-hook":{description:"Internal hook handlers (called by agents)",load:()=>import("./chunks/invoke-hook-JZBFLW46.js")},rule:{description:"Manage rules (add, list, promote)",load:()=>import("./chunks/rule-4D2CRBI4.js")}}});var r={name:"@eser/noskills",version:"4.1.32",type:"module",exports:{".":"./main.ts","./mod":"./mod.ts","./module":"./module.ts"},dependencies:{"@eser/ai":"workspace:*","@eser/primitives":"workspace:*","@eser/shell":"workspace:*","@eser/standards":"workspace:*","@eser/streams":"workspace:*",yaml:"^2"},devDependencies:{"@std/assert":"npm:@jsr/std__assert@^1.0.16","@std/testing":"npm:@jsr/std__testing@^1.0.16"}};var p=i.toCommand("noskills",r.version),d=async()=>await p.parse();if(import.meta.main){let n=await d();o(n,{ok:()=>{},fail:e=>{e.message!==void 0&&console.error(e.message),s.process.setExitCode(e.exitCode)}})}export{d as main};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noskills",
3
- "version": "4.1.30",
3
+ "version": "4.1.32",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "noskills": "./noskills.js"
@@ -1 +0,0 @@
1
- import{a as r}from"./chunk-HS6FTDDW.js";var i=async o=>{let n=[];try{for await(let s of r.fs.readDir(o))s.isFile&&s.name.endsWith(".json")&&n.push({name:s.name})}catch{return[]}n.sort((s,t)=>s.name.localeCompare(t.name));let e=[];for(let s of n){let t=await r.fs.readTextFile(`${o}/${s.name}`);e.push(JSON.parse(t))}return e},c=async()=>{let o=new URL("../defaults/concerns/",import.meta.url);return await i(o.pathname)},m=(o,n)=>{let e=[];for(let s of o)for(let t of s.extras)t.questionId===n&&e.push(t);return e},d=o=>{let n=[];for(let e of o)for(let s of e.reminders)n.push(`${e.id}: ${s}`);return n},f=o=>{let n=[],e=o.map(s=>s.id);return e.includes("move-fast")&&e.includes("compliance")&&n.push({between:["move-fast","compliance"],issue:"Speed vs traceability \u2014 shortcuts may violate audit requirements."}),e.includes("move-fast")&&e.includes("long-lived")&&n.push({between:["move-fast","long-lived"],issue:"Shipping speed vs maintainability \u2014 tech debt decisions need human approval."}),e.includes("beautiful-product")&&e.includes("move-fast")&&n.push({between:["beautiful-product","move-fast"],issue:"Design polish vs speed \u2014 which UI states can be deferred?"}),n};export{c as a,m as b,d as c,f as d};