eser 4.1.50 → 4.1.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunks/approve-VBXGXWZI.js +2 -0
- package/chunks/block-Z4BELXXO.js +2 -0
- package/chunks/{build-S4DSRSSR.js → build-4WTOXDXD.js} +1 -1
- package/chunks/cancel-HHW2G675.js +2 -0
- package/chunks/{changelog-gen-TE6FXELA.js → changelog-gen-JTU6WIYA.js} +1 -1
- package/chunks/{chunk-66VSO643.js → chunk-352YGR5O.js} +1 -1
- package/chunks/{chunk-BJ45FF6F.js → chunk-4BOZ4A55.js} +1 -1
- package/chunks/chunk-5GGWX7CO.js +4 -0
- package/chunks/{chunk-NWWXAZFA.js → chunk-5QUEAV4O.js} +26 -26
- package/chunks/chunk-5YBG2HOI.js +3 -0
- package/chunks/chunk-6F4PFXYY.js +2 -0
- package/chunks/{chunk-N6PXARPJ.js → chunk-6HJUPT5Y.js} +1 -1
- package/chunks/{chunk-AUDMKDAA.js → chunk-6M64JLJW.js} +1 -1
- package/chunks/{chunk-Z2RL2SFY.js → chunk-6WFCBJPF.js} +1 -1
- package/chunks/{chunk-ZQ7KN4HT.js → chunk-7L4DDCRL.js} +1 -1
- package/chunks/{chunk-TTLUVJIR.js → chunk-7V3IDYYI.js} +1 -1
- package/chunks/{chunk-YCI2VITZ.js → chunk-BKWQQUSY.js} +1 -1
- package/chunks/{chunk-OSNPAAYT.js → chunk-BZSILAX3.js} +1 -1
- package/chunks/{chunk-BNZPRQUS.js → chunk-DGI7M6TL.js} +1 -1
- package/chunks/{chunk-TBRDRQQK.js → chunk-DYBJ6UPO.js} +1 -1
- package/chunks/{chunk-QRNSYEPI.js → chunk-EJBYYUXZ.js} +1 -1
- package/chunks/{chunk-3SBAWBWS.js → chunk-F4QK3J3J.js} +1 -1
- package/chunks/{chunk-HV3EYAGF.js → chunk-GQ4WRANA.js} +1 -1
- package/chunks/{chunk-4QMRLILJ.js → chunk-H6U2EE7V.js} +1 -1
- package/chunks/{chunk-4NNSMDFH.js → chunk-IUORSUN6.js} +1 -1
- package/chunks/{chunk-3CE7GA2P.js → chunk-JBUJTUEU.js} +1 -1
- package/chunks/chunk-KFVUFHJB.js +6 -0
- package/chunks/{chunk-IY3YRKJJ.js → chunk-L6J3BWVP.js} +1 -1
- package/chunks/{chunk-PG7KG7NX.js → chunk-LRAHXO3G.js} +1 -1
- package/chunks/chunk-NE2J6ISX.js +6 -0
- package/chunks/chunk-NQS27P25.js +6 -0
- package/chunks/{chunk-2PWSTO7A.js → chunk-NYHMH3N5.js} +1 -1
- package/chunks/chunk-ODBJ5KMQ.js +3 -0
- package/chunks/chunk-OXP2FOO5.js +2 -0
- package/chunks/{chunk-JTSRGXS4.js → chunk-PZUDTTK4.js} +1 -1
- package/chunks/{chunk-WJI2X6IA.js → chunk-RLA2Z7XV.js} +1 -1
- package/chunks/{chunk-PY6ZNQ4B.js → chunk-RLTTHJ3E.js} +1 -1
- package/chunks/{chunk-UYGKTA3C.js → chunk-RSHUTH4K.js} +1 -1
- package/chunks/chunk-RUTM4VP7.js +11 -0
- package/chunks/{chunk-4XXI5LYN.js → chunk-SKW7N57D.js} +1 -1
- package/chunks/{chunk-CE6UVD6F.js → chunk-TJ4VL7T5.js} +1 -1
- package/chunks/{chunk-KFSZ6MDH.js → chunk-UTENCUNI.js} +1 -1
- package/chunks/{chunk-BESTYZQY.js → chunk-V3KWM26F.js} +1 -1
- package/chunks/{chunk-72R6CKNY.js → chunk-VGCEFEFY.js} +1 -1
- package/chunks/{chunk-MGNBNMJZ.js → chunk-VJSHVZ7R.js} +1 -1
- package/chunks/chunk-YWSOQJ7G.js +5 -0
- package/chunks/{chunk-DHNS2KLJ.js → chunk-ZZMU6YO4.js} +1 -1
- package/chunks/concern-YFXJJ7DL.js +2 -0
- package/chunks/delegate-FVHPWQS7.js +2 -0
- package/chunks/{dev-NJVFMPTE.js → dev-UV7J3QTQ.js} +1 -1
- package/chunks/diagrams-IC2ADMKS.js +2 -0
- package/chunks/diagrams-MRJB73CF.js +2 -0
- package/chunks/done-DMKJ27IQ.js +2 -0
- package/chunks/followup-XKVSZT2H.js +2 -0
- package/chunks/{gh-YLYXDL2X.js → gh-3GMLD6TO.js} +2 -2
- package/chunks/{gh-contributors-YFATSPSW.js → gh-contributors-PNU47Y7Q.js} +1 -1
- package/chunks/init-ONTNPCSY.js +2 -0
- package/chunks/invoke-hook-ZM6UQND6.js +14 -0
- package/chunks/learn-SRDLP7B5.js +8 -0
- package/chunks/{main-JZTE4B4L.js → main-PQW6MNZM.js} +1 -1
- package/chunks/manager-BMNUSWJO.js +7 -0
- package/chunks/{mod-MC2WNSB2.js → mod-6LLSLOX6.js} +1 -1
- package/chunks/{mod-TUZZQKGZ.js → mod-MKKBIIC4.js} +1 -1
- package/chunks/next-FD3EHJW3.js +8 -0
- package/chunks/pack-ZQMMSIIP.js +6 -0
- package/chunks/{purge-ZQ23VDGR.js → purge-LXL3F3EJ.js} +1 -1
- package/chunks/{release-XACZAR6J.js → release-5PXID6GL.js} +2 -2
- package/chunks/{release-notes-W6MNV6OT.js → release-notes-3OMBQLOK.js} +1 -1
- package/chunks/{release-tag-HSZX6WYU.js → release-tag-2B2CWVMZ.js} +1 -1
- package/chunks/reopen-3NA6JI4N.js +2 -0
- package/chunks/reset-XITFRWII.js +2 -0
- package/chunks/review-UVYK4M4T.js +2 -0
- package/chunks/rule-BAO7IP5S.js +7 -0
- package/chunks/run-EBKNNOG7.js +4 -0
- package/chunks/{serve-3PZ7RBQY.js → serve-T5HR56BZ.js} +1 -1
- package/chunks/session-SZYH2UOE.js +2 -0
- package/chunks/spec-CPRKQGOX.js +2 -0
- package/chunks/status-SRCNQJ4V.js +2 -0
- package/chunks/sync-WE6A7KC7.js +2 -0
- package/chunks/{system-CP5L6XUP.js → system-6TO2XBOH.js} +1 -1
- package/chunks/{system-N5A3SM5G.js → system-RWYI6DJF.js} +1 -1
- package/chunks/{validate-bom-EH5Z5TVU.js → validate-bom-YFYXM4ND.js} +1 -1
- package/chunks/{validate-case-conflict-XN4KQDSK.js → validate-case-conflict-E7LKQYVM.js} +1 -1
- package/chunks/{validate-circular-deps-YZ4DIXIM.js → validate-circular-deps-L4MDRIG3.js} +1 -1
- package/chunks/{validate-commit-msg-MXTBUPTC.js → validate-commit-msg-2JQ2W6Y6.js} +1 -1
- package/chunks/{validate-docs-BE32R2UM.js → validate-docs-EXDICKDK.js} +1 -1
- package/chunks/{validate-filenames-DMZ46CRH.js → validate-eof-UYQI6DYK.js} +1 -1
- package/chunks/{validate-export-names-D3QNF6VB.js → validate-export-names-QBYWTK5Q.js} +1 -1
- package/chunks/{validate-eof-JPKT2D3D.js → validate-filenames-Z6VSIR2C.js} +1 -1
- package/chunks/{validate-json-KG3U4NLK.js → validate-json-2JS2Y4YU.js} +1 -1
- package/chunks/validate-large-files-JKQBKNS4.js +2 -0
- package/chunks/validate-licenses-7MVLVDZA.js +2 -0
- package/chunks/validate-line-endings-KMXN5IUT.js +2 -0
- package/chunks/validate-merge-conflict-N7M4OVXI.js +2 -0
- package/chunks/{validate-mod-exports-J6KLADGR.js → validate-mod-exports-C7WDH4FK.js} +1 -1
- package/chunks/{validate-package-configs-BFCQMBEI.js → validate-package-configs-AYVT55GJ.js} +1 -1
- package/chunks/validate-secrets-3PW5GJZD.js +2 -0
- package/chunks/validate-shebangs-JACZB7C3.js +2 -0
- package/chunks/validate-submodules-SCY4LARV.js +2 -0
- package/chunks/validate-symlinks-PDLYFPNE.js +2 -0
- package/chunks/{validate-toml-OMUYIHX2.js → validate-toml-NGF5Q27B.js} +1 -1
- package/chunks/validate-trailing-whitespace-PDAFNVPQ.js +2 -0
- package/chunks/{validate-yaml-VTE42YLF.js → validate-yaml-ILJZJGDG.js} +1 -1
- package/chunks/{versions-GXSXTSSG.js → versions-VGXMC5GM.js} +1 -1
- package/chunks/{watch-EVUCQISN.js → watch-WBZB2C5P.js} +7 -7
- package/chunks/web-GAF33V4M.js +2 -0
- package/chunks/wontfix-JBPCNL6S.js +2 -0
- package/eser.js +1 -1
- package/package.json +1 -1
- package/chunks/approve-PXC7FMDI.js +0 -2
- package/chunks/block-CSVO3R47.js +0 -2
- package/chunks/cancel-AJOYWYV5.js +0 -2
- package/chunks/chunk-4TTJVJEI.js +0 -2
- package/chunks/chunk-IZUADMIU.js +0 -3
- package/chunks/chunk-KNIM3QST.js +0 -10
- package/chunks/chunk-QL5FA3P3.js +0 -2
- package/chunks/chunk-UTWYRNI6.js +0 -17
- package/chunks/concern-DXCLVP5Y.js +0 -2
- package/chunks/done-HGZT3ZOT.js +0 -2
- package/chunks/init-X6KNS3NC.js +0 -2
- package/chunks/invoke-hook-KLJOYZF5.js +0 -12
- package/chunks/manager-FMP6PKIR.js +0 -7
- package/chunks/next-6K3PS64Z.js +0 -9
- package/chunks/pack-YQVWUWCL.js +0 -6
- package/chunks/reopen-Z3MPVAGR.js +0 -2
- package/chunks/reset-NWO3MNAG.js +0 -2
- package/chunks/rule-CH5GMFKE.js +0 -7
- package/chunks/run-5YOXFMP2.js +0 -4
- package/chunks/session-22XFZLH2.js +0 -2
- package/chunks/spec-PWS2UYVL.js +0 -2
- package/chunks/status-G5D6BYFF.js +0 -2
- package/chunks/sync-URY32B7Y.js +0 -2
- package/chunks/validate-large-files-C2ILVCDB.js +0 -2
- package/chunks/validate-licenses-P24RTTYG.js +0 -2
- package/chunks/validate-line-endings-F65GG2PC.js +0 -2
- package/chunks/validate-merge-conflict-PVT6WR2W.js +0 -2
- package/chunks/validate-secrets-RBD2KJ3R.js +0 -2
- package/chunks/validate-shebangs-L5YR7AGC.js +0 -2
- package/chunks/validate-submodules-HD7CSBOG.js +0 -2
- package/chunks/validate-symlinks-RPSZMV5Y.js +0 -2
- package/chunks/validate-trailing-whitespace-BIG3YYFY.js +0 -2
- package/chunks/wontfix-4R2ESAR5.js +0 -2
package/chunks/chunk-UTWYRNI6.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as Q}from"./chunk-NY4W44PI.js";import{a as M,c as $,d as q,e as B}from"./chunk-4NNSMDFH.js";import{c as j}from"./chunk-UEMWZOIU.js";import{i as Y}from"./chunk-6DBKPC2O.js";var G=[{id:"status_quo",text:"What does the user do today without this feature?",concerns:["product:status_quo","eng:replace_scope","qa:regression_risk"]},{id:"ambition",text:"Describe the 1-star and 10-star versions.",concerns:["product:scope_direction","eng:complexity_tier","qa:test_depth"]},{id:"reversibility",text:"Does this change involve an irreversible decision?",concerns:["product:one_way_door","eng:migration_strategy","qa:verification_stringency"]},{id:"user_impact",text:"Does this change affect existing users' behavior?",concerns:["product:breaking_change","eng:backward_compat","qa:regression_tests"]},{id:"verification",text:"How do you verify this works correctly?",concerns:["product:success_metric","eng:test_strategy","qa:acceptance_criteria"]},{id:"scope_boundary",text:"What should this feature NOT do?",concerns:["product:focus","eng:out_of_scope","qa:negative_tests"]}],te=[{questionId:"verification",text:"What tests should be written? (unit, integration, e2e \u2014 be specific about what behavior to test)"},{questionId:"verification",text:"What documentation needs updating? (README, API docs, CHANGELOG, inline comments)"}],V=e=>G.map(t=>{let n=te.filter(o=>o.questionId===t.id),s=$(e,t.id);return{...t,extras:[...n,...s]}});var H=e=>{let t=new Set(e.map(n=>n.questionId));return G.every(n=>t.has(n.id))};var A=e=>j(e),r=(e,t)=>A(t===null?e:`spec ${t} ${e}`),se="NEVER run git write commands (commit, add, push, checkout, stash, reset, merge, rebase, cherry-pick). Git is read-only for agents. The user controls git. You may read: git log, git diff, git status, git show, git blame.",Z={hasAskUserTool:!0,optionPresentation:"tool",hasSubAgentDelegation:!0,subAgentMethod:"task"},oe=(e,t,n,s,o=Z)=>{let y=e.execution.iteration>=t,c="You are a senior engineer and a scrum master who takes pride in honest reporting. Your reputation depends on accuracy, not speed. You are responsible for others' toil, and you are a perfect example of a servant leader. When reporting progress: if something is NOT implemented, say so \u2014 don't hide it. If partially done, say 'partially done: [what works] / [what doesn't]'. If untested, say 'implemented but untested'. NEVER say 'done' for something you haven't verified yourself. Underpromise \u2014 4 of 6 done means '4 of 6 done, 2 remaining', not 'almost done'.",l="Never skip steps or make decisions without asking the user. If you think something can be skipped or inferred, ask first. Explicit > Clever.",f=o.hasAskUserTool?"At every decision point (discovery questions, classification, spec approval, expansion proposals, architectural decisions, rule promotion), you MUST use AskUserQuestion to get the user's input. You MUST NOT make decisions, infer preferences, or assume the user's intent. If you're unsure whether something is a decision point, it is \u2014 ask.":"At every decision point (discovery questions, classification, spec approval, expansion proposals, architectural decisions, rule promotion), you MUST ask the user. Present options as a numbered list and ask the user to pick a number. You MUST NOT make decisions, infer preferences, or assume the user's intent. If you're unsure whether something is a decision point, it is \u2014 ask.",g="At every decision point where you present options to the user, share your recommendation BEFORE asking. Say what you think and why, then ask if the user agrees. Format: 'I'd recommend X because [reason]. Agree, or would you prefer Y?' The user always has the final word, but you save them cognitive load by proposing first.",x="noskills is a live state machine the user watches in real-time. Call noskills ONCE per interaction. Ask ONE question, wait for the user's answer, submit it. Never batch-submit, never backfill, never answer questions yourself.",d=n?[c,l,f,g,x]:[se,c,l,f,g,x];d.push("When noskills output contains a `roadmap` field, display it to the user BEFORE any other content. When output contains a `gate` field, display the gate message prominently \u2014 do NOT bury it in prose.");let v=s?.outOfScope??[],m=e.spec;switch(e.phase){case"IDLE":{let a=o.optionPresentation==="tool"?["When interactiveOptions are present, pass them DIRECTLY as the `options` array in AskUserQuestion \u2014 they are already in the correct {label, description} format. You MUST also provide a `header` field (max 12 chars, e.g. 'Action') and a `question` field. When the user picks an option, look up its label in the `commandMap` object to find the command to execute.","For availableConcerns: use AskUserQuestion with multiSelect:true. AskUserQuestion supports max 4 options per question and max 4 questions per call. If there are more than 4 concerns, split them across two questions within the same AskUserQuestion call (e.g., first 3 in question 1, remaining in question 2). NEVER silently drop concerns \u2014 present ALL available concerns to the user, even if it requires multiple questions."]:[`When interactiveOptions are present, present them as a numbered list. For each option show the number, label, and description. Ask the user to pick a number. When the user picks an option, look up its label in the \`commandMap\` object to find the command to execute. Example format:
|
|
3
|
-
|
|
4
|
-
1. Start a new spec \u2014 Begin discovery questions for a new feature
|
|
5
|
-
2. Add concerns \u2014 Shape how discovery and specs work
|
|
6
|
-
|
|
7
|
-
Pick a number:`,"For availableConcerns: present ALL available concerns as a numbered list. NEVER silently drop concerns \u2014 present ALL available concerns to the user. Ask the user to enter the numbers of the concerns they want to activate (comma-separated)."],D=o.hasAskUserTool?"For availableConcerns: use AskUserQuestion with multiSelect:true. AskUserQuestion supports max 4 options per question and max 4 questions per call. If there are more than 4 concerns, split them across two questions within the same AskUserQuestion call (e.g., first 3 in question 1, remaining in question 2). NEVER silently drop concerns \u2014 present ALL available concerns to the user, even if it requires multiple questions.":void 0,w=D!==void 0?[a[0],D]:a;return{rules:["The user has already told you what they want. If they described a feature, bug, or task, create a spec immediately with `noskills spec new \"user's description here\"` \u2014 the name is auto-generated. If they said 'fix X', create a spec for fixing X. If they pasted meeting notes, create a spec from those notes. Do NOT present a menu of options. Do NOT ask 'What would you like to do?' \u2014 the user already answered that question by talking to you. Do NOT ask for a 'short slug name' \u2014 just pass their description to spec new. Only show interactive options if the user explicitly asks 'what can I do?' or the conversation has no prior context.",...d,...w,"When the user wants to create a spec, encourage them to share everything they have \u2014 short or long. Say: 'Tell me what you want to build. A one-liner is fine, but if you have detailed requirements, meeting notes, a task list, or a full spec in mind, share it all \u2014 the more context, the better the discovery.' Do NOT ask for a 'short slug and description.' The slug is auto-generated from the content. Pass the full text as the description to `noskills spec new \"...\"` \u2014 detailed requirements produce better discovery.","After running spec new, ask the user if they want full discovery, quick discovery, or skip to spec draft. Full discovery: pre-scan, premise challenge, 6 questions, expansions, architecture, error map, synthesis. Quick discovery: only questions relevant to active concerns, skip expansions and error map. Skip to spec draft: classification \u2192 approve \u2192 execute. Never skip discovery without asking."],tone:"Welcoming. Present choices, then wait."}}case"DISCOVERY":{let a=o.hasAskUserTool?"You MUST ask each discovery question using AskUserQuestion tool. You MUST NOT answer questions yourself or infer answers from the spec description. You MUST NOT submit discovery answers without the user explicitly providing each answer through AskUserQuestion. Each question \u2192 one AskUserQuestion call \u2192 user answers \u2192 next question. If the user already gave a detailed description in spec new, you may PRE-FILL suggested answers as option descriptions in AskUserQuestion \u2014 but the user must still confirm or override each one. If the user provided a fully formed plan, you may skip Phase 2 (questions) but you MUST still run premise challenge and alternatives. Never skip premise challenge.":"You MUST ask each discovery question by presenting it to the user as text. You MUST NOT answer questions yourself or infer answers from the spec description. You MUST NOT submit discovery answers without the user explicitly providing each answer. Each question \u2192 present it \u2192 user answers \u2192 next question. If the user already gave a detailed description in spec new, you may PRE-FILL suggested answers \u2014 but the user must still confirm or override each one. If the user provided a fully formed plan, you may skip Phase 2 (questions) but you MUST still run premise challenge and alternatives. Never skip premise challenge.";return{modeOverride:"You are in plan mode. Do not attempt to create, edit, or write any files. Do not run any shell commands that modify state. You can read files and run read-only commands to understand the codebase. Your ONLY job right now is to think and talk. Read code to understand. Ask questions to discover. Challenge assumptions. Propose ideas. Debate tradeoffs. But NEVER create, edit, or delete project files. Discovery exists to catch what you don't yet know you don't know.",rules:[...d,a,"DO NOT create, edit, or write any files.","DO NOT run shell commands that modify state.","You MAY read files and run read-only commands (cat, ls, grep, git log, git diff).","BEFORE asking any discovery questions, conduct a pre-discovery codebase scan: read the project README, CLAUDE.md, and any design docs; check the last 20 git commits (git log --oneline -20); look for TODO files, open issue references, and existing specs; scan the directory structure to understand the project shape. Then present a brief 'Pre-discovery audit' summary: stack detected, recent work themes, open TODOs, existing specs. This gives you CONTEXT to ask INFORMED questions, not blind ones.","If the noskills output contains `preDiscoveryResearch` with `required: true`, you MUST research every term in `extractedTerms` using web search before asking the first question. Present findings as a brief: current stable versions, API changes, deprecations, and anything that might affect the spec's assumptions.","After the pre-discovery codebase scan and BEFORE starting questions, ask the user: 'What kind of discovery do you need? A) Explore scope \u2014 I'll help expand, find opportunities, think bigger. B) Technical depth \u2014 I'll focus on architecture, error handling, implementation strategy. C) Validate my plan \u2014 I already know what I want, challenge my assumptions. D) Ship fast \u2014 minimal scope, cut the fat, get to tasks quickly.' Adapt your discovery emphasis accordingly: Explore \u2192 heavy on expansion proposals and dream state; Technical \u2192 heavy on architectural decisions and error/rescue map; Validate \u2192 heavy on premise challenge and pushback; Ship fast \u2192 minimal questions, skip expansions, go direct to classification and tasks.","Before starting discovery questions, challenge the user's initial spec description against what you learned from the codebase scan. Look for: hidden complexity they haven't mentioned, conflicts with existing code, scope that's bigger or smaller than they think, existing modules that overlap with what they're asking for. Share your observations and ask clarifying follow-ups, then proceed to questions.","When asking discovery questions, use your codebase knowledge to offer concrete options alongside the open-ended question. For example, instead of just 'What does the user do today?' present: 'Based on the codebase, I see three likely scenarios: A) ... B) ... C) ... D) Something else \u2014 describe it. Which is closest?' The user can always pick 'something else' but concrete options speed up the conversation and force specificity.",o.hasAskUserTool?"Ask one question at a time using AskUserQuestion tool.":"Ask one question at a time. Present it as text and wait for the user's response.","Push back on vague answers \u2014 you will be the one executing this spec, vague answers make your job harder.","When the user gives a short answer, follow up: 'Can you be more specific?'","After collecting discovery answers, synthesize a CURRENT STATE \u2192 THIS SPEC \u2192 6-MONTH IDEAL vision before generating the spec. Show three columns: where the project is now, what this spec achieves, and where it could go in 6 months. Note: 'This spec moves you from column 1 to column 2. Column 3 is out of scope but worth knowing \u2014 every decision in this spec should keep column 3 possible.' This helps the user see if the scope is right.","When you spot expansion opportunities during discovery (from codebase scan, TODOs, concern requirements, synergies with the current plan), present each as a numbered proposal (1/N, 2/N...). Every proposal MUST include: clear description of WHAT and WHY (how it connects to the current plan); effort estimate as S/M/L/XL with human time and CC time estimates (e.g., 'S (human: ~1 day / CC: ~15 min)' \u2014 not just 'small'); risk assessment as Low/Low-Med/Med/Med-High/High naming the specific risk factor; completeness delta showing X/10 without this and Y/10 with this. Every proposal gets three options: A) Add to scope B) Defer to future spec C) Skip \u2014 not interested, plus 'Chat about this' and 'Skip remaining proposals' escape hatches.","After discovery questions and expansion proposals, identify architectural decisions that must be resolved before implementation. These are decisions where choosing A vs B changes the shape of multiple tasks, the data model, the API surface, or system boundaries. Present each as a concrete technical question with options, a RECOMMENDATION with reasoning, and completeness scores. Show how each option affects downstream work (e.g., 'If you choose B, tasks 3 and 4 need a job queue setup step added'). Only surface decisions that BLOCK implementation \u2014 not preferences or nice-to-haves. If the user says 'I don't know yet', mark it as a risk: 'UNRESOLVED: [decision] TBD. Tasks X-Y may change.' Never allow implementation to start with unresolved architectural decisions \u2014 flag them prominently in the spec.","Before finalizing, map error and rescue paths for every significant codepath in the planned work. Create a table: codepath | what can go wrong | how it's handled. Identify CRITICAL GAPS \u2014 failure modes that the plan doesn't address. Present each critical gap as a decision with options, a recommendation, and completeness scores, just like architectural decisions. Resolved gaps become tasks or acceptance criteria. Unresolved gaps become risk flags. Think like an SRE reviewing a design doc \u2014 what fails at 3am?","After all discovery questions, expansion proposals, architectural decisions, and error mapping are complete, present a DISCOVERY SUMMARY for the user to review: intent, ambition, reversibility, impact, verification, out of scope, the dream state table (current \u2192 this spec \u2192 future), accepted/deferred/skipped expansions, resolved architectural decisions, and the error/rescue map. Ask for confirmation before generating the spec. This is the last chance to catch misunderstandings.","Once you have a substantive answer for each question, collect all answers and submit them together in a single `noskills next --answer` call as a JSON object."],tone:"Curious interviewer who has a stake in the answers and comes PREPARED. You've read the codebase before asking. Challenge assumptions, offer concrete options, think about architecture and failure modes. Think deeply before asking each question."}}case"DISCOVERY_REVIEW":return{modeOverride:"You are in plan mode. Do not create, edit, or write any files. Present the discovery answers to the user for review and confirmation.",rules:[...d,"DO NOT create, edit, or write any files.","Present ALL discovery answers to the user clearly, one by one.",o.hasAskUserTool?"Use AskUserQuestion to ask: 'Are these answers correct, or would you like to revise any?'":"Ask the user: 'Are these answers correct, or would you like to revise any?' Present approval and revision as numbered options.","If the user approves, run the approve command.","If the user wants to revise, collect their corrections and submit them.","You MUST NOT approve on behalf of the user. The user must explicitly confirm.","If noskills output contains a splitProposal, present it to the user with the exact options shown. Do NOT split or merge specs on your own. Do NOT recommend one option over the other unless the user asks for your opinion. The user decides."],tone:"Careful reviewer. The user must confirm every answer."};case"SPEC_DRAFT":return{modeOverride:"You are in plan mode. Do not attempt to create, edit, or write any files. Do not run any shell commands that modify state. You can read files and run read-only commands to understand the codebase. Your ONLY job right now is to think and talk. Read code to understand. Ask questions to discover. Challenge assumptions. Propose ideas. Debate tradeoffs. But NEVER create, edit, or delete project files. Discovery exists to catch what you don't yet know you don't know.",rules:[...d,"DO NOT create, edit, or write any files.","Read the spec and present a summary to the user.","Flag any tasks that are too vague to execute.","Flag any missing acceptance criteria.","Ask the user if they want to refine before approving.",o.hasAskUserTool?"When presenting classification options, use AskUserQuestion with multiSelect:true. Do NOT infer classification yourself.":"When presenting classification options, present them as a numbered list with multiselect (user picks multiple numbers). Do NOT infer classification yourself.","If you identify issues in the spec (vague tasks, irrelevant sections, missing acceptance criteria), submit a refinement via: `"+r(`next --answer='{"refinement":"task-1: Add upload endpoint, task-2: Add validation middleware, task-3: Write integration tests"}'`,m)+"`. The spec will be updated and you can review again."],tone:"Thoughtful reviewer preparing to hand off to an implementer."};case"SPEC_APPROVED":return{rules:[...d,"The spec is approved but execution has not started.","Do not start coding until the user triggers execution.","If the user wants changes, they must reset and re-spec.",o.hasAskUserTool?"Before starting execution, show the spec summary to the user and ask for final confirmation via AskUserQuestion.":"Before starting execution, show the spec summary to the user and ask for final confirmation. Present 'Start execution' and 'Not yet' as numbered options."],tone:"Patient. Wait for the go signal."};case"EXECUTING":{let a=[];o.subAgentMethod==="task"?a.push(`When you receive a task from noskills next, do NOT execute it yourself. Spawn the noskills-executor sub-agent using the Agent tool. Pass it: the task title, description, acceptance criteria (with IDs), behavioral rules, out-of-scope constraints, concern reminders, and relevant file paths. When the sub-agent completes, review its results briefly, then report to noskills via \`${r(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`,m)}\`. You are the orchestrator \u2014 the sub-agent is the implementer.`,"If the sub-agent fails, errors out, or returns no results, fall back to executing the task directly yourself. Report the sub-agent failure in your next status report so it can be investigated.","After the noskills-executor sub-agent completes a task, spawn a noskills-verifier sub-agent to independently verify the work. Pass it: the list of changed files, the acceptance criteria, and the test commands. The verifier reports PASS/FAIL per criterion with evidence. Use the verifier's report as your status report to noskills. Do NOT submit status reports based solely on the executor's self-report.",`After spawning sub-agents, ALWAYS present a dispatch table showing the FULL pipeline \u2014 not just executors, but also verification and test steps:
|
|
8
|
-
|
|
9
|
-
| Step | Agent | Files | Tasks | Est. Time |
|
|
10
|
-
|------|-------|-------|-------|-----------|
|
|
11
|
-
| 1. Implement | noskills-executor | purge.ts | Tasks 1-6 | ~3 min |
|
|
12
|
-
| 2. Verify | noskills-verifier | purge.ts (read-only) | Validate ACs | ~1 min |
|
|
13
|
-
| 3. Write tests | noskills-executor | purge.test.ts | Task 7 | ~2 min |
|
|
14
|
-
|
|
15
|
-
When agents complete, update with actual time and status (Done / Failed / Found N issues). The user should see the complete plan upfront.
|
|
16
|
-
|
|
17
|
-
Estimate: S ~1min, M ~2min, L ~5min, XL ~10min.`,"The agent that writes implementation code must NOT write tests for that code. Spawn a SEPARATE sub-agent for test writing. This prevents the implementer from writing tests that only confirm what it already knows. The test writer reads the code fresh and tests what it actually does, not what the implementer intended.","When deciding how to split work across sub-agents: if all tasks touch the same file or tightly coupled files, batch them into one executor. If tasks touch independent files or modules, spawn parallel executors. Always err toward smaller, focused sub-agents over large batched ones \u2014 fresh context per task is better than accumulated context across tasks."):o.subAgentMethod==="spawn"?a.push(`When you receive a task from noskills next, use spawn_agent to delegate to the noskills-executor agent. Pass it: the task title, description, acceptance criteria (with IDs), behavioral rules, out-of-scope constraints, concern reminders, and relevant file paths. Use wait_agent to collect results. Then report to noskills via \`${r(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`,m)}\`. You are the orchestrator \u2014 the spawned agent is the implementer.`,"If the spawned agent fails, errors out, or returns no results, fall back to executing the task directly yourself. Report the agent failure in your next status report so it can be investigated.","After the noskills-executor agent completes a task, spawn a noskills-verifier agent to independently verify the work. Pass it: the list of changed files, the acceptance criteria, and the test commands. The verifier reports PASS/FAIL per criterion with evidence. Use the verifier's report as your status report to noskills. Do NOT submit status reports based solely on the executor's self-report.","When deciding how to split work across spawned agents: if all tasks touch the same file or tightly coupled files, batch them into one executor. If tasks touch independent files or modules, spawn parallel executors. Always err toward smaller, focused agents over large batched ones \u2014 fresh context per task is better than accumulated context across tasks."):o.subAgentMethod==="fleet"?a.push(`When you receive a task from noskills next, use /fleet to run parallel sub-agents for implementation tasks. Pass each agent: the task title, description, acceptance criteria (with IDs), behavioral rules, out-of-scope constraints, concern reminders, and relevant file paths. Collect results and report to noskills via \`${r(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`,m)}\`. You are the orchestrator \u2014 the fleet agents are the implementers.`,"If a fleet agent fails, errors out, or returns no results, fall back to executing the task directly yourself. Report the agent failure in your next status report so it can be investigated.","After the fleet agents complete, run a verification pass to independently check the work. Verify: changed files, acceptance criteria, test commands. Report PASS/FAIL per criterion with evidence.","When deciding how to split work across fleet agents: if all tasks touch the same file or tightly coupled files, batch them into one agent. If tasks touch independent files or modules, run parallel agents. Always err toward smaller, focused agents over large batched ones."):o.subAgentMethod==="delegation"?a.push(`When you receive a task from noskills next, use Kiro's agent delegation to spawn the noskills-executor agent. Pass it: the task title, description, acceptance criteria (with IDs), behavioral rules, out-of-scope constraints, concern reminders, and relevant file paths. When the agent completes, review its results briefly, then report to noskills via \`${r(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`,m)}\`. You are the orchestrator \u2014 the delegated agent is the implementer.`,"If the delegated agent fails, errors out, or returns no results, fall back to executing the task directly yourself. Report the agent failure in your next status report so it can be investigated.","After the noskills-executor agent completes a task, delegate to the noskills-verifier agent to independently verify the work. Pass it: the list of changed files, the acceptance criteria, and the test commands. The verifier reports PASS/FAIL per criterion with evidence. Use the verifier's report as your status report to noskills. Do NOT submit status reports based solely on the executor's self-report.","When deciding how to split work across delegated agents: if all tasks touch the same file or tightly coupled files, batch them into one executor. If tasks touch independent files or modules, spawn parallel executors. Always err toward smaller, focused agents over large batched ones \u2014 fresh context per task is better than accumulated context across tasks."):a.push("Execute tasks sequentially in this context. Do not attempt to spawn sub-agents \u2014 this tool does not support agent delegation. Complete each task yourself, verify your work (run type checks and tests), then report progress.",`After completing a task, report to noskills via \`${r(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`,m)}\`.`);let D=[...d,"You are the orchestrator, not the implementer. NEVER create, edit, or delete project files directly. ALWAYS delegate to noskills-executor sub-agent, even for single-line changes. There is no 'minor change' \u2014 every edit goes through the executor\u2192verifier pipeline. Your job: read noskills output, spawn sub-agents, report status.","Do not explore the codebase beyond what the current task requires.","Do not refactor, improve, or modify code outside this task's scope.","Do not add features, tests, or documentation not specified in the spec.","If you need to read files to understand context, timebox it \u2014 then write code.","The deliverable is working code, not a plan or analysis.","Complete the task, then report progress. The user handles git.",...a,`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: \`${A('rule add "<description>"')}\`. If just this task, note it and move on. Never write to \`.eser/rules/\` directly.`,"FORCED VERIFICATION: After every file edit, run the project's type-check command (e.g., `tsc --noEmit`, `deno check`, `go build`) and lint command. Report results in AC status. Do NOT mark any AC as passed if type-check fails. If no type-checker is configured, state that explicitly.","FILE READ BUDGET: Files over 500 lines must be read in chunks using offset and limit. Never assume a single read captured the full file. When you read a partial file, state which lines you read.","TOOL RESULT AWARENESS: If any search or command returns suspiciously few results, re-run with narrower scope (single directory, stricter pattern). State when you suspect results were truncated.","PRE-EDIT RE-READ: Before EVERY file edit, re-read the target file to get current content. After editing, read the file again to confirm the change applied correctly. Never edit against stale context.","DEAD CODE FIRST: Before structural refactors on files over 300 LOC, first remove dead imports, unused exports, and orphaned props. Commit cleanup separately before starting the real work.","Do NOT suggest pausing, checkpointing, committing mid-spec, or stopping execution. The spec was scoped during discovery as a meaningful deliverable \u2014 execute it to completion. A half-delivered increment has no value. If scope feels too large, finish this spec and note the concern for future specs. The user decides when to stop, not you."];e.execution.lastVerification?.passed===!1&&D.push("Tests are failing. Fix ONLY the failing tests. Do not refactor passing code.");let w={rules:D,tone:"Direct. Orchestrate immediately \u2014 spawn sub-agents.",outOfScope:v.length>0?v:void 0};return y?{...w,urgency:`You have been in this session for ${e.execution.iteration}+ iterations. Your context is degrading. Finish the current task and recommend the user start a fresh session. Do not start new tasks.`}:w}case"BLOCKED":return{rules:[...d,"Present the decision to the user exactly as described.","Do not suggest a preferred option unless the user asks for your opinion.","After the user decides, relay the answer immediately. Do not elaborate."],tone:"Brief. The user is making a decision, not having a discussion."};case"COMPLETED":return{rules:[...d,"Report the completion summary. Do not start new work.","If the user wants to continue, they start a new spec."],tone:"Concise. Celebrate briefly, then stop."};default:return{rules:[...d,`Run \`${r("next",m)}\` to get your instructions.`,"Do not take action without noskills guidance."],tone:"Neutral. Waiting for direction."}}},re=5*60*1e3,ie=(e,t)=>{let n=e.spec,s;switch(e.phase){case"IDLE":s=`No active spec. Start one with: \`${A('spec new --name=<slug> "description"')}\``;break;case"DISCOVERY":s=`Discovery in progress for "${e.spec}". ${e.discovery.answers.length} questions answered so far.`;break;case"DISCOVERY_REVIEW":s=`Discovery answers ready for review. ${e.discovery.answers.length} answers collected. Waiting for user confirmation.`;break;case"SPEC_DRAFT":s=`Spec draft ready for review at ${e.specState.path}. Waiting for approval.`;break;case"SPEC_APPROVED":s=`Spec "${e.spec}" is approved. Waiting to start execution.`;break;case"EXECUTING":s=e.execution.lastProgress!==null?`Executing "${e.spec}", iteration ${e.execution.iteration}. Last progress: ${e.execution.lastProgress}. Continue with the current task.`:`Executing "${e.spec}", iteration ${e.execution.iteration}. Start the first task.`;break;case"BLOCKED":s=`Execution blocked: ${e.execution.lastProgress}. Ask the user to resolve.`;break;case"COMPLETED":s=`Spec "${e.spec}" completed in ${e.execution.iteration} iterations.`;break;default:s=`Run \`${r("next",n)}\` to get started.`}return{protocol:`Run \`${r('next --answer="..."',n)}\` to submit results and advance`,spec:e.spec,branch:e.branch,iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,activeConcerns:t.map(o=>o.id),resumeHint:s}},ae=e=>{let t=e.spec;if(e.lastCalledAt===null)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 DISCOVERY_REVIEW \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE \u2192 IDLE",how:`Run \`${r("next",t)}\` for instructions. Submit results with \`${r('next --answer="..."',t)}\`. Never make architectural decisions without asking.`,currentPhase:e.phase};let n=new Date(e.lastCalledAt).getTime();if(Date.now()-n>re)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 DISCOVERY_REVIEW \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE \u2192 IDLE",how:`Run \`${r("next",t)}\` for instructions. Submit results with \`${r('next --answer="..."',t)}\`. Never make architectural decisions without asking.`,currentPhase:e.phase}},X=[{key:"IDLE",label:"IDLE"},{key:"DISCOVERY",label:"DISCOVERY"},{key:"DISCOVERY_REVIEW",label:"REVIEW"},{key:"SPEC_DRAFT",label:"DRAFT"},{key:"SPEC_APPROVED",label:"APPROVED"},{key:"EXECUTING",label:"EXECUTING"},{key:"COMPLETED",label:"DONE"},{key:"IDLE_END",label:"IDLE"}],ce=e=>e==="BLOCKED"?X.map(t=>t.key==="EXECUTING"?"\u2726 EXECUTING (BLOCKED) \u2726":t.label).join(" \u2192 "):X.map(t=>t.key==="IDLE"&&e==="IDLE"?"\u2726 IDLE \u2726":t.key===e?`\u2726 ${t.label} \u2726`:t.label).join(" \u2192 "),le=(e,t)=>{switch(e.phase){case"DISCOVERY_REVIEW":return{message:`${e.discovery.answers.length}/6 answers collected.`,action:"Type APPROVE to generate spec, or REVISE to correct answers.",phase:"DISCOVERY_REVIEW"};case"SPEC_APPROVED":return{message:`Spec approved. ${t?.tasks?.length??0} tasks ready.`,action:"Type START to begin execution.",phase:"SPEC_APPROVED"};default:return}},Se=async(e,t,n,s,o,y,c,l,f)=>{let g=ie(e,t),x=s?.maxIterationsBeforeRestart??15,d=s?.allowGit??!1,u=l??Z,v=oe(e,x,d,o,u),m=ae(e),a;switch(e.phase){case"IDLE":a=K(t,M,n.length,c);break;case"DISCOVERY":a=await ge(e,t,n,f);break;case"DISCOVERY_REVIEW":a=ve(e,t);break;case"SPEC_DRAFT":a=we(e);break;case"SPEC_APPROVED":a=be(e);break;case"EXECUTING":a=Ee(e,t,n,x,o,y);break;case"BLOCKED":a=Ie(e);break;case"COMPLETED":a=De(e);break;default:a=K(t,M,n.length,c)}let D=ce(e.phase),w=le(e,o),b={...a,meta:g,behavioral:v,roadmap:D};w!==void 0&&(b={...b,gate:w}),m!==void 0&&(b={...b,protocolGuide:m});let C=de(e,t,c);if(C.length>0){let T=C.map(({label:h,description:I})=>({label:h,description:I})),p={};for(let h of C)p[h.label]=h.command;let E=u.optionPresentation==="tool"?"AskUserQuestion":"prose-numbered-list",U=u.optionPresentation==="tool"?"Use AskUserQuestion tool to present these options. Do NOT use prose.":"Present options as a numbered list. Ask user to pick a number.";b={...b,interactiveOptions:T,commandMap:p,toolHint:E,toolHintInstruction:U}}return b},de=(e,t,n)=>{let s=e.spec;switch(e.phase){case"IDLE":{let o=[],c=(n?.existingSpecs??[]).filter(l=>l.phase!=="COMPLETED");t.length===0&&o.push({label:"Add concerns (Recommended)",description:"Shape how discovery and specs work by adding project concerns",command:A("concern add <id> [<id2> ...]")}),o.push({label:"Start a new spec",description:"Tell me what you want to build \u2014 a one-liner, detailed requirements, meeting notes, anything",command:A('spec new "description"')});for(let l of c.slice(0,2))o.push({label:`Continue: ${l.name} (${l.phase})`,description:l.detail??`Iteration ${l.iteration}`,command:r("next",l.name)});return t.length>0&&o.push({label:"Edit concerns",description:`Currently: ${t.map(l=>l.id).join(", ")}`,command:A("concern list")}),o.slice(0,4)}case"DISCOVERY_REVIEW":return e.discovery.approved?[{label:"Keep as one spec",description:"All work in a single spec",command:r('next --answer="keep"',s)},{label:"Split into separate specs",description:"Create one spec per independent area",command:r('next --answer="split"',s)}]:[{label:"Approve all answers",description:"Answers look correct \u2014 generate the spec",command:r('next --answer="approve"',s)},{label:"Revise answers",description:"Correct one or more discovery answers",command:r(`next --answer='{"revise":{...}}'`,s)}];case"SPEC_DRAFT":return[{label:"Approve spec",description:"Review looks good \u2014 approve and move to execution",command:r("approve",s)},{label:"Refine spec",description:"Submit refinements to improve tasks or sections",command:r(`next --answer='{"refinement":"..."}'`,s)},{label:"Save for later",description:"Keep the draft as-is. Others can review, add ACs, notes, or tasks. Come back anytime to approve.",command:r('next --answer="save"',s)},{label:"Start over",description:"Reset the spec and start fresh",command:r("reset",s)}];case"SPEC_APPROVED":return[{label:"Start execution",description:"Begin implementing the tasks",command:r('next --answer="start"',s)},{label:"Save for later",description:"Spec is approved but don't start execution yet. Others can still add ACs or notes.",command:r('next --answer="save"',s)}];case"EXECUTING":return[];case"BLOCKED":return[{label:"Resolve block",description:"Provide a resolution to unblock execution",command:r('next --answer="resolution"',s)},{label:"Reset spec",description:"Abandon this spec and start over",command:r("reset",s)}];case"COMPLETED":return[{label:"New spec",description:"Start a new feature spec",command:A('spec new --name=<slug> "description"')},{label:"Reopen spec",description:"Reopen this spec for revision",command:r("reopen",s)},{label:"Check status",description:"Review completed spec summary",command:A("status")}];default:return[]}},ue="noskills is a state-machine orchestrator that acts as a scrum master for both you and your agent \u2014 keeping work focused, decisions in your hands, and tokens efficient.",K=(e,t,n,s)=>({phase:"IDLE",instruction:"No active spec. Work freely or start a new spec. If the user has already described what they want to build, create a spec immediately with `noskills spec new \"user's description here\"` \u2014 the name is auto-generated from the description. Do NOT re-ask what they want to do. Do NOT ask for a 'short slug' \u2014 just take what the user gives you and create the spec. When prompting the user, encourage them to share everything they have: 'Tell me what you want to build. A one-liner is fine, but if you have detailed requirements, meeting notes, a task list, or a full spec in mind, share it all \u2014 the more context, the better the discovery.' IMPORTANT: Present ALL available concerns to the user \u2014 never truncate the list. Split across multiple AskUserQuestion calls if needed.",welcome:ue,existingSpecs:s?.existingSpecs??[],availableConcerns:t.map(o=>({id:o.id,description:o.description})),activeConcerns:e.map(o=>o.id),activeRulesCount:s?.rulesCount??n,behavioralNote:"These options are fallbacks. If the user already described what they want, act on it directly without presenting these options.",hint:e.length===0?"No concerns active. Consider adding concerns first \u2014 they shape discovery questions and specs.":void 0}),pe=/\b(Node\.?js|Deno|Bun|Go|Rust|Python|Ruby|Java|Kotlin|Swift|PHP|React|Vue|Angular|Svelte|Next\.?js|Nuxt|Remix|Astro|SolidJS|Qwik|TypeScript|Webpack|Vite|esbuild|Rollup|Terraform|Docker|Kubernetes|PostgreSQL|MySQL|Redis|MongoDB|SQLite|Prisma|Drizzle|gRPC|GraphQL|tRPC)\s+v?(\d+(?:\.\d+)?(?:\.\d+)?\+?)\b/gi,he=e=>{if(e===null||e.length===0)return[];let t=[],n,s=new RegExp(pe.source,"gi");for(;(n=s.exec(e))!==null;)t.push(`${n[1]} ${n[2]}`);return t},J=e=>{let t=he(e);if(t.length!==0)return{required:!0,instruction:"Before asking discovery questions, research the current state of all platforms, runtimes, libraries, and APIs mentioned in the spec description. Use web search and Context7 MCP if available. Report findings as a pre-discovery brief to the user. Do NOT assume your training data is current \u2014 versions change, APIs get added, features get deprecated.",extractedTerms:t}},me=50*1024,z=async e=>{if(e!==null)try{let t=await Y.fs.readTextFile(e);return t.length>me?void 0:{provided:!0,content:t,instruction:"A plan document was provided. Read it carefully, extract relevant information for each discovery question, and present pre-filled answers for user review. Do NOT skip any question \u2014 present your extraction and let the user confirm, correct, or expand. IMPORTANT: When extracting answers from the plan, mark each extraction as [STATED] (directly written in the plan) or [INFERRED] (your interpretation). Present extractions individually for confirmation."}}catch{return}},ye=e=>{switch(e){case"full":return["Ask each discovery question as written. Push for specific, concrete answers.","If the answer is vague, ask follow-up questions before accepting."];case"validate":return["The user has a plan. Your job is to challenge it, not explore it.","For each question, identify assumptions and ask: 'What would prove this wrong?'","If the description already answers a question, present your understanding and ask to confirm.","When pre-filling answers from a rich description, plan, or prior discussion, DISTINGUISH between what the user EXPLICITLY STATED and what you INFERRED. Format each pre-filled item as: '[STATED] GPU skinning in all 3 renderers \u2014 you said this during technical discussion' or '[INFERRED] tangent space is 10-star scope \u2014 I assumed this based on complexity'. The user confirms stated items and corrects inferred items.","Present pre-filled answers ONE ITEM AT A TIME for confirmation, not as a completed block. The user's job is to correct your inferences, not rubber-stamp your summary. If you pre-fill 5 items and 2 are wrong, the user must be able to catch them individually."];case"technical-depth":return["Focus on architecture, data flow, performance, and integration points.","Before each question, scan the codebase for related implementations.","Ask: 'How does this interact with [existing system]?' for each integration point."];case"ship-fast":return["Focus on minimum viable scope.","For each question, also ask: 'What can we defer to a follow-up?'","Push for the smallest version that delivers value."];case"explore":return["Think bigger. What's the 10x version?","For each question, ask about adjacent opportunities.","Suggest possibilities the user might not have considered."]}},fe=(e,t)=>{let n=new Map;for(let s of e){let o="user"in s?s.user:"Unknown User";t!==void 0&&o===t.name||n.set(o,(n.get(o)??0)+1)}return[...n.entries()].map(([s,o])=>({name:s,contributions:`${o} answer${o>1?"s":""}`}))},ge=async(e,t,n,s)=>{let o=e.spec,y=V(t),c=e.discovery.answers.length,l=H(e.discovery.answers),f=e.discovery.audience==="agent",g=fe(e.discovery.answers,s),x=(e.specNotes??[]).filter(i=>!i.text.startsWith("[TASK] ")).map(i=>({text:i.text,user:i.user})),d={...s!==void 0?{currentUser:s}:{},...g.length>0?{previousContributors:g}:{},...x.length>0?{notes:x}:{}},u=e.specDescription!==null&&e.specDescription.length>0,v=e.discovery.planPath!==null,m=e.discovery.mode;if(m===void 0&&u&&c===0&&!v){let i={phase:"DISCOVERY",instruction:"Before starting discovery, select the discovery mode that best fits this spec.",questions:[],answeredCount:0,context:{rules:n,concernReminders:q(t)},transition:{onComplete:r('next --answer="<mode>"',o)},modeSelection:{required:!0,instruction:"Select the discovery mode.",options:[{id:"full",label:"Full discovery",description:"Standard 6 questions with all concern extras. Default for new features."},{id:"validate",label:"Validate my plan",description:"I already know what I want \u2014 challenge my assumptions, find gaps."},{id:"technical-depth",label:"Technical depth",description:"Focus on architecture, data flow, performance, integration points."},{id:"ship-fast",label:"Ship fast",description:"Minimum viable scope. What can we defer? What's the MVP?"},{id:"explore",label:"Explore scope",description:"Think bigger. 10x version? Adjacent opportunities? What are we missing?"}]}};return s!==void 0?{...i,currentUser:s}:i}let a=e.discovery.premisesCompleted===!0;if(m!==void 0&&!a&&!l){let i={phase:"DISCOVERY",instruction:"Before asking discovery questions, challenge the premises of this spec.",questions:[],answeredCount:0,context:{rules:n,concernReminders:q(t)},transition:{onComplete:r(`next --answer='{"premises":[...]}'`,o)},premiseChallenge:{required:!0,instruction:"Read the spec description"+(e.discovery.planPath!==null?" and the plan document":"")+'. Identify 2-4 premises the spec assumes. Present each premise and ask the user to agree or disagree. Submit as JSON: {"premises":[{"text":"...","agreed":true/false,"revision":"..."}]}',prompts:["Is this the right problem to solve? Could a different framing yield a simpler solution?","What happens if we do nothing? Is this a real pain point or a hypothetical one?","What existing code already partially solves this? Can we build on it instead?"]}};return s!==void 0?{...i,currentUser:s}:i}let D=m!==void 0?ye(m):[],w=[...n,...D],b=e.specDescription??"",C=b.length>500,T=e.discovery.premises??[],p=T.filter(i=>i.agreed).map(i=>i.text),E=T.filter(i=>!i.agreed&&i.revision!==void 0).map(i=>({original:i.text,revision:i.revision}));if(l){let i=e.revisitHistory??[],k=i.length>0?i[i.length-1]:null,O={phase:"DISCOVERY",instruction:k!==null?"This spec was revisited from EXECUTING. All previous answers are preserved. Review and approve, or revise answers before regenerating the spec.":`All discovery questions answered. Run: \`${r("approve",o)}\``,questions:[],answeredCount:c,context:{rules:n,concernReminders:[]},transition:{onComplete:r("approve",o)},...d};if(k!=null){let N=k;return{...O,revisited:!0,revisitReason:N.reason,previousProgress:{completedTasks:[...N.completedTasks],totalTasks:N.completedTasks.length}}}return O}if(f){let i=e.discovery.currentQuestion,k=y[i];if(k===void 0)return{phase:"DISCOVERY",instruction:`All discovery questions answered. Run: \`${r("approve",o)}\``,questions:[],answeredCount:c,context:{rules:n,concernReminders:[]},transition:{onComplete:r("approve",o)},...d};let O={id:k.id,text:k.text,concerns:[...k.concerns],extras:k.extras.map(W=>W.text)},N={phase:"DISCOVERY",instruction:`Ask this question to the user using AskUserQuestion. Submit the answer with: \`${r('next --agent --answer="<answer>"',o)}\``,questions:[O],answeredCount:c,currentQuestion:i,totalQuestions:y.length,context:{rules:w,concernReminders:q(t)},transition:{onComplete:`${r('next --agent --answer="<answer>"',o)}`},...d},R=N;if((p.length>0||E.length>0)&&(R={...R,...p.length>0?{agreedPremises:p}:{},...E.length>0?{revisedPremises:E}:{}}),i===0){let W=J(e.specDescription??null);W!==void 0&&(R={...R,preDiscoveryResearch:W});let _=await z(e.discovery.planPath??null);_!==void 0&&(R={...R,planContext:_}),C&&_===void 0&&(R={...R,richDescription:{provided:!0,length:b.length,content:b,instruction:"The user provided a detailed description. For each question, extract relevant info and present as a pre-filled suggestion. IMPORTANT: When extracting answers from the description, mark each extraction as [STATED] (directly written by the user) or [INFERRED] (your interpretation). Present extractions individually for confirmation."}})}return R!==N?R:N}let U=new Set(e.discovery.answers.map(i=>i.questionId)),h=y.filter(i=>!U.has(i.id)).map(i=>({id:i.id,text:i.text,concerns:[...i.concerns],extras:i.extras.map(k=>k.text)})),I=e.revisitHistory??[],L=I.length>0?I[I.length-1]:null,S=L!==null,P={phase:"DISCOVERY",instruction:S?"This spec was revisited from EXECUTING. Previous discovery answers are preserved \u2014 review and revise as needed, or approve to regenerate tasks.":"Conduct a thorough discovery conversation. FIRST: perform a pre-discovery codebase scan (README, CLAUDE.md, recent git log, TODOs, directory structure) and present a brief audit summary. THEN: challenge the user's spec description against your findings. THEN: ask the discovery questions one at a time, offering concrete options based on codebase knowledge. AFTER questions: present a dream state table (current \u2192 this spec \u2192 future), scored expansion proposals, architectural decisions, and an error/rescue map. FINALLY: present a complete discovery synthesis for user confirmation before submitting answers as a JSON object.",questions:h,answeredCount:c,context:{rules:w,concernReminders:q(t)},transition:{onComplete:`${r(`next --answer='{"status_quo":"...","ambition":"...",...}'`,o)}`},...d,...p.length>0?{agreedPremises:p}:{},...E.length>0?{revisedPremises:E}:{}};if(S&&L!==void 0)return{...P,revisited:!0,revisitReason:L.reason,previousProgress:{completedTasks:[...L.completedTasks],totalTasks:L.completedTasks.length}};if(c===0){let i=P,k=J(e.specDescription??null);k!==void 0&&(i={...i,preDiscoveryResearch:k});let O=await z(e.discovery.planPath??null);if(O!==void 0&&(i={...i,planContext:O}),C&&O===void 0&&(i={...i,richDescription:{provided:!0,length:b.length,content:b,instruction:"The user provided a detailed description. For each question, extract relevant info and present as a pre-filled suggestion."}}),i!==P)return i}return P},ve=(e,t)=>{let n=e.spec,s=V(t),o=e.discovery.answers.map(l=>{let f=s.find(g=>g.id===l.questionId);return{questionId:l.questionId,question:f?.text??l.questionId,answer:l.answer}}),y=Q(e.discovery.answers);if(e.discovery.approved&&y.detected)return{phase:"DISCOVERY_REVIEW",instruction:"Discovery answers are approved. noskills detected multiple independent work areas in this spec. Present the split proposal to the user and let them decide whether to keep as one spec or split into separate specs.",answers:o,transition:{onApprove:r('next --answer="keep"',n),onRevise:r(`next --answer='{"revise":{"status_quo":"corrected answer"}}'`,n)},splitProposal:y};let c=e.discovery.alternativesPresented===!0;return e.discovery.approved&&!c?{phase:"DISCOVERY_REVIEW",subPhase:"alternatives",instruction:"Based on discovery answers, propose 2-3 distinct implementation approaches. Present each with name, summary, effort (S/M/L/XL), risk (Low/Med/High), pros, and cons. Ask the user to choose one, or skip.",answers:o,transition:{onApprove:r(`next --answer='{"approach":"A","name":"...","summary":"...","effort":"M","risk":"Low"}'`,n),onRevise:r('next --answer="skip"',n)},alternatives:{required:!0,instruction:"Generate 2-3 approaches from discovery answers and codebase. Present via AskUserQuestion.",format:{fields:["id","name","summary","effort","risk","pros","cons"]}}}:{phase:"DISCOVERY_REVIEW",instruction:y.detected?"Present ALL discovery answers to the user for review. ALSO present the split proposal \u2014 noskills detected multiple independent areas.":"Present ALL discovery answers to the user for review. The user must confirm or correct each answer before the spec can be generated. Use AskUserQuestion to ask for confirmation.",answers:o,transition:{onApprove:r('next --answer="approve"',n),onRevise:r(`next --answer='{"revise":{"status_quo":"corrected answer"}}'`,n)},splitProposal:y.detected?y:void 0}},we=e=>{let t=e.spec;return e.classification===null?{phase:"SPEC_DRAFT",instruction:"Before generating the spec, classify what this spec involves. Ask the user to select all that apply.",specPath:e.specState.path??"",transition:{onApprove:`${r(`next --answer='{"involvesWebUI":false,"involvesCLI":false,"involvesPublicAPI":false,"involvesMigration":false,"involvesDataHandling":false}'`,t)}`},classificationRequired:!0,classificationPrompt:{options:[{id:"involvesWebUI",label:"Web/Mobile UI \u2014 layouts, responsive design, visual components"},{id:"involvesCLI",label:"CLI/Terminal UI \u2014 spinners, progress bars, interactive prompts"},{id:"involvesPublicAPI",label:"Public API changes"},{id:"involvesMigration",label:"Data migration or schema changes"},{id:"involvesDataHandling",label:"Data handling or privacy"}],instruction:"Select all that apply. Submit as JSON: `"+r(`next --answer='{"involvesWebUI":true,"involvesCLI":false,"involvesPublicAPI":false,...}'`,t)+"`. If none apply, answer with: `"+r('next --answer="none"',t)+"`"}}:{phase:"SPEC_DRAFT",instruction:"Spec draft is ready for review. Ask the user to review and approve.",specPath:e.specState.path??"",transition:{onApprove:r("approve",t)}}},be=e=>{let t=e.spec;return{phase:"SPEC_APPROVED",instruction:"Spec is approved and ready. When the user is ready to start, begin execution.",specPath:e.specState.path??"",transition:{onStart:`${r('next --answer="start"',t)}`}}},ke=(e,t)=>{if(t===null)return!1;let n=e.toLowerCase();return n.includes("mobile")||n.includes("layout")||n.includes("interaction design")?t.involvesWebUI:n.includes("ui state")||n.includes("skeleton ui")?t.involvesWebUI||t.involvesCLI:n.includes("readme")||n.includes("documentation updated")||n.includes("reflected in")&&n.includes("docs")?!0:n.includes("api doc")||n.includes("public api")?t.involvesPublicAPI:n.includes("migration")||n.includes("backward compat")||n.includes("deprecat")?t.involvesMigration:n.includes("audit trail")||n.includes("access control")||n.includes("data handling")||n.includes("data retention")?t.involvesDataHandling:!0},xe=(e,t,n,s,o,y,c,l)=>{let f=[],g=new Set(l??[]),x=0,d=()=>`ac-${++x}`;if(s!==null)for(let u of s.items)g.has(u.id)||f.push({id:u.id,text:`[DEBT from iteration ${u.since}] ${u.text}`});if(t&&f.push({id:d(),text:`[FAILED] Tests \u2014 fix this first: ${n.slice(0,200)}`}),y!=null)for(let u of y.verification){let v=d();g.has(v)||f.push({id:v,text:u})}for(let u of e)if(u.acceptanceCriteria!==void 0&&u.acceptanceCriteria.length>0)for(let v of u.acceptanceCriteria){if(!ke(v,o))continue;let m=d();g.has(m)||f.push({id:m,text:`(${u.id}) ${v}`})}if(c!==void 0)for(let u of c){let v=d();g.has(v)||f.push({id:v,text:`(folder: ${u.folder}) ${u.rule}`})}return f.push({id:"mandatory-tests",text:"Tests written and passing for all new and changed behavior"}),f.push({id:"mandatory-docs",text:"Documentation updated for all public-facing changes"}),f},Ee=(e,t,n,s,o,y)=>{let c=e.spec,l=B(t),f=e.execution.iteration>=s,g=e.execution.lastVerification?.passed===!1,x=e.execution.lastVerification?.output??"",d=o?.tasks??[],u=e.execution.completedTasks??[],v=new Set(u),m=d.find(h=>!v.has(h.id))??null,a=m!==null?{id:m.id,title:m.title,totalTasks:d.length,completedTasks:u.length}:void 0;if(e.execution.awaitingStatusReport){let h=xe(t,g,x,e.execution.debt,e.classification,o,y,e.execution.naItems),I=[];try{let F=JSON.parse(e.execution.lastProgress??"");Array.isArray(F.completed)&&(I=F.completed.filter(P=>typeof P=="string"&&P.startsWith("task-")))}catch{}let S={phase:"EXECUTING",instruction:I.length>=2?`${I.length} tasks reported complete. Report status against ALL relevant acceptance criteria.`:"Before this task is accepted, report your completion status against these acceptance criteria.",context:{rules:n,concernReminders:q(t)},transition:{onComplete:`${r(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`,c)}`,onBlocked:`${r('block "reason"',c)}`,iteration:e.execution.iteration},statusReportRequired:!0,statusReport:{criteria:h,reportFormat:{completed:"list item IDs you finished (e.g., ['debt-1', 'ac-3']) with evidence",remaining:"list item IDs not yet done",blocked:"list item IDs that need a decision from the user",na:"(optional) list item IDs that are not applicable to this task \u2014 they will be removed from future criteria",newIssues:"(optional) list NEW issues discovered during implementation \u2014 free text, will be assigned debt IDs automatically"}}};return I.length>=2&&(S={...S,batchTasks:I}),g&&(S={...S,verificationFailed:!0,verificationOutput:x.slice(0,2e3)}),S}let D=(e.execution.lastProgress??"").includes("Task not accepted"),w=e.execution.debt?.items??[],b=e.execution.debt?.unaddressedIterations??0,C=a!==void 0?`Execute task ${a.id}: ${a.title} (${a.completedTasks}/${a.totalTasks} completed)`:"All tasks completed. Run `"+r("done",c)+"` to finish.",T;if(g)T="Verification FAILED. Fix the failing tests before continuing.";else if(D&&w.length>0){let h=b>=3?` These items have been outstanding for ${b} iterations.`:"";T=`Task not accepted \u2014 ${w.length} remaining item(s) must be addressed before this task can be completed.${h} Address them, then submit a new status report.`}else T=C;let p={phase:"EXECUTING",instruction:T,task:a,context:{rules:n,concernReminders:q(t)},transition:{onComplete:`${r('next --answer="..."',c)}`,onBlocked:`${r('block "reason"',c)}`,iteration:e.execution.iteration}};if(D&&w.length>0&&(p={...p,taskRejected:!0,rejectionReason:`${w.length} remaining item(s) must be addressed.`,rejectionRemaining:w.map(h=>h.text)}),e.execution.debt!==null&&e.execution.debt.items.length>0){let h=e.execution.debt.unaddressedIterations??0,I=h>=3?`URGENT: These items have been unaddressed for ${h} iterations. Address them IMMEDIATELY before any new work.`:"These were not completed in a previous iteration. Address them BEFORE starting new work.";p={...p,previousIterationDebt:{fromIteration:e.execution.debt.fromIteration,items:e.execution.debt.items,note:I}}}if(g){let h=x.slice(0,2e3);p={...p,verificationFailed:!0,verificationOutput:h}}l.length>0&&(p={...p,concernTensions:l}),f&&(p={...p,restartRecommended:!0,restartInstruction:`Context may be getting large after ${e.execution.iteration} iterations. Consider starting a new conversation and running \`${r("next",c)}\` to resume - your progress is saved.`});let E=[...e.decisions].reverse().find(h=>!h.promoted);return E!==void 0&&e.execution.lastProgress?.startsWith("Resolved:")&&(p={...p,promotePrompt:{decisionId:E.id,question:E.question,choice:E.choice,prompt:`You just resolved a decision: "${E.choice}". Ask the user: "Should this be a permanent rule for future specs too?" If yes, run: \`${A(`rule add "${E.choice}"`)}\``}}),t.some(h=>h.id==="beautiful-product")&&(p={...p,designChecklist:{required:!0,instruction:"Before completing any UI task, rate your implementation 0-10 on these dimensions and include the ratings in your AC report:",dimensions:[{id:"hierarchy",label:"Information hierarchy \u2014 what does the user see first, second, third?"},{id:"states",label:"Interaction states \u2014 loading, empty, error, success all specified?"},{id:"edge-cases",label:"Edge cases \u2014 long text, zero results, slow connection handled?"},{id:"intentionality",label:"Overall intentionality \u2014 does this feel designed or generated?"}]}}),p},Ie=e=>{let t=e.spec;return{phase:"BLOCKED",instruction:"A decision is needed. Ask the user.",reason:e.execution.lastProgress??"Unknown",transition:{onResolved:`${r('next --answer="..."',t)}`}}},De=e=>({phase:"COMPLETED",summary:{spec:e.spec,iterations:e.execution.iteration,decisionsCount:e.decisions.length,completionReason:e.completionReason,completionNote:e.completionNote},learningPrompt:{instruction:"Before closing this spec, reflect: did you discover any project-specific patterns, pitfalls, or preferences during this work? If so, suggest them as permanent rules.",examples:["This project uses specific allocators \u2014 rule: 'All heap allocations go through the engine allocator, never raw malloc'","Tests need special flags \u2014 rule: 'Always run deno test with --allow-all flag'","PR titles follow a pattern \u2014 rule: 'PR titles follow conventional commits format (feat:/fix:/chore:)'"]}});export{G as a,V as b,H as c,Se as d};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as A}from"./chunk-4NNSMDFH.js";import{k,l as y,m as x,n as P}from"./chunk-KNIM3QST.js";import{b as $,c as b}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as m,h as w,k as g}from"./chunk-SHN5MT56.js";import{c as d,d as c,f as u,g as C}from"./chunk-YVN2NZL4.js";import{a as l,b as p}from"./chunk-FFWPJP7A.js";import{i as v}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var 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};
|
package/chunks/done-HGZT3ZOT.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as D,d as I}from"./chunk-2PWSTO7A.js";import{h as x}from"./chunk-L32KHQVT.js";import{p as k,s as T,v as U}from"./chunk-QL5FA3P3.js";import{c as S,e as g,g as C,h as E,i as y}from"./chunk-KNIM3QST.js";import{c as $}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as w,h as f,k as h}from"./chunk-SHN5MT56.js";import{c as m,d as o,f as a,g as u}from"./chunk-YVN2NZL4.js";import{a as d,b as n}from"./chunk-FFWPJP7A.js";import{i as l}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var q=async P=>{let e=w({renderer:h.ansi(),sink:f.stdout()}),i=l.process.cwd(),c=C(P);if(!c.ok)return e.writeln(a(c.error)),await e.close(),n({exitCode:1});let t;try{t=await g(i,c.spec)}catch(r){let p=r instanceof Error?r.message:String(r);return e.writeln(a(p)),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 r=`${i}/${S.specDir(t.spec)}`;try{await l.fs.stat(r)}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 v=await x(i),s=k(t,"done");s=T(s,"EXECUTING","COMPLETED",v),s.spec!==null&&await y(i,s.spec,s);let A=U(s);if(await E(i,A),s.spec!==null&&(await D(i,s.spec,"completed"),await I(i,s.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 r=t.decisions.filter(p=>p.promoted);r.length>0&&e.writeln(o(` Promoted to rules: ${r.length}`))}return e.writeln(""),e.writeln("Start a new spec with: ",m(`${$('spec new "..."')}`)),await e.close(),d(void 0)};export{q as main};
|
package/chunks/init-X6KNS3NC.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as oe,b as ie}from"./chunk-NTY267SI.js";import{d as ne}from"./chunk-L5OC7F24.js";import{d as Y}from"./chunk-UTWYRNI6.js";import"./chunk-NY4W44PI.js";import{b as P}from"./chunk-4NNSMDFH.js";import{d as se}from"./chunk-2ZYCRMUT.js";import{c as Z,d as ee,e as te}from"./chunk-NWWXAZFA.js";import{a as H,b as _,h as q,l as B,n as K,p as U,z as V}from"./chunk-KNIM3QST.js";import{a as Q,c as S,d as X}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import"./chunk-7ZYDAZBD.js";import{a as k,b as M,i as I,j as W,k as z,l as J,m as G,n as h,o as r,p as w}from"./chunk-4TTJVJEI.js";import"./chunk-GE3LJ6QM.js";import{a as F}from"./chunk-QXSFQQGJ.js";import"./chunk-BNQAZLIQ.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import"./chunk-J7YTWK67.js";import"./chunk-VKB3B2FE.js";import"./chunk-PBZV2KA3.js";import"./chunk-NMEPQK3T.js";import"./chunk-RNFCAHVL.js";import"./chunk-MG65QJY6.js";import{a as b}from"./chunk-FFWPJP7A.js";import{i as f}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var re=F;var me=async t=>{try{return await f.fs.stat(t),!0}catch{return!1}},he=[{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"]}],ae=async t=>{let e=[];for(let o of he)for(let s of o.paths)if(await me(`${t}/${s}`)){e.push(o.id);break}return e};var a=async t=>{try{return await f.fs.stat(t),!0}catch{return!1}},ce=async(t,e)=>{try{let o=await f.fs.readTextFile(t);return JSON.parse(o)[e]??null}catch{return null}},ye=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},Ce=async t=>{let e=[],o=await ce(`${t}/package.json`,"dependencies");return o!==null&&("react"in o&&e.push("react"),"vue"in o&&e.push("vue"),"svelte"in o&&e.push("svelte"),"next"in o&&e.push("nextjs"),"express"in o&&e.push("express"),"hono"in o&&e.push("hono")),e},ve=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},$e=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},le=async t=>{let[e,o,s,d]=await Promise.all([ye(t),Ce(t),ve(t),$e(t)]);return{languages:e,frameworks:o,ci:s,testRunner:d}};var Ge=async t=>{let e=f.process.cwd(),o=oe(t),s=M({target:o==="agent"?"non-interactive":"interactive"}),d=ie(t),y=de(d,"--concerns"),g=de(d,"--tools"),u=d.includes("--non-interactive")||o==="agent";if(await V(e))return r.warn(s,"noskills is already initialized in this project."),r.info(s,`Run \`${S("sync")}\` to regenerate tool files.`),b(void 0);W(s,"noskills init");let D=w(s,"Scanning project...");D.start();let m=await le(e);D.succeed("Project scanned");for(let n of m.languages)r.step(s,` ${n}`);for(let n of m.frameworks)r.step(s,` ${n}`);for(let n of m.ci)r.step(s,` ${n}`);m.testRunner!==null&&r.step(s,` test runner: ${m.testRunner}`),h(s);let j=w(s,"Detecting coding tools...");j.start();let A=await ae(e),C=ne(),L=C!==null&&!A.includes(C)?[C]:[],v=[...new Set([...L,...A])];j.succeed(`${v.length} coding tool(s) detected`);for(let n of v){let i=n===C?" (current)":"";r.step(s,` ${n}${i}`)}let p;if(g!==null){let n=["claude-code","cursor","kiro","copilot","windsurf","opencode","codex","copilot-cli"],i=g.filter(l=>n.includes(l));p=[...new Set([...L,...i])]}else u?p=[...v]:(h(s),p=await be(s,v,C));h(s);let O=w(s,"Detecting AI providers...");O.start();let x=(await re()).filter(n=>n.available).map(n=>n.name);O.succeed(`${x.length} provider(s) detected`),h(s);let T=await P(),c;if(y!==null){let n=T.map(i=>i.id);c=y.filter(i=>n.includes(i)).sort((i,l)=>n.indexOf(i)-n.indexOf(l))}else if(u)c=[];else{let n=T.map(l=>({value:l.id,label:l.name,hint:l.description.slice(0,60)})),i=await I(s,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:n});c=k(i)?[]:[...i]}c.length>0?r.success(s,` Concerns: ${c.join(", ")}`):r.info(s,"No concerns selected. Add later with `concern add <id> [<id2> ...]`."),h(s);let E=w(s,"Initializing...");E.start(),await U(e);let ue=T.filter(n=>c.includes(n.id));for(let n of ue)await K(e,n);let N=await X();Q(N);let $={..._(c,p,x,m),command:N};await B(e,$);let R=H();if(await q(e,R),E.succeed("Scaffolded `.eser/`"),p.length>0){let n=w(s,"Syncing tool files...");n.start();let i=await te(e,p,$);n.succeed(`Synced ${i.length} tool(s)`)}else r.warn(s,"No tools selected. noskills will work in agentless CLI mode only."),r.info(s,"Add tools later with `noskills sync`.");if(z(s,`Done. ${p.length} tool(s), ${x.length} provider(s), ${c.length} concern(s).`),o==="agent"){let i=(await P()).filter(ge=>c.includes(ge.id)),l=await Z(e),pe=ee($?.tools??[]),fe=await Y(R,i,l,$,void 0,void 0,void 0,pe);await se(fe,"json")}else J(s),G(s,`Start a spec with: ${S('spec new "..."')}`);return b(void 0)},Te=[{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"}],be=async(t,e,o)=>{let s=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),y=await I(t,{message:s,options:Te.map(u=>({...u,hint:u.value===o?"you're running inside it":d.has(u.value)?"detected":void 0,disabled:u.value===o})),initialValues:[...e],required:!1});if(k(y))return[...e];let g=[...y];return o!==null&&!g.includes(o)&&g.unshift(o),g},de=(t,e)=>{if(t===void 0)return null;for(let o of t)if(o.startsWith(`${e}=`))return o.slice(e.length+1).split(",").map(s=>s.trim()).filter(Boolean);return null};export{Ge as main};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as P}from"./chunk-UTWYRNI6.js";import"./chunk-NY4W44PI.js";import"./chunk-4NNSMDFH.js";import{c as _,d as A}from"./chunk-NWWXAZFA.js";import{c as p,d as x,e as T,k as R,o as C,s as I,t as $,z as N}from"./chunk-KNIM3QST.js";import{c as m}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{a as l}from"./chunk-FFWPJP7A.js";import{i as a}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var B=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"]),U=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"])]]),V=new Set(["-C","-c","--git-dir","--work-tree","--namespace","--super-prefix","--config-env"]),M=new Set(["--no-replace-objects","--bare","--no-optional-locks","--literal-pathspecs","--glob-pathspecs","--noglob-pathspecs","--icase-pathspecs","--no-pager","--paginate"]),Y=t=>{let s=0;for(;s<t.length;){let e=t[s];if(V.has(e)){s+=2;continue}if(M.has(e)){s+=1;continue}if(e.startsWith("--git-dir=")||e.startsWith("--work-tree=")||e.startsWith("--namespace=")||e.startsWith("--super-prefix=")||e.startsWith("--config-env=")){s+=1;continue}if(e.startsWith("-C")&&e.length>2){s+=1;continue}if(e.startsWith("-c")&&e.length>2&&e.includes("=")){s+=1;continue}return e}return null},S=t=>{let s=t.trim();if(!s.startsWith("git"))return!0;let e=s.slice(3).trim();if(e.length===0)return!0;let n=e.split(/\s+/),o=Y(n)??"";if(B.has(o))return!0;let i=U.get(o);if(i!==void 0){let r=n.indexOf(o),g=r>=0&&r+1<n.length?n[r+1]:"";if(i.has(g))return!0}return!1};var G=t=>{let s=[/(?: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 s){let i;for(;(i=o.exec(t))!==null;){let r=i[1]??"";if(r.includes("git")&&!S(r))return!0}}let e=t.split(/\s*\|\s*/);for(let o of e){let i=o.trim();if(i.startsWith("git")&&!S(i))return!0}let n=t.matchAll(/(?:^|[\s($`(])git\b/g);for(let o of n){let r=o[0].indexOf("git"),g=(o.index??0)+r,f=(t.slice(g).split(/[;&|$)`'"]/)[0]??"").trim();if(f.startsWith("git")&&!S(f))return!0}return!1};var E=async()=>{let t=a.process.stdin.getReader(),s=[];try{for(;;){let{done:i,value:r}=await t.read();if(i||r===void 0)break;s.push(r)}}finally{t.releaseLock()}let e=0,n=new Uint8Array(s.reduce((i,r)=>i+r.length,0));for(let i of s)n.set(i,e),e+=i.length;let o=new TextDecoder().decode(n);try{return JSON.parse(o)}catch{return{}}},W=async t=>{let s=new TextEncoder,e=a.process.stdout.getWriter();await e.write(s.encode(JSON.stringify(t))),e.releaseLock()},ne=async t=>{switch(t?.[0]){case"pre-tool-use":return await K();case"stop":return await j();case"post-file-write":return await X();case"post-bash":return await H();case"session-start":return await z();default:return l(void 0)}},O=async t=>{await W({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`noskills: ${t}`}})},F=(t,s)=>{if(s||!t.includes("git"))return null;let e=t.split(/\s*(?:&&|;)\s*/);for(let n of e){let o=n.trim();if(o.startsWith("git")&&!S(o))return"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."}return G(t)?"Git write operations detected in subshell or pipe. Only read commands are permitted. The user controls git, the agent controls files.":null},K=async()=>{let t=await E(),s=t.tool_name??"unknown",e=t.tool_input??{},n=t.cwd??a.process.cwd(),o=await R(n),i=a.env.get("NOSKILLS_SESSION")??null;if(i!==null){let c=await I(n,i);if(c!==null&&c.mode==="free"){if(s==="Bash"){let u=(e.command??"").trim(),d=o?.allowGit??!1;if(!d&&u.includes("git")){let h=F(u,d);if(h!==null)return await O(h),l(void 0)}}return l(void 0)}}let r={};if(i!==null){let c=await I(n,i);if(c!==null&&c.mode==="spec"&&c.phase!==null)r={phase:c.phase};else if(c!==null&&c.spec!==null)try{r=await T(n,c.spec)}catch{return l(void 0)}else return l(void 0)}else{let c=await $(n);if(c.length>0){let u={DISCOVERY:10,DISCOVERY_REVIEW:10,SPEC_DRAFT:10,SPEC_APPROVED:8,BLOCKED:8,EXECUTING:2,IDLE:0,COMPLETED:0},d="IDLE",h=0;for(let L of c){let v=L.phase??"IDLE",b=u[v]??0;b>h&&(h=b,d=v)}r={phase:d};let y=new TextEncoder,D=a.process.stderr.getWriter();await D.write(y.encode(`noskills: WARNING \u2014 ${c.length} session(s) active but NOSKILLS_SESSION not set. Using most restrictive phase (${d}). Set NOSKILLS_SESSION for correct per-instance enforcement.
|
|
3
|
-
`)),D.releaseLock()}else try{r=await x(n)}catch{return l(void 0)}}if(s==="Bash"){let c=(e.command??"").trim(),u=o?.allowGit??!1,d=F(c,u);return d!==null?(await O(d),l(void 0)):l(void 0)}let g=["Write","Edit","MultiEdit"];if(!g.includes(s))return l(void 0);let w=e.file_path??e.path??"";if(w.includes(".eser/")||w.includes(".claude/"))return l(void 0);let f=r.phase??"UNKNOWN";if(f==="EXECUTING"||f==="IDLE"||f==="COMPLETED"||f==="UNKNOWN"){if(f==="EXECUTING"&&g.includes(s)){let c=`${n}/${p.stateDir}/executor-warned.flag`;try{await a.fs.readTextFile(c)}catch{try{await a.fs.mkdir(`${n}/${p.stateDir}`,{recursive:!0}),await a.fs.writeTextFile(c,new Date().toISOString());let u=new TextEncoder,d=a.process.stderr.getWriter();await d.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.
|
|
4
|
-
`)),d.releaseLock()}catch{}}}return l(void 0)}let k={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 \`${m("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 \`${m('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 \`${m("approve")}\``,SPEC_APPROVED:`You are in SPEC_APPROVED \u2014 start execution first: \`${m('next --answer="start"')}\``,BLOCKED:`Execution blocked. Resolve with \`${m('next --answer="resolution"')}\``};return await O(k[f]??`Run \`${m("next")}\` first.`),l(void 0)},j=async()=>{let t=await E();if(t.stop_hook_active===!0)return l(void 0);let s=t.cwd??a.process.cwd(),e;try{let u=await a.fs.readTextFile(`${s}/${p.stateFile}`);e=JSON.parse(u)}catch{return l(void 0)}if(e.phase!=="EXECUTING")return l(void 0);let n=e.execution??{},o=`${s}/${p.stateDir}/files-changed.jsonl`,i=[];try{let d=(await a.fs.readTextFile(o)).trim().split(`
|
|
5
|
-
`).filter(Boolean);i=[...new Set(d.map(h=>{try{return JSON.parse(h).file}catch{return null}}).filter(h=>h!==null))]}catch{}let r=[],g="no changes";try{let{execSync:u}=await import("node:child_process");r=u("git diff --name-only",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
6
|
-
`).filter(Boolean);let y=u("git diff --stat",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
7
|
-
`);g=y[y.length-1]??"no changes"}catch{}let w=[...new Set([...i,...r])],f=(n.iteration??0)+1,k=`${s}/${p.stateDir}/iterations`;try{await a.fs.mkdir(k,{recursive:!0}),await a.fs.writeTextFile(`${k}/iteration-${f}.json`,JSON.stringify({iteration:f,files:w,gitStat:g.trim(),timestamp:new Date().toISOString()},null,2)+`
|
|
8
|
-
`)}catch{}let c=15;try{let u=await R(s);u!==null&&(c=u.maxIterationsBeforeRestart)}catch{}e.execution={...n,iteration:f,modifiedFiles:w,lastProgress:g.trim()||n.lastProgress||null},e.lastCalledAt=new Date().toISOString();try{await a.fs.writeTextFile(`${s}/${p.stateFile}`,JSON.stringify(e,null,2)+`
|
|
9
|
-
`)}catch{}try{await a.fs.writeTextFile(o,"")}catch{}try{await a.fs.remove(`${s}/${p.stateDir}/executor-warned.flag`)}catch{}if(f>=c){let u=new TextEncoder,d=a.process.stderr.getWriter();await d.write(u.encode(`noskills: iteration ${f} reached threshold (${c}). Consider starting a fresh conversation.
|
|
10
|
-
`)),d.releaseLock()}return l(void 0)},X=async()=>{let t=await E(),s=t.tool_input??{},e=s.file_path??s.path??"";if(!e||e.includes(".eser/")||e.includes(".claude/"))return l(void 0);let n=t.cwd??a.process.cwd(),o=`${n}/${p.stateDir}/files-changed.jsonl`,i=JSON.stringify({file:e,tool:t.tool_name,ts:new Date().toISOString()});try{await a.fs.mkdir(`${n}/${p.stateDir}`,{recursive:!0});let r="";try{r=await a.fs.readTextFile(o)}catch{}await a.fs.writeTextFile(o,r+i+`
|
|
11
|
-
`)}catch{}return l(void 0)},H=async()=>{let t=await E(),e=(t.tool_input??{}).command??"";if(!e.includes("noskills"))return l(void 0);let n=t.cwd??a.process.cwd(),o=`${n}/${p.stateDir}/noskills-calls.jsonl`,i=JSON.stringify({command:e,ts:new Date().toISOString()});try{await a.fs.mkdir(`${n}/${p.stateDir}`,{recursive:!0});let r="";try{r=await a.fs.readTextFile(o)}catch{}await a.fs.writeTextFile(o,r+i+`
|
|
12
|
-
`)}catch{}return l(void 0)},z=async()=>{let t=a.process.cwd();if(!await N(t))return l(void 0);let s=await x(t),e=await R(t),o=(await C(t)).filter(w=>e!==null&&e.concerns.includes(w.id)),i=await _(t),r=A(e?.tools??[]),g=await P(s,o,i,e,void 0,void 0,void 0,r);return await W(g),l(void 0)};export{ne as main};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{e as oe,j as ce,r as q,u as le,w as ue,y as j,z as de}from"./chunk-KNIM3QST.js";import{b as K}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{c as _,d as re,e as ie,r as w,s as c,t as M,u as ae,v as P,w as W}from"./chunk-4TTJVJEI.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import{d as se,e as N,f as ne}from"./chunk-VKB3B2FE.js";import{a as V,b as te}from"./chunk-FFWPJP7A.js";import{i as L}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var pe=()=>({tabs:[],selectedTabIndex:-1,focus:"list",running:!0});var Se=e=>e===null?"\u2014":{DISCOVERY:"DISC",DISCOVERY_REVIEW:"REVW",SPEC_DRAFT:"DRFT",SPEC_APPROVED:"APPR",EXECUTING:"EXEC",BLOCKED:"BLKD",COMPLETED:"DONE",IDLE:"IDLE"}[e]??e.slice(0,4),Te=e=>{switch(e){case"EXECUTING":return"green";case"DISCOVERY":case"DISCOVERY_REVIEW":return"cyan";case"BLOCKED":return"red";case"SPEC_DRAFT":case"SPEC_APPROVED":return"yellow";case"COMPLETED":return"dim";default:return"dim"}},v=(e,s)=>{let r=new Set(s.filter(a=>a.spec!==null).map(a=>a.spec)),n=e.map(a=>({label:a.name,badge:Se(a.phase),badgeColor:Te(a.phase),active:r.has(a.name),dimmed:a.phase==="COMPLETED"}));return n.length===0&&n.push({label:"No specs yet",dimmed:!0,selectable:!1}),n.push({label:"\u2500".repeat(20),dimmed:!0,selectable:!1}),n.push({label:"[n] New spec",badge:"+",badgeColor:"green"}),n.push({label:"[f] Idle mode",badge:"~",badgeColor:"cyan"}),n},X=(e,s,r,n)=>{let a=v(e,s),t=M.drawBox({x:n.x,y:n.y,width:n.width,height:n.height,title:"Specs",borderStyle:"rounded"}),y=P.renderList(a,r,n);return t+y};var Ie=["IDLE","DISCOVERY","REVIEW","DRAFT","APPROVED","EXECUTING","DONE","IDLE"],Me=e=>{if(e===null||e==="IDLE")return"IDLE";let r={DISCOVERY_REVIEW:"REVIEW",SPEC_DRAFT:"DRAFT",SPEC_APPROVED:"APPROVED",COMPLETED:"DONE"}[e]??e;return Ie.map(n=>n===r?c.bold(`\u2726${n}\u2726`):c.dim(n)).join("\u2192")},Ee=(e,s,r)=>{if(s===0)return c.dim("no tasks");let n=Math.round(e/s*r),a=r-n;return c.green("\u2588".repeat(n))+c.dim("\u2591".repeat(a))+` ${e}/${s}`},Y=(e,s,r)=>{let n=[];return e===null?(n.push(c.dim("No spec selected")),n.push(""),n.push(c.dim("Select a spec from the list or press [n] for new"))):e.mode==="free"?(n.push(c.bold("Mode: ")+c.cyan("IDLE")),n.push(c.dim("No active spec")),n.push(""),n.push(c.dim(`Session: ${e.sessionId}`))):(n.push(c.bold("Spec: ")+(e.spec??"unknown")),n.push(c.bold("Phase: ")+(e.phase??"unknown")),n.push(""),n.push(Me(e.phase)),n.push(""),r!==void 0&&n.push(c.bold("Progress: ")+Ee(r.completed,r.total,15)),n.push(""),n.push(c.dim(`Session: ${e.sessionId}`))),M.fillBox({x:s.x,y:s.y,width:s.width,height:s.height,title:"Monitor",borderStyle:"rounded"},n)};var z=(e,s)=>{let r=e!==null?e.mode==="free"?"Terminal (IDLE)":`Terminal (${e.spec??"?"})`:"Terminal",n=e!==null&&e.widget!==null,a=M.drawBox({x:s.x,y:s.y,width:s.width,height:s.height,title:r,borderStyle:"rounded",skipInterior:n});if(e===null||e.widget===null&&e.buffer.length===0){let S=c.dim("Waiting for output..."),B=" ".repeat(s.width-2),d="";for(let k=1;k<s.height-1;k++)d+=c.moveTo(s.y+k,s.x+1),d+=k===1?c.truncate(S,s.width-2)+" ".repeat(Math.max(0,s.width-2-c.visibleLength(S))):B;return a+d}if(e.widget!==null)return a+e.widget.render(s);let t=s.height-2,y=e.buffer.slice(-t);return M.fillBox({x:s.x,y:s.y,width:s.width,height:s.height,title:r,borderStyle:"rounded"},y)};var U=(e,s)=>({...e,tabs:[...e.tabs,s],selectedTabIndex:e.tabs.length}),me=(e,s)=>{let r=e.tabs.findIndex(t=>t.id===s);if(r===-1)return e;let n=e.tabs[r];n.process!==null&&n.process.kill();let a=e.tabs.filter(t=>t.id!==s);return{...e,tabs:a,selectedTabIndex:Math.min(e.selectedTabIndex,a.length-1)}},ge=(e,s)=>s<0||s>=e.tabs.length?e:{...e,selectedTabIndex:s},G=(e,s)=>{let r=s.split(`
|
|
3
|
-
`);for(let n of r)e.buffer.push(n);e.buffer.length>1e3&&e.buffer.splice(0,e.buffer.length-1e3)},E=e=>e.selectedTabIndex<0||e.selectedTabIndex>=e.tabs.length?null:e.tabs[e.selectedTabIndex]??null;var fe=(e,s,r)=>{if(r&&s==="c")return{type:"quit"};if(s==="tab")return{type:"toggleFocus"};if(e.focus==="list")switch(s){case"up":return{type:"navigate",direction:"up"};case"down":return{type:"navigate",direction:"down"};case"return":return{type:"select"};case"n":return{type:"newSpec"};case"f":return{type:"freeMode"};case"x":return{type:"closeTab"};case"q":return{type:"quit"};default:return{type:"none"}}return{type:"passthrough",data:s}},be=e=>({...e,focus:e.focus==="list"?"terminal":"list"}),J=(e,s,r)=>{let n=P.nextSelectableIndex(r,e.selectedTabIndex,s);return{...e,selectedTabIndex:n}},H=(e,s,r)=>e>=r.x&&e<r.x+r.width&&s>=r.y&&s<r.y+r.height,ye=(e,s,r,n)=>{let a=e.x+1,t=e.y+1;if(H(a,t,s.left)){if(e.type==="wheel")return{type:"scrollSpecs",direction:e.direction==="up"?"up":"down"};if(e.type==="mousedown"&&e.button===0){let y=e.y+1-s.left.y-1;if(y>=0&&y<r.length){let S=r[y];if(S.selectable!==!1)return S.label.includes("[n]")?{type:"clickNewSpec"}:S.label.includes("[f]")?{type:"clickFreeMode"}:{type:"clickSpec",index:y}}}return{type:"none"}}return H(a,t,s.rightBottom)?e.type==="wheel"?{type:"scrollTerminal",direction:e.direction==="up"?"up":"down"}:n!=="terminal"?{type:"clickTerminal"}:{type:"forwardMouse",event:e}:H(a,t,s.rightTop)?{type:"clickMonitor"}:{type:"none"}};var Be=async e=>{let s=e?.includes("--dry-run")??!1,r=L.process.cwd();if(!await de(r))return console.error("noskills is not initialized. Run:",K(),"init"),te({exitCode:1});let a=(await ce(r)).map(i=>({name:i.name,phase:i.state.phase,hasActiveSession:!1})),t=pe(),{cols:y,rows:S}=w.getTerminalSize(),B={leftWidth:.25,rightTopHeight:.35},d=ae.calculateLayout(y,S,B),k=new TextEncoder,g=i=>{L.process.writeToStdout(k.encode(i))};if(s){g(w.clearScreenSeq());let i=` noskills manager | ${a.length} spec(s) | ${K()} | Ctrl+C to quit`;g(c.moveTo(d.statusBar.y,d.statusBar.x)),g(c.inverse(c.truncate(i,d.statusBar.width))),g(X(a,t.tabs,t.selectedTabIndex,d.left));let l=E(t);return g(Y(l,d.rightTop)),g(z(l,d.rightBottom)),g(c.moveTo(S,1)),g(`
|
|
4
|
-
`),V(void 0)}let D=new ne,F=null,Q=async()=>{for(let i of["claude","claude-code"])try{if(await se`which ${i}`.noThrow().code()===0)return i}catch{}return"claude"},T=v(a,t.tabs);t.selectedTabIndex=P.nextSelectableIndex(T,-1,"down");let A=async()=>{let i=j();await q(r,{id:i,spec:null,mode:"free",phase:null,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"});let l=d.rightBottom.width-2,p=d.rightBottom.height-2,o=new W(p,l),f={id:`tab-${i}`,spec:null,mode:"free",sessionId:i,process:null,buffer:[],widget:o,active:!0,phase:null};try{let m=await Q(),b=await N({command:m,cwd:r,env:{...L.env.toObject(),NOSKILLS_SESSION:i},cols:l,rows:p});f.process=b,D.add(f.id,b),b.onData(I=>{o.write(I),G(f,I),F?.()})}catch(m){let b=m instanceof Error?m.message:String(m);o.write(`[noskills manager] Failed to spawn claude: ${b}\r
|
|
5
|
-
`),o.write(`Is Claude Code installed? Set command in manifest.yml\r
|
|
6
|
-
`)}Object.assign(t,U(t,f)),t.focus="terminal",T=v(a,t.tabs)},Z=async i=>{let l=t.tabs.find(h=>h.spec===i);if(l!==void 0){let h=t.tabs.indexOf(l);Object.assign(t,ge(t,h)),t.focus="terminal";return}let p=null;try{p=(await oe(r,i)).phase}catch{}let o=j();await q(r,{id:o,spec:i,mode:"spec",phase:p,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"});let f=d.rightBottom.width-2,m=d.rightBottom.height-2,b=new W(m,f),I={id:`tab-${o}`,spec:i,mode:"spec",sessionId:o,process:null,buffer:[],widget:b,active:!0,phase:p};try{let h=await Q(),R=await N({command:h,cwd:r,env:{...L.env.toObject(),NOSKILLS_SESSION:o},cols:f,rows:m});I.process=R,D.add(I.id,R),R.onData(ee=>{b.write(ee),G(I,ee),F?.()})}catch(h){let R=h instanceof Error?h.message:String(h);b.write(`[noskills manager] Failed to spawn claude for spec "${i}": ${R}\r
|
|
7
|
-
`)}Object.assign(t,U(t,I)),t.focus="terminal",T=v(a,t.tabs)};g(w.enterAlternateScreen()),g(w.hideCursorSeq()),g(w.clearScreenSeq()),g(_.enableMouse());let u=new Set(["specs","monitor","terminal","status"]),C=()=>{let i=E(t),l=[];if(l.push(w.hideCursorSeq()),u.has("status")||u.size===0){let p=t.focus==="list"?"LIST":"TERM",o=` noskills manager | ${a.length} spec(s) | ${t.tabs.length} tab(s) | [${p}] Tab: toggle | q: quit | n: new | f: free`;l.push(c.moveTo(d.statusBar.y,d.statusBar.x)),l.push(c.inverse(c.truncate(o,d.statusBar.width)+" ".repeat(Math.max(0,d.statusBar.width-c.visibleLength(o)))))}u.has("specs")&&l.push(X(a,t.tabs,t.selectedTabIndex,d.left)),u.has("monitor")&&l.push(Y(i,d.rightTop)),u.has("terminal")&&l.push(z(i,d.rightBottom)),l.push(w.showCursorSeq()),u.clear(),g(l.join(""))},x=()=>{u.add("specs"),u.add("monitor"),u.add("terminal"),u.add("status")},$=!1;F=()=>{u.add("terminal"),!$&&($=!0,setTimeout(()=>{$=!1,t.running&&C()},16))},x(),C();let he=async i=>{let l=ye(i,d,T,t.focus);switch(l.type){case"clickSpec":{t.focus="list",t.selectedTabIndex=l.index;let p=a.find(o=>o.name===T[l.index]?.label)?.name;if(p!==void 0){await Z(p),x();return}u.add("specs"),u.add("monitor"),u.add("status");break}case"clickNewSpec":case"clickFreeMode":{t.focus="list",await A(),x();return}case"clickTerminal":{t.focus="terminal",u.add("status");break}case"clickMonitor":{t.focus="list",u.add("status");break}case"scrollSpecs":{Object.assign(t,J(t,l.direction,T)),u.add("specs"),u.add("monitor");break}case"scrollTerminal":{let p=E(t);if(p?.process!==null&&p!==null){let o=l.direction==="up"?"\x1B[A":"\x1B[B";p.process?.write(o.repeat(3))}break}case"forwardMouse":{t.focus="terminal",u.add("status");let p=E(t);if(p?.process!==null&&p!==null){let o=i.x+1-d.rightBottom.x,f=i.y+1-d.rightBottom.y,m=i.button;i.type==="mousemove"&&(m|=32),i.type==="wheel"&&(m=64|(i.direction==="down"?1:0)),i.shift&&(m|=4),i.ctrl&&(m|=16);let b=i.type==="mouseup"?"m":"M";p.process?.write(`\x1B[<${m};${o};${f}${b}`)}break}case"none":break}};try{await re(async()=>{for await(let i of ie(L.process.stdin)){if(!t.running)break;if(i.kind==="mouse"){await he(i.event),u.size>0&&C();continue}let l=i.event,p=fe(t,l.name,l.ctrl);switch(p.type){case"quit":t.running=!1;break;case"toggleFocus":Object.assign(t,be(t)),u.add("status");break;case"navigate":Object.assign(t,J(t,p.direction,T)),u.add("specs"),u.add("monitor"),u.add("terminal");break;case"freeMode":await A(),x();break;case"newSpec":await A(),x();break;case"select":{let o=T[t.selectedTabIndex];if(o===void 0)break;let f=o.label;if(f.includes("[n]")||f.includes("[f]"))await A();else{let m=a.find(b=>b.name===f)?.name;m!==void 0&&await Z(m)}x();break}case"closeTab":{let o=E(t);o!==null&&(o.process!==null&&D.remove(o.id),await le(r,o.sessionId),Object.assign(t,me(t,o.id)),T=v(a,t.tabs),t.focus="list"),x();break}case"passthrough":{let o=E(t);o?.process!==null&&o!==null&&o.process?.write(new TextDecoder().decode(l.raw));break}case"none":break}if(!t.running)break;u.size>0&&C()}})}finally{await D.killAll(),D.forceKillAll(),await ue(r),g(_.disableMouse()),g(w.showCursorSeq()),g(w.exitAlternateScreen())}return V(void 0)};export{Be as main};
|
package/chunks/next-6K3PS64Z.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as ye}from"./chunk-NTY267SI.js";import"./chunk-L5OC7F24.js";import{a as ge,b as he,c as Se,d as K}from"./chunk-UTWYRNI6.js";import{a as z}from"./chunk-NY4W44PI.js";import"./chunk-4NNSMDFH.js";import{a as ve,b as we,d as C}from"./chunk-2ZYCRMUT.js";import{a as Y,b as B,d as X}from"./chunk-NWWXAZFA.js";import{a as be}from"./chunk-Z2RL2SFY.js";import{a as _}from"./chunk-IZUADMIU.js";import{a as Pe,b as Ae,c as Fe,d as Ee}from"./chunk-2PWSTO7A.js";import{h as V}from"./chunk-L32KHQVT.js";import{a as xe,b as Ie,c as Z,d as ee,e as De,f as te,g as O,h as se,i as q,j as ne,k as Ce,m as ke,o as ie,p as Re}from"./chunk-QL5FA3P3.js";import{a as ae,c as E,e as ce,f as le,i as de,j as pe,k as ue,o as me,q as M,v as G,z as fe}from"./chunk-KNIM3QST.js";import{c as j}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{a as N,b as A}from"./chunk-FFWPJP7A.js";import{i as y}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var Te=a=>a.split(`
|
|
3
|
-
`).map(e=>e.replace(/^[-*]\s+/,"").trim()).filter(e=>e.length>0&&!e.startsWith("#")),Le=async(a,e)=>{let r=[],n=(e.startsWith(a)?e.slice(a.length+1):e).split("/");n.pop();for(let s=n.length;s>=0;s--){let c=`${s===0?a:`${a}/${n.slice(0,s).join("/")}`}/.folder-rules.md`,i=s===0?".":n.slice(0,s).join("/");try{let l=await y.fs.readTextFile(c),d=Te(l);for(let o of d)r.push({folder:i,rule:o})}catch{}}return r},re=async(a,e)=>{let r=new Set,p=[];for(let n of e){let s=await Le(a,n);for(let t of s){let c=`${t.folder}::${t.rule}`;r.has(c)||(r.add(c),p.push(t))}}return p};var ot=async a=>{let e=y.process.cwd(),r=ve(a),p=we(a);if(!await fe(e))return await C({error:`noskills not initialized. Run: ${j("init")}`},r),A({exitCode:1});let n=null;for(let m of p)m.startsWith("--answer=")&&(n=m.slice(9));let s=le(p),t;try{t=await ce(e,s)}catch(m){let f=m instanceof Error?m.message:String(m);return await C({error:f},r),A({exitCode:1})}if(s===null&&t.phase!=="IDLE"&&t.phase!=="COMPLETED")return await C({error:"Error: --spec=<name> is required. Use `noskills spec list` to see available specs."},r),A({exitCode:1});let c=await ue(e);if(c?.command!==void 0){let{setCommandPrefix:m}=await import("./cmd-QE4P4DS4.js");m(c.command)}if(c===null)return await C({error:"No config found"},r),A({exitCode:1});if(t.spec!==null&&t.phase!=="IDLE"&&t.phase!=="COMPLETED"){let m=`${e}/${E.specDir(t.spec)}`;try{await y.fs.stat(m)}catch{return await C({error:!0,message:`Active spec '${t.spec}' directory not found. Files may have been deleted manually.`,suggestion:`Run \`${j("reset")}\` to return to idle, or \`${j("cancel")}\` to mark as cancelled.`},r),A({exitCode:1})}}let i=ye(p,c);t.phase==="DISCOVERY"&&t.discovery.audience!==i&&(t={...t,discovery:{...t.discovery,audience:i}});let d=(await me(e)).filter(m=>c.concerns.includes(m.id));if(n!==null){let m=await V(e),f=await Ne(e,t,c,d,n,m);await M(e,f);let g={...f,lastCalledAt:new Date().toISOString()};await M(e,g);let R=y.env.get("NOSKILLS_SESSION")??null;R!==null&&await G(e,R,g.phase);let H=await Y(e),L=B(H,g.phase),U=g.spec!==null?await _(e,g.spec):null,v=await Oe(e,g),k=await re(e,v),b=X(c?.tools??[]),D=await V(e),I=await K(g,d,L,c,U,k,void 0,b,D),S=n.trim().toLowerCase()==="save",P=g.phase===t.phase;if(S&&P&&(g.phase==="SPEC_DRAFT"||g.phase==="SPEC_APPROVED")){let Q=g.phase==="SPEC_DRAFT"?"Spec draft saved. The spec stays in DRAFT and can be reviewed by anyone. Other users can add ACs (`ac add`), notes (`note add`), or tasks (`task add`) while in draft. When ready, any user can approve with `noskills spec <name> approve`.":'Spec is approved and parked. Others can still add ACs or notes. When ready, run `noskills next --answer="start"` to begin execution.',$e={...I,instruction:Q,saved:!0};return await C($e,r),N(void 0)}return await C(I,r),N(void 0)}let o={...t,lastCalledAt:new Date().toISOString()};await M(e,o);let u=y.env.get("NOSKILLS_SESSION")??null;u!==null&&await G(e,u,o.phase);let h=await Y(e),w=B(h,o.phase),x=o.spec!==null?await _(e,o.spec):null,W=await Oe(e,o),$=await re(e,W),F;o.phase==="IDLE"&&(F={existingSpecs:(await pe(e)).map(f=>({name:f.name,phase:f.state.phase,iteration:f.state.execution.iteration,detail:f.state.phase==="EXECUTING"?`${f.state.execution.completedTasks.length} tasks done, iteration ${f.state.execution.iteration}`:f.state.phase==="SPEC_DRAFT"?"awaiting approval":f.state.phase==="COMPLETED"?"completed":void 0})),rulesCount:w.length});let J=X(c?.tools??[]),T=await V(e),oe=await K(o,d,w,c,x,$,F,J,T);return await C(oe,r),N(void 0)},Ne=async(a,e,r,p,n,s)=>{switch(e.phase){case"DISCOVERY":{let t=e.specDescription!==null&&e.specDescription.length>0,c=e.discovery.mode;if(c===void 0&&t)return["full","validate","technical-depth","ship-fast","explore"].includes(n)?Z(e,n):Z(e,"full");let i=e.discovery.premisesCompleted===!0;if(c!==void 0&&!i){try{let u=JSON.parse(n);if(u!==null&&typeof u=="object"&&"premises"in u){let w=u.premises.map(x=>({text:x.text??"",agreed:x.agreed??!0,revision:x.revision,user:s?.name??"Unknown User",timestamp:new Date().toISOString()}));return ee(e,w)}}catch{}return ee(e,[])}let l=e.discovery.audience==="agent",d=null;try{let u=JSON.parse(n);typeof u=="object"&&u!==null&&!Array.isArray(u)&&(l?ge.map(x=>x.id).every(x=>x in u)&&(d=u):d=u)}catch{}let o=e;if(d!==null)for(let[u,h]of Object.entries(d))typeof h=="string"&&h.length>0&&(o=O(o,u,h,s));else{let u=he(p),h=o.discovery.currentQuestion,w=u[h];if(w===void 0)return e;o=O(o,w.id,n,s),o=Ce(o)}return Se(o.discovery.answers)&&(o=se(o)),o}case"DISCOVERY_REVIEW":{let t=n.trim().toLowerCase();if(t==="approve"){let i=z(e.discovery.answers);return i.detected&&i.proposals.length>=2?ne(e):e.discovery.mode!==void 0?ne(e):q(e)}if(t==="split")return await Me(a,e);if(t==="keep"){let i=ie(e,{id:`decision-split-keep-${Date.now()}`,question:"Split spec into separate areas?",choice:"Chose to keep as single spec despite multiple areas detected",promoted:!1,timestamp:new Date().toISOString()});return q(i)}let c=e.discovery.alternativesPresented===!0;if(e.discovery.approved&&!c){let i;if(t==="skip"||t==="none")i=te(e);else{let l=!1;try{let d=JSON.parse(n);if(d!==null&&typeof d=="object"&&"approach"in d){let o={id:String(d.approach),name:String(d.name??d.approach),summary:String(d.summary??""),effort:String(d.effort??""),risk:String(d.risk??""),user:s?.name??"Unknown User",timestamp:new Date().toISOString()};i=De(e,o),l=!0}}catch{}l||(i=te(e))}return q(i)}try{let i=JSON.parse(n);if(typeof i.revise=="object"&&i.revise!==null){let l=e;for(let[d,o]of Object.entries(i.revise))typeof o=="string"&&o.length>0&&(l=O(l,d,o,s));return l}}catch{}return e}case"SPEC_DRAFT":{if(n.trim().toLowerCase()==="save")return e;if(e.classification===null){let t,c=n.trim().toLowerCase();if(c==="none"||c==="skip")t={involvesWebUI:!1,involvesCLI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1};else try{let l=JSON.parse(n);t={involvesWebUI:l.involvesWebUI===!0||l.involvesUI===!0,involvesCLI:l.involvesCLI===!0||l.involvesUI===!0,involvesPublicAPI:l.involvesPublicAPI===!0,involvesMigration:l.involvesMigration===!0,involvesDataHandling:l.involvesDataHandling===!0}}catch{t={involvesWebUI:!1,involvesCLI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1}}let i={...e,classification:t};try{await be(a,i,p)}catch{}return i}try{let t=JSON.parse(n);if(typeof t.refinement=="string"&&t.refinement.length>0){let c=t.refinement;if(e.spec!==null){let i=`${a}/${E.specFile(e.spec)}`,l=await y.fs.readTextFile(i);if(c.includes("task-")){let o=je(c).map(w=>`- [ ] ${w}`).join(`
|
|
4
|
-
`),u=/## Tasks\n\n([\s\S]*?)(?=\n## |\n*$)/,h=l.replace(u,`## Tasks
|
|
5
|
-
|
|
6
|
-
${o}
|
|
7
|
-
`);await y.fs.writeTextFile(i,h)}}return e}}catch{}return e}case"SPEC_APPROVED":{if(n.trim().toLowerCase()==="save")return e;let t=ke(e);return t.spec!==null&&(await Pe(a,t.spec,"executing"),await Ee(a,t.spec,"executing")),t}case"EXECUTING":{if(!e.execution.awaitingStatusReport){let t={...e,execution:{...e.execution,lastProgress:n}};if(r.verifyCommand!==null&&r.verifyCommand!==void 0&&r.verifyCommand.length>0){let c=await Ve(a,r.verifyCommand);if(t={...t,execution:{...t.execution,lastVerification:c}},!c.passed)return t}return t={...t,execution:{...t.execution,awaitingStatusReport:!0}},t}return await qe(a,e,n,p)}case"BLOCKED":{let t=e.execution.lastProgress??"Unknown",c={id:`d${e.decisions.length+1}`,question:t.replace(/^BLOCKED:\s*/,""),choice:n,promoted:!1,timestamp:new Date().toISOString()},i=ie(e,c);return i=xe(i,"EXECUTING"),i={...i,execution:{...i.execution,lastProgress:`Resolved: ${n}`}},i}default:return e}},Me=async(a,e)=>{let r=z(e.discovery.answers);if(!r.detected||r.proposals.length===0)return e;let p=[];for(let s of r.proposals){let t=`${a}/${E.specDir(s.name)}`;await y.fs.mkdir(t,{recursive:!0});let c=e.discovery.answers.filter(d=>s.relevantAnswers.includes(d.questionId)),l=Ie(ae(),s.name,`spec/${s.name}`);for(let d of c)l=O(l,d.questionId,d.answer);l=se(l),await de(a,s.name,l),p.push(s.name)}return Re(e,"cancelled",`Split into: ${p.join(", ")}`)},je=a=>a.split(/(?=task-\d+:)/).map(e=>e.replace(/[,;\n\s]+$/,"").trim()).filter(e=>/^task-\d+:/.test(e)),qe=async(a,e,r,p)=>{let n;try{n=JSON.parse(r)}catch{return{...e,execution:{...e.execution,lastProgress:r,awaitingStatusReport:!1}}}let s=e;if(e.execution.debt!==null&&e.execution.debt.items.length>0&&typeof e.execution.debt.items[0]=="string"){let k=e.execution.debt.items.map((I,S)=>({id:`legacy-${S+1}`,text:I,since:e.execution.debt.fromIteration}));s={...e,execution:{...e.execution,debt:{...e.execution.debt,items:k}}};let b=new TextEncoder,D=y.process.stderr.getWriter();await D.write(b.encode(`noskills: migrated legacy string[] debt to DebtItem[] format
|
|
8
|
-
`)),D.releaseLock()}let t=new Set(["mandatory-tests","mandatory-docs"]),i=(n.na??[]).filter(v=>t.has(v));if(i.length>0)return{...s,execution:{...s.execution,lastProgress:`REJECTED: Tests and documentation ACs require explicit justification to mark as N/A. Explain why tests or docs are not needed for this spec. Rejected IDs: ${i.join(", ")}`,awaitingStatusReport:!0}};let l=n.completed??[],d=new Set(l),o=n.na??[],u=new Set(o),h=n.newIssues??[],w=n.remaining??[],x=n.blocked??[],W=s.execution.debt?.unaddressedIterations??0,$=s.execution.debt!==null?s.execution.debt.items.filter(v=>!d.has(v.id)&&!u.has(v.id)):[],F=s.execution.debtCounter??0,J=h.map((v,k)=>({id:`debt-${F+k+1}`,text:v,since:s.execution.iteration})),T=[...$,...J],m=w.length===0&&x.length===0&&h.length===0||T.length===0?null:{items:T,fromIteration:s.execution.debt?.fromIteration??s.execution.iteration,unaddressedIterations:$.length>0?W+1:1},f=[...new Set([...s.execution.naItems??[],...o])],g=[];l.length>0&&g.push(`Completed: ${l.join(", ")}`),o.length>0&&g.push(`N/A: ${o.join(", ")}`);let R=g.length>0?g.join("; "):"Status report submitted",H=s.execution.lastVerification===null||s.execution.lastVerification.passed===!0,L=m===null&&H,U=F+h.length;if(L&&s.spec!==null){let v=await _(a,s.spec);if(v!==null){let k=s.execution.completedTasks??[],b=new Set(k),D=[];try{let S=JSON.parse(s.execution.lastProgress??"");Array.isArray(S.completed)&&(D=S.completed.filter(P=>!b.has(P)&&v.tasks.some(Q=>Q.id===P)))}catch{}if(D.length===0){let S=v.tasks.find(P=>!b.has(P.id));S!==void 0&&(D=[S.id])}let I=[];for(let S of D)await Ae(a,s.spec,S),await Fe(a,s.spec,S,"done"),I.push(S);if(I.length>0){let S=I.length===1?`Task ${I[0]} accepted`:`Tasks ${I.join(", ")} accepted`;return{...s,execution:{...s.execution,lastProgress:`${S}: ${R}`,awaitingStatusReport:!1,debt:m,completedTasks:[...k,...I],debtCounter:U,naItems:f}}}}}return{...s,execution:{...s.execution,lastProgress:L?R:`Task not accepted \u2014 remaining items must be addressed first. ${R}`,awaitingStatusReport:!1,debt:m,debtCounter:U,naItems:f}}},Ve=async(a,e)=>{try{let{execSync:r}=await import("node:child_process"),p=r(e,{cwd:a,encoding:"utf-8",timeout:6e4,stdio:["pipe","pipe","pipe"]});return{passed:!0,output:String(p).slice(0,4e3),timestamp:new Date().toISOString()}}catch(r){let p=r,n=((p.stdout??"")+(p.stderr??"")).slice(0,4e3);return p.status!==void 0?{passed:!1,output:n||"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()}}},Oe=async(a,e)=>{let r=[...e.execution.modifiedFiles??[]],p=await _e(a);return[...new Set([...r,...p])]},_e=async a=>{let e=`${a}/${E.stateDir}/files-changed.jsonl`;try{let p=(await y.fs.readTextFile(e)).trim().split(`
|
|
9
|
-
`).filter(Boolean),n=[];for(let s of p)try{let t=JSON.parse(s);n.includes(t.file)||n.push(t.file)}catch{}return n}catch{return[]}};export{Ne as handleAnswer,ot as main,je as parseRefinementTasks};
|
package/chunks/pack-YQVWUWCL.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{e as T}from"./chunk-NWWXAZFA.js";import{c as y,k as F}from"./chunk-KNIM3QST.js";import{b as v}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as P,h as S,k as C}from"./chunk-SHN5MT56.js";import{c as h,d as m,f as w,g as I}from"./chunk-YVN2NZL4.js";import{a as $,b as g}from"./chunk-FFWPJP7A.js";import{i as f}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var q=r=>{let e=r;if(typeof e?.name!="string"||e.name.length===0)throw new Error("Pack manifest must have a non-empty 'name' field");if(typeof e?.version!="string"||e.version.length===0)throw new Error("Pack manifest must have a non-empty 'version' field");if(typeof e?.description!="string"||e.description.length===0)throw new Error("Pack manifest must have a non-empty 'description' field");return e},U=()=>({installed:[]});var B={name:"typescript",version:"1.0.0",description:"TypeScript best practices",tags:["typescript","types"],rules:["rules/use-strict-types.md","rules/no-any.md","rules/prefer-const.md"],concerns:["concerns/ts-quality.json"]};var L={id:"ts-quality",name:"TypeScript Quality",description:"Enforces TypeScript best practices",extras:[{questionId:"verification",text:"Does the code pass strict TypeScript checks (noEmit, strict mode)?"}],specSections:[],reminders:["Run tsc --noEmit before reporting task complete"],acceptanceCriteria:["TypeScript strict mode passes with zero errors"]};var _={name:"react",version:"1.0.0",description:"React component conventions",tags:["react","frontend"],rules:["rules/component-structure.md","rules/prefer-function-components.md","rules/state-management.md"]};var J={name:"security",version:"1.0.0",description:"Security audit rules",tags:["security","audit"],rules:["rules/no-secrets-in-code.md","rules/validate-input.md","rules/no-eval.md"],concerns:["concerns/security-audit.json"]};var H={id:"security-audit",name:"Security Audit",description:"Security-focused review for every spec",extras:[{questionId:"verification",text:"Has the change been reviewed for injection, XSS, CSRF, and auth bypass?"},{questionId:"scope_boundary",text:"What security boundaries must NOT be crossed?"}],specSections:["Security Review"],reminders:["Check for hardcoded secrets, unsanitized input, and missing auth checks"],acceptanceCriteria:["No hardcoded secrets","All user input validated","Auth checks present on protected routes"]};var ee={"use-strict-types":"Prefer explicit types over inference for function params and returns","no-any":"Never use 'any'. Use 'unknown' when type is genuinely unknown.","prefer-const":"Use const by default, let only when reassignment is needed"},ne={"component-structure":"One component per file. Name file same as component.","prefer-function-components":"Use function components with hooks. No class components.","state-management":"Keep state as close to where it's used as possible."},te={"no-secrets-in-code":"Never hardcode API keys, passwords, or tokens","validate-input":"Validate and sanitize all user input at API boundaries","no-eval":"Never use eval(), new Function(), or equivalent dynamic code execution"},se={manifest:B,ruleContents:ee,concernContents:[L]},re={manifest:_,ruleContents:ne,concernContents:[]},ie={manifest:J,ruleContents:te,concernContents:[H]},x=new Map([["typescript",se],["react",re],["security",ie]]);var K=".eser/packs.json",j=3e4,Ee=async r=>{let e=r?.[0];if(e==="list")return await oe();if(e==="install")return await ce(r?.slice(1));if(e==="uninstall")return await le(r?.slice(1));if(e==="inspect")return await de(r?.slice(1));if(e==="search")return await ue(r?.slice(1));let n=v(),i=P({renderer:C.ansi(),sink:S.stdout()});return i.writeln(`Usage: ${n} pack <list | install <name> | uninstall <name> | inspect <name> | search <query>>`),await i.close(),$(void 0)},D=async r=>{let e=`${r}/${K}`;try{let n=await f.fs.readTextFile(e);return JSON.parse(n)}catch{return U()}},N=async(r,e)=>{let n=`${r}/${K}`;await f.fs.mkdir(`${r}/.eser`,{recursive:!0}),await f.fs.writeTextFile(n,JSON.stringify(e,null,2)+`
|
|
3
|
-
`)},R=r=>x.get(r),M=r=>{let e=r.replace(/^github:/,"").replace(/^gh:/,""),n=e.indexOf("#");if(n===-1)return null;let i=e.slice(0,n),t=e.slice(n+1),l=i.indexOf("/");if(l===-1)return null;let u=i.slice(0,l),c=i.slice(l+1);return u.length===0||c.length===0||t.length===0?null:{owner:u,repo:c,ref:"main",packPath:t}},z=async r=>{let e=M(r);if(e===null)throw new Error(`Invalid pack specifier: ${r}. Expected format: github:owner/repo#pack-name`);let n=`https://raw.githubusercontent.com/${e.owner}/${e.repo}/${e.ref}/packs/${e.packPath}/pack.json`,i=await globalThis.fetch(n,{signal:AbortSignal.timeout(j)});if(!i.ok)throw new Error(`Could not fetch pack from ${r}. HTTP ${i.status}`);let t=JSON.parse(await i.text());return q(t)},E=async(r,e)=>{let n=M(r);if(n===null)throw new Error(`Invalid pack specifier: ${r}`);let i=`https://raw.githubusercontent.com/${n.owner}/${n.repo}/${n.ref}/packs/${n.packPath}/${e}`,t=await globalThis.fetch(i,{signal:AbortSignal.timeout(j)});if(!t.ok)throw new Error(`Could not fetch ${e} from ${r}. HTTP ${t.status}`);return await t.text()},W=async r=>{let e=`${r}/${y.concernsDir}`,n=0;try{for await(let i of f.fs.readDir(e))if(i.isFile&&i.name.endsWith(".json")){let t=i.name.match(/^(\d+)-/);if(t!==null){let l=parseInt(t[1],10);l>n&&(n=l)}}}catch{}return n+1},A=async(r,e,n)=>{let i=[],t=[],l=[],u=`${r}/${y.rulesDir}`;await f.fs.mkdir(u,{recursive:!0});for(let[p,o]of Object.entries(n.ruleContents)){let a=`pack-${e}-${p}.md`;await f.fs.writeTextFile(`${u}/${a}`,o+`
|
|
4
|
-
`),i.push(a)}if(n.concernContents.length>0){let p=`${r}/${y.concernsDir}`;await f.fs.mkdir(p,{recursive:!0});let o=await W(r);for(let a of n.concernContents){let d=`${String(o).padStart(3,"0")}-${a.id}.json`;await f.fs.writeTextFile(`${p}/${d}`,JSON.stringify(a,null,2)+`
|
|
5
|
-
`),t.push(d),o++}}if(n.folderRuleContents!==void 0)for(let[p,o]of Object.entries(n.folderRuleContents)){let a=`${r}/${p}/.folder-rules.md`;await f.fs.mkdir(`${r}/${p}`,{recursive:!0}),await f.fs.writeTextFile(a,o+`
|
|
6
|
-
`),l.push(`${p}/.folder-rules.md`)}return{name:e,version:n.manifest.version,installedAt:new Date().toISOString(),source:"builtin",rules:i,concerns:t,folderRules:l}},ae=async(r,e,n)=>{let i=n.name,t=[],l=[],u=[],c=`${r}/${y.rulesDir}`;if(await f.fs.mkdir(c,{recursive:!0}),n.rules!==void 0)for(let o of n.rules){let a=await E(e,o),s=o.replace(/^rules\//,"").replace(/\.md$/,""),d=`pack-${i}-${s}.md`;await f.fs.writeTextFile(`${c}/${d}`,a),t.push(d)}if(n.concerns!==void 0&&n.concerns.length>0){let o=`${r}/${y.concernsDir}`;await f.fs.mkdir(o,{recursive:!0});let a=await W(r);for(let s of n.concerns){let d=await E(e,s),k=JSON.parse(d),O=`${String(a).padStart(3,"0")}-${k.id}.json`;await f.fs.writeTextFile(`${o}/${O}`,d),l.push(O),a++}}if(n.folderRules!==void 0)for(let[o,a]of Object.entries(n.folderRules)){let s=await E(e,a),d=`${r}/${o}/.folder-rules.md`;await f.fs.mkdir(`${r}/${o}`,{recursive:!0}),await f.fs.writeTextFile(d,s),u.push(`${o}/.folder-rules.md`)}return{name:i,version:n.version,installedAt:new Date().toISOString(),source:e,rules:t,concerns:l,folderRules:u}},oe=async()=>{let r=P({renderer:C.ansi(),sink:S.stdout()}),e=f.process.cwd(),n=await D(e),i=new Set(n.installed.map(t=>t.name));r.writeln(h("Built-in packs:"));for(let[t,l]of x){let u=Object.keys(l.ruleContents).length,c=l.concernContents.length,p=[];u>0&&p.push(`${u} rules`),c>0&&p.push(`${c} concern${c>1?"s":""}`),r.writeln(" ",h(t.padEnd(16)),m(l.manifest.description),m(` (${p.join(", ")})`))}if(r.writeln(""),r.writeln(h("Installed packs:")),n.installed.length===0)r.writeln(m(" No packs installed."));else for(let t of n.installed){let l=t.installedAt.slice(0,10);r.writeln(" ",i.has(t.name)?I(t.name.padEnd(16)):h(t.name.padEnd(16)),m(`v${t.version}`),m(` (installed ${l})`))}return await r.close(),$(void 0)},ce=async r=>{let e=P({renderer:C.ansi(),sink:S.stdout()}),n=f.process.cwd(),i=r?.[0];if(i===void 0||i.length===0){let a=v();return e.writeln(w("Please provide a pack name: "),h(`${a} pack install typescript`)),await e.close(),g({exitCode:1})}let t=await D(n),l=i.includes("/")||i.includes(":"),u=l?M(i)?.packPath??i:i;if(t.installed.some(a=>a.name===u))return e.writeln(w(`Pack "${u}" is already installed.`)),e.writeln(m(" Uninstall first to re-install.")),await e.close(),g({exitCode:1});let c;if(l){e.writeln(m(`Fetching pack from ${i}...`));try{let a=await z(i);if(a.requires!==void 0){for(let s of a.requires)if(!t.installed.some(d=>d.name===s)){e.writeln(m(` Installing dependency: ${s}`));let d=R(s);if(d!==void 0){let k=await A(n,s,d);t.installed.push(k)}}}c=await ae(n,i,a)}catch(a){return e.writeln(w(`Failed to install: ${a instanceof Error?a.message:String(a)}`)),await e.close(),g({exitCode:1})}}else{let a=R(i);if(a===void 0)return e.writeln(w(`Unknown pack: ${i}`)),e.writeln(m(` Available built-in packs: ${[...x.keys()].join(", ")}`)),await e.close(),g({exitCode:1});if(a.manifest.requires!==void 0){for(let s of a.manifest.requires)if(!t.installed.some(d=>d.name===s)){e.writeln(m(` Installing dependency: ${s}`));let d=R(s);if(d!==void 0){let k=await A(n,s,d),b=[...t.installed,k];await N(n,{installed:b})}}}c=await A(n,i,a)}let p={installed:[...t.installed,c]};await N(n,p);let o=await F(n);return o!==null&&o.tools.length>0&&(await T(n,o.tools,o),e.writeln(m(" Tool files synced."))),e.writeln(I("\u2714"),` Pack "${c.name}" v${c.version} installed.`),c.rules.length>0&&e.writeln(m(` Rules: ${c.rules.join(", ")}`)),c.concerns.length>0&&e.writeln(m(` Concerns: ${c.concerns.join(", ")}`)),await e.close(),$(void 0)},le=async r=>{let e=P({renderer:C.ansi(),sink:S.stdout()}),n=f.process.cwd(),i=r?.[0];if(i===void 0||i.length===0){let s=v();return e.writeln(w("Please provide a pack name: "),h(`${s} pack uninstall typescript`)),await e.close(),g({exitCode:1})}let t=await D(n),l=t.installed.find(s=>s.name===i);if(l===void 0)return e.writeln(w(`Pack "${i}" is not installed.`)),await e.close(),g({exitCode:1});let u=[];for(let s of t.installed){if(s.name===i)continue;let d=R(s.name);d?.manifest.requires!==void 0&&d.manifest.requires.includes(i)&&u.push(s.name)}u.length>0&&e.writeln(w(`Warning: pack "${i}" is required by: ${u.join(", ")}`));let c=`${n}/${y.rulesDir}`;for(let s of l.rules)try{await f.fs.remove(`${c}/${s}`)}catch{}let p=`${n}/${y.concernsDir}`;for(let s of l.concerns)try{await f.fs.remove(`${p}/${s}`)}catch{}for(let s of l.folderRules)try{await f.fs.remove(`${n}/${s}`)}catch{}let o={installed:t.installed.filter(s=>s.name!==i)};await N(n,o);let a=await F(n);return a!==null&&a.tools.length>0&&(await T(n,a.tools,a),e.writeln(m(" Tool files synced."))),e.writeln(I("\u2714"),` Pack "${i}" uninstalled.`),await e.close(),$(void 0)},de=async r=>{let e=P({renderer:C.ansi(),sink:S.stdout()}),n=r?.[0];if(n===void 0||n.length===0){let s=v();return e.writeln(w("Please provide a pack name: "),h(`${s} pack inspect typescript`)),await e.close(),g({exitCode:1})}let i=n.includes("/")||n.includes(":"),t,l=null,u=null;if(i)try{t=await z(n)}catch(s){return e.writeln(w(`Failed to fetch: ${s instanceof Error?s.message:String(s)}`)),await e.close(),g({exitCode:1})}else{let s=R(n);if(s===void 0)return e.writeln(w(`Unknown pack: ${n}`)),await e.close(),g({exitCode:1});t=s.manifest,l=s.ruleContents,u=s.concernContents}e.writeln(h(`Pack: ${t.name}`),m(` v${t.version}`)),e.writeln(`Description: ${t.description}`),t.author!==void 0&&e.writeln(`Author: ${t.author}`),t.tags!==void 0&&t.tags.length>0&&e.writeln(`Tags: ${t.tags.join(", ")}`),e.writeln("");let c=t.rules?.length??0;if(e.writeln(h(`Rules (${c}):`)),l!==null)for(let[s,d]of Object.entries(l))e.writeln(` - ${s}: `,m(`"${d}"`));else if(t.rules!==void 0)for(let s of t.rules){let d=s.replace(/^rules\//,"").replace(/\.md$/,"");e.writeln(` - ${d}`)}let p=t.concerns?.length??0;if(e.writeln(""),e.writeln(h(`Concerns (${p}):`)),u!==null&&u.length>0)for(let s of u)e.writeln(` - ${s.id}: ${s.name}`),s.acceptanceCriteria.length>0&&e.writeln(m(` ACs: "${s.acceptanceCriteria.join('", "')}"`));else p===0&&e.writeln(m(" none"));let o=t.folderRules!==void 0?Object.keys(t.folderRules).length:0;e.writeln(""),e.writeln(`Folder rules: ${o>0?o:"none"}`);let a=t.requires?.length??0;return e.writeln(`Dependencies: ${a>0?t.requires.join(", "):"none"}`),await e.close(),$(void 0)},ue=async r=>{let e=P({renderer:C.ansi(),sink:S.stdout()}),n=r?.[0]?.toLowerCase();if(n===void 0||n.length===0){let c=v();return e.writeln(w("Please provide a search query: "),h(`${c} pack search typescript`)),await e.close(),g({exitCode:1})}e.writeln(h("Matching packs:"));let i=!1;for(let[c,p]of x){let o=p.manifest.tags??[],a=c.includes(n),s=o.some(k=>k.includes(n)),d=p.manifest.description.toLowerCase().includes(n);(a||s||d)&&(e.writeln(" ",h(c.padEnd(16)),m(p.manifest.description),m(" [builtin]")),i=!0)}let t=f.process.cwd(),u=(await F(t))?.packRegistry;if(u!==void 0)try{let c=await globalThis.fetch(u,{signal:AbortSignal.timeout(j)});if(c.ok){let p=JSON.parse(await c.text());for(let o of p.packs){let a=o.tags??[],s=o.name.includes(n),d=a.some(b=>b.includes(n)),k=o.description.toLowerCase().includes(n);(s||d||k)&&(e.writeln(" ",h(o.name.padEnd(16)),m(o.description),m(` [${o.source}]`)),i=!0)}}}catch{}return i||e.writeln(m(` No packs matching "${n}" found.`)),await e.close(),$(void 0)};export{A as installBuiltinPack,ae as installRemotePack,Ee as main,D as readPacksFile,N as writePacksFile};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{h as E}from"./chunk-L32KHQVT.js";import{q as y,s as C}from"./chunk-QL5FA3P3.js";import{e as f,g as h,h as S,i as g}from"./chunk-KNIM3QST.js";import"./chunk-2XNFZXHY.js";import{f as d,h as u,k as w}from"./chunk-SHN5MT56.js";import{d as l,f as a,g as m}from"./chunk-YVN2NZL4.js";import{a as p,b as n}from"./chunk-FFWPJP7A.js";import{i as c}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var A=async k=>{let e=d({renderer:w.ansi(),sink:u.stdout()}),r=c.process.cwd(),i=h(k);if(!i.ok)return e.writeln(a(i.error)),await e.close(),n({exitCode:1});let t;try{t=await f(r,i.spec)}catch(o){let x=o instanceof Error?o.message:String(o);return e.writeln(a(x)),await e.close(),n({exitCode:1})}if(t.phase!=="COMPLETED")return e.writeln(a(`Cannot reopen in phase: ${t.phase}`)),e.writeln(l("Only COMPLETED specs can be reopened.")),await e.close(),n({exitCode:1});let v=await E(r),s=y(t);return s=C(s,"COMPLETED","DISCOVERY",v,"reopened"),await S(r,s),s.spec!==null&&await g(r,s.spec,s),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};
|
package/chunks/reset-NWO3MNAG.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{v as I}from"./chunk-QL5FA3P3.js";import{c as h,e as g,g as y,h as S,i as k}from"./chunk-KNIM3QST.js";import"./chunk-2XNFZXHY.js";import{f as u,h as w,k as f}from"./chunk-SHN5MT56.js";import{d as a,f as n,g as d}from"./chunk-YVN2NZL4.js";import{a as c,b as l}from"./chunk-FFWPJP7A.js";import{i as p}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var E=async A=>{let e=u({renderer:f.ansi(),sink:w.stdout()}),i=p.process.cwd(),o=y(A);if(!o.ok)return e.writeln(n(o.error)),await e.close(),l({exitCode:1});let s;try{s=await g(i,o.spec)}catch(r){let $=r instanceof Error?r.message:String(r);return e.writeln(n($)),await e.close(),l({exitCode:1})}if(s.phase==="IDLE"||s.phase==="UNINITIALIZED")return e.writeln(a("Already idle. Nothing to reset.")),await e.close(),c(void 0);if(s.spec!==null){let r=`${i}/${h.specDir(s.spec)}`;try{await p.fs.stat(r)}catch{e.writeln(n(`Active spec '${s.spec}' directory not found.`)),e.writeln(a("Resetting to idle anyway."))}}let t=s.spec,m=I(s);return await S(i,m),t!==null&&await k(i,t,m),e.writeln(d("\u2714")," Reset to idle."),t!==null&&e.writeln(a(`Spec "${t}" state cleared. Files in .eser/specs/${t}/ preserved.`)),await e.close(),c(void 0)};export{E as main};
|
package/chunks/rule-CH5GMFKE.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as v,e as C}from"./chunk-NWWXAZFA.js";import{c as x,k as T}from"./chunk-KNIM3QST.js";import{b as A,c as j}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as d,h as u,k as c}from"./chunk-SHN5MT56.js";import{c as y,d as a,f as k,g as P}from"./chunk-YVN2NZL4.js";import{a as g,b as $}from"./chunk-FFWPJP7A.js";import{i as p}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var q=async e=>{let s=e?.[0];if(s==="add")return await R(e?.slice(1));if(s==="list")return await L();if(s==="promote")return await W(e?.slice(1));let n=A(),t=d({renderer:c.ansi(),sink:u.stdout()});return t.writeln(`Usage: ${n} rule <add "rule text" | list | promote "decision">`),await t.close(),g(void 0)},R=async e=>{let s=d({renderer:c.ansi(),sink:u.stdout()}),n=p.process.cwd(),t=[],r=[],i=[];if(e!==void 0)for(let o of e)o.startsWith("--phases=")?t=o.slice(9).split(",").map(w=>w.trim()):o.startsWith("--applies-to=")?r=o.slice(13).split(",").map(w=>w.trim().replace(/^["']|["']$/g,"")):o.startsWith("-")||i.push(o);let m=i.join(" "),f=await T(n);if(m.length===0)return s.writeln(k("Please provide a rule: "),y(`${j('rule add "Use Deno Tests for all tests"')}`)),await s.close(),$({exitCode:1});let b=m.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50),l="";(t.length>0||r.length>0)&&(l+=`---
|
|
3
|
-
`,t.length>0&&(l+=`phases: [${t.join(", ")}]
|
|
4
|
-
`),r.length>0&&(l+=`applies_to: [${r.map(o=>`"${o}"`).join(", ")}]
|
|
5
|
-
`),l+=`---
|
|
6
|
-
`),l+=m+`
|
|
7
|
-
`;let D=`${n}/${x.rulesDir}/${b}.md`;await p.fs.mkdir(`${n}/${x.rulesDir}`,{recursive:!0}),await p.fs.writeTextFile(D,l);let h=[];t.length>0&&h.push(t.join(", ")),r.length>0&&h.push(r.join(", "));let E=h.length>0?` [${h.join("; ")}]`:"";return s.writeln(P("\u2714")," Rule added: ",a(m),a(E)),f!==null&&f.tools.length>0&&(await C(n,f.tools,f),s.writeln(a(" Tool files synced."))),await s.close(),g(void 0)},L=async()=>{let e=d({renderer:c.ansi(),sink:u.stdout()}),s=p.process.cwd(),n=await v(s);if(e.writeln(y("Rules")),e.writeln(""),n.length===0)e.writeln(a(` No rules yet. Add one with: ${j('rule add "..."')}`));else for(let t=0;t<n.length;t++){let r=n[t],i=[];r.phases!==void 0&&r.phases.length>0?i.push(r.phases.join(", ")):i.push("all phases"),r.appliesTo!==void 0&&r.appliesTo.length>0?i.push(r.appliesTo.join(", ")):i.push("all files"),e.writeln(` ${t+1}. ${r.text} `,a(`[${i.join(", ")}]`))}return await e.close(),g(void 0)},W=async e=>{let s=d({renderer:c.ansi(),sink:u.stdout()}),n=e?.join(" ");return n===void 0||n.length===0?(s.writeln(k("Please provide the decision text to promote.")),await s.close(),$({exitCode:1})):(await s.close(),await R(e))};export{q as main};
|
package/chunks/run-5YOXFMP2.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as B}from"./chunk-UTWYRNI6.js";import"./chunk-NY4W44PI.js";import"./chunk-4NNSMDFH.js";import{c as W,d as X}from"./chunk-NWWXAZFA.js";import{a as _,m as j}from"./chunk-QL5FA3P3.js";import{d as g,e as N,f as U,h as $,k as G,o as L,z as M}from"./chunk-KNIM3QST.js";import{b as E,c as V}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{a as D,b as A,g as F}from"./chunk-4TTJVJEI.js";import{f as R,h as O,k as T}from"./chunk-SHN5MT56.js";import{c as v,d as o,f as l,g as P,h,k as I}from"./chunk-YVN2NZL4.js";import{a as S,b as w}from"./chunk-FFWPJP7A.js";import{i as y}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.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=await 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-D5IDWU35.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-D5IDWU35.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(`
|
|
3
|
-
`)},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}
|
|
4
|
-
`;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};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{e as b,j as y,r as A,t as C,u as N,w as $,x,y as O,z as R}from"./chunk-KNIM3QST.js";import{b as I,c as E}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f,h as w,k as S}from"./chunk-SHN5MT56.js";import{c as l,d as n,f as c,g as v}from"./chunk-YVN2NZL4.js";import{a as u,b as h}from"./chunk-FFWPJP7A.js";import{i as m}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var G=async t=>{let s=t?.[0];if(s==="start")return await P(t?.slice(1));if(s==="end")return await D(t?.slice(1));if(s==="list")return await M();if(s==="gc")return await K();let i=I(),e=f({renderer:S.ansi(),sink:w.stdout()});return e.writeln(`Usage: ${i} session <start | end | list | gc>`),e.writeln(""),e.writeln(n(" start --spec=<name> Bind to a spec")),e.writeln(n(" start --free Idle mode (no spec, no enforcement)")),e.writeln(n(" start --auto Auto-detect spec or idle")),e.writeln(n(" end [--id=<id>] End current/specific session")),e.writeln(n(" list Show active sessions")),e.writeln(n(" gc Remove stale sessions")),await e.close(),u(void 0)},P=async t=>{let s=f({renderer:S.ansi(),sink:w.stdout()}),i=m.process.cwd();if(!await R(i))return s.writeln(c("noskills is not initialized.")," Run: ",l(E("init"))),await s.close(),h({exitCode:1});let e=null,o=!1,d=!1;for(let r of t??[])r.startsWith("--spec=")?e=r.slice(7):r==="--free"?o=!0:r==="--auto"&&(d=!0);if(d){let p=(await y(i)).filter(L=>L.state.phase!=="COMPLETED"&&L.state.phase!=="IDLE");p.length===1?e=p[0].name:o=!0}if(e===null&&!o)return s.writeln(c("Specify --spec=<name>, --free, or --auto.")),s.writeln(n(`Example: ${I()} session start --spec=my-feature`)),await s.close(),h({exitCode:1});let a=null;if(e!==null)try{a=(await b(i,e)).phase}catch(r){let p=r instanceof Error?r.message:String(r);return s.writeln(c(`Error: ${p}`)),await s.close(),h({exitCode:1})}let g=O(),k={id:g,spec:e,mode:o?"free":"spec",phase:o?null:a,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"};return await A(i,k),s.writeln(v("Session started.")),s.writeln(" ID: ",l(g)),s.writeln(" Mode: ",l(o?"free":"spec")),e!==null&&(s.writeln(" Spec: ",l(e)),a!==null&&s.writeln(" Phase: ",n(a))),s.writeln(""),s.writeln("Run: ",l(`export NOSKILLS_SESSION=${g}`)),await s.close(),u(void 0)},D=async t=>{let s=f({renderer:S.ansi(),sink:w.stdout()}),i=m.process.cwd(),e=null;for(let d of t??[])d.startsWith("--id=")&&(e=d.slice(5));return e===null&&(e=m.env.get("NOSKILLS_SESSION")??null),e===null?(s.writeln(c("No session specified. Use --id=<id> or set NOSKILLS_SESSION env var.")),await s.close(),h({exitCode:1})):(await N(i,e)?s.writeln(v("Session ended: "),n(e)):s.writeln(c(`Session not found: ${e}`)),await s.close(),u(void 0))},M=async()=>{let t=f({renderer:S.ansi(),sink:w.stdout()}),s=m.process.cwd(),i=await C(s);if(t.writeln(l("Sessions")),t.writeln(""),i.length===0)t.writeln(n(` No active sessions. Start one with: ${E("session start --spec=<name>")}`));else for(let e of i){let o=x(e),d=Date.now()-new Date(e.lastActiveAt).getTime(),a=Math.floor(d/6e4),g=a<60?`${a}min ago`:`${Math.floor(a/60)}h ago`,k=e.mode==="free"?"free":`spec:${e.spec??"?"}`,r=e.phase??"\u2014",p=o?c(" (stale)"):"";t.writeln(" ",l(e.id)," ",n(k.padEnd(25))," ",n(r.padEnd(18))," ",n(g),p)}return await t.close(),u(void 0)},K=async()=>{let t=f({renderer:S.ansi(),sink:w.stdout()}),s=m.process.cwd(),i=await $(s);if(i.length===0)t.writeln(n("No stale sessions to remove."));else{t.writeln(v(`Removed ${i.length} stale session(s):`));for(let e of i)t.writeln(" ",n(e))}return await t.close(),u(void 0)};export{G as main};
|
package/chunks/spec-PWS2UYVL.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as K}from"./chunk-NY4W44PI.js";import{a as G,d as X}from"./chunk-2ZYCRMUT.js";import{g as W,h as P}from"./chunk-L32KHQVT.js";import{b as z,g as N,h as F,p as L,r as B,s as H,t as J,u as _}from"./chunk-QL5FA3P3.js";import{a as T,c as b,e as D,f as M,i as k,j as Y,z as O}from"./chunk-KNIM3QST.js";import{b as $,c as I}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as y,h as C,k as x}from"./chunk-SHN5MT56.js";import{c as m,d as c,f as p,g as E,h as U,k as q}from"./chunk-YVN2NZL4.js";import{a as w,b as d}from"./chunk-FFWPJP7A.js";import{i as g}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var Q=new Set(["new","list","help","next","approve","done","block","reset","cancel","wontfix","reopen","revisit","split","ac","task","note"]),Z=new Set(["a","an","the","and","or","but","in","on","at","to","for","of","with","by","from","is","it","its","this","that","as","be","are","was","were","been","being","have","has","had","do","does","did","will","would","could","should","may","might","shall","can","i","we","you","they","our","my","so","if","not","no","all"]),ee=n=>{let s=n.toLowerCase().replace(/[^a-z0-9\s-]/g,"").split(/\s+/).filter(l=>l.length>0&&!Z.has(l)).slice(0,6).join("-");return s.length>50&&(s=s.slice(0,50).replace(/-[^-]*$/,"")),s=s.replace(/^-+|-+$/g,""),s||"spec"},te=n=>n.includes(" ")||n.length>50,se=new Map([["next",()=>import("./next-6K3PS64Z.js")],["approve",()=>import("./approve-PXC7FMDI.js")],["done",()=>import("./done-HGZT3ZOT.js")],["block",()=>import("./block-CSVO3R47.js")],["reset",()=>import("./reset-NWO3MNAG.js")],["cancel",()=>import("./cancel-AJOYWYV5.js")],["wontfix",()=>import("./wontfix-4R2ESAR5.js")],["reopen",()=>import("./reopen-Z3MPVAGR.js")]]);var xe=async n=>{let e=n?.[0];if(e==="new")return await ne(n?.slice(1));if(e==="list")return await ie(n?.slice(1));if(e==="help"||e===void 0){let a=$(),r=y({renderer:x.ansi(),sink:C.stdout()});return r.writeln(`Usage: ${a} spec <new "description" | list | <name> <command>>`),r.writeln(""),r.writeln(c(" Commands for a spec:")),r.writeln(c(" next, approve, done, block, reset, cancel, wontfix, reopen, revisit, split, ac, task, note")),r.writeln(""),r.writeln(c(" Examples:")),r.writeln(c(` ${a} spec new "Add photo upload support" # name auto-generated`)),r.writeln(c(` ${a} spec new my-feature "Add upload support" # explicit name`)),r.writeln(c(` ${a} spec my-feature next`)),r.writeln(c(` ${a} spec my-feature next --answer="approve"`)),await r.close(),w(void 0)}let t=e,s=n?.[1];if(s===void 0)return await(await import("./status-G5D6BYFF.js")).main([`--spec=${t}`]);if(s==="split")return await ae([`--spec=${t}`,...n?.slice(2)??[]]);if(s==="revisit")return await oe([`--spec=${t}`,...n?.slice(2)??[]]);if(s==="ac")return await le(t,n?.slice(2));if(s==="task")return await ce(t,n?.slice(2));if(s==="note")return await pe(t,n?.slice(2));let l=se.get(s);if(l!==void 0)return await(await l()).main([`--spec=${t}`,...n?.slice(2)??[]]);let o=y({renderer:x.ansi(),sink:C.stdout()});return o.writeln(p(`Unknown command: spec ${t} ${s}`)),o.writeln(c(" Valid: next, approve, done, block, reset, cancel, wontfix, reopen, revisit, split, ac, task, note")),await o.close(),d({exitCode:1})},ne=async n=>{let e=y({renderer:x.ansi(),sink:C.stdout()}),t=g.process.cwd();if(!await O(t))return e.writeln(p("noskills is not initialized.")," Run: ",m(I("init"))),await e.close(),d({exitCode:1});let s=null,l=[];if(n!==void 0){let h=!1,S=[];for(let v of n)v.startsWith("--name=")?(s=v.slice(7),h=!0):v.startsWith("-")||S.push(v);if(h)l.push(...S);else if(S.length>=1){let v=S[0];te(v)?l.push(...S):(s=v,l.push(...S.slice(1)))}}let o=null;if(n!==void 0)for(let h of n)h.startsWith("--from-plan=")&&(o=h.slice(12));let a=l.join(" ");if((s===null||s.length===0)&&a.length>0){s=ee(a);let h=s,S=2;for(;;){if(Q.has(h)){h=`${s}-${S}`,S++;continue}let v=`${t}/${b.specDir(h)}`;try{await g.fs.stat(v),h=`${s}-${S}`,S++}catch{break}}s=h}if(s===null||s.length===0)return e.writeln(p("Error: description is required.")),e.writeln(c("Example: "),m(`${$()} spec new "Add photo upload support"`)),await e.close(),d({exitCode:1});if(Q.has(s))return e.writeln(p(`"${s}" is a reserved name.`),c(" Choose a different spec name.")),await e.close(),d({exitCode:1});let r=/^[a-z0-9][a-z0-9-]*[a-z0-9]$/;if(s.length>50||s.length>1&&!r.test(s)||s.length===1&&!/^[a-z0-9]$/.test(s))return e.writeln(p("Invalid spec name: "),m(s)),e.writeln(c("Must be lowercase, hyphens, numbers only. Max 50 chars. Regex: /^[a-z0-9][a-z0-9-]*[a-z0-9]$/")),await e.close(),d({exitCode:1});if(a.length===0)return e.writeln(p("Please provide a description: "),m(`${$()} spec new "Add photo upload support"`)),await e.close(),d({exitCode:1});if(o!==null)try{if((await g.fs.stat(o)).size>50*1024)return e.writeln(p("Plan file too large. Maximum 50KB.")),await e.close(),d({exitCode:1})}catch{return e.writeln(p(`Plan file not found: ${o}`)),await e.close(),d({exitCode:1})}let i=`spec/${s}`,u=`${t}/${b.specDir(s)}`;try{return await g.fs.stat(u),e.writeln(p(`Spec "${s}" already exists.`),c(` Use a different --name or run \`${$()} reset --spec=${s}\` first.`)),await e.close(),d({exitCode:1})}catch{}let A=T(),f=z(A,s,i,a),R=await P(t),V=H(f,"IDLE","DISCOVERY",R);return o!==null&&(V={...f,discovery:{...f.discovery,planPath:o}}),await g.fs.mkdir(`${t}/${b.specDir(s)}`,{recursive:!0}),await k(t,s,V),e.writeln(E("\u2714")," Spec started: ",m(s)),e.writeln(" Directory: ",c(b.specDir(s))),e.writeln(" Branch: ",c(i)),e.writeln(" Phase: ",U("DISCOVERY")),o!==null&&e.writeln(" Plan: ",c(o)),e.writeln(""),e.writeln("Run ",m(I(`next --spec=${s}`))," to begin discovery questions."),await e.close(),w(void 0)},ie=async n=>{let e=g.process.cwd(),t=G(n),s=await Y(e),l=`${e}/${b.specsDir}`,o=new Set(s.map(i=>i.name)),a=[];for(let i of s)a.push({name:i.name,phase:i.state.phase,iteration:i.state.execution.iteration});try{for await(let i of g.fs.readDir(l))i.isDirectory&&!o.has(i.name)&&a.push({name:i.name,phase:"IDLE",iteration:0})}catch{}if(t==="json")return await X(a,"json"),w(void 0);let r=y({renderer:x.ansi(),sink:C.stdout()});if(r.writeln(m("Specs")),r.writeln(""),a.length===0)r.writeln(c(" No specs yet."));else for(let i of a){let u=i.phase==="COMPLETED"?E(i.phase):i.phase==="EXECUTING"?q(i.phase):i.phase==="BLOCKED"?p(i.phase):U(i.phase),A=i.phase==="EXECUTING"?c(` iteration ${i.iteration}`):"";r.writeln(" ",c("\u25CB")," ",i.name," ",u,A)}return await r.close(),w(void 0)},re=n=>{let e=[],t=0;for(;t<n.length;)if(n[t]==="--into"&&t+1<n.length){let s=n[t+1],l=s;t+2<n.length&&!n[t+2].startsWith("-")?(l=n[t+2],t+=3):t+=2,e.push({name:s,description:l})}else t+=1;return e},ae=async n=>{let e=y({renderer:x.ansi(),sink:C.stdout()}),t=g.process.cwd();if(!await O(t))return e.writeln(p("noskills is not initialized.")," Run: ",m(I("init"))),await e.close(),d({exitCode:1});let s=M(n??[]);if(s===null)return e.writeln(p("Error: --spec=<name> is required.")),e.writeln(c("Example: "),m(`${$()} spec split --spec=parent --into name1 "desc1" --into name2 "desc2"`)),await e.close(),d({exitCode:1});let l;try{l=await D(t,s)}catch(i){let u=i instanceof Error?i.message:String(i);return e.writeln(p(`Error: ${u}`)),await e.close(),d({exitCode:1})}if(l.phase!=="DISCOVERY"&&l.phase!=="DISCOVERY_REVIEW")return e.writeln(p(`Cannot split spec in phase ${l.phase}. Must be in DISCOVERY or DISCOVERY_REVIEW.`)),await e.close(),d({exitCode:1});let o=re(n??[]);if(o.length<2){let i=K(l.discovery.answers);if(!i.detected||i.proposals.length<2)return e.writeln(p("Error: at least 2 --into entries required, or discovery answers must contain 2+ independent areas.")),await e.close(),d({exitCode:1});let u=[];for(let f of i.proposals){let R=`${t}/${b.specDir(f.name)}`;await g.fs.mkdir(R,{recursive:!0});let j=l.discovery.answers.filter(S=>f.relevantAnswers.includes(S.questionId)),h=z(T(),f.name,`spec/${f.name}`);for(let S of j)h=N(h,S.questionId,S.answer);h=F(h),await k(t,f.name,h),u.push(f.name)}let A=L(l,"cancelled",`Split into: ${u.join(", ")}`);await k(t,s,A),e.writeln(E("Split complete."),` Created ${u.length} sub-specs:`);for(let f of u)e.writeln(" ",c("\u25CB")," ",m(f));return e.writeln("",c(`Parent spec "${s}" cancelled.`)),await e.close(),w(void 0)}let a=[];for(let i of o){let u=`${t}/${b.specDir(i.name)}`;await g.fs.mkdir(u,{recursive:!0});let f=z(T(),i.name,`spec/${i.name}`);for(let R of l.discovery.answers)f=N(f,R.questionId,R.answer);f=F(f),await k(t,i.name,f),a.push(i.name)}let r=L(l,"cancelled",`Split into: ${a.join(", ")}`);await k(t,s,r),e.writeln(E("Split complete."),` Created ${a.length} sub-specs:`);for(let i of a)e.writeln(" ",c("\u25CB")," ",m(i));return e.writeln("",c(`Parent spec "${s}" cancelled.`)),await e.close(),w(void 0)},oe=async n=>{let e=y({renderer:x.ansi(),sink:C.stdout()}),t=g.process.cwd();if(!await O(t))return e.writeln(p("noskills is not initialized.")," Run: ",m(I("init"))),await e.close(),d({exitCode:1});let s=M(n??[]);if(s===null)return e.writeln(p("Error: --spec=<name> is required.")),e.writeln(c("Example: "),m(`${$()} spec revisit --spec=my-spec "reason for revisit"`)),await e.close(),d({exitCode:1});let l=(n??[]).find(i=>!i.startsWith("--")&&i!==s);if(l===void 0||l.trim().length===0)return e.writeln(p('Error: Reason is required: noskills spec revisit --spec=X "reason"')),await e.close(),d({exitCode:1});let o;try{o=await D(t,s)}catch(i){let u=i instanceof Error?i.message:String(i);return e.writeln(p(`Error: ${u}`)),await e.close(),d({exitCode:1})}if(o.phase==="DISCOVERY"||o.phase==="DISCOVERY_REVIEW"||o.phase==="SPEC_DRAFT"||o.phase==="SPEC_APPROVED")return e.writeln(p("Already in planning phase, no need to revisit.")),await e.close(),d({exitCode:1});if(o.phase==="COMPLETED")return e.writeln(p(`Spec is completed. Use \`${$()} reopen --spec=${s}\` instead.`)),await e.close(),d({exitCode:1});if(o.phase==="IDLE")return e.writeln(p("No active spec to revisit.")),await e.close(),d({exitCode:1});let a=o.execution.completedTasks.length,r=B(o,l.trim());return await k(t,s,r),e.writeln(E("Revisit complete.")),e.writeln(" Phase: ",m("DISCOVERY"),c(` (revisited from ${o.phase})`)),a>0&&e.writeln(" Previous progress: ",m(`${a} tasks completed`)),e.writeln(" Reason: ",c(`"${l.trim()}"`)),e.writeln(" Discovery answers preserved \u2014 revise or re-approve."),await e.close(),w(void 0)},le=async(n,e)=>{let t=y({renderer:x.ansi(),sink:C.stdout()}),s=g.process.cwd(),l=e?.[0];if(n===void 0||l===void 0)return t.writeln(`Usage: ${$()} spec <name> ac <add "text" | list>`),await t.close(),w(void 0);if(l==="add"){let o=(e?.slice(1)??[]).filter(u=>!u.startsWith("-")).join(" ");if(o.length===0)return t.writeln(p("Please provide AC text.")),await t.close(),d({exitCode:1});let a=await D(s,n),r=await P(s);a.phase==="EXECUTING"&&t.writeln(U("Warning: Adding ACs during execution is scope creep."));let i=J(a,o,r);return await k(s,n,i),t.writeln(E("AC added: "),`"${o}"`,c(` (by ${W(r)})`)),await t.close(),w(void 0)}if(l==="list"){let a=(await D(s,n)).customACs??[];if(t.writeln(m(`Custom ACs for ${n}`)),t.writeln(""),a.length===0)t.writeln(c(" No custom ACs."));else for(let r of a)t.writeln(` - ${r.text}`,c(` -- ${r.user}, ${r.addedInPhase}`));return await t.close(),w(void 0)}return t.writeln(`Usage: ${$()} spec <name> ac <add "text" | list>`),await t.close(),w(void 0)},ce=async(n,e)=>{let t=y({renderer:x.ansi(),sink:C.stdout()}),s=g.process.cwd(),l=e?.[0];if(n===void 0||l===void 0)return t.writeln(`Usage: ${$()} spec <name> task <add "text" | list>`),await t.close(),w(void 0);if(l==="add"){let o=(e?.slice(1)??[]).filter(u=>!u.startsWith("-")).join(" ");if(o.length===0)return t.writeln(p("Please provide task text.")),await t.close(),d({exitCode:1});let a=await D(s,n);if(a.phase==="EXECUTING"||a.phase==="BLOCKED")return t.writeln(p("Cannot add tasks during execution. Use `spec revisit` to go back to discovery.")),await t.close(),d({exitCode:1});let r=await P(s),i=_(a,`[TASK] ${o}`,r);return await k(s,n,i),t.writeln(E("Task added: "),`"${o}"`,c(` (by ${W(r)})`)),await t.close(),w(void 0)}if(l==="list"){let a=((await D(s,n)).specNotes??[]).filter(r=>r.text.startsWith("[TASK] "));if(t.writeln(m(`Custom tasks for ${n}`)),t.writeln(""),a.length===0)t.writeln(c(" No custom tasks."));else for(let r of a)t.writeln(` - ${r.text.replace("[TASK] ","")}`,c(` -- ${r.user}, ${r.phase}`));return await t.close(),w(void 0)}return t.writeln(`Usage: ${$()} spec <name> task <add "text" | list>`),await t.close(),w(void 0)},pe=async(n,e)=>{let t=y({renderer:x.ansi(),sink:C.stdout()}),s=g.process.cwd(),l=e?.[0];if(n===void 0||l===void 0)return t.writeln(`Usage: ${$()} spec <name> note <add "text" | list>`),await t.close(),w(void 0);if(l==="add"){let o=(e?.slice(1)??[]).filter(u=>!u.startsWith("-")).join(" ");if(o.length===0)return t.writeln(p("Please provide note text.")),await t.close(),d({exitCode:1});let a=await D(s,n),r=await P(s),i=_(a,o,r);return await k(s,n,i),t.writeln(E("Note added: "),`"${o}"`,c(` (by ${W(r)})`)),await t.close(),w(void 0)}if(l==="list"){let a=((await D(s,n)).specNotes??[]).filter(r=>!r.text.startsWith("[TASK] "));if(t.writeln(m(`Notes for ${n}`)),t.writeln(""),a.length===0)t.writeln(c(" No notes."));else for(let r of a)t.writeln(` - ${r.text}`,c(` -- ${r.user}, ${r.phase}`));return await t.close(),w(void 0)}return t.writeln(`Usage: ${$()} spec <name> note <add "text" | list>`),await t.close(),w(void 0)};export{Q as RESERVED_NAMES,te as looksLikeDescription,xe as main,ee as slugFromDescription};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as f,d as P}from"./chunk-UTWYRNI6.js";import"./chunk-NY4W44PI.js";import"./chunk-4NNSMDFH.js";import{a as k,d as w}from"./chunk-2ZYCRMUT.js";import{c as R,d as S}from"./chunk-NWWXAZFA.js";import{e as b,f as x,k as D,o as v,z as O}from"./chunk-KNIM3QST.js";import{c as h}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as d,h as u,k as m}from"./chunk-SHN5MT56.js";import{c as i,d as r,f as c,g as y,h as p,k as I}from"./chunk-YVN2NZL4.js";import{a as l,b as E}from"./chunk-FFWPJP7A.js";import{i as C}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var W=async g=>{let n=C.process.cwd(),o=k(g);if(!await O(n)){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(n,V),t=await D(n),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:t?.concerns??[],tools:t?.tools??[],decisions:e.decisions.length};if(o==="json"){let a=(await v(n)).filter(N=>t!==null&&t.concerns.includes(N.id)),$=await R(n),j=S(t?.tools??[]),F=await P(e,a,$,t,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`))),t!==null&&(s.writeln(""),t.concerns.length>0&&s.writeln(" Concerns: ",r(t.concerns.join(", "))),t.tools.length>0&&s.writeln(" Tools: ",r(t.tools.join(", ")))),e.decisions.length>0&&(s.writeln(""),s.writeln(` Decisions: ${e.decisions.length}`)),await s.close()}return l(void 0)};export{W as main};
|
package/chunks/sync-URY32B7Y.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{e as w}from"./chunk-NWWXAZFA.js";import{k as u}from"./chunk-KNIM3QST.js";import{c as g}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as p,h as d,k as f}from"./chunk-SHN5MT56.js";import{c as m,d as r,f as c,g as n}from"./chunk-YVN2NZL4.js";import{a as o,b as a}from"./chunk-FFWPJP7A.js";import{i as l}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var 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,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-UYGKTA3C.js";import"./chunk-MGNBNMJZ.js";import"./chunk-BVIGTD2Z.js";import"./chunk-JTSRGXS4.js";import"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-BJ45FF6F.js";import"./chunk-MGNBNMJZ.js";import"./chunk-BVIGTD2Z.js";import"./chunk-JTSRGXS4.js";import"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-OSNPAAYT.js";import"./chunk-MGNBNMJZ.js";import"./chunk-BVIGTD2Z.js";import"./chunk-JTSRGXS4.js";import"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-BESTYZQY.js";import"./chunk-MGNBNMJZ.js";import"./chunk-BVIGTD2Z.js";import"./chunk-JTSRGXS4.js";import"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-4XXI5LYN.js";import"./chunk-MGNBNMJZ.js";import"./chunk-BVIGTD2Z.js";import"./chunk-JTSRGXS4.js";import"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-66VSO643.js";import"./chunk-MGNBNMJZ.js";import"./chunk-BVIGTD2Z.js";import"./chunk-JTSRGXS4.js";import"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-QRNSYEPI.js";import"./chunk-MGNBNMJZ.js";import"./chunk-BVIGTD2Z.js";import"./chunk-JTSRGXS4.js";import"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-N6PXARPJ.js";import"./chunk-MGNBNMJZ.js";import"./chunk-BVIGTD2Z.js";import"./chunk-JTSRGXS4.js";import"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-PY6ZNQ4B.js";import"./chunk-MGNBNMJZ.js";import"./chunk-BVIGTD2Z.js";import"./chunk-JTSRGXS4.js";import"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as I,d as T}from"./chunk-2PWSTO7A.js";import{h as D}from"./chunk-L32KHQVT.js";import{p as C,s as A,v as E}from"./chunk-QL5FA3P3.js";import{c as S,e as x,g,h as k,i as y}from"./chunk-KNIM3QST.js";import"./chunk-2XNFZXHY.js";import{f,h as w,k as h}from"./chunk-SHN5MT56.js";import{d,f as n,g as u}from"./chunk-YVN2NZL4.js";import{a as m,b as i}from"./chunk-FFWPJP7A.js";import{i as c}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var W=async l=>{let e=f({renderer:h.ansi(),sink:w.stdout()}),r=c.process.cwd(),p=g(l);if(!p.ok)return e.writeln(n(p.error)),await e.close(),i({exitCode:1});let o=(l??[]).filter(a=>!a.startsWith("--spec=")).join(" ");if(o.length===0)return e.writeln(n('A reason is required: noskills wontfix "reason text"')),await e.close(),i({exitCode:1});let t;try{t=await x(r,p.spec)}catch(a){let v=a instanceof Error?a.message:String(a);return e.writeln(n(v)),await e.close(),i({exitCode:1})}if(t.phase==="IDLE"||t.phase==="UNINITIALIZED"||t.phase==="COMPLETED")return e.writeln(n(`Cannot mark as won't fix in phase: ${t.phase}`)),await e.close(),i({exitCode:1});if(t.spec!==null){let a=`${r}/${S.specDir(t.spec)}`;try{await c.fs.stat(a)}catch{return e.writeln(n(`Active spec '${t.spec}' directory not found.`)),e.writeln(d("Run `noskills reset` to return to idle.")),await e.close(),i({exitCode:1})}}let U=await D(r),s=C(t,"wontfix",o);s=A(s,t.phase,"COMPLETED",U,o),s.spec!==null&&await y(r,s.spec,s);let $=E(s);return await k(r,$),s.spec!==null&&(await I(r,s.spec,"wontfix"),await T(r,s.spec,"wontfix")),e.writeln(u("\u2714"),` Spec marked as won't fix: ${o}`),await e.close(),m(void 0)};export{W as main};
|