noskills 4.1.42 → 4.1.44
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/README.md +128 -55
- package/chunks/{approve-CC43I73M.js → approve-NPG6X7O6.js} +1 -1
- package/chunks/{block-5KC7PUH6.js → block-LSEXCK45.js} +1 -1
- package/chunks/cancel-BK6GCIIY.js +1 -0
- package/chunks/chunk-7GUYMD3Z.js +16 -0
- package/chunks/chunk-7UX6WIXX.js +1 -0
- package/chunks/chunk-MRZT23BL.js +1 -0
- package/chunks/chunk-TMC5H2A5.js +1 -0
- package/chunks/chunk-ZMVD5IU4.js +109 -0
- package/chunks/{concern-FBYT4WPA.js → concern-3K3QUYG4.js} +1 -1
- package/chunks/done-OMGLEA32.js +1 -0
- package/chunks/free-BO5UA5V2.js +1 -0
- package/chunks/init-M4MSHCVJ.js +1 -0
- package/chunks/invoke-hook-HB2TBCHD.js +10 -0
- package/chunks/next-4DJGEJBW.js +8 -0
- package/chunks/{reopen-TND2EX3W.js → reopen-EKSLLO54.js} +1 -1
- package/chunks/{reset-XSYKZNUI.js → reset-WRTVX7TT.js} +1 -1
- package/chunks/{rule-ZM34AO4G.js → rule-QP5BSH27.js} +1 -1
- package/chunks/run-3VWWQDN2.js +3 -0
- package/chunks/spec-HQZVVCBY.js +1 -0
- package/chunks/status-63TFVF7Y.js +1 -0
- package/chunks/{sync-DQYR4ZLK.js → sync-VS4HROEX.js} +1 -1
- package/chunks/{watch-CAD4JSTU.js → watch-4HJMGNF4.js} +6 -6
- package/chunks/wontfix-BOT7HHH2.js +1 -0
- package/noskills.js +1 -1
- package/package.json +1 -1
- package/chunks/cancel-EQVD54M2.js +0 -1
- package/chunks/chunk-2WH262CW.js +0 -1
- package/chunks/chunk-6AAKOXIS.js +0 -81
- package/chunks/chunk-ERUA3YBQ.js +0 -1
- package/chunks/chunk-XANYQUGJ.js +0 -16
- package/chunks/done-UNXXLE3Y.js +0 -1
- package/chunks/init-IFI75I3F.js +0 -1
- package/chunks/invoke-hook-227DMMXJ.js +0 -10
- package/chunks/next-6UT77PDL.js +0 -8
- package/chunks/run-UVYXW33C.js +0 -3
- package/chunks/spec-CTUSUGWH.js +0 -1
- package/chunks/status-4D5HFW4V.js +0 -1
- package/chunks/wontfix-6KJQNEEV.js +0 -1
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import{a as b}from"./chunk-YK6UG66R.js";import{d as f}from"./chunk-LWCWPXCS.js";import{b as n}from"./chunk-MNEZ5QGX.js";var S="<!-- noskills:start -->",y="<!-- noskills:end -->",Y=(e,t,s="npx eser noskills")=>{let o=[S,"## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/rules/`, `.eser/specs/`, or concern files directly.","noskills gives you exactly what you need via JSON output.","","### Protocol","",` ${s} next --spec=<name> # get current instruction`,` ${s} next --spec=<name> --answer="your response" # submit result and advance`,"","Every noskills command that operates on a spec MUST include `--spec=<name>`.","Never omit it. Use `"+s+" spec list` to see available specs.","","### Why noskills calls matter","","noskills is not a form to fill out. It is a live state machine that the user","watches in real-time. Every `"+s+" next --answer` call:","","- Updates the spec file on disk (the user sees it change)","- Updates the terminal dashboard if `noskills watch` is running","- Advances the state machine to the next phase","- Records the decision permanently in the project history","","When you batch-submit answers or backfill discovery responses yourself,","the user sees nothing happening \u2014 then suddenly everything jumps forward.","This defeats the purpose.","","Call noskills ONCE per interaction. Ask the user ONE question. Wait for","their answer. Submit it. Ask the next. The user is watching every step.","Do NOT pre-fill answers. Do NOT batch multiple answers. Do NOT answer","discovery questions yourself \u2014 the user's input is the data.","","### When to call noskills next","",`You MUST call \`${s} next\` in these situations:`,"","1. At the **START** of every conversation (first thing you do)","2. **BEFORE** creating or modifying any file (to verify you have an active task)","3. **AFTER** completing a logical unit of work (to report progress)","4. When you encounter a **DECISION** that affects architecture or scope","5. When you are **UNSURE** what to do next","","NEVER proceed with implementation without checking noskills first.","NEVER make architectural decisions independently \u2014 noskills routes them to the user."];if((t?.allowGit??!1)||o.push("","### Git is read-only","","You MUST NOT run git write commands: commit, add, push, checkout, stash,","reset, merge, rebase, cherry-pick. The user controls git. You control files.","You MAY read from git: log, diff, status, show, blame."),o.push("","### Interactive choices","","When noskills output contains `interactiveOptions`, you MUST present them","using the AskUserQuestion tool. NEVER present options in prose.","","This is not optional. If you ask a question without AskUserQuestion when","interactiveOptions are present, you are violating protocol.","","Pass interactiveOptions as the `options` array in AskUserQuestion.","Use the `commandMap` to resolve the user's selection to a CLI command.","","### Convention discovery","","When you discover a pattern, receive a correction, or identify a recurring",'preference from the user, ask: "Should this be a permanent rule for this',`project, or just for this task?" If permanent, run: \`${s} rule add`,'"<description>"`. If just this task, note it and move on.',"Never write to `.eser/rules/` directly.","","### Decision principle: Explicit > Clever","","You NEVER skip steps, bypass questions, or make assumptions on behalf of the user.","- Discovery questions \u2192 ask the user, don't answer yourself","- Classification \u2192 ask the user, don't infer","- Spec approval \u2192 ask the user, don't auto-approve","- Task refinement \u2192 ask the user, don't self-assign","- Rule promotion \u2192 ask the user, don't decide",`If you think something can be skipped, ASK "would you like to skip this?" \u2014 don't skip it.`,"","### Command execution","","When told to run a noskills command, execute it IMMEDIATELY. Do not explore,","research, read source code, or plan first. The command output contains all the","context you need. Exploring noskills internals wastes tokens and delays the user.","","### JSON output","","noskills returns JSON with a `phase` field and phase-specific instructions.","The `meta` block contains resume context - use it to orient yourself,","especially after compaction or at the start of a new session.","Follow the `instruction` field. Use `transition` commands to advance state."),e.length>0){o.push("","### Active Rules","");for(let i of e)o.push(`- ${i}`)}return o.push(y),o.join(`
|
|
2
|
+
`)},x=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(S),c=a.indexOf(y);l!==-1&&c!==-1?a=a.slice(0,l)+r+a.slice(c+y.length):a=a.trimEnd()+`
|
|
3
|
+
|
|
4
|
+
`+r+`
|
|
5
|
+
`}catch{a=r+`
|
|
6
|
+
`}await n.fs.writeTextFile(i,a)};var J=e=>({hooks:{PreToolUse:[{matcher:"Write|Edit|MultiEdit|Bash",hooks:[{type:"command",command:`${e} invoke-hook pre-tool-use`,timeout:5}]}],PostToolUse:[{matcher:"Write|Edit|MultiEdit",hooks:[{type:"command",command:`${e} invoke-hook post-file-write`,timeout:3}]},{matcher:"Bash",hooks:[{type:"command",command:`${e} invoke-hook post-bash`,timeout:3}]}],Stop:[{hooks:[{type:"command",command:`${e} invoke-hook stop`,timeout:10}]}],SessionStart:[{hooks:[{type:"command",command:`${e} invoke-hook session-start`,timeout:5}]}]}}),R=async(e,t="npx eser@latest noskills")=>{let s=`${e}/.claude/settings.json`,o={};try{let a=await n.fs.readTextFile(s);o=JSON.parse(a)}catch{}let i=J(t),r={...o,...i};await n.fs.mkdir(`${e}/.claude`,{recursive:!0}),await n.fs.writeTextFile(s,JSON.stringify(r,null,2)+`
|
|
7
|
+
`)};var K=async(e,t)=>{let s=`${e}/.claude/agents`;await n.fs.mkdir(s,{recursive:!0});let o=`---
|
|
8
|
+
name: noskills-executor
|
|
9
|
+
description: "Executes a single noskills task."
|
|
10
|
+
tools: Read, Edit, MultiEdit, Write, Bash, Grep, Glob, LS
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
You are executing a single task from a noskills spec.
|
|
14
|
+
Your ONLY job is to complete the task described in the prompt.
|
|
15
|
+
Follow all behavioral rules provided in the prompt.
|
|
16
|
+
Do NOT start new tasks, explore unrelated code, or make architectural decisions.
|
|
17
|
+
If the task is too vague to execute, say so immediately.
|
|
18
|
+
|
|
19
|
+
## Self-Verification
|
|
20
|
+
After completing the task, you MUST verify your own work before reporting:
|
|
21
|
+
1. Run type check: \`deno check\` on all modified files
|
|
22
|
+
2. Run test suite: \`deno test\` on the relevant test files
|
|
23
|
+
3. If type check or tests fail, fix the issues before reporting
|
|
24
|
+
|
|
25
|
+
## Reporting
|
|
26
|
+
When finished, provide a structured JSON summary:
|
|
27
|
+
\\\`\\\`\\\`json
|
|
28
|
+
{"completed": ["<item IDs done>"], "remaining": ["<item IDs not done>"], "blocked": ["<item IDs needing decisions>"], "filesModified": ["<paths>"], "verification": {"typeCheck": "pass|fail", "tests": "pass|fail (N passed, M failed)"}}
|
|
29
|
+
\\\`\\\`\\\`
|
|
30
|
+
|
|
31
|
+
Do NOT return raw test output \u2014 summarize it in the verification field.
|
|
32
|
+
The orchestrator will submit this to \`${t} next --answer\` on your behalf.
|
|
33
|
+
`;await n.fs.writeTextFile(`${s}/noskills-executor.md`,o)},q=async(e,t)=>{let s=`${e}/.claude/agents`;await n.fs.mkdir(s,{recursive:!0}),await n.fs.writeTextFile(`${s}/noskills-verifier.md`,`---
|
|
34
|
+
name: noskills-verifier
|
|
35
|
+
description: "Independently verifies completed task work. Read-only. Never sees the executor's context."
|
|
36
|
+
tools: Read, Bash, Grep, Glob, LS
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
You are verifying another agent's work. You have NO context about how it was done.
|
|
40
|
+
Read the changed files. Run the test suite. Check each acceptance criterion independently.
|
|
41
|
+
|
|
42
|
+
For each acceptance criterion:
|
|
43
|
+
- PASS: with evidence \u2014 show the grep result, the test output, or the file content that proves it
|
|
44
|
+
- FAIL: with specific reason \u2014 what's missing, what's wrong, what doesn't match
|
|
45
|
+
|
|
46
|
+
Be skeptical. Don't assume anything works \u2014 verify it yourself.
|
|
47
|
+
You CANNOT edit files. Read-only access only.
|
|
48
|
+
|
|
49
|
+
## Verification Steps
|
|
50
|
+
1. Read each modified file and verify the changes are correct
|
|
51
|
+
2. Run type check: \\\`deno check\\\` on modified files
|
|
52
|
+
3. Run tests: \\\`deno test\\\` on relevant test files
|
|
53
|
+
4. Check each acceptance criterion against actual file contents
|
|
54
|
+
|
|
55
|
+
## Report Format
|
|
56
|
+
When finished, provide a structured JSON summary:
|
|
57
|
+
\\\`\\\`\\\`json
|
|
58
|
+
{"results": [{"id": "ac-1", "status": "PASS", "evidence": "..."}, {"id": "ac-2", "status": "FAIL", "reason": "..."}]}
|
|
59
|
+
\\\`\\\`\\\`
|
|
60
|
+
|
|
61
|
+
The orchestrator will use this report for the noskills status report.
|
|
62
|
+
`)},A={id:"claude-code",capabilities:{rules:!0,hooks:!0,agents:!0,specs:!1,mcp:!1,interaction:{hasAskUserTool:!0,optionPresentation:"tool",hasSubAgentDelegation:!0,subAgentMethod:"task"}},async syncRules(e,t){await x(e.root,e.rules,t,e.commandPrefix)},async syncHooks(e,t){await R(e.root,e.commandPrefix)},async syncAgents(e,t){await K(e.root,e.commandPrefix),await q(e.root,e.commandPrefix)}};var T=async(e,t,s="npx eser noskills")=>{let o=["# Generated by noskills \u2014 do not edit manually","","## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/specs/` or `.eser/rules/` directly. noskills gives you what you need.","",`Run \`${s} next\` to get your current instruction.`,`Submit results with \`${s} next --answer="..."\``,"","## Why noskills calls matter","","noskills is not a form to fill out. It is a live state machine that the user","watches in real-time. Every `"+s+" next --answer` call:","","- Updates the spec file on disk (the user sees it change)","- Updates the terminal dashboard if `noskills watch` is running","- Advances the state machine to the next phase","- Records the decision permanently in the project history","","When you batch-submit answers or backfill discovery responses yourself,","the user sees nothing happening \u2014 then suddenly everything jumps forward.","This defeats the purpose.","","Call noskills ONCE per interaction. Ask the user ONE question. Wait for","their answer. Submit it. Ask the next. The user is watching every step.","Do NOT pre-fill answers. Do NOT batch multiple answers. Do NOT answer","discovery questions yourself \u2014 the user's input is the data.","","## When to call noskills next","","1. At the START of every conversation","2. BEFORE creating or modifying any file","3. AFTER completing a logical unit of work","4. When you encounter a DECISION that affects architecture","5. When you are UNSURE what to do next","","NEVER proceed with implementation without checking noskills first.","","## Interactive choices","","Present choices as numbered lists. Users select by number.","When interactiveOptions are present in noskills output, present each as a","numbered item with its label and description. Ask the user to pick a number.","","## Execution model","","Execute tasks sequentially in this context. Do not attempt to spawn sub-agents.",""];if(t.length>0){o.push("## Rules","");for(let i of t)o.push(`- ${i}`);o.push("")}await n.fs.writeTextFile(`${e}/.cursorrules`,o.join(`
|
|
63
|
+
`))};var C={id:"cursor",capabilities:{rules:!0,hooks:!1,agents:!1,specs:!1,mcp:!1,interaction:{hasAskUserTool:!1,optionPresentation:"prose",hasSubAgentDelegation:!1,subAgentMethod:"none"}},async syncRules(e){await T(e.root,e.rules,e.commandPrefix)}};var X=".kiro/steering",O=".kiro/settings",Z=".kiro/agents",ee=".kiro/specs",te="hooks.json",se="mcp.json",oe="noskills-protocol.md",ne="noskills-coaching.md",k="noskills-rules.md",N="conventions.md",ie="noskills-executor.json",re="noskills-verifier.json",ae=(e,t)=>{let s=["---","inclusion: always","---","","# noskills Protocol","","# Generated by noskills \u2014 do not edit manually","","## What is noskills","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/rules/`, `.eser/specs/`, or concern files directly.","noskills gives you exactly what you need via JSON output.","","## Protocol","",` ${e} next --spec=<name> # get current instruction`,` ${e} next --spec=<name> --answer="your response" # submit result and advance`,"","Every noskills command that operates on a spec MUST include `--spec=<name>`.",`Never omit it. Use \`${e} spec list\` to see available specs.`,"","## Why noskills calls matter","","noskills is not a form to fill out. It is a live state machine that the user","watches in real-time. Every `"+e+" next --answer` call:","","- Updates the spec file on disk (the user sees it change)","- Updates the terminal dashboard if `noskills watch` is running","- Advances the state machine to the next phase","- Records the decision permanently in the project history","","When you batch-submit answers or backfill discovery responses yourself,","the user sees nothing happening \u2014 then suddenly everything jumps forward.","This defeats the purpose.","","Call noskills ONCE per interaction. Ask the user ONE question. Wait for","their answer. Submit it. Ask the next. The user is watching every step.","Do NOT pre-fill answers. Do NOT batch multiple answers. Do NOT answer","discovery questions yourself \u2014 the user's input is the data.","","## When to call noskills next","",`You MUST call \`${e} next\` in these situations:`,"","1. At the **START** of every conversation (first thing you do)","2. **BEFORE** creating or modifying any file (to verify you have an active task)","3. **AFTER** completing a logical unit of work (to report progress)","4. When you encounter a **DECISION** that affects architecture or scope","5. When you are **UNSURE** what to do next","","NEVER proceed with implementation without checking noskills first.","NEVER make architectural decisions independently \u2014 noskills routes them to the user."];return(t?.allowGit??!1)||s.push("","## Git is read-only","","You MUST NOT run git write commands: commit, add, push, checkout, stash,","reset, merge, rebase, cherry-pick. The user controls git. You control files.","You MAY read from git: log, diff, status, show, blame."),s.push("","## Interactive choices","","Present choices as numbered lists. Users select by number.","When interactiveOptions are present in noskills output, present each as a","numbered item with its label and description. Ask the user to pick a number.","Use the `commandMap` to resolve the user's selection to a CLI command.","","## Decision principle: Explicit > Clever","","You NEVER skip steps, bypass questions, or make assumptions on behalf of the user.","- Discovery questions \u2192 ask the user, don't answer yourself","- Classification \u2192 ask the user, don't infer","- Spec approval \u2192 ask the user, don't auto-approve","- Task refinement \u2192 ask the user, don't self-assign","- Rule promotion \u2192 ask the user, don't decide",`If you think something can be skipped, ASK "would you like to skip this?" \u2014 don't skip it.`,"","## Command execution","","When told to run a noskills command, execute it IMMEDIATELY. Do not explore,","research, read source code, or plan first. The command output contains all the","context you need. Exploring noskills internals wastes tokens and delays the user.","","## JSON output","","noskills returns JSON with a `phase` field and phase-specific instructions.","The `meta` block contains resume context - use it to orient yourself,","especially after compaction or at the start of a new session.","Follow the `instruction` field. Use `transition` commands to advance state.",""),s.join(`
|
|
64
|
+
`)},ce=e=>["---","inclusion: auto","name: noskills-coaching",'description: "Guidance for noskills spec-driven development workflow, including convention discovery and rule promotion"',"---","","# noskills Coaching","","# Generated by noskills \u2014 do not edit manually","","## Convention discovery","","When you discover a pattern, receive a correction, or identify a recurring",'preference from the user, ask: "Should this be a permanent rule for this',`project, or just for this task?" If permanent, run: \`${e} rule add`,'"<description>"`. If just this task, note it and move on.',"Never write to `.eser/rules/` directly.","","## How to promote rules","","When a convention should be permanent, use the noskills CLI to register it:","",` ${e} rule add "<description of the rule>"`,"","This stores the rule in `.eser/rules/` and ensures it is synced to all","coding tools on the next `noskills sync`. Never edit `.eser/rules/` directly.",""].join(`
|
|
65
|
+
`),le=e=>{let t=["---","inclusion: always","---","","# noskills Rules","","# Generated by noskills \u2014 do not edit manually","","## Active Rules",""];for(let s of e)t.push(`- ${s}`);return t.push(""),t.join(`
|
|
66
|
+
`)},ue=e=>({hooks:[{_noskills:!0,trigger:"Prompt Submit",action:{type:"Run Command",command:`${e} invoke-hook session-start`},timeout:5e3},{_noskills:!0,trigger:"Pre Tool Use",condition:{toolNames:["write","shell"]},action:{type:"Run Command",command:`${e} invoke-hook pre-tool-use`},timeout:5e3},{_noskills:!0,trigger:"Post Tool Use",condition:{toolNames:["write"]},action:{type:"Run Command",command:`${e} invoke-hook post-file-write`},timeout:3e3},{_noskills:!0,trigger:"Post Tool Use",condition:{toolNames:["shell"]},action:{type:"Run Command",command:`${e} invoke-hook post-bash`},timeout:3e3},{_noskills:!0,trigger:"Agent Stop",action:{type:"Run Command",command:`${e} invoke-hook stop`},timeout:1e4}]}),de=e=>{let t=e.split(/\s+/),s=t[0]??"npx",o=[...t.slice(1),"mcp-serve"];return{mcpServers:{noskills:{command:s,args:o,env:{},autoApprove:["noskills_next","noskills_status"],disabled:!1}}}},pe=e=>({name:"noskills-executor",description:"Executes a single noskills task. Follows spec behavioral rules and reports structured results.",tools:["read","write","glob","grep","shell","delegate"],allowedTools:["read","write","glob","grep","shell","delegate"],resources:["file://.kiro/steering/noskills-protocol.md"],prompt:["You are executing a single task from a noskills spec.","Your ONLY job is to complete the task described in the prompt.","Follow all behavioral rules provided in the prompt.","Do NOT start new tasks, explore unrelated code, or make architectural decisions.","If the task is too vague to execute, say so immediately.","","## Self-Verification","After completing the task, you MUST verify your own work before reporting:","1. Run type check: `deno check` on all modified files","2. Run test suite: `deno test` on the relevant test files","3. If type check or tests fail, fix the issues before reporting","","## Reporting","When finished, provide a structured JSON summary:","```json",'{"completed": ["<item IDs done>"], "remaining": ["<item IDs not done>"], "blocked": ["<item IDs needing decisions>"], "filesModified": ["<paths>"], "verification": {"typeCheck": "pass|fail", "tests": "pass|fail (N passed, M failed)"}}',"```","","Do NOT return raw test output \u2014 summarize it in the verification field.",`The orchestrator will submit this to \`${e} next --answer\` on your behalf.`].join(`
|
|
67
|
+
`)}),he=()=>({name:"noskills-verifier",description:"Independently verifies completed task work. Read-only. Never sees the executor's context.",tools:["read","glob","grep","shell","use_subagent"],allowedTools:["read","glob","grep","shell"],resources:["file://.kiro/steering/noskills-protocol.md"],prompt:["You are verifying another agent's work. You have NO context about how it was done.","Read the changed files. Run the test suite. Check each acceptance criterion independently.","","For each acceptance criterion:","- PASS: with evidence \u2014 show the grep result, the test output, or the file content that proves it","- FAIL: with specific reason \u2014 what's missing, what's wrong, what doesn't match","","Be skeptical. Don't assume anything works \u2014 verify it yourself.","You CANNOT edit files. Read-only access only.","","## Verification Steps","1. Read each modified file and verify the changes are correct","2. Run type check: `deno check` on modified files","3. Run tests: `deno test` on relevant test files","4. Check each acceptance criterion against actual file contents","","## Report Format","When finished, provide a structured JSON summary:","```json",'{"results": [{"id": "ac-1", "status": "PASS", "evidence": "..."}, {"id": "ac-2", "status": "FAIL", "reason": "..."}]}',"```","","The orchestrator will use this report for the noskills status report."].join(`
|
|
68
|
+
`)}),E=async e=>{try{return await n.fs.stat(e),!0}catch{return!1}},me=e=>{let s=e.match(/^# Spec:\s*(.+)$/m)?.[1]?.trim()??"Untitled",o=new Map,i=e.split(/^## /m);for(let a of i){let l=a.indexOf(`
|
|
69
|
+
`);if(l===-1)continue;let c=a.slice(0,l).trim().toLowerCase(),u=a.slice(l+1).trim();o.set(c,u)}let r=a=>{for(let[l,c]of o)if(l.startsWith(a.toLowerCase()))return c;return""};return{title:s,concerns:r("concerns"),discoveryAnswers:r("discovery answers"),contributorGuide:r("contributor guide"),publicApi:r("public api"),outOfScope:r("out of scope"),tasks:r("tasks"),verification:r("verification")}},fe=e=>{let t=[`# Feature: ${e.title}`,"","## Overview","",e.discoveryAnswers||"(no discovery answers yet)","","## Requirements",""],s=e.discoveryAnswers.split(`
|
|
70
|
+
`).filter(o=>o.startsWith("### "));if(s.length>0)for(let o of s)t.push(`- ${o.replace(/^###\s*/,"")}`);else e.discoveryAnswers?t.push("- See overview for details"):t.push("- (none yet)");if(t.push("","## Acceptance Criteria",""),e.verification){let o=e.verification.split(`
|
|
71
|
+
`).filter(i=>i.trim());for(let i of o){let r=i.replace(/^[-*]\s*/,"").trim();r&&t.push(`- [ ] ${r}`)}}else t.push("- [ ] (none yet)");return t.push("","## Out of Scope",""),t.push(e.outOfScope||"(nothing listed)"),t.push(""),t.join(`
|
|
72
|
+
`)},ye=e=>{let t=[`# Design: ${e.title}`,"","## Architecture",""];return e.discoveryAnswers?t.push(e.discoveryAnswers):t.push("(no architecture decisions yet)"),t.push("","## Concerns",""),e.concerns?t.push(e.concerns):t.push("(no active concerns)"),t.push("","## Decisions",""),e.contributorGuide||e.publicApi?(e.contributorGuide&&t.push("### Contributor Guide","",e.contributorGuide,""),e.publicApi&&t.push("### Public API Surface","",e.publicApi,"")):t.push("(no decisions yet)"),t.push(""),t.join(`
|
|
73
|
+
`)},ke=e=>{let t=[`# Tasks: ${e.title}`,""];return e.tasks?t.push(e.tasks):t.push("(no tasks yet)"),t.push(""),t.join(`
|
|
74
|
+
`)},$={id:"kiro",capabilities:{rules:!0,hooks:!0,agents:!0,specs:!0,mcp:!0,interaction:{hasAskUserTool:!1,optionPresentation:"prose",hasSubAgentDelegation:!0,subAgentMethod:"delegation"}},async syncRules(e,t){let s=`${e.root}/${X}`;await n.fs.mkdir(s,{recursive:!0}),await n.fs.writeTextFile(`${s}/${oe}`,ae(e.commandPrefix,t)),await n.fs.writeTextFile(`${s}/${ne}`,ce(e.commandPrefix)),e.rules.length>0?await n.fs.writeTextFile(`${s}/${k}`,le(e.rules)):await E(`${s}/${k}`)&&await n.fs.remove(`${s}/${k}`),await E(`${s}/${N}`)&&await n.fs.remove(`${s}/${N}`)},async syncHooks(e,t){let s=`${e.root}/${O}`,o=`${s}/${te}`;await n.fs.mkdir(s,{recursive:!0});let i=[];try{let c=await n.fs.readTextFile(o),u=JSON.parse(c);Array.isArray(u.hooks)&&(i=u.hooks)}catch{}let r=i.filter(c=>!c._noskills),a=ue(e.commandPrefix),l={hooks:[...r,...a.hooks]};await n.fs.writeTextFile(o,JSON.stringify(l,null,2)+`
|
|
75
|
+
`)},async syncAgents(e,t){let s=`${e.root}/${Z}`;await n.fs.mkdir(s,{recursive:!0});let o=pe(e.commandPrefix);await n.fs.writeTextFile(`${s}/${ie}`,JSON.stringify(o,null,2)+`
|
|
76
|
+
`);let i=he();await n.fs.writeTextFile(`${s}/${re}`,JSON.stringify(i,null,2)+`
|
|
77
|
+
`)},async syncSpecs(e,t){let s;try{s=await n.fs.readTextFile(t)}catch{return}if(s.trim()==="")return;let o=t.split("/"),i=o[o.length-2]??"unknown",r=me(s),a=`${e.root}/${ee}/${i}`;await n.fs.mkdir(a,{recursive:!0}),await n.fs.writeTextFile(`${a}/requirements.md`,fe(r)),await n.fs.writeTextFile(`${a}/design.md`,ye(r)),await n.fs.writeTextFile(`${a}/tasks.md`,ke(r))},async syncMcp(e){let t=`${e.root}/${O}`,s=`${t}/${se}`;await n.fs.mkdir(t,{recursive:!0});let o={mcpServers:{}};try{let a=await n.fs.readTextFile(s),l=JSON.parse(a);l.mcpServers!==void 0&&l.mcpServers!==null&&(o=l)}catch{}let i=de(e.commandPrefix),r={...o,mcpServers:{...o.mcpServers,...i.mcpServers}};await n.fs.writeTextFile(s,JSON.stringify(r,null,2)+`
|
|
78
|
+
`)}};var m=async(e,t,s="npx eser noskills")=>{let o=["# Generated by noskills \u2014 do not edit manually","","## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/specs/` or `.eser/rules/` directly. noskills gives you what you need.","",`Run \`${s} next\` to get your current instruction.`,`Submit results with \`${s} next --answer="..."\``,"","## Why noskills calls matter","","noskills is not a form to fill out. It is a live state machine that the user","watches in real-time. Every `"+s+" next --answer` call:","","- Updates the spec file on disk (the user sees it change)","- Updates the terminal dashboard if `noskills watch` is running","- Advances the state machine to the next phase","- Records the decision permanently in the project history","","When you batch-submit answers or backfill discovery responses yourself,","the user sees nothing happening \u2014 then suddenly everything jumps forward.","This defeats the purpose.","","Call noskills ONCE per interaction. Ask the user ONE question. Wait for","their answer. Submit it. Ask the next. The user is watching every step.","Do NOT pre-fill answers. Do NOT batch multiple answers. Do NOT answer","discovery questions yourself \u2014 the user's input is the data.","","## When to call noskills next","","1. At the START of every conversation","2. BEFORE creating or modifying any file","3. AFTER completing a logical unit of work","4. When you encounter a DECISION that affects architecture","5. When you are UNSURE what to do next","","NEVER proceed with implementation without checking noskills first.","","## Interactive choices","","Present choices as numbered lists. Users select by number.","When interactiveOptions are present in noskills output, present each as a","numbered item with its label and description. Ask the user to pick a number.","","## Execution model","","Execute tasks sequentially in this context. Do not attempt to spawn sub-agents.",""];if(t.length>0){o.push("## Rules","");for(let i of t)o.push(`- ${i}`);o.push("")}await n.fs.mkdir(`${e}/.github`,{recursive:!0}),await n.fs.writeTextFile(`${e}/.github/copilot-instructions.md`,o.join(`
|
|
79
|
+
`))};var D={id:"copilot",capabilities:{rules:!0,hooks:!1,agents:!1,specs:!1,mcp:!1,interaction:{hasAskUserTool:!1,optionPresentation:"prose",hasSubAgentDelegation:!1,subAgentMethod:"none"}},async syncRules(e){await m(e.root,e.rules,e.commandPrefix)}};var M=async(e,t,s="npx eser noskills")=>{let o=["# Generated by noskills \u2014 do not edit manually","","## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/specs/` or `.eser/rules/` directly. noskills gives you what you need.","",`Run \`${s} next\` to get your current instruction.`,`Submit results with \`${s} next --answer="..."\``,"","## Why noskills calls matter","","noskills is not a form to fill out. It is a live state machine that the user","watches in real-time. Every `"+s+" next --answer` call:","","- Updates the spec file on disk (the user sees it change)","- Updates the terminal dashboard if `noskills watch` is running","- Advances the state machine to the next phase","- Records the decision permanently in the project history","","When you batch-submit answers or backfill discovery responses yourself,","the user sees nothing happening \u2014 then suddenly everything jumps forward.","This defeats the purpose.","","Call noskills ONCE per interaction. Ask the user ONE question. Wait for","their answer. Submit it. Ask the next. The user is watching every step.","Do NOT pre-fill answers. Do NOT batch multiple answers. Do NOT answer","discovery questions yourself \u2014 the user's input is the data.","","## When to call noskills next","","1. At the START of every conversation","2. BEFORE creating or modifying any file","3. AFTER completing a logical unit of work","4. When you encounter a DECISION that affects architecture","5. When you are UNSURE what to do next","","NEVER proceed with implementation without checking noskills first.","","## Interactive choices","","Present choices as numbered lists. Users select by number.","When interactiveOptions are present in noskills output, present each as a","numbered item with its label and description. Ask the user to pick a number.","","## Execution model","","Execute tasks sequentially in this context. Do not attempt to spawn sub-agents.",""];if(t.length>0){o.push("## Rules","");for(let i of t)o.push(`- ${i}`);o.push("")}await n.fs.writeTextFile(`${e}/.windsurfrules`,o.join(`
|
|
80
|
+
`))};var F={id:"windsurf",capabilities:{rules:!0,hooks:!1,agents:!1,specs:!1,mcp:!1,interaction:{hasAskUserTool:!1,optionPresentation:"prose",hasSubAgentDelegation:!1,subAgentMethod:"none"}},async syncRules(e){await M(e.root,e.rules,e.commandPrefix)}};var Se="AGENTS.md",P="<!-- noskills:start -->",g="<!-- noskills:end -->",xe=(e,t)=>{let s=["## noskills Protocol","","# Generated by noskills \u2014 do not edit manually","","### What is noskills","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/rules/`, `.eser/specs/`, or concern files directly.","noskills gives you exactly what you need via JSON output.","","### Protocol","",` ${e} next --spec=<name> # get current instruction`,` ${e} next --spec=<name> --answer="your response" # submit result and advance`,"","Every noskills command that operates on a spec MUST include `--spec=<name>`.",`Never omit it. Use \`${e} spec list\` to see available specs.`,"","### Why noskills calls matter","","noskills is not a form to fill out. It is a live state machine that the user","watches in real-time. Every `"+e+" next --answer` call:","","- Updates the spec file on disk (the user sees it change)","- Updates the terminal dashboard if `noskills watch` is running","- Advances the state machine to the next phase","- Records the decision permanently in the project history","","When you batch-submit answers or backfill discovery responses yourself,","the user sees nothing happening \u2014 then suddenly everything jumps forward.","This defeats the purpose.","","Call noskills ONCE per interaction. Ask the user ONE question. Wait for","their answer. Submit it. Ask the next. The user is watching every step.","Do NOT pre-fill answers. Do NOT batch multiple answers. Do NOT answer","discovery questions yourself \u2014 the user's input is the data.","","### When to call noskills next","",`You MUST call \`${e} next\` in these situations:`,"","1. At the **START** of every conversation (first thing you do)","2. **BEFORE** creating or modifying any file (to verify you have an active task)","3. **AFTER** completing a logical unit of work (to report progress)","4. When you encounter a **DECISION** that affects architecture or scope","5. When you are **UNSURE** what to do next","","NEVER proceed with implementation without checking noskills first.","NEVER make architectural decisions independently \u2014 noskills routes them to the user."];return(t?.allowGit??!1)||s.push("","### Git is read-only","","You MUST NOT run git write commands: commit, add, push, checkout, stash,","reset, merge, rebase, cherry-pick. The user controls git. You control files.","You MAY read from git: log, diff, status, show, blame."),s.push("","### Interactive choices","","Present choices as numbered lists. Users select by number.","When interactiveOptions are present in noskills output, present each as a","numbered item with its label and description. Ask the user to pick a number.","Use the `commandMap` to resolve the user's selection to a CLI command.","","### Decision principle: Explicit > Clever","","You NEVER skip steps, bypass questions, or make assumptions on behalf of the user.","- Discovery questions \u2192 ask the user, don't answer yourself","- Classification \u2192 ask the user, don't infer","- Spec approval \u2192 ask the user, don't auto-approve","- Task refinement \u2192 ask the user, don't self-assign","- Rule promotion \u2192 ask the user, don't decide",`If you think something can be skipped, ASK "would you like to skip this?" \u2014 don't skip it.`,"","### Command execution","","When told to run a noskills command, execute it IMMEDIATELY. Do not explore,","research, read source code, or plan first. The command output contains all the","context you need. Exploring noskills internals wastes tokens and delays the user.","","### JSON output","","noskills returns JSON with a `phase` field and phase-specific instructions.","The `meta` block contains resume context - use it to orient yourself,","especially after compaction or at the start of a new session.","Follow the `instruction` field. Use `transition` commands to advance state.",""),s.join(`
|
|
81
|
+
`)},Re=e=>["### Convention discovery","","When you discover a pattern, receive a correction, or identify a recurring",'preference from the user, ask: "Should this be a permanent rule for this',`project, or just for this task?" If permanent, run: \`${e} rule add`,'"<description>"`. If just this task, note it and move on.',"Never write to `.eser/rules/` directly.","","### How to promote rules","","When a convention should be permanent, use the noskills CLI to register it:","",` ${e} rule add "<description of the rule>"`,"","This stores the rule in `.eser/rules/` and ensures it is synced to all","coding tools on the next `noskills sync`. Never edit `.eser/rules/` directly.",""].join(`
|
|
82
|
+
`),Ae=e=>{let t=["### Active Rules",""];for(let s of e)t.push(`- ${s}`);return t.push(""),t.join(`
|
|
83
|
+
`)},Te=(e,t,s)=>{let o=[P,xe(t,s),Re(t)];return e.length>0&&o.push(Ae(e)),o.push(g),o.join(`
|
|
84
|
+
`)},p=async(e,t)=>{let s=`${e.root}/${Se}`,o=Te(e.rules,e.commandPrefix,t),i;try{i=await n.fs.readTextFile(s);let r=i.indexOf(P),a=i.indexOf(g);r!==-1&&a!==-1?i=i.slice(0,r)+o+i.slice(a+g.length):i=i.trimEnd()+`
|
|
85
|
+
|
|
86
|
+
`+o+`
|
|
87
|
+
`}catch{i=o+`
|
|
88
|
+
`}await n.fs.writeTextFile(s,i)};var Ce=".opencode/plugins",Oe=".opencode/agents",Ne=".opencode/skills",Ee="opencode.json",$e=e=>["// Generated by noskills \u2014 do not edit manually",'import { execSync } from "node:child_process";',"","const run = (event: string): void => {"," try {",` execSync(\`${e} invoke-hook \${event}\`, {`,' stdio: "inherit",'," timeout: 10000,"," });"," } catch {"," // Hook failure should not block the session"," }","};","","export default async () => ({",' "session.created": async () => {',' run("session-start");'," },",' "tool.execute.before": async (params: { toolName: string }) => {',' if (["write", "shell"].includes(params.toolName)) {',' run("pre-tool-use");'," }"," },",' "tool.execute.after": async (params: { toolName: string }) => {',' if (params.toolName === "write") {',' run("post-file-write");',' } else if (params.toolName === "shell") {',' run("post-bash");'," }"," },",' "session.deleted": async () => {',' run("stop");'," },","});",""].join(`
|
|
89
|
+
`),Ie=e=>["---","name: noskills-executor",'description: "Executes a single noskills task. Follows spec behavioral rules and reports structured results."',"tools: read, write, glob, grep, shell, delegate","---","","You are executing a single task from a noskills spec.","Your ONLY job is to complete the task described in the prompt.","Follow all behavioral rules provided in the prompt.","Do NOT start new tasks, explore unrelated code, or make architectural decisions.","If the task is too vague to execute, say so immediately.","","## Self-Verification","After completing the task, you MUST verify your own work before reporting:","1. Run type check: `deno check` on all modified files","2. Run test suite: `deno test` on the relevant test files","3. If type check or tests fail, fix the issues before reporting","","## Reporting","When finished, provide a structured JSON summary:","```json",'{"completed": ["<item IDs done>"], "remaining": ["<item IDs not done>"], "blocked": ["<item IDs needing decisions>"], "filesModified": ["<paths>"], "verification": {"typeCheck": "pass|fail", "tests": "pass|fail (N passed, M failed)"}}',"```","","Do NOT return raw test output \u2014 summarize it in the verification field.",`The orchestrator will submit this to \`${e} next --answer\` on your behalf.`,""].join(`
|
|
90
|
+
`),De=()=>["---","name: noskills-verifier",`description: "Independently verifies completed task work. Read-only. Never sees the executor's context."`,"tools: read, glob, grep, shell","---","","You are verifying another agent's work. You have NO context about how it was done.","Read the changed files. Run the test suite. Check each acceptance criterion independently.","","For each acceptance criterion:","- PASS: with evidence \u2014 show the grep result, the test output, or the file content that proves it","- FAIL: with specific reason \u2014 what's missing, what's wrong, what doesn't match","","Be skeptical. Don't assume anything works \u2014 verify it yourself.","You CANNOT edit files. Read-only access only.","","## Verification Steps","1. Read each modified file and verify the changes are correct","2. Run type check: `deno check` on modified files","3. Run tests: `deno test` on relevant test files","4. Check each acceptance criterion against actual file contents","","## Report Format","When finished, provide a structured JSON summary:","```json",'{"results": [{"id": "ac-1", "status": "PASS", "evidence": "..."}, {"id": "ac-2", "status": "FAIL", "reason": "..."}]}',"```","","The orchestrator will use this report for the noskills status report.",""].join(`
|
|
91
|
+
`),Me=e=>{let s=e.match(/^# Spec:\s*(.+)$/m)?.[1]?.trim()??"Untitled",o=new Map,i=e.split(/^## /m);for(let a of i){let l=a.indexOf(`
|
|
92
|
+
`);if(l===-1)continue;let c=a.slice(0,l).trim().toLowerCase(),u=a.slice(l+1).trim();o.set(c,u)}let r=a=>{for(let[l,c]of o)if(l.startsWith(a.toLowerCase()))return c;return""};return{title:s,concerns:r("concerns"),discoveryAnswers:r("discovery answers"),contributorGuide:r("contributor guide"),publicApi:r("public api"),outOfScope:r("out of scope"),tasks:r("tasks"),verification:r("verification")}},Fe=e=>{let t=["---",`name: ${e.title}`,`description: "noskills spec: ${e.title}"`,"---","",`# ${e.title}`,""];return e.discoveryAnswers&&t.push("## Overview","",e.discoveryAnswers,""),e.concerns&&t.push("## Concerns","",e.concerns,""),e.contributorGuide&&t.push("## Contributor Guide","",e.contributorGuide,""),e.publicApi&&t.push("## Public API","",e.publicApi,""),e.outOfScope&&t.push("## Out of Scope","",e.outOfScope,""),e.tasks&&t.push("## Tasks","",e.tasks,""),e.verification&&t.push("## Verification","",e.verification,""),t.join(`
|
|
93
|
+
`)},Pe=async e=>{try{return await n.fs.stat(e),!0}catch{return!1}},U={id:"opencode",capabilities:{rules:!0,hooks:!0,agents:!0,specs:!0,mcp:!0,interaction:{hasAskUserTool:!1,optionPresentation:"prose",hasSubAgentDelegation:!0,subAgentMethod:"delegation"}},async syncRules(e,t){await p(e,t)},async syncHooks(e,t){let s=`${e.root}/${Ce}`;await n.fs.mkdir(s,{recursive:!0}),await n.fs.writeTextFile(`${s}/noskills.ts`,$e(e.commandPrefix))},async syncAgents(e,t){let s=`${e.root}/${Oe}`;await n.fs.mkdir(s,{recursive:!0}),await n.fs.writeTextFile(`${s}/noskills-executor.md`,Ie(e.commandPrefix)),await n.fs.writeTextFile(`${s}/noskills-verifier.md`,De())},async syncSpecs(e,t){let s;try{s=await n.fs.readTextFile(t)}catch{return}if(s.trim()==="")return;let o=t.split("/"),i=o[o.length-2]??"unknown",r=Me(s),a=`${e.root}/${Ne}`;await n.fs.mkdir(a,{recursive:!0}),await n.fs.writeTextFile(`${a}/${i}.md`,Fe(r))},async syncMcp(e){let t=`${e.root}/${Ee}`,s={};if(await Pe(t))try{let l=await n.fs.readTextFile(t);s=JSON.parse(l)}catch{}let o=e.commandPrefix.split(/\s+/),i=o[0]??"npx",r=[...o.slice(1),"mcp-serve"],a={...s,mcp:{...s.mcp,noskills:{type:"local",command:i,args:r}}};await n.fs.writeTextFile(t,JSON.stringify(a,null,2)+`
|
|
94
|
+
`)}};var je=".codex",_e="hooks.json",We=".codex/agents",He=".codex/config.toml",Le=e=>({hooks:[{_noskills:!0,event:"SessionStart",command:`${e} invoke-hook session-start`,timeout:5e3},{_noskills:!0,event:"PreToolUse",command:`${e} invoke-hook pre-tool-use`,timeout:5e3},{_noskills:!0,event:"PostToolUse",command:`${e} invoke-hook post-file-write`,timeout:3e3},{_noskills:!0,event:"Stop",command:`${e} invoke-hook stop`,timeout:1e4}]}),Ye=e=>['name = "noskills-executor"','description = "Executes a single noskills task. Follows spec behavioral rules and reports structured results."','developer_instructions = """',["You are executing a single task from a noskills spec.","Your ONLY job is to complete the task described in the prompt.","Follow all behavioral rules provided in the prompt.","Do NOT start new tasks, explore unrelated code, or make architectural decisions.","If the task is too vague to execute, say so immediately.","","## Self-Verification","After completing the task, you MUST verify your own work before reporting:","1. Run type check: `deno check` on all modified files","2. Run test suite: `deno test` on the relevant test files","3. If type check or tests fail, fix the issues before reporting","","## Reporting","When finished, provide a structured JSON summary:",'{"completed": ["<item IDs done>"], "remaining": ["<item IDs not done>"],',' "blocked": ["<item IDs needing decisions>"], "filesModified": ["<paths>"],',' "verification": {"typeCheck": "pass|fail", "tests": "pass|fail"}}',"","Do NOT return raw test output \u2014 summarize it in the verification field.",`The orchestrator will submit this to \`${e} next --answer\` on your behalf.`].join(`
|
|
95
|
+
`),'"""',""].join(`
|
|
96
|
+
`),Ge=()=>['name = "noskills-verifier"',`description = "Independently verifies completed task work. Read-only. Never sees the executor's context."`,'developer_instructions = """',["You are verifying another agent's work. You have NO context about how it was done.","Read the changed files. Run the test suite. Check each acceptance criterion independently.","","For each acceptance criterion:","- PASS: with evidence \u2014 show the grep result, the test output, or the file content that proves it","- FAIL: with specific reason \u2014 what's missing, what's wrong, what doesn't match","","Be skeptical. Don't assume anything works \u2014 verify it yourself.","You CANNOT edit files. Read-only access only.","","## Verification Steps","1. Read each modified file and verify the changes are correct","2. Run type check: `deno check` on modified files","3. Run tests: `deno test` on relevant test files","4. Check each acceptance criterion against actual file contents","","## Report Format","When finished, provide a structured JSON summary:",'{"results": [{"id": "ac-1", "status": "PASS", "evidence": "..."},',' {"id": "ac-2", "status": "FAIL", "reason": "..."}]}',"","The orchestrator will use this report for the noskills status report."].join(`
|
|
97
|
+
`),'"""',""].join(`
|
|
98
|
+
`),Je=e=>{let t=e.split(/\s+/),s=t[0]??"npx",o=[...t.slice(1),"mcp-serve"].map(i=>`"${i}"`).join(", ");return`[mcp_servers.noskills]
|
|
99
|
+
command = "${s}"
|
|
100
|
+
args = [${o}]
|
|
101
|
+
`},Ve=async e=>{try{return await n.fs.stat(e),!0}catch{return!1}},j={id:"codex",capabilities:{rules:!0,hooks:!0,agents:!0,specs:!1,mcp:!0,interaction:{hasAskUserTool:!1,optionPresentation:"prose",hasSubAgentDelegation:!0,subAgentMethod:"delegation"}},async syncRules(e,t){await p(e,t)},async syncHooks(e,t){let s=`${e.root}/${je}`,o=`${s}/${_e}`;await n.fs.mkdir(s,{recursive:!0});let i=[];try{let c=await n.fs.readTextFile(o),u=JSON.parse(c);Array.isArray(u.hooks)&&(i=u.hooks)}catch{}let r=i.filter(c=>!c._noskills),a=Le(e.commandPrefix),l={hooks:[...r,...a.hooks]};await n.fs.writeTextFile(o,JSON.stringify(l,null,2)+`
|
|
102
|
+
`)},async syncAgents(e,t){let s=`${e.root}/${We}`;await n.fs.mkdir(s,{recursive:!0}),await n.fs.writeTextFile(`${s}/noskills-executor.toml`,Ye(e.commandPrefix)),await n.fs.writeTextFile(`${s}/noskills-verifier.toml`,Ge())},async syncMcp(e){let t=`${e.root}/${He}`;await n.fs.mkdir(`${e.root}/.codex`,{recursive:!0});let s="";if(await Ve(t))try{s=await n.fs.readTextFile(t)}catch{}let o=s.replace(/\[mcp_servers\.noskills\][\s\S]*?(?=\[|$)/,"").trimEnd(),i=Je(e.commandPrefix),r=o+(o.length>0?`
|
|
103
|
+
|
|
104
|
+
`:"")+i;await n.fs.writeTextFile(t,r)}};var qe=".github/hooks",Be="noskills.json",ze=".github/agents",Qe=".copilot",Xe="mcp.json",Ze=e=>({version:1,hooks:{"noskills:sessionStart":{_noskills:!0,command:["bash","-c",`${e} invoke-hook session-start`],timeoutSec:5},"noskills:preToolUse":{_noskills:!0,command:["bash","-c",`${e} invoke-hook pre-tool-use`],timeoutSec:5},"noskills:postToolUse":{_noskills:!0,command:["bash","-c",`${e} invoke-hook post-file-write`],timeoutSec:3},"noskills:agentStop":{_noskills:!0,command:["bash","-c",`${e} invoke-hook stop`],timeoutSec:10}}}),et=e=>["---","name: noskills-executor",'description: "Executes a single noskills task. Follows spec behavioral rules and reports structured results."',"tools:"," - read"," - write"," - glob"," - grep"," - shell","---","","You are executing a single task from a noskills spec.","Your ONLY job is to complete the task described in the prompt.","Follow all behavioral rules provided in the prompt.","Do NOT start new tasks, explore unrelated code, or make architectural decisions.","If the task is too vague to execute, say so immediately.","","## Self-Verification","After completing the task, you MUST verify your own work before reporting:","1. Run type check: `deno check` on all modified files","2. Run test suite: `deno test` on the relevant test files","3. If type check or tests fail, fix the issues before reporting","","## Reporting","When finished, provide a structured JSON summary:","```json",'{"completed": ["<item IDs done>"], "remaining": ["<item IDs not done>"], "blocked": ["<item IDs needing decisions>"], "filesModified": ["<paths>"], "verification": {"typeCheck": "pass|fail", "tests": "pass|fail (N passed, M failed)"}}',"```","","Do NOT return raw test output \u2014 summarize it in the verification field.",`The orchestrator will submit this to \`${e} next --answer\` on your behalf.`,""].join(`
|
|
105
|
+
`),tt=()=>["---","name: noskills-verifier",`description: "Independently verifies completed task work. Read-only. Never sees the executor's context."`,"tools:"," - read"," - glob"," - grep"," - shell","---","","You are verifying another agent's work. You have NO context about how it was done.","Read the changed files. Run the test suite. Check each acceptance criterion independently.","","For each acceptance criterion:","- PASS: with evidence \u2014 show the grep result, the test output, or the file content that proves it","- FAIL: with specific reason \u2014 what's missing, what's wrong, what doesn't match","","Be skeptical. Don't assume anything works \u2014 verify it yourself.","You CANNOT edit files. Read-only access only.","","## Verification Steps","1. Read each modified file and verify the changes are correct","2. Run type check: `deno check` on modified files","3. Run tests: `deno test` on relevant test files","4. Check each acceptance criterion against actual file contents","","## Report Format","When finished, provide a structured JSON summary:","```json",'{"results": [{"id": "ac-1", "status": "PASS", "evidence": "..."}, {"id": "ac-2", "status": "FAIL", "reason": "..."}]}',"```","","The orchestrator will use this report for the noskills status report.",""].join(`
|
|
106
|
+
`),st=e=>{let t=e.split(/\s+/),s=t[0]??"npx",o=[...t.slice(1),"mcp-serve"];return{mcpServers:{noskills:{type:"local",command:s,args:o,tools:["*"]}}}},ot=async e=>{try{return await n.fs.stat(e),!0}catch{return!1}},_={id:"copilot-cli",capabilities:{rules:!0,hooks:!0,agents:!0,specs:!1,mcp:!0,interaction:{hasAskUserTool:!1,optionPresentation:"prose",hasSubAgentDelegation:!0,subAgentMethod:"delegation"}},async syncRules(e,t){await p(e,t),await m(e.root,e.rules,e.commandPrefix)},async syncHooks(e,t){let s=`${e.root}/${qe}`,o=`${s}/${Be}`;await n.fs.mkdir(s,{recursive:!0});let i={};try{let c=await n.fs.readTextFile(o),u=JSON.parse(c);u.hooks!==void 0&&u.hooks!==null&&(i=u.hooks)}catch{}let r={};for(let[c,u]of Object.entries(i))u._noskills||(r[c]=u);let a=Ze(e.commandPrefix),l={version:1,hooks:{...r,...a.hooks}};await n.fs.writeTextFile(o,JSON.stringify(l,null,2)+`
|
|
107
|
+
`)},async syncAgents(e,t){let s=`${e.root}/${ze}`;await n.fs.mkdir(s,{recursive:!0}),await n.fs.writeTextFile(`${s}/noskills-executor.agent.md`,et(e.commandPrefix)),await n.fs.writeTextFile(`${s}/noskills-verifier.agent.md`,tt())},async syncMcp(e){let t=`${e.root}/${Qe}`,s=`${t}/${Xe}`;await n.fs.mkdir(t,{recursive:!0});let o={mcpServers:{}};if(await ot(s))try{let a=await n.fs.readTextFile(s),l=JSON.parse(a);l.mcpServers!==void 0&&l.mcpServers!==null&&(o=l)}catch{}let i=st(e.commandPrefix),r={...o,mcpServers:{...o.mcpServers,...i.mcpServers}};await n.fs.writeTextFile(s,JSON.stringify(r,null,2)+`
|
|
108
|
+
`)}};var it=async e=>{let t=`${e}/${f.rulesDir}`,s=[];try{for await(let o of n.fs.readDir(t))if(o.isFile&&(o.name.endsWith(".md")||o.name.endsWith(".txt"))){let i=await n.fs.readTextFile(`${t}/${o.name}`),r=i.trim().split(`
|
|
109
|
+
`)[0]??i.trim();s.push(r)}}catch{}return s},H=[A,C,$,D,F,U,j,_],W={hasAskUserTool:!0,optionPresentation:"tool",hasSubAgentDelegation:!0,subAgentMethod:"task"},ht=e=>{let t=e[0];return t===void 0?W:H.find(o=>o.id===t)?.capabilities.interaction??W},mt=async(e,t,s)=>{let o=await it(e),i=[],r={allowGit:s?.allowGit??!1},a=s?.command??"npx eser@latest noskills";b(a);for(let l of t){let c=H.find(h=>h.id===l);if(c===void 0)continue;let u={root:e,rules:o,commandPrefix:a};if(await c.syncRules(u,r),c.capabilities.hooks&&c.syncHooks!==void 0&&await c.syncHooks(u,r),c.capabilities.agents&&c.syncAgents!==void 0&&await c.syncAgents(u,r),c.capabilities.specs&&c.syncSpecs!==void 0){let h=`${e}/${f.specsDir}`;try{for await(let v of n.fs.readDir(h))if(v.isDirectory){let L=`${h}/${v.name}/spec.md`;await c.syncSpecs(u,L)}}catch{}}c.capabilities.mcp&&c.syncMcp!==void 0&&await c.syncMcp(u),i.push(l)}return t.includes("claude-code")&&i.push("hooks"),i};export{it as a,ht as b,mt as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as A}from"./chunk-
|
|
1
|
+
import{b as A}from"./chunk-MRZT23BL.js";import{b as $,c as b}from"./chunk-YK6UG66R.js";import{l as k,m as y,n as x,o as P}from"./chunk-LWCWPXCS.js";import{c as d,d as c,f as u,g as C,o as m,q as w,r as g}from"./chunk-Y6AFIAJP.js";import{a as l,b as p}from"./chunk-2N4GTHXQ.js";import{b as v}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var q=async s=>{let e=s?.[0];if(e==="add")return await I(s?.slice(1));if(e==="remove")return await M(s?.slice(1));if(e==="list")return await R();let r=$(),n=m({renderer:g.ansi(),sink:w.stdout()});return n.writeln(`Usage: ${r} concern <add <id> | remove <id> | list>`),await n.close(),l(void 0)},I=async s=>{let e=m({renderer:g.ansi(),sink:w.stdout()}),r=v.process.cwd(),n=(s??[]).filter(i=>!i.startsWith("-")),t=await k(r);if(n.length===0)return e.writeln(u("Please provide concern ID(s): "),d(b("concern add open-source beautiful-product"))),await e.close(),p({exitCode:1});if(t===null)return e.writeln(u("noskills not initialized.")),await e.close(),p({exitCode:1});let a=await A(),o=[];for(let i of n){let f=await x(r,i);if(f===null&&(f=a.find(h=>h.id===i)??null,f!==null&&await P(r,f)),f===null){e.writeln(u(`Unknown concern: ${i}`)),e.writeln(c(` Available: ${a.map(h=>h.id).join(", ")}`));continue}if(t.concerns.includes(i)||o.includes(i)){e.writeln(c(`Concern "${i}" is already active.`));continue}o.push(i)}if(o.length>0){let i={...t,concerns:[...t.concerns,...o]};await y(r,i),e.writeln(C("\u2714"),` Activated concerns: ${o.join(", ")}`)}return await e.close(),l(void 0)},M=async s=>{let e=m({renderer:g.ansi(),sink:w.stdout()}),r=v.process.cwd(),n=s?.[0],t=await k(r);if(n===void 0||n.length===0)return e.writeln(u("Please provide a concern ID: "),d(b("concern remove move-fast"))),await e.close(),p({exitCode:1});if(t===null)return e.writeln(u("noskills not initialized.")),await e.close(),p({exitCode:1});if(!t.concerns.includes(n))return e.writeln(c(`Concern "${n}" is not active.`)),await e.close(),l(void 0);let a={...t,concerns:t.concerns.filter(o=>o!==n)};return await y(r,a),e.writeln(C("\u2714")," Deactivated concern: ",d(n)),await e.close(),l(void 0)},R=async()=>{let s=m({renderer:g.ansi(),sink:w.stdout()}),e=v.process.cwd(),r=await k(e),n=await A(),t=r?.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=t.includes(a.id);s.writeln(" ",o?C("\u25CF"):c("\u25CB")," ",o?d(a.id):c(a.id),c(` ${a.description.slice(0,60)}...`))}return await s.close(),l(void 0)};export{q as main};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as x,d as D}from"./chunk-3SLKOP72.js";import{c as $}from"./chunk-YK6UG66R.js";import{m as k}from"./chunk-TMC5H2A5.js";import{d as S,f as g,h as C,i as y,j as E}from"./chunk-LWCWPXCS.js";import{c as m,d as o,f as a,g as u,o as w,q as f,r as h}from"./chunk-Y6AFIAJP.js";import{a as d,b as n}from"./chunk-2N4GTHXQ.js";import{b as l}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var G=async U=>{let e=w({renderer:h.ansi(),sink:f.stdout()}),i=l.process.cwd(),p=C(U);if(!p.ok)return e.writeln(a(p.error)),await e.close(),n({exitCode:1});let t;try{t=await g(i,p.spec)}catch(s){let c=s instanceof Error?s.message:String(s);return e.writeln(a(c)),await e.close(),n({exitCode:1})}if(t.phase!=="EXECUTING")return e.writeln(a(`Cannot complete in phase: ${t.phase}`)),e.writeln(o("Only EXECUTING phase can transition to COMPLETED.")),await e.close(),n({exitCode:1});if(t.spec!==null){let s=`${i}/${S.specDir(t.spec)}`;try{await l.fs.stat(s)}catch{return e.writeln(a(`Active spec '${t.spec}' directory not found.`)),e.writeln(o("Run `noskills reset` to return to IDLE.")),await e.close(),n({exitCode:1})}}let r=k(t,"done");if(await y(i,r),r.spec!==null&&await E(i,r.spec,r),r.spec!==null&&(await x(i,r.spec,"completed"),await D(i,r.spec,"completed")),e.writeln(u("\u2714")," Spec completed!"),e.writeln(""),e.writeln(" Spec: ",m(t.spec??"unknown")),e.writeln(` Iterations: ${t.execution.iteration}`),e.writeln(` Decisions: ${t.decisions.length}`),t.decisions.length>0){let s=t.decisions.filter(c=>c.promoted);s.length>0&&e.writeln(o(` Promoted to rules: ${s.length}`))}return e.writeln(""),e.writeln("Start a new spec with: ",m(`${$('spec new "..."')}`)),await e.close(),d(void 0)};export{G as main};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c}from"./chunk-YK6UG66R.js";import{c as x,d as g}from"./chunk-TMC5H2A5.js";import{e as E,i as p}from"./chunk-LWCWPXCS.js";import{c as o,d as m,f as n,g as l,o as f,q as u,r as h}from"./chunk-Y6AFIAJP.js";import{a as i,b as r}from"./chunk-2N4GTHXQ.js";import{b as w}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var b=async d=>{let e=f({renderer:h.ansi(),sink:u.stdout()}),a=w.process.cwd(),S=d!==void 0&&d.some(s=>s==="--exit"),t;try{t=await E(a)}catch(s){let y=s instanceof Error?s.message:String(s);return e.writeln(n(y)),await e.close(),r({exitCode:1})}if(S){if(t.phase!=="FREE")return e.writeln(n(`Cannot exit free mode in phase: ${t.phase}`)),e.writeln(m("Only FREE phase can transition back to IDLE.")),await e.close(),r({exitCode:1});let s=g(t);return await p(a,s),e.writeln(l("\u2714")," Exited free mode. Back to IDLE."),e.writeln(""),e.writeln("Start a spec with: ",o(`${c('spec new "..."')}`)),await e.close(),i(void 0)}if(t.phase!=="IDLE")return e.writeln(n(`Cannot enter free mode in phase: ${t.phase}`)),e.writeln(m("Only IDLE phase can transition to FREE.")),await e.close(),r({exitCode:1});let k=x(t);return await p(a,k),e.writeln(l("\u2714")," Free mode active \u2014 no enforcement."),e.writeln(""),e.writeln("Exit free mode with: ",o(`${c("free --exit")}`)),await e.close(),i(void 0)};export{b as main};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as T,b as J,e as B,f as N,g as q,h as G,i as U,j as h,k as r,l as y}from"./chunk-73EEM3FY.js";import{a as ie,b as ne,c as re}from"./chunk-VK7L5SMS.js";import{d as Z}from"./chunk-7GUYMD3Z.js";import{a as ee,b as te,c as oe}from"./chunk-ZMVD5IU4.js";import{b as I}from"./chunk-MRZT23BL.js";import"./chunk-7UX6WIXX.js";import{d as se}from"./chunk-TJZAIUKM.js";import{a as X,c as A,d as Y}from"./chunk-YK6UG66R.js";import{a as W,b as z,i as H,m as _,o as K,q as V,s as Q}from"./chunk-LWCWPXCS.js";import"./chunk-AGPCY6XP.js";import{a as k}from"./chunk-ERX4HONR.js";import"./chunk-Y6AFIAJP.js";import"./chunk-5MN3MWQN.js";import"./chunk-OLM5RTFK.js";import{a as F}from"./chunk-ALZM4JXG.js";import{a as S}from"./chunk-2N4GTHXQ.js";import"./chunk-BBKSV2RO.js";import{b as g}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var he=new F({description:"AI provider interface \u2014 ask questions, generate content",modules:{ask:{description:"Send a prompt to an AI provider",load:()=>import("./ask-F4XM2EEC.js")},list:{description:"List available AI providers",load:()=>import("./list-3RK7TPGG.js")}}});var ae=k;var ve=async t=>{try{return await g.fs.stat(t),!0}catch{return!1}},we=[{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 we)for(let o of i.paths)if(await ve(`${t}/${o}`)){e.push(i.id);break}return e};var a=async t=>{try{return await g.fs.stat(t),!0}catch{return!1}},ce=async(t,e)=>{try{let i=await g.fs.readTextFile(t);return JSON.parse(i)[e]??null}catch{return null}},xe=async t=>{let e=[];return(await a(`${t}/package.json`)||await a(`${t}/deno.json`))&&e.push("typescript"),await a(`${t}/go.mod`)&&e.push("go"),await a(`${t}/Cargo.toml`)&&e.push("rust"),(await a(`${t}/pyproject.toml`)||await a(`${t}/setup.py`))&&e.push("python"),e},Pe=async t=>{let e=[],i=await ce(`${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},Se=async t=>{let e=[];return await a(`${t}/.github/workflows`)&&e.push("github-actions"),await a(`${t}/.gitlab-ci.yml`)&&e.push("gitlab-ci"),await a(`${t}/Jenkinsfile`)&&e.push("jenkins"),await a(`${t}/.circleci`)&&e.push("circleci"),e},Te=async t=>{if(await a(`${t}/deno.json`))return"deno";let e=await ce(`${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},de=async t=>{let[e,i,o,d]=await Promise.all([xe(t),Pe(t),Se(t),Te(t)]);return{languages:e,frameworks:i,ci:o,testRunner:d}};var It=async t=>{let e=g.process.cwd(),i=ne(t),o=J({target:i==="agent"?"non-interactive":"interactive"}),d=re(t),b=pe(d,"--concerns"),f=pe(d,"--tools"),p=d.includes("--non-interactive")||i==="agent";if(await Q(e))return r.warn(o,"noskills is already initialized in this project."),r.info(o,`Run \`${A("sync")}\` to regenerate tool files.`),S(void 0);N(o,"noskills init");let D=y(o,"Scanning project...");D.start();let m=await de(e);D.succeed("Project scanned");for(let s of m.languages)r.step(o,` ${s}`);for(let s of m.frameworks)r.step(o,` ${s}`);for(let s of m.ci)r.step(o,` ${s}`);m.testRunner!==null&&r.step(o,` test runner: ${m.testRunner}`),h(o);let R=y(o,"Detecting coding tools...");R.start();let $=await le(e),v=ie(),E=v!==null&&!$.includes(v)?[v]:[],w=[...new Set([...E,...$])];R.succeed(`${w.length} coding tool(s) detected`);for(let s of w){let n=s===v?" (current)":"";r.step(o,` ${s}${n}`)}let u;if(f!==null){let s=["claude-code","cursor","kiro","copilot","windsurf","opencode","codex","copilot-cli"],n=f.filter(c=>s.includes(c));u=[...new Set([...E,...n])]}else p?u=[...w]:(h(o),u=await Ie(o,w,v));h(o);let M=y(o,"Detecting AI providers...");M.start();let x=(await ae()).filter(s=>s.available).map(s=>s.name);M.succeed(`${x.length} provider(s) detected`),h(o);let P=await I(),l;if(b!==null){let s=P.map(n=>n.id);l=b.filter(n=>s.includes(n)).sort((n,c)=>s.indexOf(n)-s.indexOf(c))}else if(p)l=[];else{let s=P.map(c=>({value:c.id,label:c.name,hint:c.description.slice(0,60)})),n=await B(o,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:s});l=T(n)?[]:[...n]}l.length>0?r.success(o,` Concerns: ${l.join(", ")}`):r.info(o,"No concerns selected. Add later with `concern add <id> [<id2> ...]`."),h(o);let j=y(o,"Initializing...");j.start(),await V(e);let ue=P.filter(s=>l.includes(s.id));for(let s of ue)await K(e,s);let L=await Y();X(L);let C={...z(l,u,x,m),command:L};await _(e,C);let O=W();if(await H(e,O),j.succeed("Scaffolded `.eser/`"),u.length>0){let s=y(o,"Syncing tool files...");s.start();let n=await oe(e,u,C);s.succeed(`Synced ${n.length} tool(s)`)}else r.warn(o,"No tools selected. noskills will work in agentless CLI mode only."),r.info(o,"Add tools later with `noskills sync`.");if(q(o,`Done. ${u.length} tool(s), ${x.length} provider(s), ${l.length} concern(s).`),i==="agent"){let n=(await I()).filter(me=>l.includes(me.id)),c=await ee(e),ge=te(C?.tools??[]),fe=Z(O,n,c,C,void 0,void 0,void 0,ge);await se(fe,"json")}else G(o),U(o,`Start a spec with: ${A('spec new "..."')}`);return S(void 0)},ke=[{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"}],Ie=async(t,e,i)=>{let o=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),b=await B(t,{message:o,options:ke.map(p=>({...p,hint:p.value===i?"you're running inside it":d.has(p.value)?"detected":void 0,disabled:p.value===i})),initialValues:[...e],required:!1});if(T(b))return[...e];let f=[...b];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(o=>o.trim()).filter(Boolean);return null};export{It as main};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{d as T}from"./chunk-7GUYMD3Z.js";import{a as $,b as C}from"./chunk-ZMVD5IU4.js";import"./chunk-MRZT23BL.js";import"./chunk-7UX6WIXX.js";import{c as w}from"./chunk-YK6UG66R.js";import{d as f,e as E,l as R,p as D,s as b}from"./chunk-LWCWPXCS.js";import{a as c}from"./chunk-2N4GTHXQ.js";import{b as r}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var O=new Set(["log","diff","status","show","blame","rev-parse","ls-files","ls-tree","cat-file","describe","shortlog","name-rev","for-each-ref","rev-list","help","version"]),v=new Map([["branch",new Set(["","--list","-l","-a","--all","-r","--remotes","-v","--verbose","--contains","--no-contains","--merged","--no-merged"])],["tag",new Set(["","-l","--list","-v","--verify","-n"])],["stash",new Set(["list","show"])],["remote",new Set(["","-v","--verbose","show","get-url"])],["config",new Set(["--get","--get-all","--get-regexp","--list","-l","--global","--local","--system"])],["reflog",new Set(["","show"])]]),y=t=>{let n=t.trim();if(!n.startsWith("git"))return!0;let e=n.slice(3).trim();if(e.length===0)return!0;let a=e.split(/\s+/),o=a[0]??"";if(O.has(o))return!0;let s=v.get(o);if(s!==void 0){let i=a[1]??"";if(s.has(i))return!0}return!1};var I=t=>{let n=[/(?:bash|sh|\/bin\/bash|\/bin\/sh)\s+-c\s+["'](.+?)["']/g,/(?:bash|sh|\/bin\/bash|\/bin\/sh)\s+-c\s+(\S+)/g,/eval\s+["'](.+?)["']/g];for(let o of n){let s;for(;(s=o.exec(t))!==null;){let i=s[1]??"";if(i.includes("git")&&!y(i))return!0}}let e=t.split(/\s*\|\s*/);for(let o of e){let s=o.trim();if(s.startsWith("git")&&!y(s))return!0}let a=t.matchAll(/\bgit\s+([\w-]+)/g);for(let o of a){let s=o[1]??"";if(!O.has(s)&&!v.has(s))return!0;if(v.has(s)){let i=o.index??0,g=t.slice(i);if(!y(g.split(/[;&|$)`]/)[0]??""))return!0}}return!1};var x=async()=>{let t=r.process.stdin.getReader(),n=[];try{for(;;){let{done:s,value:i}=await t.read();if(s||i===void 0)break;n.push(i)}}finally{t.releaseLock()}let e=0,a=new Uint8Array(n.reduce((s,i)=>s+i.length,0));for(let s of n)a.set(s,e),e+=s.length;let o=new TextDecoder().decode(a);try{return JSON.parse(o)}catch{return{}}},P=async t=>{let n=new TextEncoder,e=r.process.stdout.getWriter();await e.write(n.encode(JSON.stringify(t))),e.releaseLock()},V=async t=>{switch(t?.[0]){case"pre-tool-use":return await N();case"stop":return await A();case"post-file-write":return await _();case"post-bash":return await W();case"session-start":return await G();default:return c(void 0)}},N=async()=>{let t=await x(),n=t.tool_name??"unknown",e=t.tool_input??{},a=t.cwd??r.process.cwd(),o=await R(a),s={};try{s=await E(a)}catch{return c(void 0)}let i=async d=>{await P({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`noskills: ${d}`}})};if(n==="Bash"){let d=(e.command??"").trim();if(!(o?.allowGit??!1)&&d.includes("git")){let p=d.split(/\s*(?:&&|;)\s*/);for(let m of p){let k=m.trim();if(k.startsWith("git")&&!y(k))return await i("Git write operations are not allowed. Only read commands (log, diff, status, show, blame, branch, tag) are permitted. The user controls git, the agent controls files."),c(void 0)}if(I(d))return await i("Git write operations detected in subshell or pipe. Only read commands are permitted. The user controls git, the agent controls files."),c(void 0)}return c(void 0)}let g=["Write","Edit","MultiEdit"];if(!g.includes(n))return c(void 0);let h=e.file_path??e.path??"";if(h.includes(".eser/")||h.includes(".claude/"))return c(void 0);let l=s.phase??"UNKNOWN";if(l==="EXECUTING"||l==="IDLE"||l==="FREE"||l==="COMPLETED"||l==="UNKNOWN"){if(l==="EXECUTING"&&g.includes(n)){let d=`${a}/${f.stateDir}/executor-warned.flag`;try{await r.fs.readTextFile(d)}catch{try{await r.fs.mkdir(`${a}/${f.stateDir}`,{recursive:!0}),await r.fs.writeTextFile(d,new Date().toISOString());let u=new TextEncoder,p=r.process.stderr.getWriter();await p.write(u.encode(`noskills: REMINDER \u2014 You should be spawning a noskills-executor sub-agent for implementation work. If you're the main orchestrator agent, delegate to a sub-agent instead of editing directly. If you ARE a sub-agent, ignore this message and continue.
|
|
2
|
+
`)),p.releaseLock()}catch{}}}return c(void 0)}let S={DISCOVERY:`You are in DISCOVERY \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, complete discovery and get the spec approved first. Run \`${w("next")}\` to continue.`,DISCOVERY_REVIEW:`You are in DISCOVERY_REVIEW \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, complete discovery and get the spec approved first. Run \`${w('next --answer="approve"')}\` or revise answers.`,SPEC_DRAFT:`You are in SPEC_DRAFT \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, approve the spec first. Run \`${w("approve")}\``,SPEC_APPROVED:`You are in SPEC_APPROVED \u2014 start execution first: \`${w('next --answer="start"')}\``,BLOCKED:`Execution blocked. Resolve with \`${w('next --answer="resolution"')}\``};return await i(S[l]??`Run \`${w("next")}\` first.`),c(void 0)},A=async()=>{let t=await x();if(t.stop_hook_active===!0)return c(void 0);let n=t.cwd??r.process.cwd(),e;try{let u=await r.fs.readTextFile(`${n}/${f.stateFile}`);e=JSON.parse(u)}catch{return c(void 0)}if(e.phase!=="EXECUTING")return c(void 0);let a=e.execution??{},o=`${n}/${f.stateDir}/files-changed.jsonl`,s=[];try{let p=(await r.fs.readTextFile(o)).trim().split(`
|
|
3
|
+
`).filter(Boolean);s=[...new Set(p.map(m=>{try{return JSON.parse(m).file}catch{return null}}).filter(m=>m!==null))]}catch{}let i=[],g="no changes";try{let{execSync:u}=await import("node:child_process");i=u("git diff --name-only",{cwd:n,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
4
|
+
`).filter(Boolean);let k=u("git diff --stat",{cwd:n,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
5
|
+
`);g=k[k.length-1]??"no changes"}catch{}let h=[...new Set([...s,...i])],l=(a.iteration??0)+1,S=`${n}/${f.stateDir}/iterations`;try{await r.fs.mkdir(S,{recursive:!0}),await r.fs.writeTextFile(`${S}/iteration-${l}.json`,JSON.stringify({iteration:l,files:h,gitStat:g.trim(),timestamp:new Date().toISOString()},null,2)+`
|
|
6
|
+
`)}catch{}let d=15;try{let u=await R(n);u!==null&&(d=u.maxIterationsBeforeRestart)}catch{}e.execution={...a,iteration:l,modifiedFiles:h,lastProgress:g.trim()||a.lastProgress||null},e.lastCalledAt=new Date().toISOString();try{await r.fs.writeTextFile(`${n}/${f.stateFile}`,JSON.stringify(e,null,2)+`
|
|
7
|
+
`)}catch{}try{await r.fs.writeTextFile(o,"")}catch{}try{await r.fs.remove(`${n}/${f.stateDir}/executor-warned.flag`)}catch{}if(l>=d){let u=new TextEncoder,p=r.process.stderr.getWriter();await p.write(u.encode(`noskills: iteration ${l} reached threshold (${d}). Consider starting a fresh conversation.
|
|
8
|
+
`)),p.releaseLock()}return c(void 0)},_=async()=>{let t=await x(),n=t.tool_input??{},e=n.file_path??n.path??"";if(!e||e.includes(".eser/")||e.includes(".claude/"))return c(void 0);let a=t.cwd??r.process.cwd(),o=`${a}/${f.stateDir}/files-changed.jsonl`,s=JSON.stringify({file:e,tool:t.tool_name,ts:new Date().toISOString()});try{await r.fs.mkdir(`${a}/${f.stateDir}`,{recursive:!0});let i="";try{i=await r.fs.readTextFile(o)}catch{}await r.fs.writeTextFile(o,i+s+`
|
|
9
|
+
`)}catch{}return c(void 0)},W=async()=>{let t=await x(),e=(t.tool_input??{}).command??"";if(!e.includes("noskills"))return c(void 0);let a=t.cwd??r.process.cwd(),o=`${a}/${f.stateDir}/noskills-calls.jsonl`,s=JSON.stringify({command:e,ts:new Date().toISOString()});try{await r.fs.mkdir(`${a}/${f.stateDir}`,{recursive:!0});let i="";try{i=await r.fs.readTextFile(o)}catch{}await r.fs.writeTextFile(o,i+s+`
|
|
10
|
+
`)}catch{}return c(void 0)},G=async()=>{let t=r.process.cwd();if(!await b(t))return c(void 0);let n=await E(t),e=await R(t),o=(await D(t)).filter(h=>e!==null&&e.concerns.includes(h.id)),s=await $(t),i=C(e?.tools??[]),g=T(n,o,s,e,void 0,void 0,void 0,i);return await P(g),c(void 0)};export{V as main};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{b as ae}from"./chunk-VK7L5SMS.js";import{a as te,b as se,c as ne,d as M}from"./chunk-7GUYMD3Z.js";import{a as W,b as J}from"./chunk-ZMVD5IU4.js";import"./chunk-MRZT23BL.js";import{a as ie}from"./chunk-7UX6WIXX.js";import{a as re,b as oe,d as S}from"./chunk-TJZAIUKM.js";import{a as ge}from"./chunk-SNHYXBHM.js";import{a as he,b as we,c as Se,d as ve}from"./chunk-3SLKOP72.js";import{a as q}from"./chunk-VPXOI7CR.js";import{c as N}from"./chunk-YK6UG66R.js";import{a as ce,b as le,e as R,f as H,g as de,h as ue,j as pe,l as me,m as fe}from"./chunk-TMC5H2A5.js";import{a as G,d as F,f as z,g as B,j as X,k as Y,l as K,p as Z,r as U,s as ee}from"./chunk-LWCWPXCS.js";import{a as V,b as C}from"./chunk-2N4GTHXQ.js";import{b as h}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var Ie=a=>a.split(`
|
|
2
|
+
`).map(e=>e.replace(/^[-*]\s+/,"").trim()).filter(e=>e.length>0&&!e.startsWith("#")),Ce=async(a,e)=>{let r=[],i=(e.startsWith(a)?e.slice(a.length+1):e).split("/");i.pop();for(let t=i.length;t>=0;t--){let n=`${t===0?a:`${a}/${i.slice(0,t).join("/")}`}/.folder-rules.md`,o=t===0?".":i.slice(0,t).join("/");try{let p=await h.fs.readTextFile(n),l=Ie(p);for(let m of l)r.push({folder:o,rule:m})}catch{}}return r},Q=async(a,e)=>{let r=new Set,c=[];for(let i of e){let t=await Ce(a,i);for(let s of t){let n=`${s.folder}::${s.rule}`;r.has(n)||(r.add(n),c.push(s))}}return c};var Ge=async a=>{let e=h.process.cwd(),r=re(a),c=oe(a);if(!await ee(e))return await S({error:`noskills not initialized. Run: ${N("init")}`},r),C({exitCode:1});let i=null;for(let d of c)d.startsWith("--answer=")&&(i=d.slice(9));let t=B(c),s;try{s=await z(e,t)}catch(d){let u=d instanceof Error?d.message:String(d);return await S({error:u},r),C({exitCode:1})}if(t===null&&s.phase!=="IDLE"&&s.phase!=="FREE"&&s.phase!=="COMPLETED")return await S({error:"Error: --spec=<name> is required. Use `noskills spec list` to see available specs."},r),C({exitCode:1});let n=await K(e);if(n?.command!==void 0){let{setCommandPrefix:d}=await import("./cmd-RST2ZPA6.js");d(n.command)}if(n===null)return await S({error:"No config found"},r),C({exitCode:1});if(s.spec!==null&&s.phase!=="IDLE"&&s.phase!=="COMPLETED"){let d=`${e}/${F.specDir(s.spec)}`;try{await h.fs.stat(d)}catch{return await S({error:!0,message:`Active spec '${s.spec}' directory not found. Files may have been deleted manually.`,suggestion:`Run \`${N("reset")}\` to return to IDLE, or \`${N("cancel")}\` to mark as cancelled.`},r),C({exitCode:1})}}let o=ae(c,n);s.phase==="DISCOVERY"&&s.discovery.audience!==o&&(s={...s,discovery:{...s.discovery,audience:o}});let l=(await Z(e)).filter(d=>n.concerns.includes(d.id));if(i!==null){let d=await be(e,s,n,l,i);await U(e,d);let u={...d,lastCalledAt:new Date().toISOString()};await U(e,u);let x=await W(e),b=u.spec!==null?await q(e,u.spec):null,j=await ye(e,u),A=await Q(e,j),T=J(n?.tools??[]),g=M(u,l,x,n,b,A,void 0,T);return await S(g,r),V(void 0)}let m={...s,lastCalledAt:new Date().toISOString()};await U(e,m);let y=await W(e),D=m.spec!==null?await q(e,m.spec):null,k=await ye(e,m),E=await Q(e,k),P;m.phase==="IDLE"&&(P={existingSpecs:(await Y(e)).map(u=>({name:u.name,phase:u.state.phase,iteration:u.state.execution.iteration,detail:u.state.phase==="EXECUTING"?`${u.state.execution.completedTasks.length} tasks done, iteration ${u.state.execution.iteration}`:u.state.phase==="SPEC_DRAFT"?"awaiting approval":u.state.phase==="COMPLETED"?"completed":void 0})),rulesCount:y.length});let $=J(n?.tools??[]),_=M(m,l,y,n,D,E,P,$);return await S(_,r),V(void 0)},be=async(a,e,r,c,i)=>{switch(e.phase){case"DISCOVERY":{let t=e.discovery.audience==="agent",s=null;try{let o=JSON.parse(i);typeof o=="object"&&o!==null&&!Array.isArray(o)&&(t?te.map(m=>m.id).every(m=>m in o)&&(s=o):s=o)}catch{}let n=e;if(s!==null)for(let[o,p]of Object.entries(s))typeof p=="string"&&p.length>0&&(n=R(n,o,p));else{let o=se(c),p=n.discovery.currentQuestion,l=o[p];if(l===void 0)return e;n=R(n,l.id,i),n=ue(n)}return ne(n.discovery.answers)&&(n=H(n)),n}case"DISCOVERY_REVIEW":{if(i.trim().toLowerCase()==="approve")return de(e);if(i.trim().toLowerCase()==="split")return await Fe(a,e);try{let t=JSON.parse(i);if(typeof t.revise=="object"&&t.revise!==null){let s=e;for(let[n,o]of Object.entries(t.revise))typeof o=="string"&&o.length>0&&(s=R(s,n,o));return s}}catch{}return e}case"SPEC_DRAFT":{if(e.classification===null){let t,s=i.trim().toLowerCase();if(s==="none"||s==="skip")t={involvesWebUI:!1,involvesCLI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1};else try{let o=JSON.parse(i);t={involvesWebUI:o.involvesWebUI===!0||o.involvesUI===!0,involvesCLI:o.involvesCLI===!0||o.involvesUI===!0,involvesPublicAPI:o.involvesPublicAPI===!0,involvesMigration:o.involvesMigration===!0,involvesDataHandling:o.involvesDataHandling===!0}}catch{t={involvesWebUI:!1,involvesCLI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1}}let n={...e,classification:t};try{await ge(a,n,c)}catch{}return n}try{let t=JSON.parse(i);if(typeof t.refinement=="string"&&t.refinement.length>0){let s=t.refinement;if(e.spec!==null){let n=`${a}/${F.specFile(e.spec)}`,o=await h.fs.readTextFile(n);if(s.includes("task-")){let l=Re(s).map(D=>`- [ ] ${D}`).join(`
|
|
3
|
+
`),m=/## Tasks\n\n([\s\S]*?)(?=\n## |\n*$)/,y=o.replace(m,`## Tasks
|
|
4
|
+
|
|
5
|
+
${l}
|
|
6
|
+
`);await h.fs.writeTextFile(n,y)}}return e}}catch{}return e}case"SPEC_APPROVED":{let t=pe(e);return t.spec!==null&&(await he(a,t.spec,"executing"),await ve(a,t.spec,"executing")),t}case"EXECUTING":{if(!e.execution.awaitingStatusReport){let t={...e,execution:{...e.execution,lastProgress:i}};if(r.verifyCommand!==null&&r.verifyCommand!==void 0&&r.verifyCommand.length>0){let s=await Ee(a,r.verifyCommand);if(t={...t,execution:{...t.execution,lastVerification:s}},!s.passed)return t}return t={...t,execution:{...t.execution,awaitingStatusReport:!0}},t}return await ke(a,e,i,c)}case"BLOCKED":{let t=e.execution.lastProgress??"Unknown",s={id:`d${e.decisions.length+1}`,question:t.replace(/^BLOCKED:\s*/,""),choice:i,promoted:!1,timestamp:new Date().toISOString()},n=me(e,s);return n=ce(n,"EXECUTING"),n={...n,execution:{...n.execution,lastProgress:`Resolved: ${i}`}},n}default:return e}},Fe=async(a,e)=>{let r=ie(e.discovery.answers);if(!r.detected||r.proposals.length===0)return e;let c=[];for(let t of r.proposals){let s=`${a}/${F.specDir(t.name)}`;await h.fs.mkdir(s,{recursive:!0});let n=e.discovery.answers.filter(l=>t.relevantAnswers.includes(l.questionId)),p=le(G(),t.name,`spec/${t.name}`);for(let l of n)p=R(p,l.questionId,l.answer);p=H(p),await X(a,t.name,p),c.push(t.name)}return fe(e,"cancelled",`Split into: ${c.join(", ")}`)},Re=a=>a.split(/(?=task-\d+:)/).map(e=>e.replace(/[,;\n\s]+$/,"").trim()).filter(e=>/^task-\d+:/.test(e)),ke=async(a,e,r,c)=>{let i;try{i=JSON.parse(r)}catch{return{...e,execution:{...e.execution,lastProgress:r,awaitingStatusReport:!1}}}let t=e;if(e.execution.debt!==null&&e.execution.debt.items.length>0&&typeof e.execution.debt.items[0]=="string"){let I=e.execution.debt.items.map((w,f)=>({id:`legacy-${f+1}`,text:w,since:e.execution.debt.fromIteration}));t={...e,execution:{...e.execution,debt:{...e.execution.debt,items:I}}};let O=new TextEncoder,v=h.process.stderr.getWriter();await v.write(O.encode(`noskills: migrated legacy string[] debt to DebtItem[] format
|
|
7
|
+
`)),v.releaseLock()}let s=i.completed??[],n=new Set(s),o=i.na??[],p=new Set(o),l=i.newIssues??[],m=i.remaining??[],y=i.blocked??[],D=t.execution.debt?.unaddressedIterations??0,k=t.execution.debt!==null?t.execution.debt.items.filter(g=>!n.has(g.id)&&!p.has(g.id)):[],E=t.execution.debtCounter??0,P=l.map((g,I)=>({id:`debt-${E+I+1}`,text:g,since:t.execution.iteration})),$=[...k,...P],d=m.length===0&&y.length===0&&l.length===0||$.length===0?null:{items:$,fromIteration:t.execution.debt?.fromIteration??t.execution.iteration,unaddressedIterations:k.length>0?D+1:1},u=[...new Set([...t.execution.naItems??[],...o])],x=[];s.length>0&&x.push(`Completed: ${s.join(", ")}`),o.length>0&&x.push(`N/A: ${o.join(", ")}`);let b=x.length>0?x.join("; "):"Status report submitted",j=t.execution.lastVerification===null||t.execution.lastVerification.passed===!0,A=d===null&&j,T=E+l.length;if(A&&t.spec!==null){let g=await q(a,t.spec);if(g!==null){let I=t.execution.completedTasks??[],O=new Set(I),v=[];try{let f=JSON.parse(t.execution.lastProgress??"");Array.isArray(f.completed)&&(v=f.completed.filter(L=>!O.has(L)&&g.tasks.some(xe=>xe.id===L)))}catch{}if(v.length===0){let f=g.tasks.find(L=>!O.has(L.id));f!==void 0&&(v=[f.id])}let w=[];for(let f of v)await we(a,t.spec,f),await Se(a,t.spec,f,"done"),w.push(f);if(w.length>0){let f=w.length===1?`Task ${w[0]} accepted`:`Tasks ${w.join(", ")} accepted`;return{...t,execution:{...t.execution,lastProgress:`${f}: ${b}`,awaitingStatusReport:!1,debt:d,completedTasks:[...I,...w],debtCounter:T,naItems:u}}}}}return{...t,execution:{...t.execution,lastProgress:A?b:`Task not accepted \u2014 remaining items must be addressed first. ${b}`,awaitingStatusReport:!1,debt:d,debtCounter:T,naItems:u}}},Ee=async(a,e)=>{try{let{execSync:r}=await import("node:child_process"),c=r(e,{cwd:a,encoding:"utf-8",timeout:6e4,stdio:["pipe","pipe","pipe"]});return{passed:!0,output:String(c).slice(0,4e3),timestamp:new Date().toISOString()}}catch(r){let c=r,i=((c.stdout??"")+(c.stderr??"")).slice(0,4e3);return c.status!==void 0?{passed:!1,output:i||"Verification failed with no output",timestamp:new Date().toISOString()}:{passed:!1,output:`Verification command failed to execute: ${r instanceof Error?r.message:String(r)}`,timestamp:new Date().toISOString()}}},ye=async(a,e)=>{let r=[...e.execution.modifiedFiles??[]],c=await Pe(a);return[...new Set([...r,...c])]},Pe=async a=>{let e=`${a}/${F.stateDir}/files-changed.jsonl`;try{let c=(await h.fs.readTextFile(e)).trim().split(`
|
|
8
|
+
`).filter(Boolean),i=[];for(let t of c)try{let s=JSON.parse(t);i.includes(s.file)||i.push(s.file)}catch{}return i}catch{return[]}};export{be as handleAnswer,Ge as main,Re as parseRefinementTasks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{n as y}from"./chunk-TMC5H2A5.js";import{f,h,i as S,j as g}from"./chunk-LWCWPXCS.js";import{d as l,f as n,g as m,o as u,q as d,r as w}from"./chunk-Y6AFIAJP.js";import{a as p,b as t}from"./chunk-2N4GTHXQ.js";import{b as c}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var A=async C=>{let e=u({renderer:w.ansi(),sink:d.stdout()}),a=c.process.cwd(),i=h(C);if(!i.ok)return e.writeln(n(i.error)),await e.close(),t({exitCode:1});let s;try{s=await f(a,i.spec)}catch(o){let k=o instanceof Error?o.message:String(o);return e.writeln(n(k)),await e.close(),t({exitCode:1})}if(s.phase!=="COMPLETED")return e.writeln(n(`Cannot reopen in phase: ${s.phase}`)),e.writeln(l("Only COMPLETED specs can be reopened.")),await e.close(),t({exitCode:1});let r=y(s);return await S(a,r),r.spec!==null&&await g(a,r.spec,r),e.writeln(m("\u2714")," Spec reopened. Discovery answers preserved \u2014 run `noskills next` to revise."),await e.close(),p(void 0)};export{A as main};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{o as k}from"./chunk-TMC5H2A5.js";import{d as h,f as g,h as y,i as S,j as I}from"./chunk-LWCWPXCS.js";import{d as i,f as n,g as d,o as u,q as w,r as f}from"./chunk-Y6AFIAJP.js";import{a as c,b as p}from"./chunk-2N4GTHXQ.js";import{b as l}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var x=async D=>{let e=u({renderer:f.ansi(),sink:w.stdout()}),a=l.process.cwd(),o=y(D);if(!o.ok)return e.writeln(n(o.error)),await e.close(),p({exitCode:1});let s;try{s=await g(a,o.spec)}catch(r){let A=r instanceof Error?r.message:String(r);return e.writeln(n(A)),await e.close(),p({exitCode:1})}if(s.phase==="IDLE"||s.phase==="UNINITIALIZED")return e.writeln(i("Already idle. Nothing to reset.")),await e.close(),c(void 0);if(s.spec!==null){let r=`${a}/${h.specDir(s.spec)}`;try{await l.fs.stat(r)}catch{e.writeln(n(`Active spec '${s.spec}' directory not found.`)),e.writeln(i("Resetting to IDLE anyway."))}}let t=s.spec,m=k(s);return await S(a,m),t!==null&&await I(a,t,m),e.writeln(d("\u2714")," Reset to IDLE."),t!==null&&e.writeln(i(`Spec "${t}" state cleared. Files in .eser/specs/${t}/ preserved.`)),await e.close(),c(void 0)};export{x as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as k,c as x}from"./chunk-
|
|
1
|
+
import{a as k,c as x}from"./chunk-ZMVD5IU4.js";import{b as y,c as w}from"./chunk-YK6UG66R.js";import{d as f,l as h}from"./chunk-LWCWPXCS.js";import{c as m,d as i,f as p,g,o,q as l,r as a}from"./chunk-Y6AFIAJP.js";import{a as u,b as c}from"./chunk-2N4GTHXQ.js";import{b as n}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var U=async s=>{let e=s?.[0];if(e==="add")return await $(s?.slice(1));if(e==="list")return await v();if(e==="promote")return await C(s?.slice(1));let t=y(),r=o({renderer:a.ansi(),sink:l.stdout()});return r.writeln(`Usage: ${t} rule <add "rule text" | list | promote "decision">`),await r.close(),u(void 0)},$=async s=>{let e=o({renderer:a.ansi(),sink:l.stdout()}),t=n.process.cwd(),r=s?.join(" "),d=await h(t);if(r===void 0||r.length===0)return e.writeln(p("Please provide a rule: "),m(`${w('rule add "Use Deno Tests for all tests"')}`)),await e.close(),c({exitCode:1});let P=r.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50),A=`${t}/${f.rulesDir}/${P}.md`;return await n.fs.mkdir(`${t}/${f.rulesDir}`,{recursive:!0}),await n.fs.writeTextFile(A,r+`
|
|
2
2
|
`),e.writeln(g("\u2714")," Rule added: ",i(r)),d!==null&&d.tools.length>0&&(await x(t,d.tools,d),e.writeln(i(" Tool files synced."))),await e.close(),u(void 0)},v=async()=>{let s=o({renderer:a.ansi(),sink:l.stdout()}),e=n.process.cwd(),t=await k(e);if(s.writeln(m("Rules")),s.writeln(""),t.length===0)s.writeln(i(` No rules yet. Add one with: ${w('rule add "..."')}`));else for(let r of t)s.writeln(" ",i("\u2022"),` ${r}`);return await s.close(),u(void 0)},C=async s=>{let e=o({renderer:a.ansi(),sink:l.stdout()}),t=s?.join(" ");return t===void 0||t.length===0?(e.writeln(p("Please provide the decision text to promote.")),await e.close(),c({exitCode:1})):(await e.close(),await $(s))};export{U as main};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as D,b as A,d as F}from"./chunk-73EEM3FY.js";import{d as B}from"./chunk-7GUYMD3Z.js";import{a as W,b as X}from"./chunk-ZMVD5IU4.js";import"./chunk-MRZT23BL.js";import"./chunk-7UX6WIXX.js";import{b as E,c as V}from"./chunk-YK6UG66R.js";import{a as _,j}from"./chunk-TMC5H2A5.js";import{e as g,f as N,g as U,i as $,l as G,p as L,s as M}from"./chunk-LWCWPXCS.js";import{c as v,d as o,f as l,g as P,h,k as I,o as R,q as O,r as T}from"./chunk-Y6AFIAJP.js";import{a as S,b as w}from"./chunk-2N4GTHXQ.js";import{b as y}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var ue=async t=>{let e=R({renderer:T.ansi(),sink:O.stdout()}),i=y.process.cwd(),n=t?.includes("--unattended")??!1,r=z(t,"--max-turns")??10,p=z(t,"--max-iterations")??50;if(!await M(i))return e.writeln(l(`noskills not initialized. Run: ${V("init")}`)),await e.close(),w({exitCode:1});let x=U(t),c=await N(i,x);if(c.phase!=="EXECUTING"&&c.phase!=="SPEC_APPROVED")return e.writeln(l(`Cannot run from phase: ${c.phase}`)),e.writeln(o("Must be in SPEC_APPROVED or EXECUTING to start.")),await e.close(),w({exitCode:1});if(c.phase==="SPEC_APPROVED"){e.writeln(o("Starting execution from approved spec..."));let s=j(c);await $(i,s)}let u=await G(i);if(u===null)return e.writeln(l("Config not found.")),await e.close(),w({exitCode:1});e.writeln(v(`${E()} run`)),e.writeln(o(`Mode: ${n?"unattended":"interactive"}, max-turns: ${r}, max-iterations: ${p}`)),e.writeln("");let m=0,d=0;for(;m<p;){m++;let s=await g(i);if(s.phase==="COMPLETED"){e.writeln(""),e.writeln(P("\u2714")," Spec completed!"),e.writeln(` Iterations: ${s.execution.iteration}`),e.writeln(` Decisions: ${s.decisions.length}`);break}if(s.phase==="BLOCKED"){let a=s.execution.lastProgress??"Unknown";if(e.writeln(""),e.writeln(h("\u26A0")," Execution blocked: ",o(a)),n){await Z(i,a,m),e.writeln(o("Logged to .eser/.state/blocked.log. Resolve and re-run.")),d=1;break}let C=A(),f=await F(C,{message:"Enter resolution (or leave empty to stop):"});if(D(f)||f===""){e.writeln(o("Stopped by user."));break}let k=_(s,"EXECUTING");await $(i,{...k,execution:{...k.execution,lastProgress:`Resolved: ${f}`}});continue}if(s.phase!=="EXECUTING"){e.writeln(l(`Unexpected phase: ${s.phase}. Stopping.`)),d=1;break}let H=(await L(i)).filter(a=>u.concerns.includes(a.id)),q=await W(i),K=X(u.tools),J=B(s,H,q,u,void 0,void 0,void 0,K),Q=Y(J);e.writeln(I(`\u2500\u2500 Iteration ${m}`),o(` (execution: ${s.execution.iteration}, debt: ${s.execution.debt?.items.length??0})`)),s.execution.lastProgress!==null&&e.writeln(o(` Last: ${s.execution.lastProgress}`)),s.execution.lastVerification?.passed===!1&&e.writeln(l(" Verification failed \u2014 agent will fix")),s.execution.debt!==null&&e.writeln(h(` Debt: ${s.execution.debt.items.length} items`)),e.writeln(o(" Spawning agent..."));try{await(await import("./mod-KTV64DHD.js")).exec`claude -p ${Q} --max-turns ${String(r)} --output-format json`.noThrow().text()}catch{e.writeln(l(" Failed to spawn claude CLI. Is it installed?")),d=1;break}e.writeln(o(" Agent exited. Stop hook captured state."));let b=await g(i);if(u.autoCommit===!0&&u.allowGit!==!1)try{let a=await import("./mod-KTV64DHD.js");if((await a.exec`git diff --name-only`.noThrow().text()).trim().length>0){await a.exec`git add -A`.noThrow().text();let f=`noskills: iteration ${b.execution.iteration} \u2014 ${b.execution.lastProgress??"progress"}`;await a.exec`git commit -m ${f}`.noThrow().text(),e.writeln(o(" Auto-committed."))}}catch{e.writeln(o(" Auto-commit failed (non-fatal)."))}}return m>=p&&(e.writeln(""),e.writeln(h("\u26A0"),` Max iterations (${p}) reached. Stopping.`),d=2),await e.close(),d!==0?w({exitCode:d}):S(void 0)},Y=t=>{let e=[];if(e.push(t.meta.resumeHint),e.push(""),t.meta.spec!==null&&(e.push(`Working on spec: ${t.meta.spec}`),e.push("")),"instruction"in t&&(e.push(t.instruction),e.push("")),"previousIterationDebt"in t){let n=t.previousIterationDebt;if(n!==void 0){e.push(`DEBT from iteration ${n.fromIteration} (address first):`);for(let r of n.items)e.push(`- ${r}`);e.push("")}}if("statusReportRequired"in t){let n=t.statusReport;if(n!==void 0){e.push("Report against these acceptance criteria:");for(let r of n.criteria)e.push(`- ${r}`);e.push("")}}if("verificationFailed"in t&&t.verificationFailed===!0&&(e.push("Test output:"),e.push(("verificationOutput"in t?t.verificationOutput:"")??""),e.push("")),t.behavioral.rules.length>0){e.push("Rules:");for(let n of t.behavioral.rules)e.push(`- ${n}`);e.push("")}if("context"in t){let n=t.context;if(n.concernReminders.length>0){e.push("Reminders:");for(let r of n.concernReminders)e.push(`- ${r}`);e.push("")}}let i=E();return e.push(`When done, report progress: ${i} next --answer="your progress"`),e.push(`If blocked, run: ${i} block "reason"`),e.push(`When all tasks are complete: ${i} done`),e.join(`
|
|
2
|
+
`)},z=(t,e)=>{if(t===void 0)return null;let i=`${e}=`;for(let n of t)if(n.startsWith(i)){let r=parseInt(n.slice(i.length),10);if(!isNaN(r)&&r>0)return r}return null},Z=async(t,e,i)=>{let n=`${t}/.eser/.state/blocked.log`,r=`[${new Date().toISOString()}] iteration=${i} reason=${e}
|
|
3
|
+
`;try{let{appendFileSync:p,mkdirSync:x}=await import("node:fs"),{dirname:c}=await import("node:path");x(c(n),{recursive:!0}),p(n,r)}catch{}};export{ue as main};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as M}from"./chunk-7UX6WIXX.js";import{a as Y,d as L}from"./chunk-TJZAIUKM.js";import{b as $,c as R}from"./chunk-YK6UG66R.js";import{b as z,e as N,f as O,m as q}from"./chunk-TMC5H2A5.js";import{a as x,d as h,f as V,g as W,j as g,k as j,s as P}from"./chunk-LWCWPXCS.js";import{c as p,d as o,f as d,g as C,h as A,k as F,o as D,q as I,r as k}from"./chunk-Y6AFIAJP.js";import{a as f,b as m}from"./chunk-2N4GTHXQ.js";import{b as w}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var ie=async r=>{let e=r?.[0];if(e==="new")return await G(r?.slice(1));if(e==="list")return await T(r?.slice(1));if(e==="split")return await _(r?.slice(1));let n=$(),s=D({renderer:k.ansi(),sink:I.stdout()});return s.writeln(`Usage: ${n} spec <new --name=<slug> "description" | list | split --spec=<name> --into name1 "desc1" --into name2 "desc2">`),await s.close(),f(void 0)},G=async r=>{let e=D({renderer:k.ansi(),sink:I.stdout()}),n=w.process.cwd();if(!await P(n))return e.writeln(d("noskills is not initialized.")," Run: ",p(R("init"))),await e.close(),m({exitCode:1});let s=null,a=[];if(r!==void 0)for(let i of r)i.startsWith("--name=")?s=i.slice(7):i.startsWith("-")||a.push(i);let S=a.join(" ");if(s===null||s.length===0)return e.writeln(d("Error: --name is required.")),e.writeln(o("Example: "),p(`${$()} spec new --name=photo-upload "photo upload feature"`)),await e.close(),m({exitCode:1});let c=/^[a-z0-9][a-z0-9-]*[a-z0-9]$/;if(s.length>50||s.length>1&&!c.test(s)||s.length===1&&!/^[a-z0-9]$/.test(s))return e.writeln(d("Invalid spec name: "),p(s)),e.writeln(o("Must be lowercase, hyphens, numbers only. Max 50 chars. Regex: /^[a-z0-9][a-z0-9-]*[a-z0-9]$/")),await e.close(),m({exitCode:1});if(S.length===0)return e.writeln(d("Please provide a description: "),p(`${$()} spec new --name=${s} "photo upload feature"`)),await e.close(),m({exitCode:1});let u=`spec/${s}`,t=`${n}/${h.specDir(s)}`;try{return await w.fs.stat(t),e.writeln(d(`Spec "${s}" already exists.`),o(` Use a different --name or run \`${$()} reset --spec=${s}\` first.`)),await e.close(),m({exitCode:1})}catch{}let l=x(),y=z(l,s,u);return await w.fs.mkdir(`${n}/${h.specDir(s)}`,{recursive:!0}),await g(n,s,y),e.writeln(C("\u2714")," Spec started: ",p(s)),e.writeln(" Directory: ",o(h.specDir(s))),e.writeln(" Branch: ",o(u)),e.writeln(" Phase: ",A("DISCOVERY")),e.writeln(""),e.writeln("Run ",p(R(`next --spec=${s}`))," to begin discovery questions."),await e.close(),f(void 0)},T=async r=>{let e=w.process.cwd(),n=Y(r),s=await j(e),a=`${e}/${h.specsDir}`,S=new Set(s.map(t=>t.name)),c=[];for(let t of s)c.push({name:t.name,phase:t.state.phase,iteration:t.state.execution.iteration});try{for await(let t of w.fs.readDir(a))t.isDirectory&&!S.has(t.name)&&c.push({name:t.name,phase:"IDLE",iteration:0})}catch{}if(n==="json")return await L(c,"json"),f(void 0);let u=D({renderer:k.ansi(),sink:I.stdout()});if(u.writeln(p("Specs")),u.writeln(""),c.length===0)u.writeln(o(" No specs yet."));else for(let t of c){let l=t.phase==="COMPLETED"?C(t.phase):t.phase==="EXECUTING"?F(t.phase):t.phase==="BLOCKED"?d(t.phase):A(t.phase),y=t.phase==="EXECUTING"?o(` iteration ${t.iteration}`):"";u.writeln(" ",o("\u25CB")," ",t.name," ",l,y)}return await u.close(),f(void 0)},X=r=>{let e=[],n=0;for(;n<r.length;)if(r[n]==="--into"&&n+1<r.length){let s=r[n+1],a=s;n+2<r.length&&!r[n+2].startsWith("-")?(a=r[n+2],n+=3):n+=2,e.push({name:s,description:a})}else n+=1;return e},_=async r=>{let e=D({renderer:k.ansi(),sink:I.stdout()}),n=w.process.cwd();if(!await P(n))return e.writeln(d("noskills is not initialized.")," Run: ",p(R("init"))),await e.close(),m({exitCode:1});let s=W(r??[]);if(s===null)return e.writeln(d("Error: --spec=<name> is required.")),e.writeln(o("Example: "),p(`${$()} spec split --spec=parent --into name1 "desc1" --into name2 "desc2"`)),await e.close(),m({exitCode:1});let a;try{a=await V(n,s)}catch(t){let l=t instanceof Error?t.message:String(t);return e.writeln(d(`Error: ${l}`)),await e.close(),m({exitCode:1})}if(a.phase!=="DISCOVERY"&&a.phase!=="DISCOVERY_REVIEW")return e.writeln(d(`Cannot split spec in phase ${a.phase}. Must be in DISCOVERY or DISCOVERY_REVIEW.`)),await e.close(),m({exitCode:1});let S=X(r??[]);if(S.length<2){let t=M(a.discovery.answers);if(!t.detected||t.proposals.length<2)return e.writeln(d("Error: at least 2 --into entries required, or discovery answers must contain 2+ independent areas.")),await e.close(),m({exitCode:1});let l=[];for(let i of t.proposals){let v=`${n}/${h.specDir(i.name)}`;await w.fs.mkdir(v,{recursive:!0});let U=a.discovery.answers.filter(b=>i.relevantAnswers.includes(b.questionId)),E=z(x(),i.name,`spec/${i.name}`);for(let b of U)E=N(E,b.questionId,b.answer);E=O(E),await g(n,i.name,E),l.push(i.name)}let y=q(a,"cancelled",`Split into: ${l.join(", ")}`);await g(n,s,y),e.writeln(C("Split complete."),` Created ${l.length} sub-specs:`);for(let i of l)e.writeln(" ",o("\u25CB")," ",p(i));return e.writeln("",o(`Parent spec "${s}" cancelled.`)),await e.close(),f(void 0)}let c=[];for(let t of S){let l=`${n}/${h.specDir(t.name)}`;await w.fs.mkdir(l,{recursive:!0});let i=z(x(),t.name,`spec/${t.name}`);for(let v of a.discovery.answers)i=N(i,v.questionId,v.answer);i=O(i),await g(n,t.name,i),c.push(t.name)}let u=q(a,"cancelled",`Split into: ${c.join(", ")}`);await g(n,s,u),e.writeln(C("Split complete."),` Created ${c.length} sub-specs:`);for(let t of c)e.writeln(" ",o("\u25CB")," ",p(t));return e.writeln("",o(`Parent spec "${s}" cancelled.`)),await e.close(),f(void 0)};export{ie as main};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f,d as P}from"./chunk-7GUYMD3Z.js";import{a as R,b as S}from"./chunk-ZMVD5IU4.js";import"./chunk-MRZT23BL.js";import"./chunk-7UX6WIXX.js";import{a as k,d as w}from"./chunk-TJZAIUKM.js";import{c as h}from"./chunk-YK6UG66R.js";import{f as b,g as x,l as D,p as v,s as O}from"./chunk-LWCWPXCS.js";import{c as i,d as r,f as c,g as y,h as p,k as I,o as d,q as u,r as m}from"./chunk-Y6AFIAJP.js";import{a as l,b as E}from"./chunk-2N4GTHXQ.js";import{b as C}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var W=async g=>{let t=C.process.cwd(),o=k(g);if(!await O(t)){if(o==="json")await w({error:"noskills is not initialized"},o);else{let s=d({renderer:m.ansi(),sink:u.stdout()});s.writeln(c("noskills is not initialized.")," Run: ",i(h("init"))),await s.close()}return E({exitCode:1})}let V=x(g),e=await b(t,V),n=await D(t),T={phase:e.phase,spec:e.spec,branch:e.branch,discovery:e.phase==="DISCOVERY"||e.phase==="DISCOVERY_REVIEW"?{answered:e.discovery.answers.length,total:f.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:n?.concerns??[],tools:n?.tools??[],decisions:e.decisions.length};if(o==="json"){let a=(await v(t)).filter(N=>n!==null&&n.concerns.includes(N.id)),$=await R(t),j=S(n?.tools??[]),F=P(e,a,$,n,void 0,void 0,void 0,j);return await w({...T,...F},"json"),l(void 0)}{let s=d({renderer:m.ansi(),sink:u.stdout()});s.writeln(i(`${h("status")}`)),s.writeln("");let a=e.phase==="COMPLETED"?y(e.phase):e.phase==="BLOCKED"?c(e.phase):e.phase==="EXECUTING"?I(e.phase):p(e.phase);s.writeln(" Phase: ",a),e.spec!==null&&s.writeln(" Spec: ",i(e.spec)),e.branch!==null&&s.writeln(" Branch: ",e.branch),(e.phase==="DISCOVERY"||e.phase==="DISCOVERY_REVIEW")&&s.writeln(` Discovery: ${e.discovery.answers.length}/${f.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(p(` Debt: ${e.execution.debt.items.length} items`))),n!==null&&(s.writeln(""),n.concerns.length>0&&s.writeln(" Concerns: ",r(n.concerns.join(", "))),n.tools.length>0&&s.writeln(" Tools: ",r(n.tools.join(", ")))),e.decisions.length>0&&(s.writeln(""),s.writeln(` Decisions: ${e.decisions.length}`)),await s.close()}return l(void 0)};export{W as main};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as w}from"./chunk-
|
|
1
|
+
import{c as w}from"./chunk-ZMVD5IU4.js";import{c as g}from"./chunk-YK6UG66R.js";import{l as u}from"./chunk-LWCWPXCS.js";import{c as m,d as r,f as c,g as n,o as p,q as d,r as f}from"./chunk-Y6AFIAJP.js";import{a as o,b as a}from"./chunk-2N4GTHXQ.js";import{b as l}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var v=async h=>{let s=p({renderer:f.ansi(),sink:d.stdout()}),t=l.process.cwd(),e=await u(t);if(e===null)return s.writeln(c("noskills is not initialized.")," Run: ",m(g("init"))),await s.close(),a({exitCode:1});s.writeln(r("Syncing tool files..."));let i=await w(t,e.tools,e);for(let y of i)s.writeln(" ",n("\u2714"),` ${y}`);return i.length===0&&s.writeln(r(" No tools configured.")),s.writeln(""),s.writeln(n("Done.")),await s.close(),o(void 0)};export{v as main};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as v,c as L}from"./chunk-TJZAIUKM.js";import{a as
|
|
2
|
-
`).filter(Boolean),s=[];for(let c of l)try{let u=JSON.parse(c);s.includes(u.file)||s.push(u.file)}catch{}return s}catch{return[]}},W="\x1B[2J\x1B[H",E="\x1B[1m",
|
|
1
|
+
import{a as v,c as L}from"./chunk-TJZAIUKM.js";import{a as F,c as I}from"./chunk-VPXOI7CR.js";import{e as S,k as x,l as P,s as D}from"./chunk-LWCWPXCS.js";import{a as y,b as C}from"./chunk-2N4GTHXQ.js";import{b as f}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var M=async e=>{let t=await S(e),d=await P(e),l=await A(e),s=null,c=null,u=0,a=0;if(t.spec!==null){let n=await F(e,t.spec);if(n!==null){u=n.tasks.length,a=t.execution.completedTasks.length;let g=I(n.tasks,t.execution.completedTasks);g!==null&&(s=g.id,c=g.title)}}let p=null;t.lastCalledAt!==null&&(p=Math.floor((Date.now()-new Date(t.lastCalledAt).getTime())/1e3));let r=(await x(e)).map(n=>({name:n.name,phase:n.state.phase,iteration:n.state.execution.iteration}));return{spec:t.spec,phase:t.phase,iteration:t.execution.iteration,activeTaskId:s,activeTaskTitle:c,totalTasks:u,completedTaskCount:a,lastProgress:t.execution.lastProgress,lastCalledAt:t.lastCalledAt,modifiedFiles:t.execution.modifiedFiles,debt:t.execution.debt,concerns:d?.concerns??[],maxIterations:d?.maxIterationsBeforeRestart??15,awaitingStatusReport:t.execution.awaitingStatusReport,verificationPassed:t.execution.lastVerification?.passed??null,decisionsCount:t.decisions.length,discoveryAnswered:t.discovery.answers.length,discoveryTotal:6,trackedFiles:l,timeSinceUpdate:p,allSpecs:r}},A=async e=>{let t=`${e}/.eser/.state/files-changed.jsonl`;try{let l=(await f.fs.readTextFile(t)).trim().split(`
|
|
2
|
+
`).filter(Boolean),s=[];for(let c of l)try{let u=JSON.parse(c);s.includes(u.file)||s.push(u.file)}catch{}return s}catch{return[]}},W="\x1B[2J\x1B[H",E="\x1B[1m",h="\x1B[2m",o="\x1B[0m",k="\x1B[32m",T="\x1B[33m",w="\x1B[31m",R="\x1B[36m",b=e=>{switch(e){case"COMPLETED":return k;case"BLOCKED":return w;case"EXECUTING":return R;default:return T}},O=(e,t,d)=>{if(t===0)return"\u2591".repeat(d);let l=Math.min(e/t,1),s=Math.round(l*d);return"\u2588".repeat(s)+"\u2591".repeat(d-s)},N=e=>e===null?"never":e<60?`${e}s ago`:e<3600?`${Math.floor(e/60)}m ago`:`${Math.floor(e/3600)}h ago`,B=e=>e.replace(/\x1b\[[0-9;]*m/g,""),U=(e,t)=>{let d=B(e).length;return e+" ".repeat(Math.max(0,t-d))},j=e=>{let t=[],l="\u2500".repeat(54),s=a=>`${h}\u2502${o} ${U(a,52)}${h}\u2502${o}`,c=()=>`${h}\u2502${"".padEnd(54)}\u2502${o}`;if(t.push(`${h}\u256D${l}\u256E${o}`),t.push(s(`${E}noskills watch${o}`)),t.push(c()),t.push(s(`${E}Specs:${o}`)),e.allSpecs.length>0)for(let a of e.allSpecs){let p=b(a.phase),i=a.name.slice(0,18).padEnd(18),r=`${p}${a.phase}${o}`.padEnd(a.phase.length+10);if(a.phase==="EXECUTING"||a.phase==="BLOCKED"){let n=O(e.completedTaskCount,e.totalTasks,10),g=e.totalTasks>0?Math.round(e.completedTaskCount/e.totalTasks*100):0;t.push(s(` ${i} ${r} ${n} ${e.completedTaskCount}/${e.totalTasks} (${g}%)`))}else a.phase==="COMPLETED"?t.push(s(` ${i} ${r} done`)):t.push(s(` ${i} ${r}`))}else if(e.spec!==null){let a=b(e.phase);t.push(s(` ${e.spec} ${a}${e.phase}${o}`))}else t.push(s(` ${h}No specs yet${o}`));if(t.push(c()),e.phase==="DISCOVERY"||e.phase==="DISCOVERY_REVIEW")t.push(s(`Phase: ${b(e.phase)}${e.phase}${o} Discovery: ${e.discoveryAnswered}/${e.discoveryTotal} questions answered`));else if(e.phase==="SPEC_DRAFT")t.push(s(`Phase: ${T}${e.phase}${o} ${T}Awaiting approval${o}`));else if(e.phase==="SPEC_APPROVED")t.push(s(`Phase: ${T}${e.phase}${o} ${k}Ready to start${o}`));else if(e.phase==="EXECUTING"||e.phase==="BLOCKED"){if(e.spec!==null&&t.push(s(`${E}${e.spec}${o} (iteration ${e.iteration}):`)),e.activeTaskId!==null){let i=`${e.activeTaskId}${e.activeTaskTitle!==null?` (${e.activeTaskTitle})`:""}`;t.push(s(` Active task: ${R}${i.slice(0,36)}${o}`))}let a=O(e.completedTaskCount,e.totalTasks,12),p=e.totalTasks>0?Math.round(e.completedTaskCount/e.totalTasks*100):0;if(t.push(s(` Progress: ${k}${a} ${e.completedTaskCount}/${e.totalTasks} tasks (${p}%)${o}`)),t.push(s(` Iteration: ${e.iteration}`)),t.push(s(` Last update: ${N(e.timeSinceUpdate)}`)),e.lastProgress!==null&&t.push(s(` ${h}${e.lastProgress.slice(0,50)}${o}`)),e.phase==="BLOCKED"){let i=(e.lastProgress??"unknown").replace(/^BLOCKED:\s*/,"");t.push(s(` ${w}BLOCKED: ${i.slice(0,40)}${o}`)),t.push(s(` ${T}Human input needed${o}`))}if(e.awaitingStatusReport&&t.push(s(` ${T}Status report pending${o}`)),e.verificationPassed===!1&&t.push(s(` ${w}Verification failed${o}`)),t.push(c()),e.debt!==null&&e.debt.items.length>0){t.push(s(` Debt: ${e.debt.items.length} item(s)`));for(let i of e.debt.items.slice(0,3))t.push(s(` \u2514\u2500 ${i.text.slice(0,44)}`));e.debt.items.length>3&&t.push(s(` \u2514\u2500 ... and ${e.debt.items.length-3} more`))}if(e.trackedFiles.length>0||e.modifiedFiles.length>0){let i=e.trackedFiles.length>0?e.trackedFiles:e.modifiedFiles;t.push(s(` Files changed: ${i.length}`));for(let r of i.slice(0,5)){let n=r.length>44?"..."+r.slice(-41):r;t.push(s(` \u2514\u2500 ${n}`))}i.length>5&&t.push(s(` \u2514\u2500 ... and ${i.length-5} more`))}}else e.phase==="COMPLETED"?t.push(s(`${k}Complete!${o} ${e.iteration} iterations, ${e.decisionsCount} decisions`)):e.phase==="FREE"?t.push(s(`${h}Free mode \u2014 no enforcement${o}`)):e.phase==="IDLE"&&t.push(s(`${h}No active work${o}`));t.push(c()),e.concerns.length>0&&t.push(s(`Concerns: ${e.concerns.join(", ").slice(0,40)}`));let u=e.iteration>=e.maxIterations?`${w}RESTART RECOMMENDED${o}`:`${k}ok${o} (${e.iteration}/${e.maxIterations})`;return t.push(s(`Context: ${u}`)),t.push(`${h}\u2570${l}\u256F${o}`),t.push(` ${h}watching .eser/.state/ ... ctrl+c to stop${o}`),t.join(`
|
|
3
3
|
`)},K=e=>JSON.stringify({ts:new Date().toISOString(),phase:e.phase,spec:e.spec,iteration:e.iteration,activeTask:e.activeTaskId,tasks:{completed:e.completedTaskCount,total:e.totalTasks},progress:e.lastProgress,debt:e.debt?.items.length??0,filesChanged:e.trackedFiles.length>0?e.trackedFiles:e.modifiedFiles,timeSinceUpdate:e.timeSinceUpdate,verificationPassed:e.verificationPassed}),X=async e=>{let t=f.process.cwd(),l=e!==void 0&&e.some(r=>r==="-o"||r.startsWith("--output"))?v(e):"ansi";if(!await D(t)){let r=new TextEncoder,n=f.process.stdout.getWriter();return await n.write(r.encode(`noskills not initialized.
|
|
4
|
-
`)),n.releaseLock(),C({exitCode:1})}let s=`${t}/.eser/.state`,c="",u=async()=>{let r=await M(t),n=l==="json"?K(r):l==="markdown"?L(r,"markdown"):j(r);if(l==="json"){let
|
|
5
|
-
`)),$.releaseLock()}else if(l==="markdown"){let
|
|
4
|
+
`)),n.releaseLock(),C({exitCode:1})}let s=`${t}/.eser/.state`,c="",u=async()=>{let r=await M(t),n=l==="json"?K(r):l==="markdown"?L(r,"markdown"):j(r);if(l==="json"){let m=new TextEncoder,$=f.process.stdout.getWriter();await $.write(m.encode(n+`
|
|
5
|
+
`)),$.releaseLock()}else if(l==="markdown"){let m=new TextEncoder,$=f.process.stdout.getWriter();await $.write(m.encode(n+`
|
|
6
6
|
---
|
|
7
|
-
`)),$.releaseLock()}else if(n!==c){let
|
|
8
|
-
`)),$.releaseLock(),c=n}return r.allSpecs.length>0&&r.allSpecs.every(
|
|
7
|
+
`)),$.releaseLock()}else if(n!==c){let m=new TextEncoder,$=f.process.stdout.getWriter();await $.write(m.encode(W+n+`
|
|
8
|
+
`)),$.releaseLock(),c=n}return r.allSpecs.length>0&&r.allSpecs.every(m=>m.phase==="COMPLETED")||r.allSpecs.length===0&&r.phase==="COMPLETED"};if(await u())return y(void 0);let p=1e3,i=0;for(;;){await new Promise(r=>setTimeout(r,p));try{let n=(await f.fs.stat(`${s}/state.json`)).mtime?.getTime()??0;if(n>i&&(i=n,await new Promise(m=>setTimeout(m,200)),await u()))break}catch{}}return y(void 0)};export{M as buildSnapshot,X as main,K as renderJsonLine,j as renderTerminal};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as y,d as A}from"./chunk-3SLKOP72.js";import{m as E}from"./chunk-TMC5H2A5.js";import{d as x,f as S,h as g,i as k,j as C}from"./chunk-LWCWPXCS.js";import{d as u,f as n,g as f,o as d,q as w,r as h}from"./chunk-Y6AFIAJP.js";import{a as m,b as i}from"./chunk-2N4GTHXQ.js";import{b as c}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var q=async l=>{let e=d({renderer:h.ansi(),sink:w.stdout()}),a=c.process.cwd(),o=g(l);if(!o.ok)return e.writeln(n(o.error)),await e.close(),i({exitCode:1});let p=(l??[]).filter(r=>!r.startsWith("--spec=")).join(" ");if(p.length===0)return e.writeln(n('A reason is required: noskills wontfix "reason text"')),await e.close(),i({exitCode:1});let s;try{s=await S(a,o.spec)}catch(r){let D=r instanceof Error?r.message:String(r);return e.writeln(n(D)),await e.close(),i({exitCode:1})}if(s.phase==="IDLE"||s.phase==="FREE"||s.phase==="UNINITIALIZED"||s.phase==="COMPLETED")return e.writeln(n(`Cannot mark as won't fix in phase: ${s.phase}`)),await e.close(),i({exitCode:1});if(s.spec!==null){let r=`${a}/${x.specDir(s.spec)}`;try{await c.fs.stat(r)}catch{return e.writeln(n(`Active spec '${s.spec}' directory not found.`)),e.writeln(u("Run `noskills reset` to return to IDLE.")),await e.close(),i({exitCode:1})}}let t=E(s,"wontfix",p);return await k(a,t),t.spec!==null&&await C(a,t.spec,t),t.spec!==null&&(await y(a,t.spec,"wontfix"),await A(a,t.spec,"wontfix")),e.writeln(f("\u2714"),` Spec marked as won't fix: ${p}`),await e.close(),m(void 0)};export{q as main};
|
package/noskills.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as t}from"./chunks/chunk-ALZM4JXG.js";import{c as o}from"./chunks/chunk-2N4GTHXQ.js";import{b as s}from"./chunks/chunk-MNEZ5QGX.js";import"./chunks/chunk-DHMCIRLT.js";import"./chunks/chunk-4BH6CF3J.js";import"./chunks/chunk-OTRBRRIO.js";var r=new t({description:"noskills \u2014 state-machine orchestrator for AI agents",modules:{init:{description:"Initialize noskills in project",load:()=>import("./chunks/init-
|
|
2
|
+
import{a as t}from"./chunks/chunk-ALZM4JXG.js";import{c as o}from"./chunks/chunk-2N4GTHXQ.js";import{b as s}from"./chunks/chunk-MNEZ5QGX.js";import"./chunks/chunk-DHMCIRLT.js";import"./chunks/chunk-4BH6CF3J.js";import"./chunks/chunk-OTRBRRIO.js";var r=new t({description:"noskills \u2014 state-machine orchestrator for AI agents",modules:{init:{description:"Initialize noskills in project",load:()=>import("./chunks/init-M4MSHCVJ.js")},status:{description:"Show current state",load:()=>import("./chunks/status-63TFVF7Y.js")},spec:{description:"Manage specs (new, list)",load:()=>import("./chunks/spec-HQZVVCBY.js")},next:{description:"Get next instruction for agent",load:()=>import("./chunks/next-4DJGEJBW.js")},approve:{description:"Approve phase transition",load:()=>import("./chunks/approve-NPG6X7O6.js")},block:{description:"Mark spec as blocked",load:()=>import("./chunks/block-LSEXCK45.js")},reset:{description:"Reset current spec state",load:()=>import("./chunks/reset-WRTVX7TT.js")},done:{description:"Mark spec execution as complete",load:()=>import("./chunks/done-OMGLEA32.js")},free:{description:"Enter or exit free mode (no enforcement)",load:()=>import("./chunks/free-BO5UA5V2.js")},cancel:{description:"Cancel current spec",load:()=>import("./chunks/cancel-BK6GCIIY.js")},wontfix:{description:"Mark spec as won't fix (requires reason)",load:()=>import("./chunks/wontfix-BOT7HHH2.js")},reopen:{description:"Reopen a completed spec for revision",load:()=>import("./chunks/reopen-EKSLLO54.js")},concern:{description:"Manage concerns (add, remove, list)",load:()=>import("./chunks/concern-3K3QUYG4.js")},run:{description:"Autonomous execution loop (Ralph loop)",load:()=>import("./chunks/run-3VWWQDN2.js")},watch:{description:"Live dashboard for monitoring agent progress",load:()=>import("./chunks/watch-4HJMGNF4.js")},sync:{description:"Regenerate tool-specific files",load:()=>import("./chunks/sync-VS4HROEX.js")},purge:{description:"Remove all noskills content (specs, rules, concerns, hooks)",load:()=>import("./chunks/purge-MDSEQLDQ.js")},"invoke-hook":{description:"Internal hook handlers (called by agents)",load:()=>import("./chunks/invoke-hook-HB2TBCHD.js")},rule:{description:"Manage rules (add, list, promote)",load:()=>import("./chunks/rule-QP5BSH27.js")}}});var i={name:"@eser/noskills",version:"4.1.44",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=r.toCommand("noskills",i.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 +0,0 @@
|
|
|
1
|
-
import{a as k,d as D}from"./chunk-3SLKOP72.js";import{k as C}from"./chunk-ERUA3YBQ.js";import{d as w,f as h,h as S,i as g,j as y}from"./chunk-LWCWPXCS.js";import{d as l,f as n,g as m,o as u,q as d,r as f}from"./chunk-Y6AFIAJP.js";import{a as p,b as i}from"./chunk-2N4GTHXQ.js";import{b as o}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var R=async E=>{let e=u({renderer:f.ansi(),sink:d.stdout()}),r=o.process.cwd(),c=S(E);if(!c.ok)return e.writeln(n(c.error)),await e.close(),i({exitCode:1});let s;try{s=await h(r,c.spec)}catch(a){let I=a instanceof Error?a.message:String(a);return e.writeln(n(I)),await e.close(),i({exitCode:1})}if(s.phase==="IDLE"||s.phase==="UNINITIALIZED"||s.phase==="COMPLETED")return e.writeln(n(`Cannot cancel in phase: ${s.phase}`)),await e.close(),i({exitCode:1});if(s.spec!==null){let a=`${r}/${w.specDir(s.spec)}`;try{await o.fs.stat(a)}catch{return e.writeln(n(`Active spec '${s.spec}' directory not found.`)),e.writeln(l("Run `noskills reset` to return to IDLE.")),await e.close(),i({exitCode:1})}}let t=C(s,"cancelled");return await g(r,t),t.spec!==null&&await y(r,t.spec,t),t.spec!==null&&(await k(r,t.spec,"cancelled"),await D(r,t.spec,"cancelled")),e.writeln(m("\u2714")," Spec cancelled."),await e.close(),p(void 0)};export{R as main};
|
package/chunks/chunk-2WH262CW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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{u as a,N as b,U as c,F as d,_ as e};
|