prjct-cli 3.27.0 → 3.28.0

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.
@@ -1190,7 +1190,7 @@ CREATE TABLE velocity_sprints (
1190
1190
  name TEXT NOT NULL,
1191
1191
  applied_at TEXT NOT NULL
1192
1192
  )
1193
- `);let r=new Set(e.prepare("SELECT version FROM _migrations").all().map(i=>i.version)),s=ai.filter(i=>!r.has(i.version));if(s.length!==0){if(t&&r.size>0)try{let i=`${t}.pre-migrate.bak`;Yr.existsSync(i)&&Yr.rmSync(i,{force:!0}),e.prepare("VACUUM INTO ?").run(i)}catch(i){console.warn(`prjct: pre-migration backup failed (continuing): ${i?.message??i}`)}for(let i of s)Ua(e,()=>{i.up(e),e.prepare("INSERT INTO _migrations (version, name, applied_at) VALUES (?, ?, ?)").run(i.version,i.name,new Date().toISOString())})}}getMigrations(e){return this.getDb(e).prepare("SELECT * FROM _migrations ORDER BY version").all()}getSchemaVersion(e){return this.getDb(e).prepare("SELECT MAX(version) as version FROM _migrations").get()?.version??0}},y=new ci,h=y});function Ap(n){let e=n.toLowerCase();return e.includes("github")?"github":e.includes("gitlab")?"gitlab":e.includes("bitbucket")?"bitbucket":"other"}function Ha(n){let e=n.trim();if(!e)return{};let t=e.match(/^[^/@]+@([^:/]+):(.+?)(?:\.git)?\/?$/);if(t)return{provider:Ap(t[1]),repoSlug:t[2]};try{let r=new URL(e),s=r.pathname.replace(/^\/+/,"").replace(/\.git$/,"").replace(/\/+$/,"");return!r.host||!s?{}:{provider:Ap(r.host),repoSlug:s}}catch{return{}}}async function KS(n){try{let{stdout:e}=await W("git",["remote","get-url","origin"],{cwd:n});return e.trim()||void 0}catch{return}}async function YS(n){try{let{stdout:e}=await W("git",["symbolic-ref","--short","refs/remotes/origin/HEAD"],{cwd:n});return e.trim().replace(/^origin\//,"")||void 0}catch{return}}function Tn(n){return typeof n=="string"&&n.length>0?n:void 0}function xp(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}function JS(n){return Object.fromEntries(Object.entries(n).filter(([,e])=>e!==void 0))}async function Np(n){let e=y.getDoc(n,"project")||{},t=Tn(e.repoPath),{provider:r,repoSlug:s}=t?Ha(await KS(t)||""):{},i=t?await YS(t):void 0,o=Array.isArray(e.techStack)?e.techStack.filter(c=>typeof c=="string"):void 0;return JS({provider:r,repoSlug:s,currentBranch:Tn(e.currentBranch),defaultBranch:i,stack:Tn(e.stack),techStack:o&&o.length>0?o:void 0,version:Tn(e.version),commitCount:xp(e.commitCount),fileCount:xp(e.fileCount),lastCommit:Tn(e.lastSyncCommit),hasUncommitted:typeof e.hasUncommittedChanges=="boolean"?e.hasUncommittedChanges:void 0,cliVersion:Tn(e.cliVersion),syncedAt:Tn(e.lastSync)})}var Wa=g(()=>{"use strict";N();se();a(Ap,"providerForHost");a(Ha,"parseRemote");a(KS,"gitRemoteUrl");a(YS,"gitDefaultBranch");a(Tn,"str");a(xp,"num");a(JS,"compact");a(Np,"buildProjectMeta")});import{execFile as zS}from"node:child_process";import QS from"node:crypto";import{promisify as ZS}from"node:util";function nb(n,e=tb){let t=Buffer.from(e.replace(/-/g,""),"hex"),s=QS.createHash("sha1").update(t).update(n,"utf8").digest().subarray(0,16);s[6]=s[6]&15|80,s[8]=s[8]&63|128;let i=s.toString("hex");return`${i.slice(0,8)}-${i.slice(8,12)}-${i.slice(12,16)}-${i.slice(16,20)}-${i.slice(20,32)}`}async function rb(n){let e;try{let{stdout:s}=await eb("git",["remote","get-url","origin"],{cwd:n});e=s.trim()||void 0}catch{return null}if(!e)return null;let{provider:t,repoSlug:r}=Ha(e);return!t||!r?null:`${t}:${r}`.toLowerCase()}async function Ip(n){let e=await rb(n);return e?nb(e):null}var eb,tb,Dp=g(()=>{"use strict";Wa();eb=ZS(zS),tb="6f9b2c1a-3d4e-5f60-8a7b-1c2d3e4f5a6b";a(nb,"uuidv5");a(rb,"repoKey");a(Ip,"deriveProjectId")});var Xa={};j(Xa,{PACKAGE_ROOT:()=>Dt,VERSION:()=>Ae,getPackageRoot:()=>Ga,getVersion:()=>ui,resetPackageRoot:()=>sb});import Ba from"node:fs";import li from"node:path";function Ga(){if(nr)return nr;let n=__dirname;for(let e=0;e<5;e++){let t=li.join(n,"package.json");if(Ba.existsSync(t))try{if(JSON.parse(Ba.readFileSync(t,"utf-8")).name==="prjct-cli")return nr=n,n}catch{}n=li.dirname(n)}return nr=li.join(__dirname,"..","..",".."),nr}function ui(){if(kn)return kn;let n="3.27.0";if(n&&/^\d+\.\d+\.\d+/.test(n))return kn=n,kn;try{let e=li.join(Ga(),"package.json");return kn=JSON.parse(Ba.readFileSync(e,"utf-8")).version,kn}catch(e){return process.env.PRJCT_DEBUG==="1"&&console.error("Failed to read version from package.json:",S(e)),"0.0.0"}}function sb(n){nr=n,kn=null}var kn,nr,Ae,Dt,it=g(()=>{"use strict";J();kn=null,nr=null;a(Ga,"getPackageRoot");a(ui,"getVersion");a(sb,"resetPackageRoot");Ae=ui(),Dt=Ga()});async function di(n){try{let{stdout:e}=await I(n,{timeout:5e3});return{success:!0,output:e.trim()}}catch{return{success:!1,output:""}}}async function ib(){let n=await di("gh api user --jq .login");return n.success&&n.output||(n=await di("git config --global github.user"),n.success&&n.output)?n.output:null}async function ob(){let n=await di("git config user.name");return n.success&&n.output?n.output:null}async function ab(){let n=await di("git config user.email");return n.success&&n.output?n.output:null}async function rr(){let[n,e,t]=await Promise.all([ib(),ob(),ab()]);return{github:n,email:t,name:e||n||"Unknown"}}var pi=g(()=>{"use strict";se();a(di,"execCommand");a(ib,"detectGitHubUsername");a(ob,"detectGitName");a(ab,"detectGitEmail");a(rr,"detect")});var Ya={};j(Ya,{worktreeService:()=>cb});import Va from"node:fs/promises";import yt from"node:path";var Pp,Ka,cb,Ja=g(()=>{"use strict";se();X();Pp=".worktrees",Ka=class{static{a(this,"WorktreeService")}async create(e,t,r={}){let s=await this.getMainWorktree(e),i=yt.join(s,Pp,t),o=r.branch||`feat/${t}`;await Va.mkdir(yt.join(s,Pp),{recursive:!0});let c=r.baseBranch?` ${r.baseBranch}`:"";await I(`git worktree add "${i}" -b "${o}"${c}`,{cwd:s});let{stdout:l}=await I("git rev-parse HEAD",{cwd:i});return{path:i,branch:o,commit:l.trim(),isMain:!1,slug:t}}async remove(e,t=!1){let r=await this.getMainWorktree(e),s;if(t)try{let{stdout:i}=await I("git rev-parse --abbrev-ref HEAD",{cwd:e});s=i.trim()}catch{}if(await I(`git worktree remove "${e}" --force`,{cwd:r}),t&&s&&s!=="main"&&s!=="master")try{await I(`git branch -D "${s}"`,{cwd:r})}catch{}}async list(e){let t=await this.getMainWorktree(e),{stdout:r}=await I("git worktree list --porcelain",{cwd:t});return this.parsePorcelainOutput(r,t)}async detect(e){try{let{stdout:t}=await I("git rev-parse --git-common-dir",{cwd:e}),{stdout:r}=await I("git rev-parse --git-dir",{cwd:e}),s=yt.resolve(e,t.trim()),i=yt.resolve(e,r.trim());if(s!==i){let{stdout:o}=await I("git rev-parse --abbrev-ref HEAD",{cwd:e}),{stdout:c}=await I("git rev-parse HEAD",{cwd:e}),{stdout:l}=await I("git rev-parse --show-toplevel",{cwd:e}),u=l.trim(),d=yt.basename(u);return{path:u,branch:o.trim(),commit:c.trim(),isMain:!1,slug:d}}return null}catch{return null}}async getMainWorktree(e){try{let{stdout:r}=await I("git worktree list --porcelain",{cwd:e}),s=r.split(`
1193
+ `);let r=new Set(e.prepare("SELECT version FROM _migrations").all().map(i=>i.version)),s=ai.filter(i=>!r.has(i.version));if(s.length!==0){if(t&&r.size>0)try{let i=`${t}.pre-migrate.bak`;Yr.existsSync(i)&&Yr.rmSync(i,{force:!0}),e.prepare("VACUUM INTO ?").run(i)}catch(i){console.warn(`prjct: pre-migration backup failed (continuing): ${i?.message??i}`)}for(let i of s)Ua(e,()=>{i.up(e),e.prepare("INSERT INTO _migrations (version, name, applied_at) VALUES (?, ?, ?)").run(i.version,i.name,new Date().toISOString())})}}getMigrations(e){return this.getDb(e).prepare("SELECT * FROM _migrations ORDER BY version").all()}getSchemaVersion(e){return this.getDb(e).prepare("SELECT MAX(version) as version FROM _migrations").get()?.version??0}},y=new ci,h=y});function Ap(n){let e=n.toLowerCase();return e.includes("github")?"github":e.includes("gitlab")?"gitlab":e.includes("bitbucket")?"bitbucket":"other"}function Ha(n){let e=n.trim();if(!e)return{};let t=e.match(/^[^/@]+@([^:/]+):(.+?)(?:\.git)?\/?$/);if(t)return{provider:Ap(t[1]),repoSlug:t[2]};try{let r=new URL(e),s=r.pathname.replace(/^\/+/,"").replace(/\.git$/,"").replace(/\/+$/,"");return!r.host||!s?{}:{provider:Ap(r.host),repoSlug:s}}catch{return{}}}async function KS(n){try{let{stdout:e}=await W("git",["remote","get-url","origin"],{cwd:n});return e.trim()||void 0}catch{return}}async function YS(n){try{let{stdout:e}=await W("git",["symbolic-ref","--short","refs/remotes/origin/HEAD"],{cwd:n});return e.trim().replace(/^origin\//,"")||void 0}catch{return}}function Tn(n){return typeof n=="string"&&n.length>0?n:void 0}function xp(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}function JS(n){return Object.fromEntries(Object.entries(n).filter(([,e])=>e!==void 0))}async function Np(n){let e=y.getDoc(n,"project")||{},t=Tn(e.repoPath),{provider:r,repoSlug:s}=t?Ha(await KS(t)||""):{},i=t?await YS(t):void 0,o=Array.isArray(e.techStack)?e.techStack.filter(c=>typeof c=="string"):void 0;return JS({provider:r,repoSlug:s,currentBranch:Tn(e.currentBranch),defaultBranch:i,stack:Tn(e.stack),techStack:o&&o.length>0?o:void 0,version:Tn(e.version),commitCount:xp(e.commitCount),fileCount:xp(e.fileCount),lastCommit:Tn(e.lastSyncCommit),hasUncommitted:typeof e.hasUncommittedChanges=="boolean"?e.hasUncommittedChanges:void 0,cliVersion:Tn(e.cliVersion),syncedAt:Tn(e.lastSync)})}var Wa=g(()=>{"use strict";N();se();a(Ap,"providerForHost");a(Ha,"parseRemote");a(KS,"gitRemoteUrl");a(YS,"gitDefaultBranch");a(Tn,"str");a(xp,"num");a(JS,"compact");a(Np,"buildProjectMeta")});import{execFile as zS}from"node:child_process";import QS from"node:crypto";import{promisify as ZS}from"node:util";function nb(n,e=tb){let t=Buffer.from(e.replace(/-/g,""),"hex"),s=QS.createHash("sha1").update(t).update(n,"utf8").digest().subarray(0,16);s[6]=s[6]&15|80,s[8]=s[8]&63|128;let i=s.toString("hex");return`${i.slice(0,8)}-${i.slice(8,12)}-${i.slice(12,16)}-${i.slice(16,20)}-${i.slice(20,32)}`}async function rb(n){let e;try{let{stdout:s}=await eb("git",["remote","get-url","origin"],{cwd:n});e=s.trim()||void 0}catch{return null}if(!e)return null;let{provider:t,repoSlug:r}=Ha(e);return!t||!r?null:`${t}:${r}`.toLowerCase()}async function Ip(n){let e=await rb(n);return e?nb(e):null}var eb,tb,Dp=g(()=>{"use strict";Wa();eb=ZS(zS),tb="6f9b2c1a-3d4e-5f60-8a7b-1c2d3e4f5a6b";a(nb,"uuidv5");a(rb,"repoKey");a(Ip,"deriveProjectId")});var Xa={};j(Xa,{PACKAGE_ROOT:()=>Dt,VERSION:()=>Ae,getPackageRoot:()=>Ga,getVersion:()=>ui,resetPackageRoot:()=>sb});import Ba from"node:fs";import li from"node:path";function Ga(){if(nr)return nr;let n=__dirname;for(let e=0;e<5;e++){let t=li.join(n,"package.json");if(Ba.existsSync(t))try{if(JSON.parse(Ba.readFileSync(t,"utf-8")).name==="prjct-cli")return nr=n,n}catch{}n=li.dirname(n)}return nr=li.join(__dirname,"..","..",".."),nr}function ui(){if(kn)return kn;let n="3.28.0";if(n&&/^\d+\.\d+\.\d+/.test(n))return kn=n,kn;try{let e=li.join(Ga(),"package.json");return kn=JSON.parse(Ba.readFileSync(e,"utf-8")).version,kn}catch(e){return process.env.PRJCT_DEBUG==="1"&&console.error("Failed to read version from package.json:",S(e)),"0.0.0"}}function sb(n){nr=n,kn=null}var kn,nr,Ae,Dt,it=g(()=>{"use strict";J();kn=null,nr=null;a(Ga,"getPackageRoot");a(ui,"getVersion");a(sb,"resetPackageRoot");Ae=ui(),Dt=Ga()});async function di(n){try{let{stdout:e}=await I(n,{timeout:5e3});return{success:!0,output:e.trim()}}catch{return{success:!1,output:""}}}async function ib(){let n=await di("gh api user --jq .login");return n.success&&n.output||(n=await di("git config --global github.user"),n.success&&n.output)?n.output:null}async function ob(){let n=await di("git config user.name");return n.success&&n.output?n.output:null}async function ab(){let n=await di("git config user.email");return n.success&&n.output?n.output:null}async function rr(){let[n,e,t]=await Promise.all([ib(),ob(),ab()]);return{github:n,email:t,name:e||n||"Unknown"}}var pi=g(()=>{"use strict";se();a(di,"execCommand");a(ib,"detectGitHubUsername");a(ob,"detectGitName");a(ab,"detectGitEmail");a(rr,"detect")});var Ya={};j(Ya,{worktreeService:()=>cb});import Va from"node:fs/promises";import yt from"node:path";var Pp,Ka,cb,Ja=g(()=>{"use strict";se();X();Pp=".worktrees",Ka=class{static{a(this,"WorktreeService")}async create(e,t,r={}){let s=await this.getMainWorktree(e),i=yt.join(s,Pp,t),o=r.branch||`feat/${t}`;await Va.mkdir(yt.join(s,Pp),{recursive:!0});let c=r.baseBranch?` ${r.baseBranch}`:"";await I(`git worktree add "${i}" -b "${o}"${c}`,{cwd:s});let{stdout:l}=await I("git rev-parse HEAD",{cwd:i});return{path:i,branch:o,commit:l.trim(),isMain:!1,slug:t}}async remove(e,t=!1){let r=await this.getMainWorktree(e),s;if(t)try{let{stdout:i}=await I("git rev-parse --abbrev-ref HEAD",{cwd:e});s=i.trim()}catch{}if(await I(`git worktree remove "${e}" --force`,{cwd:r}),t&&s&&s!=="main"&&s!=="master")try{await I(`git branch -D "${s}"`,{cwd:r})}catch{}}async list(e){let t=await this.getMainWorktree(e),{stdout:r}=await I("git worktree list --porcelain",{cwd:t});return this.parsePorcelainOutput(r,t)}async detect(e){try{let{stdout:t}=await I("git rev-parse --git-common-dir",{cwd:e}),{stdout:r}=await I("git rev-parse --git-dir",{cwd:e}),s=yt.resolve(e,t.trim()),i=yt.resolve(e,r.trim());if(s!==i){let{stdout:o}=await I("git rev-parse --abbrev-ref HEAD",{cwd:e}),{stdout:c}=await I("git rev-parse HEAD",{cwd:e}),{stdout:l}=await I("git rev-parse --show-toplevel",{cwd:e}),u=l.trim(),d=yt.basename(u);return{path:u,branch:o.trim(),commit:c.trim(),isMain:!1,slug:d}}return null}catch{return null}}async getMainWorktree(e){try{let{stdout:r}=await I("git worktree list --porcelain",{cwd:e}),s=r.split(`
1194
1194
  `)[0];if(s?.startsWith("worktree "))return s.replace("worktree ","").trim()}catch{}let{stdout:t}=await I("git rev-parse --show-toplevel",{cwd:e});return t.trim()}async setup(e,t){let r=yt.join(t,".env");await b(r)&&await Va.copyFile(r,yt.join(e,".env"));let s=yt.join(t,".prjct"),i=yt.join(e,".prjct");await b(s)&&!await b(i)&&await Va.symlink(s,i,"dir")}async teardown(e){}async clean(e){let t=await this.list(e),r=[],s=await this.getMainWorktree(e);await I("git worktree prune",{cwd:s});for(let i of t)i.isMain||await b(i.path)||r.push(i.slug);return r}parsePorcelainOutput(e,t){let r=[],s=e.trim().split(`
1195
1195
 
1196
1196
  `);for(let i of s){if(!i.trim())continue;let o=i.trim().split(`
@@ -1342,7 +1342,7 @@ ${c.join(`
1342
1342
  `);e=d.trim(),t=p.trim(),r=m.trim(),s=g.trim()&&g.trim()!=="HEAD"?g.trim():void 0}catch{let u=await oE(n);return{workspaceId:tt,worktreePath:u,shortId:tt,isMain:!0,label:ld(tt)}}let i=iE.resolve(n,t)===iE.resolve(n,r),o=await oE(e||n);if(i)return{workspaceId:tt,worktreePath:o,shortId:tt,branch:s,isMain:!0,label:ld(tt,s)};let c=ba(o),l=c.slice(0,6);return{workspaceId:c,worktreePath:o,shortId:l,branch:s,isMain:!1,label:ld(l,s)}}var tt,aE,FI,ud=h(()=>{"use strict";oe();ms();tt="main";a(oE,"safeRealpath");a(ld,"buildLabel");aE=new Map,FI=5e3;a(vr,"deriveWorkspace");a(UI,"computeWorkspace")});var Ai={};P(Ai,{collectActiveTasks:()=>yt,formatActiveTaskLine:()=>lE,formatActiveTaskList:()=>HI});function cE(n,e){let t=n===tt?tt:n.slice(0,6);return{shortId:t,label:`${t} \xB7 ${e??"(detached)"}`}}async function yt(n,e){let t=await vr(e),r=[],s=await X.getCurrentTask(n);if(s){let{shortId:o,label:c}=cE(tt,s.branch);r.push({id:s.id,description:s.description,workspaceId:tt,shortId:o,label:c,branch:s.branch,linearId:s.linearId,harness:s.harness,startedAt:s.startedAt,isCurrent:t.workspaceId===tt,pipeline:Ci(n,s.id,tt)??void 0})}for(let o of await X.getActiveTasks(n)){if(o.workspaceId===tt)continue;let{shortId:c,label:l}=cE(o.workspaceId,o.branch);r.push({id:o.id,description:o.description,workspaceId:o.workspaceId,shortId:c,label:l,branch:o.branch,linearId:o.linearId,harness:o.harness,startedAt:o.startedAt,isCurrent:t.workspaceId===o.workspaceId,pipeline:Ci(n,o.id,o.workspaceId)??void 0})}return r.sort((o,c)=>Number(c.isCurrent)-Number(o.isCurrent)),{current:r.find(o=>o.isCurrent)??null,all:r}}function lE(n){let e=n.isCurrent?"\u2192":" ",t=n.isCurrent?" (this worktree)":"";return`${e} ${n.label} ${n.description}${t}`}function HI(n){if(n.all.length===0)return"No active work cycle.";if(n.all.length===1&&n.current){let t=n.current,r=t.pipeline?`
1343
1343
  Pipeline: ${t.pipeline.station}`:"";return`Active: ${t.description}
1344
1344
  Workspace: ${t.label}${r}`}let e=[`Active work cycles (${n.all.length})`];for(let t of n.all)e.push(lE(t));return e.join(`
1345
- `)}var rn=h(()=>{"use strict";et();cd();ud();a(cE,"labelFor");a(yt,"collectActiveTasks");a(lE,"formatActiveTaskLine");a(HI,"formatActiveTaskList")});var uE,gs,WI,GI,dd=h(()=>{"use strict";uE={core:{title:"AI Agile Loop",description:"Intent, context, execution, learning, and improvement",order:1},optional:{title:"Intelligence & Quality",description:"Project intelligence, quality proof, and advanced policies",order:2},setup:{title:"Setup & Infrastructure",description:"Installation, configuration, and integration plumbing",order:3},legacy:{title:"Compatibility",description:"v2 aliases kept for existing users and scripts",order:4}},gs=[{name:"intent",group:"core",surface:"ai-agile",routing:{group:"spec",method:"draft"},routingMode:"cold-only",optionSchema:{strings:["goal","tags"]},description:"Frame the work brief: objective, constraints, risks, and success signal",usage:{claude:'p. intent "<title>"',terminal:'prjct intent "<title>" [--goal "..."] [--tags k:v,...]'},params:'"<title>" [--goal] [--tags]',implemented:!0,hasTemplate:!1,requiresProject:!0,features:["v3 AI Agile replacement for ticket-style planning","Stores the durable brief in SQLite","Sub-verbs mirror spec for compatibility: list, show, update, audit, link-work, ship"]},{name:"work",group:"core",surface:"ai-agile",routing:{group:"workflow",method:"now"},optionSchema:{strings:["spec"],booleans:["extend"]},description:"Start or inspect an AI Agile work cycle with context and evidence",usage:{claude:'p. work "<intent>"',terminal:'prjct work "<intent>"'},params:"[intent]",implemented:!0,hasTemplate:!0,requiresProject:!0,features:["v3 name for the execution cycle formerly exposed as task","No arg \u2192 shows the active work cycle","Surfaces related context before planning/editing","Captures harness/evidence expectations for the cycle"]},{name:"init",group:"core",surface:"support",routing:{group:"planning",method:"init"},description:"Deep project analysis and initialization",usage:{claude:'p. init "[idea]"',terminal:'prjct init "[idea]"'},params:"[idea]",implemented:!0,hasTemplate:!0,requiresProject:!1,requiresLlm:!0,features:["Architect mode for blank projects","Auto tech stack recommendation","Analyzes existing codebases"]},{name:"task",group:"legacy",surface:"legacy",routing:{group:"workflow",method:"now"},optionSchema:{strings:["spec"],booleans:["extend"]},description:"Compatibility alias for `work`",usage:{claude:null,terminal:'prjct task "<description>"'},params:"[description]",implemented:!0,hasTemplate:!0,requiresProject:!0,features:["No arg \u2192 shows the active task (or none)","Deprecated public language: use `prjct work` for the v3 AI Agile cycle","Auto-harness classifies H0-H3 and stores expected evidence on the task","Writes to stateStorage; runs before/after workflow rules","Optional Linear issue link when the arg matches `[A-Z]+-\\d+`"]},{name:"ship",group:"core",surface:"ai-agile",routing:{group:"shipping",method:"ship"},optionSchema:{booleans:["skipHooks","noSpecGate","noTestGate"],strings:["intent"]},description:"Commit, push, and celebrate shipped feature",usage:{claude:'p. ship ["feature"]',terminal:'prjct ship ["feature"]'},params:"[feature]",implemented:!0,hasTemplate:!0,requiresProject:!0,requiresLlm:!0,features:["No arg \u2192 ships the active task description, or derives a summary from the branch"]},{name:"sync",group:"core",surface:"ai-agile",routing:{group:"analysis",method:"sync"},description:"Sync project state and update workflow agents",usage:{claude:"p. sync",terminal:"prjct sync [--package=<name>] [--full]"},implemented:!0,hasTemplate:!0,requiresProject:!0,requiresLlm:!0,features:["Incremental sync: only re-analyzes changed files (default)","Force full sync: --full bypasses incremental cache","Monorepo support: --package=<name> for single package sync","Nested PRJCT.md inheritance","Per-package CLAUDE.md generation"]},{name:"eval",group:"optional",surface:"support",routing:{group:"eval",method:"eval"},optionSchema:{booleans:["publish","dryRun","json"],strings:["baseline","candidate","source","target","file"]},description:"Run product evals, compare versions, and publish actionable results",usage:{claude:"p. eval run [--candidate <version>] [--publish]",terminal:"prjct eval <run|compare|report|publish> [--baseline <version>] [--candidate <version>] [--target cloud] [--dry-run]"},params:"[run|compare|report|publish]",implemented:!0,hasTemplate:!1,requiresProject:!1,requiresLlm:!1,features:["Deterministic local eval runs stored under PRJCT_CLI_HOME/evals","Version comparisons with regression/improvement actionables","Cloud publication for shared benchmark history with server-side ownership and subscription checks"]},{name:"status",group:"legacy",surface:"legacy",routing:{group:"primitives",method:"status"},optionSchema:{strings:["tokensIn","tokensOut"]},description:"Compatibility lifecycle escape hatch; prefer `work` outcomes",usage:{claude:null,terminal:"prjct status <value>"},params:"[value]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["No args \u2192 prints active task + current status","Workflows are the primary status-change mechanism; this is the escape"]},{name:"tag",group:"legacy",surface:"legacy",routing:{group:"primitives",method:"tag"},optionSchema:{},description:"Compatibility metadata escape hatch; prefer synthesized context tags",usage:{claude:null,terminal:"prjct tag type:bug domain:auth"},params:"<pairs...>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Claude decides what to tag \u2014 no heuristic classifier","type:<feature|bug|improvement|chore> promotes to tasks.type"]},{name:"remember",group:"core",surface:"ai-agile",routing:{group:"primitives",method:"remember"},optionSchema:{strings:["tags"],booleans:["force","global"]},description:"Capture a project memory entry (fact, decision, learning, gotcha, \u2026)",usage:{claude:'p. remember learning "message"',terminal:'prjct remember learning "message" --tags domain:auth'},params:'<type> "<content>" [--tags k:v,...]',implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Types: fact, decision, learning, gotcha, pattern, anti-pattern, shipped, inbox, todo, idea, insight, question, source, person \u2014 plus user-defined","Grows the project memory consumable via `prjct context memory`"]},{name:"forget",group:"core",surface:"ai-agile",routing:{group:"primitives",method:"forget"},optionSchema:{},description:"Delete a project memory entry by id (the delete half of `remember`)",usage:{claude:"p. forget mem_1234",terminal:"prjct forget mem_1234 [--md]"},params:"<id>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Accepts `mem_1234`, `mem-1234`, or a bare `1234`","Hard-deletes the source event + drops the FTS mirror and any embedding \u2014 cannot resurface lexically or semantically"]},{name:"capture",group:"legacy",surface:"legacy",routing:{group:"capture",method:"capture"},optionSchema:{strings:["tags"],booleans:["force","fromCurrent"]},description:"Compatibility inbox fallback; prefer synthesized `remember context`",usage:{claude:null,terminal:'prjct capture "call Ana re pricing" --tags domain:sales'},params:'"<content>" [--tags k:v,...]',implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Writes memory type=inbox; Claude retypes later via a clarify workflow","No task id, no branch, no worktree \u2014 just persists",'Bare `prjct "<text>"` auto-routes to `capture`']},{name:"seed",group:"setup",surface:"support",routing:{group:"seed",method:"seed"},routingMode:"bin-only",optionSchema:{},description:"Manage declarative packs (persona, memory types, workflow slots, hook signals)",usage:{claude:"p. seed list",terminal:"prjct seed add pm,daily"},params:"[add|remove|list|suggest] [pack,pack,...]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Packs declare signals only \u2014 no bash is written","Add or remove multi-persona contexts per project","Auto-detect suggestion from project stack"]},{name:"mcp",group:"setup",surface:"support",routing:{group:"mcp",method:"mcp"},routingMode:"bin-only",optionSchema:{},description:"Toggle MCP servers per-project \u2014 interactive multi-select in your terminal, list/deny/allow for scripts",usage:{claude:"p. mcp list",terminal:"prjct mcp"},params:"[list|status|deny|allow] [serverName]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Interactive multi-select with live tool-cost delta (default UX in TTY)","Project-local \u2014 writes only to .claude/settings.local.json","Knows the well-known cloud MCPs from claude.ai (PostHog, Atlassian, etc.)","Headless list/deny/allow for LLM agents and scripts (--md flag)"]},{name:"install",group:"setup",surface:"support",routing:{group:"install",method:"install"},routingMode:"bin-only",optionSchema:{},description:"Install universal agent surfaces, Claude hooks, and Codex config",usage:{claude:"p. install",terminal:"prjct install"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Inside a prjct project, refreshes AGENTS.md as the portable baseline","Writes Claude passive hooks: SessionStart, UserPromptSubmit, \u2026","Repairs detected Codex config.toml with prjct MCP and TUI status_line","Idempotent; existing non-prjct hooks stay intact","Audit agent support with `prjct agents doctor`"]},{name:"help",group:"setup",surface:"support",routingMode:"bin-only",description:"Contextual help and guidance",usage:{claude:"p. help [topic]",terminal:"prjct help [topic]"},params:"[topic]",implemented:!0,hasTemplate:!0,requiresProject:!1},{name:"analysis-save-llm",group:"optional",surface:"internal",routing:{group:"analysis",method:"saveLlmAnalysis"},description:"Persist analysis notes produced by an LLM run",usage:{claude:null,terminal:"prjct analysis-save-llm <file|text|json>"},params:"<file|text|json>",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0},{name:"analyze",group:"legacy",surface:"legacy",routing:{group:"analysis",method:"analyze"},description:"Compatibility alias for sync analysis",usage:{claude:null,terminal:"prjct analyze"},implemented:!0,hasTemplate:!0,requiresProject:!0,isOptional:!0,requiresLlm:!0},{name:"lean",group:"optional",surface:"support",routing:{group:"lean",method:"lean"},optionSchema:{},description:"Anti-over-engineering: set intensity, review/audit/debt (read-only)",usage:{claude:"p. lean [review|audit|debt|off|lite|full|ultra]",terminal:"prjct lean [sub]"},params:"[review|audit|debt|off|lite|full|ultra]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["No arg \u2192 show active intensity mode + a one-screen summary","review/audit/debt are advisory \u2014 no gate, no source writes","off|lite|full|ultra sets the intensity (mirrors ponytail modes)"]},{name:"tdd",group:"optional",surface:"support",routing:{group:"tdd",method:"tdd"},optionSchema:{},description:"Test-Driven Development: set intensity, run the test command (check)",usage:{claude:"p. tdd [check|off|assist|strict]",terminal:"prjct tdd [sub]"},params:"[check|off|assist|strict]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["No arg \u2192 show mode + the auto-detected test command","off|assist|strict sets the intensity (opt-in, like lean)","check runs the detected test command now (red/green) \u2014 the real gate"]},{name:"sdd",group:"optional",surface:"support",routing:{group:"sdd",method:"sdd"},optionSchema:{},description:"Spec-Driven Development: gate the spec pipeline (off/advisory/strict)",usage:{claude:"p. sdd [off|advisory|strict]",terminal:"prjct sdd [sub]"},params:"[off|advisory|strict]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["No arg \u2192 show mode + the active task spec station (pipeline checklist)","off|advisory|strict sets the intensity (opt-in, like lean)","strict: every task needs a reviewed spec; ship blocks unspecced work"]},{name:"notify",group:"setup",surface:"support",routing:{group:"notify",method:"notify"},optionSchema:{},description:"Desktop notifications (default on): ping on Claude-waiting + subagent-finished",usage:{claude:"p. notify [on|off]",terminal:"prjct notify [on|off]"},params:"[on|off]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Default ON \u2014 pings when Claude is waiting or a subagent finishes","No arg \u2192 show mode + what fires","off silences OS notifications (per-prompt work-state block stays)"]},{name:"agents",group:"setup",surface:"support",routing:{group:"agents",method:"agents"},optionSchema:{booleans:["fix"]},description:"Show the concrete compatibility matrix for AI coding agents",usage:{claude:"p. agents [doctor|doctor --fix]",terminal:"prjct agents [doctor|doctor --fix]"},params:"[doctor|status|list] [--fix]",implemented:!0,hasTemplate:!1,requiresProject:!1,isOptional:!0,features:["Derives support levels from the runtime registry","Reports AGENTS.md, MCP, skills, hooks, ACP, and project-rule support","doctor --fix refreshes repo-local agent surfaces when run inside a project",'Use this to audit claims like "works with Codex/Gemini/OpenCode/Cursor/Windsurf"']},{name:"value",group:"legacy",surface:"legacy",routing:{group:"product",method:"value"},optionSchema:{},description:"Compatibility alias for `insights value`",usage:{claude:null,terminal:"prjct value [--md]"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Scores project continuity from real SQLite data","Counts durable memory, preventive guardrails, shipped work, sync metrics, and agent coverage","Designed as the paid-tier proof screen for humans and agents"]},{name:"memory-doctor",group:"legacy",surface:"legacy",routing:{group:"product",method:"memoryDoctor"},optionSchema:{},description:"Compatibility alias for `insights quality`",usage:{claude:null,terminal:"prjct memory-doctor [--md]"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Finds duplicate groups, stale inbox entries, low-signal memories, and missing types","Read-only by default; recommends exact cleanup actions","Protects recall quality across Claude, Codex, Gemini, OpenCode, and future agents"]},{name:"report",group:"legacy",surface:"legacy",routing:{group:"product",method:"report"},optionSchema:{numbers:["days"]},description:"Compatibility alias for `insights report`",usage:{claude:null,terminal:"prjct report [days] [--md]"},params:"[days]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Summarizes shipped features, completed tasks, active work, and carry-forward lessons","Uses real project state instead of a marketing changelog","Useful for founders, teams, and paid Cloud status emails"]},{name:"handoff",group:"legacy",surface:"legacy",routing:{group:"product",method:"handoff"},optionSchema:{},description:"Compatibility alias for `insights continue`",usage:{claude:null,terminal:"prjct handoff codex [--md]"},params:"[agent]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Gives the next agent the active task, required prjct checks, and high-value memories","Works across Codex, Claude, Gemini, Cursor, OpenCode, Qwen, Kimi, and unknown future agents","Makes multi-agent continuity concrete instead of relying on private model memory"]},{name:"guardrails",group:"legacy",surface:"legacy",routing:{group:"product",method:"guardrails"},optionSchema:{},description:"Compatibility alias for `insights guardrails`",usage:{claude:null,terminal:"prjct guardrails [--md]"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Checks changed files against preventive memory","Falls back to general project traps when no file-specific hit exists","Advisory only; no gate, no mutation"]},{name:"insights",group:"optional",surface:"ai-agile",routing:{group:"product",method:"insights"},optionSchema:{numbers:["days"]},description:"AI Agile intelligence: value, quality, reliability, token cost, reports, continuation, and guardrails",usage:{claude:"p. insights [value|quality|reliability|cost|report|continue|guardrails]",terminal:"prjct insights [value|quality|reliability|cost|report|continue|guardrails] [--md]"},params:"[value|quality|reliability|cost|report|continue|guardrails] [agent|days]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["v3 surface for project intelligence formerly spread across value/report/handoff/memory-doctor/guardrails","Default view summarizes whether the project is compounding","reliability/trust shows whether value, cost, and performance metrics are decision-ready","cost/spend/tokens shows subscription burn, token coverage, context reuse, and capture gaps","Subcommands remain read-only except where underlying compatibility commands already mutate nothing"]},{name:"performance",group:"optional",surface:"ai-agile",routing:{group:"product",method:"performance"},optionSchema:{numbers:["days"]},description:"Measure dev+LLM efficiency per work cycle: time, tokens, model/runtime, tools, friction",usage:{claude:"p. performance [7]",terminal:"prjct performance [days] [--md]"},params:"[days]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Uses real task/session rows and available token columns","Stores unknown when a runtime does not expose exact model/token data","Designed to guide the next work cycle, not to create scrum velocity reports"]},{name:"cloud",group:"setup",surface:"support",routing:{group:"cloud",method:"cloud"},optionSchema:{},description:"Cloud sync (paid): link/unlink a project, sync/pull, pause/resume, status",usage:{claude:"p. cloud [link|unlink|sync|pull|pause|resume|status]",terminal:"prjct cloud [sub]"},params:"[link|unlink|sync|pull|pause|resume|status]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Local-first: nothing leaves the machine until `prjct cloud link`","Token API only \u2014 no backend engine details, no client-side paywall","Auto-syncs on `prjct ship` and at session end once linked"]},{name:"workflow",group:"optional",surface:"support",routing:{group:"workflow",method:"workflow"},optionSchema:{},description:"Configure workflow hooks via natural language",usage:{claude:'p. workflow ["config"]',terminal:'prjct workflow ["config"]'},params:'["natural language config"]',implemented:!0,hasTemplate:!0,requiresProject:!0,isOptional:!0,requiresLlm:!0,features:["Natural language configuration","Before/after hooks for task, done, ship, sync","Permanent, session, or one-time preferences"]},{name:"start",group:"setup",surface:"support",routing:{group:"setup",method:"start"},routingMode:"bin-only",description:"First-time setup (install commands to editors)",usage:{claude:null,terminal:"prjct start"},implemented:!0,hasTemplate:!1,requiresProject:!1},{name:"setup",group:"setup",surface:"support",routing:{group:"setup",method:"setup"},routingMode:"bin-only",description:"Reconfigure editor installations and user-owned defaults",usage:{claude:"p. setup",terminal:"prjct setup"},params:"[--force] [--non-interactive]",implemented:!0,hasTemplate:!0,requiresProject:!1},{name:"login",group:"setup",surface:"support",routing:{group:"setup",method:"login"},description:"Authenticate with prjct cloud (opens browser)",usage:{claude:null,terminal:"prjct login"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"},{name:"logout",group:"setup",surface:"support",routing:{group:"setup",method:"logout"},description:"Sign out from prjct cloud",usage:{claude:null,terminal:"prjct logout"},implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"},{name:"auth",group:"setup",surface:"support",routing:{group:"setup",method:"auth"},description:"Manage cloud authentication",usage:{claude:"p. auth [action]",terminal:"prjct auth [action]"},params:"[logout|status]",implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"},{name:"context",group:"setup",surface:"support",routing:{group:"context",method:"context"},routingMode:"bin-only",optionSchema:{},description:"Smart context filtering tools for AI agents",usage:{claude:null,terminal:"prjct context <tool> [args]"},params:"<tool> [args]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["files - Find relevant files for a task","signatures - Extract code structure (~90% compression)","imports - Analyze dependency graphs","recent - Find hot files from git history","summary - Intelligent file summarization"]},{name:"search",group:"core",surface:"ai-agile",routing:{group:"context",method:"search"},optionSchema:{booleans:["global"]},description:"Search project memory (decisions, learnings, gotchas, ships\u2026) \u2014 BM25 + semantic + recall",usage:{claude:'p. search "<query>"',terminal:'prjct search "<query>" [--md]'},params:"<query>",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Blended retrieval: FTS5 BM25 + opt-in semantic + recency recall","Reranks by proven usefulness, expands one hop of the memory graph","`prjct search mem_1234` resolves a specific entry by id"]},{name:"update",group:"setup",surface:"support",routing:{group:"update",method:"update"},routingMode:"bin-only",description:"Update prjct system-wide: package + migrations + daemon restart",usage:{claude:null,terminal:"prjct update [--dry-run]"},params:"[--dry-run]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Phase 1: npm update (migrates homebrew \u2192 npm if needed)","Phase 2: All projects \u2014 migrate, sweep, reinstall commands","Phase 3: Daemon stop + restart with new code","--dry-run to preview without changes"]},{name:"uninstall",group:"setup",surface:"support",routing:{group:"uninstall",method:"uninstall"},routingMode:"bin-only",description:"Complete system removal of prjct",usage:{claude:null,terminal:"prjct uninstall"},params:"[--force] [--backup] [--dry-run]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Removes ~/.prjct-cli/ data","Cleans CLAUDE.md prjct section","Uninstalls Homebrew/npm packages","Backup option before deletion"]},{name:"team",group:"setup",surface:"support",routing:{group:"team",method:"team"},optionSchema:{booleans:["required","enforce"],strings:["minVersion"]},description:"Enroll this repo in prjct team mode \u2014 commits .prjct/team.json + .claude/CLAUDE.md so teammates pick up shared expectations",usage:{claude:"p. team",terminal:"prjct team [--required] [--min-version <semver>]"},params:"[--required] [--min-version <semver>]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Writes .prjct/team.json with required/minVersion config","Adds prjct context block to .claude/CLAUDE.md (per-project)","Stages both files for the next commit (does NOT commit)","Teammates clone repo + install prjct \u2192 ready to go"]},{name:"embeddings",group:"setup",surface:"support",routing:{group:"embeddings",method:"embeddings"},optionSchema:{strings:["key","model","baseUrl","authHeader","authScheme","headers","query"]},description:"Configure the GLOBAL semantic-embeddings provider (BYOT) \u2014 one API key, stored securely, used by every project.",usage:{claude:"p. embeddings status",terminal:'prjct embeddings <set|status|test|clear> [--key <K>] [--model <M>] [--base-url <U>] [--auth-header <H>] [--auth-scheme <S|none>] [--headers "k=v,..."] [--query <qs>]'},params:"[set|status|test|clear]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["BYOT: bring your own embedding API key \u2014 ANY OpenAI-compatible provider","Zero-config: paste just --key, the base URL is auto-detected from its prefix","OpenAI, OpenRouter, Ollama, Together, Mistral, Voyage, Jina, LM Studio\u2026",'Non-Bearer providers too: --auth-header api-key --auth-scheme none --query "api-version=..." (Azure OpenAI)',"Key stored in the macOS Keychain (else a 0600 file), never in config","Global \u2014 applies to all projects; per-project config still overrides","Without a key, recall uses the always-on local subword embedder","Validate with: prjct embeddings test"]},{name:"log",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"log"},optionSchema:{strings:["task"]},params:"<note>",description:'Append-only implementation journal on the active work cycle \u2014 "what did the last agent try", the cheapest session-to-session continuity. Surfaced in prjct brief and prime.',usage:{claude:'p. log "tried X, blocked on Y"',terminal:'prjct log "<note>" [--task id]'}},{name:"brief",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"brief"},optionSchema:{},description:"COMPILED context artifact for a task: orchestration directive + journal + related memory + recently-landed conventions + graph position. Persisted, regenerable \u2014 retrieval as a build step.",usage:{claude:"p. brief",terminal:"prjct brief [task-id] [--md]"}},{name:"replan",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"replan"},optionSchema:{},params:"<what-changed>",description:"Cascading drift repair: captures the pivot as a decision memory FIRST, then serves a re-plan directive over the open frontier so downstream items get re-evaluated against reality.",usage:{claude:'p. replan "auth moved to JWT"',terminal:'prjct replan "<what changed>"'}},{name:"prime",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"prime"},optionSchema:{},description:"Session-open bundle in ONE pull: active cycle + its last journal entries + ready frontier + pull-pointers. The named start-of-session ceremony.",usage:{claude:"p. prime",terminal:"prjct prime [--md]"}},{name:"land",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"land"},optionSchema:{},description:'Session-close checklist ("land the plane"): open cycle, claimed-but-unfinished items, pending sync, hand-off reminder \u2014 everything that must not die with the context.',usage:{claude:"p. land",terminal:"prjct land [--md]"}},{name:"ready",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"ready"},optionSchema:{},description:'The ready frontier: open backlog items with zero unresolved blocking dependencies \u2014 "what can I work on NOW" as a structural query, ranked by how much each item unblocks.',usage:{claude:"p. ready",terminal:"prjct ready [--md]"}},{name:"next",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"next"},optionSchema:{},description:'Deterministic "what now": top unclaimed item of the ready frontier, served WITH its orchestration directive (model tier, effort, ceremony, fan-out, points).',usage:{claude:"p. next",terminal:"prjct next [--md]"}},{name:"claim",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"claim"},optionSchema:{strings:["as"]},params:"<id>",description:"Race-free claim of a backlog item for multi-agent fan-out: succeeds only if unclaimed (atomic check-and-set).",usage:{claude:"p. claim <id>",terminal:"prjct claim <id> [--as name]"}},{name:"depend",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"depend"},optionSchema:{strings:["on","type"]},params:"<id>",description:"Add a typed dependency edge between work items: blocks | parent | related | discovered-from. Blocking edges are cycle-checked.",usage:{claude:"p. depend <id> --on <id>",terminal:"prjct depend <id> --on <id> [--type blocks|parent|related|discovered-from]"}},{name:"phases",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"phases"},optionSchema:{},description:"Topological execution phases over the dependency graph: items in the same phase are parallelizable \u2014 a data-driven fan-out plan with per-item orchestration.",usage:{claude:"p. phases",terminal:"prjct phases [--md]"}},{name:"expand",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"expand"},optionSchema:{},params:"<id>",description:"Decomposition loop: read the persisted complexity record + expansion directive for an item, or persist the agent's decomposition as subtasks with parent edges.",usage:{claude:"p. expand <id>",terminal:'prjct expand <id> ["subtask 1" "subtask 2" ...]'}},{name:"changelog",group:"changelog",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"changelog",method:"changelog"},optionSchema:{},description:"Release notes from the typed delivery record: what shipped (by version) + completed work cycles in the window. Zero LLM \u2014 pure data-plane render.",usage:{claude:"p. changelog 14",terminal:"prjct changelog [days]"}},{name:"workflows",group:"workflowsReference",surface:"ai-agile",requiresProject:!1,implemented:!0,hasTemplate:!1,routing:{group:"workflowsReference",method:"workflows"},optionSchema:{},description:"Print the quality methodology reference (subagent dispatch, model policy, review/judgment/security workflows) \u2014 the rig-agnostic pull of what Claude reads as workflows.md.",usage:{claude:"p. workflows",terminal:"prjct workflows --md"}},{name:"memory",group:"memoryExport",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"memoryExport",method:"memory"},optionSchema:{},description:"Git-shareable project memory: `export` writes chunked JSONL to .prjct/memory-export/ (commit it); `import` replays a committed export with content-hash dedup \u2014 zero-server team onboarding.",usage:{claude:"p. memory export",terminal:"prjct memory export | prjct memory import"}},{name:"guard",group:"core",surface:"ai-agile",routing:{group:"guard",method:"guard"},optionSchema:{numbers:["limit"],strings:["diff"],booleans:["strict"]},description:"Surface preventive memory (gotchas, anti-patterns, recurring-bugs) recorded against a file BEFORE you edit it \u2014 anticipation, provider-agnostic.",usage:{claude:"p. guard <file>",terminal:"prjct guard <file> | prjct guard --diff <range> [--strict]"},params:"[file]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Pillar 3 (anticipation): see the trap before you step in it","Pull, not push \u2014 also exposed as the prjct_guard MCP tool for Claude + Codex","Strict: only gotchas / anti-patterns / recurring-bugs \u2014 never plain decisions, so no noise",'Quiet by design: "clear to edit" when nothing preventive matches',"Matches absolute or repo-relative paths by exact / suffix / basename"]},{name:"config",group:"setup",surface:"support",routing:{group:"config",method:"config"},optionSchema:{},description:"Read/write global prjct config \u2014 auto-update opt-in, suggestions toggle, etc.",usage:{claude:"p. config list",terminal:"prjct config <list|get|set|unset> [key] [value]"},params:"<list|get|set|unset> [key] [value]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Stored at ~/.prjct-cli/config/global.json","Opt into silent auto-update: prjct config set auto-update on","Toggle proactive suggestions: prjct config set suggestions off","Booleans accept on/off/true/false; numbers parsed automatically"]},{name:"spec",group:"legacy",surface:"legacy",routing:{group:"spec",method:"draft"},routingMode:"cold-only",description:"Compatibility alias for `intent` \u2014 Goal/Acceptance/Scope/Risks before work starts.",usage:{claude:null,terminal:'prjct spec "<title>" [--goal "..."] [--tags k:v,...]'},params:'"<title>" [--goal] [--tags]',implemented:!0,hasTemplate:!1,requiresProject:!0,features:['Drafting: `prjct spec "<title>"` IS the create action \u2014 there is no `draft` subverb (aliases `draft`/`new`/`create` are tolerated and stripped)',"Persists in `specs` SQLite table + memory event stream","Sub-verbs: list, show, update, set-status, record-review, link-task, ship, audit, inventory"]},{name:"audit-spec",group:"legacy",surface:"legacy",routing:{group:"spec",method:"audit"},routingMode:"cold-only",description:"Compatibility alias for `intent audit <id>`",usage:{claude:null,terminal:"prjct audit-spec <id>"},params:"<spec-id>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Emits dispatch prompt \u2014 Claude runs three Agent calls in parallel","Each reviewer writes back via `prjct spec record-review`","All three pass \u2192 spec auto-promotes draft \u2192 reviewed"]},...[["daemon","Run the prjct daemon in the foreground"],["stop","Stop the running prjct daemon"],["restart","Restart the prjct daemon"],["upgrade","Alias of `prjct update`",{group:"update",method:"update"}],["hook","Run a Claude Code hook event (internal; called by the hook scripts)"],["hooks","Inspect or reinstall the Claude Code hooks"],["claude","Claude Code integration management (install/uninstall)"],["crew","Run a crew (multi-subagent) workflow"],["doctor","Diagnose the local prjct installation"],["watch","Watch project files and react to changes"],["version","Print the installed prjct version + provider status"],["prefs","Inspect or set workflow preferences"],["retro","Summarize what shipped over a time window"],["health","Codebase health snapshot"],["skill-adherence","Report how well sessions follow the prjct skill"],["review-risk","Risk-ranked review hints for the working tree"],["context-save","Save the current working context for later restore"],["context-restore","Restore a previously saved working context"]].map(([n,e,t])=>({name:n,group:"setup",description:e,routing:t,usage:{claude:null,terminal:`prjct ${n}`},implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"}))],WI={"-h":"help","--help":"help","-v":"version","--version":"version"},GI=new Set([...gs.filter(n=>n.routingMode==="bin-only").map(n=>n.name),...Object.entries(WI).filter(([,n])=>gs.some(e=>e.name===n&&e.routingMode==="bin-only")).map(([n])=>n)])});var dE,pE=h(()=>{"use strict";dd();dE=new Set(gs.filter(n=>n.routing).map(n=>n.name))});function BI(n){return n instanceof fs}function Xe(n){return BI(n)||n instanceof Error?n.message:typeof n=="string"?n:"Unknown error"}var fs,va,Ra,xi,kn=h(()=>{"use strict";fs=class extends Error{static{a(this,"PrjctError")}code;isOperational;constructor(e,t="PRJCT_ERROR"){super(e),this.name="PrjctError",this.code=t,this.isOperational=!0,Error.captureStackTrace?.(this,this.constructor)}},va=class n extends fs{static{a(this,"ProjectError")}constructor(e,t="PROJECT_ERROR"){super(e,t),this.name="ProjectError"}static notInitialized(){return new n("Project not initialized. Run p. init first.","PROJECT_NOT_INIT")}static notFound(e){return new n(`Project not found: ${e}`,"PROJECT_NOT_FOUND")}static invalidId(e){return new n(`Invalid project ID: ${e}`,"PROJECT_INVALID_ID")}},Ra=class n extends fs{static{a(this,"TemplateError")}constructor(e,t="TEMPLATE_ERROR"){super(e,t),this.name="TemplateError"}static notFound(e){return new n(`Template not found: ${e}.md`,"TEMPLATE_NOT_FOUND")}static parseFailed(e){return new n(`Failed to parse template: ${e}`,"TEMPLATE_PARSE_ERROR")}},xi=class n extends fs{static{a(this,"AgentError")}constructor(e,t="AGENT_ERROR"){super(e,t),this.name="AgentError"}static notSupported(e){return new n(`Unsupported agent type: ${e}`,"AGENT_NOT_SUPPORTED")}static initFailed(e){return new n(`Agent initialization failed: ${e}`,"AGENT_INIT_FAILED")}};a(BI,"isPrjctError");a(Xe,"getErrorMessage")});function mE(n){let e=n.toLowerCase();return e.includes("github")?"github":e.includes("gitlab")?"gitlab":e.includes("bitbucket")?"bitbucket":"other"}function pd(n){let e=n.trim();if(!e)return{};let t=e.match(/^[^/@]+@([^:/]+):(.+?)(?:\.git)?\/?$/);if(t)return{provider:mE(t[1]),repoSlug:t[2]};try{let r=new URL(e),s=r.pathname.replace(/^\/+/,"").replace(/\.git$/,"").replace(/\/+$/,"");return!r.host||!s?{}:{provider:mE(r.host),repoSlug:s}}catch{return{}}}async function qI(n){try{let{stdout:e}=await q("git",["remote","get-url","origin"],{cwd:n});return e.trim()||void 0}catch{return}}async function XI(n){try{let{stdout:e}=await q("git",["symbolic-ref","--short","refs/remotes/origin/HEAD"],{cwd:n});return e.trim().replace(/^origin\//,"")||void 0}catch{return}}function Rr(n){return typeof n=="string"&&n.length>0?n:void 0}function gE(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}function VI(n){return Object.fromEntries(Object.entries(n).filter(([,e])=>e!==void 0))}async function Ca(n){let e=E.getDoc(n,"project")||{},t=Rr(e.repoPath),{provider:r,repoSlug:s}=t?pd(await qI(t)||""):{},i=t?await XI(t):void 0,o=Array.isArray(e.techStack)?e.techStack.filter(c=>typeof c=="string"):void 0;return VI({provider:r,repoSlug:s,currentBranch:Rr(e.currentBranch),defaultBranch:i,stack:Rr(e.stack),techStack:o&&o.length>0?o:void 0,version:Rr(e.version),commitCount:gE(e.commitCount),fileCount:gE(e.fileCount),lastCommit:Rr(e.lastSyncCommit),hasUncommitted:typeof e.hasUncommittedChanges=="boolean"?e.hasUncommittedChanges:void 0,cliVersion:Rr(e.cliVersion),syncedAt:Rr(e.lastSync)})}var _a=h(()=>{"use strict";L();oe();a(mE,"providerForHost");a(pd,"parseRemote");a(qI,"gitRemoteUrl");a(XI,"gitDefaultBranch");a(Rr,"str");a(gE,"num");a(VI,"compact");a(Ca,"buildProjectMeta")});import{execFile as KI}from"node:child_process";import JI from"node:crypto";import{promisify as zI}from"node:util";function ZI(n,e=QI){let t=Buffer.from(e.replace(/-/g,""),"hex"),s=JI.createHash("sha1").update(t).update(n,"utf8").digest().subarray(0,16);s[6]=s[6]&15|80,s[8]=s[8]&63|128;let i=s.toString("hex");return`${i.slice(0,8)}-${i.slice(8,12)}-${i.slice(12,16)}-${i.slice(16,20)}-${i.slice(20,32)}`}async function eP(n){let e;try{let{stdout:s}=await YI("git",["remote","get-url","origin"],{cwd:n});e=s.trim()||void 0}catch{return null}if(!e)return null;let{provider:t,repoSlug:r}=pd(e);return!t||!r?null:`${t}:${r}`.toLowerCase()}async function fE(n){let e=await eP(n);return e?ZI(e):null}var YI,QI,hE=h(()=>{"use strict";_a();YI=zI(KI),QI="6f9b2c1a-3d4e-5f60-8a7b-1c2d3e4f5a6b";a(ZI,"uuidv5");a(eP,"repoKey");a(fE,"deriveProjectId")});var hd={};P(hd,{PACKAGE_ROOT:()=>Tn,VERSION:()=>Le,getPackageRoot:()=>gd,getVersion:()=>_r,resetPackageRoot:()=>fd});import md from"node:fs";import Aa from"node:path";function gd(){if(hs)return hs;let n=__dirname;for(let e=0;e<5;e++){let t=Aa.join(n,"package.json");if(md.existsSync(t))try{if(JSON.parse(md.readFileSync(t,"utf-8")).name==="prjct-cli")return hs=n,n}catch{}n=Aa.dirname(n)}return hs=Aa.join(__dirname,"..","..",".."),hs}function _r(){if(Cr)return Cr;let n="3.27.0";if(n&&/^\d+\.\d+\.\d+/.test(n))return Cr=n,Cr;try{let e=Aa.join(gd(),"package.json");return Cr=JSON.parse(md.readFileSync(e,"utf-8")).version,Cr}catch(e){return process.env.PRJCT_DEBUG==="1"&&console.error("Failed to read version from package.json:",y(e)),"0.0.0"}}function fd(n){hs=n,Cr=null}var Cr,hs,Le,Tn,lt=h(()=>{"use strict";B();Cr=null,hs=null;a(gd,"getPackageRoot");a(_r,"getVersion");a(fd,"resetPackageRoot");Le=_r(),Tn=gd()});async function xa(n){try{let{stdout:e}=await H(n,{timeout:5e3});return{success:!0,output:e.trim()}}catch{return{success:!1,output:""}}}async function tP(){let n=await xa("gh api user --jq .login");return n.success&&n.output||(n=await xa("git config --global github.user"),n.success&&n.output)?n.output:null}async function nP(){let n=await xa("git config user.name");return n.success&&n.output?n.output:null}async function rP(){let n=await xa("git config user.email");return n.success&&n.output?n.output:null}async function ys(){let[n,e,t]=await Promise.all([tP(),nP(),rP()]);return{github:n,email:t,name:e||n||"Unknown"}}var Na=h(()=>{"use strict";oe();a(xa,"execCommand");a(tP,"detectGitHubUsername");a(nP,"detectGitName");a(rP,"detectGitEmail");a(ys,"detect")});var kd={};P(kd,{worktreeService:()=>sP});import wd from"node:fs/promises";import sn from"node:path";var yE,Ed,sP,Td=h(()=>{"use strict";oe();Q();yE=".worktrees",Ed=class{static{a(this,"WorktreeService")}async create(e,t,r={}){let s=await this.getMainWorktree(e),i=sn.join(s,yE,t),o=r.branch||`feat/${t}`;await wd.mkdir(sn.join(s,yE),{recursive:!0});let c=r.baseBranch?` ${r.baseBranch}`:"";await H(`git worktree add "${i}" -b "${o}"${c}`,{cwd:s});let{stdout:l}=await H("git rev-parse HEAD",{cwd:i});return{path:i,branch:o,commit:l.trim(),isMain:!1,slug:t}}async remove(e,t=!1){let r=await this.getMainWorktree(e),s;if(t)try{let{stdout:i}=await H("git rev-parse --abbrev-ref HEAD",{cwd:e});s=i.trim()}catch{}if(await H(`git worktree remove "${e}" --force`,{cwd:r}),t&&s&&s!=="main"&&s!=="master")try{await H(`git branch -D "${s}"`,{cwd:r})}catch{}}async list(e){let t=await this.getMainWorktree(e),{stdout:r}=await H("git worktree list --porcelain",{cwd:t});return this.parsePorcelainOutput(r,t)}async detect(e){try{let{stdout:t}=await H("git rev-parse --git-common-dir",{cwd:e}),{stdout:r}=await H("git rev-parse --git-dir",{cwd:e}),s=sn.resolve(e,t.trim()),i=sn.resolve(e,r.trim());if(s!==i){let{stdout:o}=await H("git rev-parse --abbrev-ref HEAD",{cwd:e}),{stdout:c}=await H("git rev-parse HEAD",{cwd:e}),{stdout:l}=await H("git rev-parse --show-toplevel",{cwd:e}),u=l.trim(),d=sn.basename(u);return{path:u,branch:o.trim(),commit:c.trim(),isMain:!1,slug:d}}return null}catch{return null}}async getMainWorktree(e){try{let{stdout:r}=await H("git worktree list --porcelain",{cwd:e}),s=r.split(`
1345
+ `)}var rn=h(()=>{"use strict";et();cd();ud();a(cE,"labelFor");a(yt,"collectActiveTasks");a(lE,"formatActiveTaskLine");a(HI,"formatActiveTaskList")});var uE,gs,WI,GI,dd=h(()=>{"use strict";uE={core:{title:"AI Agile Loop",description:"Intent, context, execution, learning, and improvement",order:1},optional:{title:"Intelligence & Quality",description:"Project intelligence, quality proof, and advanced policies",order:2},setup:{title:"Setup & Infrastructure",description:"Installation, configuration, and integration plumbing",order:3},legacy:{title:"Compatibility",description:"v2 aliases kept for existing users and scripts",order:4}},gs=[{name:"intent",group:"core",surface:"ai-agile",routing:{group:"spec",method:"draft"},routingMode:"cold-only",optionSchema:{strings:["goal","tags"]},description:"Frame the work brief: objective, constraints, risks, and success signal",usage:{claude:'p. intent "<title>"',terminal:'prjct intent "<title>" [--goal "..."] [--tags k:v,...]'},params:'"<title>" [--goal] [--tags]',implemented:!0,hasTemplate:!1,requiresProject:!0,features:["v3 AI Agile replacement for ticket-style planning","Stores the durable brief in SQLite","Sub-verbs mirror spec for compatibility: list, show, update, audit, link-work, ship"]},{name:"work",group:"core",surface:"ai-agile",routing:{group:"workflow",method:"now"},optionSchema:{strings:["spec"],booleans:["extend"]},description:"Start or inspect an AI Agile work cycle with context and evidence",usage:{claude:'p. work "<intent>"',terminal:'prjct work "<intent>"'},params:"[intent]",implemented:!0,hasTemplate:!0,requiresProject:!0,features:["v3 name for the execution cycle formerly exposed as task","No arg \u2192 shows the active work cycle","Surfaces related context before planning/editing","Captures harness/evidence expectations for the cycle"]},{name:"init",group:"core",surface:"support",routing:{group:"planning",method:"init"},description:"Deep project analysis and initialization",usage:{claude:'p. init "[idea]"',terminal:'prjct init "[idea]"'},params:"[idea]",implemented:!0,hasTemplate:!0,requiresProject:!1,requiresLlm:!0,features:["Architect mode for blank projects","Auto tech stack recommendation","Analyzes existing codebases"]},{name:"task",group:"legacy",surface:"legacy",routing:{group:"workflow",method:"now"},optionSchema:{strings:["spec"],booleans:["extend"]},description:"Compatibility alias for `work`",usage:{claude:null,terminal:'prjct task "<description>"'},params:"[description]",implemented:!0,hasTemplate:!0,requiresProject:!0,features:["No arg \u2192 shows the active task (or none)","Deprecated public language: use `prjct work` for the v3 AI Agile cycle","Auto-harness classifies H0-H3 and stores expected evidence on the task","Writes to stateStorage; runs before/after workflow rules","Optional Linear issue link when the arg matches `[A-Z]+-\\d+`"]},{name:"ship",group:"core",surface:"ai-agile",routing:{group:"shipping",method:"ship"},optionSchema:{booleans:["skipHooks","noSpecGate","noTestGate"],strings:["intent"]},description:"Commit, push, and celebrate shipped feature",usage:{claude:'p. ship ["feature"]',terminal:'prjct ship ["feature"]'},params:"[feature]",implemented:!0,hasTemplate:!0,requiresProject:!0,requiresLlm:!0,features:["No arg \u2192 ships the active task description, or derives a summary from the branch"]},{name:"sync",group:"core",surface:"ai-agile",routing:{group:"analysis",method:"sync"},description:"Sync project state and update workflow agents",usage:{claude:"p. sync",terminal:"prjct sync [--package=<name>] [--full]"},implemented:!0,hasTemplate:!0,requiresProject:!0,requiresLlm:!0,features:["Incremental sync: only re-analyzes changed files (default)","Force full sync: --full bypasses incremental cache","Monorepo support: --package=<name> for single package sync","Nested PRJCT.md inheritance","Per-package CLAUDE.md generation"]},{name:"eval",group:"optional",surface:"support",routing:{group:"eval",method:"eval"},optionSchema:{booleans:["publish","dryRun","json"],strings:["baseline","candidate","source","target","file"]},description:"Run product evals, compare versions, and publish actionable results",usage:{claude:"p. eval run [--candidate <version>] [--publish]",terminal:"prjct eval <run|compare|report|publish> [--baseline <version>] [--candidate <version>] [--target cloud] [--dry-run]"},params:"[run|compare|report|publish]",implemented:!0,hasTemplate:!1,requiresProject:!1,requiresLlm:!1,features:["Deterministic local eval runs stored under PRJCT_CLI_HOME/evals","Version comparisons with regression/improvement actionables","Cloud publication for shared benchmark history with server-side ownership and subscription checks"]},{name:"status",group:"legacy",surface:"legacy",routing:{group:"primitives",method:"status"},optionSchema:{strings:["tokensIn","tokensOut"]},description:"Compatibility lifecycle escape hatch; prefer `work` outcomes",usage:{claude:null,terminal:"prjct status <value>"},params:"[value]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["No args \u2192 prints active task + current status","Workflows are the primary status-change mechanism; this is the escape"]},{name:"tag",group:"legacy",surface:"legacy",routing:{group:"primitives",method:"tag"},optionSchema:{},description:"Compatibility metadata escape hatch; prefer synthesized context tags",usage:{claude:null,terminal:"prjct tag type:bug domain:auth"},params:"<pairs...>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Claude decides what to tag \u2014 no heuristic classifier","type:<feature|bug|improvement|chore> promotes to tasks.type"]},{name:"remember",group:"core",surface:"ai-agile",routing:{group:"primitives",method:"remember"},optionSchema:{strings:["tags"],booleans:["force","global"]},description:"Capture a project memory entry (fact, decision, learning, gotcha, \u2026)",usage:{claude:'p. remember learning "message"',terminal:'prjct remember learning "message" --tags domain:auth'},params:'<type> "<content>" [--tags k:v,...]',implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Types: fact, decision, learning, gotcha, pattern, anti-pattern, shipped, inbox, todo, idea, insight, question, source, person \u2014 plus user-defined","Grows the project memory consumable via `prjct context memory`"]},{name:"forget",group:"core",surface:"ai-agile",routing:{group:"primitives",method:"forget"},optionSchema:{},description:"Delete a project memory entry by id (the delete half of `remember`)",usage:{claude:"p. forget mem_1234",terminal:"prjct forget mem_1234 [--md]"},params:"<id>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Accepts `mem_1234`, `mem-1234`, or a bare `1234`","Hard-deletes the source event + drops the FTS mirror and any embedding \u2014 cannot resurface lexically or semantically"]},{name:"capture",group:"legacy",surface:"legacy",routing:{group:"capture",method:"capture"},optionSchema:{strings:["tags"],booleans:["force","fromCurrent"]},description:"Compatibility inbox fallback; prefer synthesized `remember context`",usage:{claude:null,terminal:'prjct capture "call Ana re pricing" --tags domain:sales'},params:'"<content>" [--tags k:v,...]',implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Writes memory type=inbox; Claude retypes later via a clarify workflow","No task id, no branch, no worktree \u2014 just persists",'Bare `prjct "<text>"` auto-routes to `capture`']},{name:"seed",group:"setup",surface:"support",routing:{group:"seed",method:"seed"},routingMode:"bin-only",optionSchema:{},description:"Manage declarative packs (persona, memory types, workflow slots, hook signals)",usage:{claude:"p. seed list",terminal:"prjct seed add pm,daily"},params:"[add|remove|list|suggest] [pack,pack,...]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Packs declare signals only \u2014 no bash is written","Add or remove multi-persona contexts per project","Auto-detect suggestion from project stack"]},{name:"mcp",group:"setup",surface:"support",routing:{group:"mcp",method:"mcp"},routingMode:"bin-only",optionSchema:{},description:"Toggle MCP servers per-project \u2014 interactive multi-select in your terminal, list/deny/allow for scripts",usage:{claude:"p. mcp list",terminal:"prjct mcp"},params:"[list|status|deny|allow] [serverName]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Interactive multi-select with live tool-cost delta (default UX in TTY)","Project-local \u2014 writes only to .claude/settings.local.json","Knows the well-known cloud MCPs from claude.ai (PostHog, Atlassian, etc.)","Headless list/deny/allow for LLM agents and scripts (--md flag)"]},{name:"install",group:"setup",surface:"support",routing:{group:"install",method:"install"},routingMode:"bin-only",optionSchema:{},description:"Install universal agent surfaces, Claude hooks, and Codex config",usage:{claude:"p. install",terminal:"prjct install"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Inside a prjct project, refreshes AGENTS.md as the portable baseline","Writes Claude passive hooks: SessionStart, UserPromptSubmit, \u2026","Repairs detected Codex config.toml with prjct MCP and TUI status_line","Idempotent; existing non-prjct hooks stay intact","Audit agent support with `prjct agents doctor`"]},{name:"help",group:"setup",surface:"support",routingMode:"bin-only",description:"Contextual help and guidance",usage:{claude:"p. help [topic]",terminal:"prjct help [topic]"},params:"[topic]",implemented:!0,hasTemplate:!0,requiresProject:!1},{name:"analysis-save-llm",group:"optional",surface:"internal",routing:{group:"analysis",method:"saveLlmAnalysis"},description:"Persist analysis notes produced by an LLM run",usage:{claude:null,terminal:"prjct analysis-save-llm <file|text|json>"},params:"<file|text|json>",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0},{name:"analyze",group:"legacy",surface:"legacy",routing:{group:"analysis",method:"analyze"},description:"Compatibility alias for sync analysis",usage:{claude:null,terminal:"prjct analyze"},implemented:!0,hasTemplate:!0,requiresProject:!0,isOptional:!0,requiresLlm:!0},{name:"lean",group:"optional",surface:"support",routing:{group:"lean",method:"lean"},optionSchema:{},description:"Anti-over-engineering: set intensity, review/audit/debt (read-only)",usage:{claude:"p. lean [review|audit|debt|off|lite|full|ultra]",terminal:"prjct lean [sub]"},params:"[review|audit|debt|off|lite|full|ultra]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["No arg \u2192 show active intensity mode + a one-screen summary","review/audit/debt are advisory \u2014 no gate, no source writes","off|lite|full|ultra sets the intensity (mirrors ponytail modes)"]},{name:"tdd",group:"optional",surface:"support",routing:{group:"tdd",method:"tdd"},optionSchema:{},description:"Test-Driven Development: set intensity, run the test command (check)",usage:{claude:"p. tdd [check|off|assist|strict]",terminal:"prjct tdd [sub]"},params:"[check|off|assist|strict]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["No arg \u2192 show mode + the auto-detected test command","off|assist|strict sets the intensity (opt-in, like lean)","check runs the detected test command now (red/green) \u2014 the real gate"]},{name:"sdd",group:"optional",surface:"support",routing:{group:"sdd",method:"sdd"},optionSchema:{},description:"Spec-Driven Development: gate the spec pipeline (off/advisory/strict)",usage:{claude:"p. sdd [off|advisory|strict]",terminal:"prjct sdd [sub]"},params:"[off|advisory|strict]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["No arg \u2192 show mode + the active task spec station (pipeline checklist)","off|advisory|strict sets the intensity (opt-in, like lean)","strict: every task needs a reviewed spec; ship blocks unspecced work"]},{name:"notify",group:"setup",surface:"support",routing:{group:"notify",method:"notify"},optionSchema:{},description:"Desktop notifications (default on): ping on Claude-waiting + subagent-finished",usage:{claude:"p. notify [on|off]",terminal:"prjct notify [on|off]"},params:"[on|off]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Default ON \u2014 pings when Claude is waiting or a subagent finishes","No arg \u2192 show mode + what fires","off silences OS notifications (per-prompt work-state block stays)"]},{name:"agents",group:"setup",surface:"support",routing:{group:"agents",method:"agents"},optionSchema:{booleans:["fix"]},description:"Show the concrete compatibility matrix for AI coding agents",usage:{claude:"p. agents [doctor|doctor --fix]",terminal:"prjct agents [doctor|doctor --fix]"},params:"[doctor|status|list] [--fix]",implemented:!0,hasTemplate:!1,requiresProject:!1,isOptional:!0,features:["Derives support levels from the runtime registry","Reports AGENTS.md, MCP, skills, hooks, ACP, and project-rule support","doctor --fix refreshes repo-local agent surfaces when run inside a project",'Use this to audit claims like "works with Codex/Gemini/OpenCode/Cursor/Windsurf"']},{name:"value",group:"legacy",surface:"legacy",routing:{group:"product",method:"value"},optionSchema:{},description:"Compatibility alias for `insights value`",usage:{claude:null,terminal:"prjct value [--md]"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Scores project continuity from real SQLite data","Counts durable memory, preventive guardrails, shipped work, sync metrics, and agent coverage","Designed as the paid-tier proof screen for humans and agents"]},{name:"memory-doctor",group:"legacy",surface:"legacy",routing:{group:"product",method:"memoryDoctor"},optionSchema:{},description:"Compatibility alias for `insights quality`",usage:{claude:null,terminal:"prjct memory-doctor [--md]"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Finds duplicate groups, stale inbox entries, low-signal memories, and missing types","Read-only by default; recommends exact cleanup actions","Protects recall quality across Claude, Codex, Gemini, OpenCode, and future agents"]},{name:"report",group:"legacy",surface:"legacy",routing:{group:"product",method:"report"},optionSchema:{numbers:["days"]},description:"Compatibility alias for `insights report`",usage:{claude:null,terminal:"prjct report [days] [--md]"},params:"[days]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Summarizes shipped features, completed tasks, active work, and carry-forward lessons","Uses real project state instead of a marketing changelog","Useful for founders, teams, and paid Cloud status emails"]},{name:"handoff",group:"legacy",surface:"legacy",routing:{group:"product",method:"handoff"},optionSchema:{},description:"Compatibility alias for `insights continue`",usage:{claude:null,terminal:"prjct handoff codex [--md]"},params:"[agent]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Gives the next agent the active task, required prjct checks, and high-value memories","Works across Codex, Claude, Gemini, Cursor, OpenCode, Qwen, Kimi, and unknown future agents","Makes multi-agent continuity concrete instead of relying on private model memory"]},{name:"guardrails",group:"legacy",surface:"legacy",routing:{group:"product",method:"guardrails"},optionSchema:{},description:"Compatibility alias for `insights guardrails`",usage:{claude:null,terminal:"prjct guardrails [--md]"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Checks changed files against preventive memory","Falls back to general project traps when no file-specific hit exists","Advisory only; no gate, no mutation"]},{name:"insights",group:"optional",surface:"ai-agile",routing:{group:"product",method:"insights"},optionSchema:{numbers:["days"]},description:"AI Agile intelligence: value, quality, reliability, token cost, reports, continuation, and guardrails",usage:{claude:"p. insights [value|quality|reliability|cost|report|continue|guardrails]",terminal:"prjct insights [value|quality|reliability|cost|report|continue|guardrails] [--md]"},params:"[value|quality|reliability|cost|report|continue|guardrails] [agent|days]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["v3 surface for project intelligence formerly spread across value/report/handoff/memory-doctor/guardrails","Default view summarizes whether the project is compounding","reliability/trust shows whether value, cost, and performance metrics are decision-ready","cost/spend/tokens shows subscription burn, token coverage, context reuse, and capture gaps","Subcommands remain read-only except where underlying compatibility commands already mutate nothing"]},{name:"performance",group:"optional",surface:"ai-agile",routing:{group:"product",method:"performance"},optionSchema:{numbers:["days"]},description:"Measure dev+LLM efficiency per work cycle: time, tokens, model/runtime, tools, friction",usage:{claude:"p. performance [7]",terminal:"prjct performance [days] [--md]"},params:"[days]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Uses real task/session rows and available token columns","Stores unknown when a runtime does not expose exact model/token data","Designed to guide the next work cycle, not to create scrum velocity reports"]},{name:"cloud",group:"setup",surface:"support",routing:{group:"cloud",method:"cloud"},optionSchema:{},description:"Cloud sync (paid): link/unlink a project, sync/pull, pause/resume, status",usage:{claude:"p. cloud [link|unlink|sync|pull|pause|resume|status]",terminal:"prjct cloud [sub]"},params:"[link|unlink|sync|pull|pause|resume|status]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Local-first: nothing leaves the machine until `prjct cloud link`","Token API only \u2014 no backend engine details, no client-side paywall","Auto-syncs on `prjct ship` and at session end once linked"]},{name:"workflow",group:"optional",surface:"support",routing:{group:"workflow",method:"workflow"},optionSchema:{},description:"Configure workflow hooks via natural language",usage:{claude:'p. workflow ["config"]',terminal:'prjct workflow ["config"]'},params:'["natural language config"]',implemented:!0,hasTemplate:!0,requiresProject:!0,isOptional:!0,requiresLlm:!0,features:["Natural language configuration","Before/after hooks for task, done, ship, sync","Permanent, session, or one-time preferences"]},{name:"start",group:"setup",surface:"support",routing:{group:"setup",method:"start"},routingMode:"bin-only",description:"First-time setup (install commands to editors)",usage:{claude:null,terminal:"prjct start"},implemented:!0,hasTemplate:!1,requiresProject:!1},{name:"setup",group:"setup",surface:"support",routing:{group:"setup",method:"setup"},routingMode:"bin-only",description:"Reconfigure editor installations and user-owned defaults",usage:{claude:"p. setup",terminal:"prjct setup"},params:"[--force] [--non-interactive]",implemented:!0,hasTemplate:!0,requiresProject:!1},{name:"login",group:"setup",surface:"support",routing:{group:"setup",method:"login"},description:"Authenticate with prjct cloud (opens browser)",usage:{claude:null,terminal:"prjct login"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"},{name:"logout",group:"setup",surface:"support",routing:{group:"setup",method:"logout"},description:"Sign out from prjct cloud",usage:{claude:null,terminal:"prjct logout"},implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"},{name:"auth",group:"setup",surface:"support",routing:{group:"setup",method:"auth"},description:"Manage cloud authentication",usage:{claude:"p. auth [action]",terminal:"prjct auth [action]"},params:"[logout|status]",implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"},{name:"context",group:"setup",surface:"support",routing:{group:"context",method:"context"},routingMode:"bin-only",optionSchema:{},description:"Smart context filtering tools for AI agents",usage:{claude:null,terminal:"prjct context <tool> [args]"},params:"<tool> [args]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["files - Find relevant files for a task","signatures - Extract code structure (~90% compression)","imports - Analyze dependency graphs","recent - Find hot files from git history","summary - Intelligent file summarization"]},{name:"search",group:"core",surface:"ai-agile",routing:{group:"context",method:"search"},optionSchema:{booleans:["global"]},description:"Search project memory (decisions, learnings, gotchas, ships\u2026) \u2014 BM25 + semantic + recall",usage:{claude:'p. search "<query>"',terminal:'prjct search "<query>" [--md]'},params:"<query>",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Blended retrieval: FTS5 BM25 + opt-in semantic + recency recall","Reranks by proven usefulness, expands one hop of the memory graph","`prjct search mem_1234` resolves a specific entry by id"]},{name:"update",group:"setup",surface:"support",routing:{group:"update",method:"update"},routingMode:"bin-only",description:"Update prjct system-wide: package + migrations + daemon restart",usage:{claude:null,terminal:"prjct update [--dry-run]"},params:"[--dry-run]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Phase 1: npm update (migrates homebrew \u2192 npm if needed)","Phase 2: All projects \u2014 migrate, sweep, reinstall commands","Phase 3: Daemon stop + restart with new code","--dry-run to preview without changes"]},{name:"uninstall",group:"setup",surface:"support",routing:{group:"uninstall",method:"uninstall"},routingMode:"bin-only",description:"Complete system removal of prjct",usage:{claude:null,terminal:"prjct uninstall"},params:"[--force] [--backup] [--dry-run]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Removes ~/.prjct-cli/ data","Cleans CLAUDE.md prjct section","Uninstalls Homebrew/npm packages","Backup option before deletion"]},{name:"team",group:"setup",surface:"support",routing:{group:"team",method:"team"},optionSchema:{booleans:["required","enforce"],strings:["minVersion"]},description:"Enroll this repo in prjct team mode \u2014 commits .prjct/team.json + .claude/CLAUDE.md so teammates pick up shared expectations",usage:{claude:"p. team",terminal:"prjct team [--required] [--min-version <semver>]"},params:"[--required] [--min-version <semver>]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Writes .prjct/team.json with required/minVersion config","Adds prjct context block to .claude/CLAUDE.md (per-project)","Stages both files for the next commit (does NOT commit)","Teammates clone repo + install prjct \u2192 ready to go"]},{name:"embeddings",group:"setup",surface:"support",routing:{group:"embeddings",method:"embeddings"},optionSchema:{strings:["key","model","baseUrl","authHeader","authScheme","headers","query"]},description:"Configure the GLOBAL semantic-embeddings provider (BYOT) \u2014 one API key, stored securely, used by every project.",usage:{claude:"p. embeddings status",terminal:'prjct embeddings <set|status|test|clear> [--key <K>] [--model <M>] [--base-url <U>] [--auth-header <H>] [--auth-scheme <S|none>] [--headers "k=v,..."] [--query <qs>]'},params:"[set|status|test|clear]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["BYOT: bring your own embedding API key \u2014 ANY OpenAI-compatible provider","Zero-config: paste just --key, the base URL is auto-detected from its prefix","OpenAI, OpenRouter, Ollama, Together, Mistral, Voyage, Jina, LM Studio\u2026",'Non-Bearer providers too: --auth-header api-key --auth-scheme none --query "api-version=..." (Azure OpenAI)',"Key stored in the macOS Keychain (else a 0600 file), never in config","Global \u2014 applies to all projects; per-project config still overrides","Without a key, recall uses the always-on local subword embedder","Validate with: prjct embeddings test"]},{name:"log",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"log"},optionSchema:{strings:["task"]},params:"<note>",description:'Append-only implementation journal on the active work cycle \u2014 "what did the last agent try", the cheapest session-to-session continuity. Surfaced in prjct brief and prime.',usage:{claude:'p. log "tried X, blocked on Y"',terminal:'prjct log "<note>" [--task id]'}},{name:"brief",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"brief"},optionSchema:{},description:"COMPILED context artifact for a task: orchestration directive + journal + related memory + recently-landed conventions + graph position. Persisted, regenerable \u2014 retrieval as a build step.",usage:{claude:"p. brief",terminal:"prjct brief [task-id] [--md]"}},{name:"replan",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"replan"},optionSchema:{},params:"<what-changed>",description:"Cascading drift repair: captures the pivot as a decision memory FIRST, then serves a re-plan directive over the open frontier so downstream items get re-evaluated against reality.",usage:{claude:'p. replan "auth moved to JWT"',terminal:'prjct replan "<what changed>"'}},{name:"prime",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"prime"},optionSchema:{},description:"Session-open bundle in ONE pull: active cycle + its last journal entries + ready frontier + pull-pointers. The named start-of-session ceremony.",usage:{claude:"p. prime",terminal:"prjct prime [--md]"}},{name:"land",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"land"},optionSchema:{},description:'Session-close checklist ("land the plane"): open cycle, claimed-but-unfinished items, pending sync, hand-off reminder \u2014 everything that must not die with the context.',usage:{claude:"p. land",terminal:"prjct land [--md]"}},{name:"ready",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"ready"},optionSchema:{},description:'The ready frontier: open backlog items with zero unresolved blocking dependencies \u2014 "what can I work on NOW" as a structural query, ranked by how much each item unblocks.',usage:{claude:"p. ready",terminal:"prjct ready [--md]"}},{name:"next",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"next"},optionSchema:{},description:'Deterministic "what now": top unclaimed item of the ready frontier, served WITH its orchestration directive (model tier, effort, ceremony, fan-out, points).',usage:{claude:"p. next",terminal:"prjct next [--md]"}},{name:"claim",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"claim"},optionSchema:{strings:["as"]},params:"<id>",description:"Race-free claim of a backlog item for multi-agent fan-out: succeeds only if unclaimed (atomic check-and-set).",usage:{claude:"p. claim <id>",terminal:"prjct claim <id> [--as name]"}},{name:"depend",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"depend"},optionSchema:{strings:["on","type"]},params:"<id>",description:"Add a typed dependency edge between work items: blocks | parent | related | discovered-from. Blocking edges are cycle-checked.",usage:{claude:"p. depend <id> --on <id>",terminal:"prjct depend <id> --on <id> [--type blocks|parent|related|discovered-from]"}},{name:"phases",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"phases"},optionSchema:{},description:"Topological execution phases over the dependency graph: items in the same phase are parallelizable \u2014 a data-driven fan-out plan with per-item orchestration.",usage:{claude:"p. phases",terminal:"prjct phases [--md]"}},{name:"expand",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"expand"},optionSchema:{},params:"<id>",description:"Decomposition loop: read the persisted complexity record + expansion directive for an item, or persist the agent's decomposition as subtasks with parent edges.",usage:{claude:"p. expand <id>",terminal:'prjct expand <id> ["subtask 1" "subtask 2" ...]'}},{name:"changelog",group:"changelog",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"changelog",method:"changelog"},optionSchema:{},description:"Release notes from the typed delivery record: what shipped (by version) + completed work cycles in the window. Zero LLM \u2014 pure data-plane render.",usage:{claude:"p. changelog 14",terminal:"prjct changelog [days]"}},{name:"workflows",group:"workflowsReference",surface:"ai-agile",requiresProject:!1,implemented:!0,hasTemplate:!1,routing:{group:"workflowsReference",method:"workflows"},optionSchema:{},description:"Print the quality methodology reference (subagent dispatch, model policy, review/judgment/security workflows) \u2014 the rig-agnostic pull of what Claude reads as workflows.md.",usage:{claude:"p. workflows",terminal:"prjct workflows --md"}},{name:"memory",group:"memoryExport",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"memoryExport",method:"memory"},optionSchema:{},description:"Git-shareable project memory: `export` writes chunked JSONL to .prjct/memory-export/ (commit it); `import` replays a committed export with content-hash dedup \u2014 zero-server team onboarding.",usage:{claude:"p. memory export",terminal:"prjct memory export | prjct memory import"}},{name:"guard",group:"core",surface:"ai-agile",routing:{group:"guard",method:"guard"},optionSchema:{numbers:["limit"],strings:["diff"],booleans:["strict"]},description:"Surface preventive memory (gotchas, anti-patterns, recurring-bugs) recorded against a file BEFORE you edit it \u2014 anticipation, provider-agnostic.",usage:{claude:"p. guard <file>",terminal:"prjct guard <file> | prjct guard --diff <range> [--strict]"},params:"[file]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Pillar 3 (anticipation): see the trap before you step in it","Pull, not push \u2014 also exposed as the prjct_guard MCP tool for Claude + Codex","Strict: only gotchas / anti-patterns / recurring-bugs \u2014 never plain decisions, so no noise",'Quiet by design: "clear to edit" when nothing preventive matches',"Matches absolute or repo-relative paths by exact / suffix / basename"]},{name:"config",group:"setup",surface:"support",routing:{group:"config",method:"config"},optionSchema:{},description:"Read/write global prjct config \u2014 auto-update opt-in, suggestions toggle, etc.",usage:{claude:"p. config list",terminal:"prjct config <list|get|set|unset> [key] [value]"},params:"<list|get|set|unset> [key] [value]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Stored at ~/.prjct-cli/config/global.json","Opt into silent auto-update: prjct config set auto-update on","Toggle proactive suggestions: prjct config set suggestions off","Booleans accept on/off/true/false; numbers parsed automatically"]},{name:"spec",group:"legacy",surface:"legacy",routing:{group:"spec",method:"draft"},routingMode:"cold-only",description:"Compatibility alias for `intent` \u2014 Goal/Acceptance/Scope/Risks before work starts.",usage:{claude:null,terminal:'prjct spec "<title>" [--goal "..."] [--tags k:v,...]'},params:'"<title>" [--goal] [--tags]',implemented:!0,hasTemplate:!1,requiresProject:!0,features:['Drafting: `prjct spec "<title>"` IS the create action \u2014 there is no `draft` subverb (aliases `draft`/`new`/`create` are tolerated and stripped)',"Persists in `specs` SQLite table + memory event stream","Sub-verbs: list, show, update, set-status, record-review, link-task, ship, audit, inventory"]},{name:"audit-spec",group:"legacy",surface:"legacy",routing:{group:"spec",method:"audit"},routingMode:"cold-only",description:"Compatibility alias for `intent audit <id>`",usage:{claude:null,terminal:"prjct audit-spec <id>"},params:"<spec-id>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Emits dispatch prompt \u2014 Claude runs three Agent calls in parallel","Each reviewer writes back via `prjct spec record-review`","All three pass \u2192 spec auto-promotes draft \u2192 reviewed"]},...[["daemon","Run the prjct daemon in the foreground"],["stop","Stop the running prjct daemon"],["restart","Restart the prjct daemon"],["upgrade","Alias of `prjct update`",{group:"update",method:"update"}],["hook","Run a Claude Code hook event (internal; called by the hook scripts)"],["hooks","Inspect or reinstall the Claude Code hooks"],["claude","Claude Code integration management (install/uninstall)"],["crew","Run a crew (multi-subagent) workflow"],["doctor","Diagnose the local prjct installation"],["watch","Watch project files and react to changes"],["version","Print the installed prjct version + provider status"],["prefs","Inspect or set workflow preferences"],["retro","Summarize what shipped over a time window"],["health","Codebase health snapshot"],["skill-adherence","Report how well sessions follow the prjct skill"],["review-risk","Risk-ranked review hints for the working tree"],["context-save","Save the current working context for later restore"],["context-restore","Restore a previously saved working context"]].map(([n,e,t])=>({name:n,group:"setup",description:e,routing:t,usage:{claude:null,terminal:`prjct ${n}`},implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"}))],WI={"-h":"help","--help":"help","-v":"version","--version":"version"},GI=new Set([...gs.filter(n=>n.routingMode==="bin-only").map(n=>n.name),...Object.entries(WI).filter(([,n])=>gs.some(e=>e.name===n&&e.routingMode==="bin-only")).map(([n])=>n)])});var dE,pE=h(()=>{"use strict";dd();dE=new Set(gs.filter(n=>n.routing).map(n=>n.name))});function BI(n){return n instanceof fs}function Xe(n){return BI(n)||n instanceof Error?n.message:typeof n=="string"?n:"Unknown error"}var fs,va,Ra,xi,kn=h(()=>{"use strict";fs=class extends Error{static{a(this,"PrjctError")}code;isOperational;constructor(e,t="PRJCT_ERROR"){super(e),this.name="PrjctError",this.code=t,this.isOperational=!0,Error.captureStackTrace?.(this,this.constructor)}},va=class n extends fs{static{a(this,"ProjectError")}constructor(e,t="PROJECT_ERROR"){super(e,t),this.name="ProjectError"}static notInitialized(){return new n("Project not initialized. Run p. init first.","PROJECT_NOT_INIT")}static notFound(e){return new n(`Project not found: ${e}`,"PROJECT_NOT_FOUND")}static invalidId(e){return new n(`Invalid project ID: ${e}`,"PROJECT_INVALID_ID")}},Ra=class n extends fs{static{a(this,"TemplateError")}constructor(e,t="TEMPLATE_ERROR"){super(e,t),this.name="TemplateError"}static notFound(e){return new n(`Template not found: ${e}.md`,"TEMPLATE_NOT_FOUND")}static parseFailed(e){return new n(`Failed to parse template: ${e}`,"TEMPLATE_PARSE_ERROR")}},xi=class n extends fs{static{a(this,"AgentError")}constructor(e,t="AGENT_ERROR"){super(e,t),this.name="AgentError"}static notSupported(e){return new n(`Unsupported agent type: ${e}`,"AGENT_NOT_SUPPORTED")}static initFailed(e){return new n(`Agent initialization failed: ${e}`,"AGENT_INIT_FAILED")}};a(BI,"isPrjctError");a(Xe,"getErrorMessage")});function mE(n){let e=n.toLowerCase();return e.includes("github")?"github":e.includes("gitlab")?"gitlab":e.includes("bitbucket")?"bitbucket":"other"}function pd(n){let e=n.trim();if(!e)return{};let t=e.match(/^[^/@]+@([^:/]+):(.+?)(?:\.git)?\/?$/);if(t)return{provider:mE(t[1]),repoSlug:t[2]};try{let r=new URL(e),s=r.pathname.replace(/^\/+/,"").replace(/\.git$/,"").replace(/\/+$/,"");return!r.host||!s?{}:{provider:mE(r.host),repoSlug:s}}catch{return{}}}async function qI(n){try{let{stdout:e}=await q("git",["remote","get-url","origin"],{cwd:n});return e.trim()||void 0}catch{return}}async function XI(n){try{let{stdout:e}=await q("git",["symbolic-ref","--short","refs/remotes/origin/HEAD"],{cwd:n});return e.trim().replace(/^origin\//,"")||void 0}catch{return}}function Rr(n){return typeof n=="string"&&n.length>0?n:void 0}function gE(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}function VI(n){return Object.fromEntries(Object.entries(n).filter(([,e])=>e!==void 0))}async function Ca(n){let e=E.getDoc(n,"project")||{},t=Rr(e.repoPath),{provider:r,repoSlug:s}=t?pd(await qI(t)||""):{},i=t?await XI(t):void 0,o=Array.isArray(e.techStack)?e.techStack.filter(c=>typeof c=="string"):void 0;return VI({provider:r,repoSlug:s,currentBranch:Rr(e.currentBranch),defaultBranch:i,stack:Rr(e.stack),techStack:o&&o.length>0?o:void 0,version:Rr(e.version),commitCount:gE(e.commitCount),fileCount:gE(e.fileCount),lastCommit:Rr(e.lastSyncCommit),hasUncommitted:typeof e.hasUncommittedChanges=="boolean"?e.hasUncommittedChanges:void 0,cliVersion:Rr(e.cliVersion),syncedAt:Rr(e.lastSync)})}var _a=h(()=>{"use strict";L();oe();a(mE,"providerForHost");a(pd,"parseRemote");a(qI,"gitRemoteUrl");a(XI,"gitDefaultBranch");a(Rr,"str");a(gE,"num");a(VI,"compact");a(Ca,"buildProjectMeta")});import{execFile as KI}from"node:child_process";import JI from"node:crypto";import{promisify as zI}from"node:util";function ZI(n,e=QI){let t=Buffer.from(e.replace(/-/g,""),"hex"),s=JI.createHash("sha1").update(t).update(n,"utf8").digest().subarray(0,16);s[6]=s[6]&15|80,s[8]=s[8]&63|128;let i=s.toString("hex");return`${i.slice(0,8)}-${i.slice(8,12)}-${i.slice(12,16)}-${i.slice(16,20)}-${i.slice(20,32)}`}async function eP(n){let e;try{let{stdout:s}=await YI("git",["remote","get-url","origin"],{cwd:n});e=s.trim()||void 0}catch{return null}if(!e)return null;let{provider:t,repoSlug:r}=pd(e);return!t||!r?null:`${t}:${r}`.toLowerCase()}async function fE(n){let e=await eP(n);return e?ZI(e):null}var YI,QI,hE=h(()=>{"use strict";_a();YI=zI(KI),QI="6f9b2c1a-3d4e-5f60-8a7b-1c2d3e4f5a6b";a(ZI,"uuidv5");a(eP,"repoKey");a(fE,"deriveProjectId")});var hd={};P(hd,{PACKAGE_ROOT:()=>Tn,VERSION:()=>Le,getPackageRoot:()=>gd,getVersion:()=>_r,resetPackageRoot:()=>fd});import md from"node:fs";import Aa from"node:path";function gd(){if(hs)return hs;let n=__dirname;for(let e=0;e<5;e++){let t=Aa.join(n,"package.json");if(md.existsSync(t))try{if(JSON.parse(md.readFileSync(t,"utf-8")).name==="prjct-cli")return hs=n,n}catch{}n=Aa.dirname(n)}return hs=Aa.join(__dirname,"..","..",".."),hs}function _r(){if(Cr)return Cr;let n="3.28.0";if(n&&/^\d+\.\d+\.\d+/.test(n))return Cr=n,Cr;try{let e=Aa.join(gd(),"package.json");return Cr=JSON.parse(md.readFileSync(e,"utf-8")).version,Cr}catch(e){return process.env.PRJCT_DEBUG==="1"&&console.error("Failed to read version from package.json:",y(e)),"0.0.0"}}function fd(n){hs=n,Cr=null}var Cr,hs,Le,Tn,lt=h(()=>{"use strict";B();Cr=null,hs=null;a(gd,"getPackageRoot");a(_r,"getVersion");a(fd,"resetPackageRoot");Le=_r(),Tn=gd()});async function xa(n){try{let{stdout:e}=await H(n,{timeout:5e3});return{success:!0,output:e.trim()}}catch{return{success:!1,output:""}}}async function tP(){let n=await xa("gh api user --jq .login");return n.success&&n.output||(n=await xa("git config --global github.user"),n.success&&n.output)?n.output:null}async function nP(){let n=await xa("git config user.name");return n.success&&n.output?n.output:null}async function rP(){let n=await xa("git config user.email");return n.success&&n.output?n.output:null}async function ys(){let[n,e,t]=await Promise.all([tP(),nP(),rP()]);return{github:n,email:t,name:e||n||"Unknown"}}var Na=h(()=>{"use strict";oe();a(xa,"execCommand");a(tP,"detectGitHubUsername");a(nP,"detectGitName");a(rP,"detectGitEmail");a(ys,"detect")});var kd={};P(kd,{worktreeService:()=>sP});import wd from"node:fs/promises";import sn from"node:path";var yE,Ed,sP,Td=h(()=>{"use strict";oe();Q();yE=".worktrees",Ed=class{static{a(this,"WorktreeService")}async create(e,t,r={}){let s=await this.getMainWorktree(e),i=sn.join(s,yE,t),o=r.branch||`feat/${t}`;await wd.mkdir(sn.join(s,yE),{recursive:!0});let c=r.baseBranch?` ${r.baseBranch}`:"";await H(`git worktree add "${i}" -b "${o}"${c}`,{cwd:s});let{stdout:l}=await H("git rev-parse HEAD",{cwd:i});return{path:i,branch:o,commit:l.trim(),isMain:!1,slug:t}}async remove(e,t=!1){let r=await this.getMainWorktree(e),s;if(t)try{let{stdout:i}=await H("git rev-parse --abbrev-ref HEAD",{cwd:e});s=i.trim()}catch{}if(await H(`git worktree remove "${e}" --force`,{cwd:r}),t&&s&&s!=="main"&&s!=="master")try{await H(`git branch -D "${s}"`,{cwd:r})}catch{}}async list(e){let t=await this.getMainWorktree(e),{stdout:r}=await H("git worktree list --porcelain",{cwd:t});return this.parsePorcelainOutput(r,t)}async detect(e){try{let{stdout:t}=await H("git rev-parse --git-common-dir",{cwd:e}),{stdout:r}=await H("git rev-parse --git-dir",{cwd:e}),s=sn.resolve(e,t.trim()),i=sn.resolve(e,r.trim());if(s!==i){let{stdout:o}=await H("git rev-parse --abbrev-ref HEAD",{cwd:e}),{stdout:c}=await H("git rev-parse HEAD",{cwd:e}),{stdout:l}=await H("git rev-parse --show-toplevel",{cwd:e}),u=l.trim(),d=sn.basename(u);return{path:u,branch:o.trim(),commit:c.trim(),isMain:!1,slug:d}}return null}catch{return null}}async getMainWorktree(e){try{let{stdout:r}=await H("git worktree list --porcelain",{cwd:e}),s=r.split(`
1346
1346
  `)[0];if(s?.startsWith("worktree "))return s.replace("worktree ","").trim()}catch{}let{stdout:t}=await H("git rev-parse --show-toplevel",{cwd:e});return t.trim()}async setup(e,t){let r=sn.join(t,".env");await x(r)&&await wd.copyFile(r,sn.join(e,".env"));let s=sn.join(t,".prjct"),i=sn.join(e,".prjct");await x(s)&&!await x(i)&&await wd.symlink(s,i,"dir")}async teardown(e){}async clean(e){let t=await this.list(e),r=[],s=await this.getMainWorktree(e);await H("git worktree prune",{cwd:s});for(let i of t)i.isMain||await x(i.path)||r.push(i.slug);return r}parsePorcelainOutput(e,t){let r=[],s=e.trim().split(`
1347
1347
 
1348
1348
  `);for(let i of s){if(!i.trim())continue;let o=i.trim().split(`
@@ -2139,7 +2139,7 @@ ${c.length} errors:`));for(let l of c)console.log(_e.red(` - ${l}`))}return con
2139
2139
  ORDER BY completed_at DESC LIMIT 40`,o);if(c.length===0&&l.length===0){let d=`Nothing shipped or completed in the last ${i} day(s).`;return r.md?console.log(`> ${d}`):f.info(d),{success:!0,ships:0,completed:0}}let u=[`# Changelog \u2014 last ${i} day(s)`,""];if(c.length>0){let d=new Map;for(let p of c){let m=p.version&&p.version!=="unversioned"?`v${p.version}`:p.shipped_at.slice(0,10),g=d.get(m)??[];g.push(p),d.set(m,g)}u.push("## Shipped");for(let[p,m]of d){u.push("",`### ${p} \u2014 ${m[0].shipped_at.slice(0,10)}`);for(let g of m)u.push(`- ${g.name}`)}u.push("")}if(l.length>0){u.push("## Completed work cycles","");for(let d of l){let p=d.type?` \`${d.type}\``:"";u.push(`- ${d.description}${p} (${d.completed_at.slice(0,10)})`)}}return console.log(u.join(`
2140
2140
  `)),{success:!0,ships:c.length,completed:l.length}}}});var qC={};P(qC,{WorkGraphCommands:()=>nh});var BC,nh,XC=h(()=>{"use strict";al();Kr();wo();Kt();ie();de();Qe();BC=["blocks","parent","related","discovered-from"],nh=class extends U{static{a(this,"WorkGraphCommands")}async ready(e=null,t=process.cwd(),r={}){let s=await G(t,r);if(!s.ok)return s.result;let i=kt.ready(s.value);if(i.length===0){let o="Nothing ready \u2014 the backlog is empty or fully blocked. `prjct phases --md` shows why.";return r.md?console.log(`> ${o}`):f.info(o),{success:!0,ready:0}}if(r.md){let o=[`# Ready frontier \u2014 ${i.length} unblocked item(s)`,"","| Id | Item | Priority | Unblocks | Claimed |","|---|---|---|---:|---|"];for(let c of i)o.push(`| \`${c.id.slice(0,8)}\` | ${c.description.slice(0,90)} | ${c.priority??"-"} | ${c.unblocks} | ${c.claimedBy??"\u2014"} |`);o.push("","Claim before working: `prjct claim <id>`. Full id via `prjct sync --md`."),console.log(o.join(`
2141
2141
  `))}else{f.info(`${i.length} ready item(s):`);for(let o of i)f.info(` \u2022 [${o.id.slice(0,8)}] ${o.description.slice(0,80)}`)}return{success:!0,ready:i.length,items:i}}async next(e=null,t=process.cwd(),r={}){let s=await G(t,r);if(!s.ok)return s.result;let i=kt.next(s.value);if(!i){let l="No unclaimed ready work. `prjct ready --md` for the frontier.";return r.md?console.log(`> ${l}`):f.info(l),{success:!0,next:null}}let o=tr(i.description),c=mn(o);if(r.md){let l=[`# Next: ${i.description}`,"",`- Id: \`${i.id}\` \xB7 priority: ${i.priority??"-"} \xB7 unblocks ${i.unblocks} item(s)`,`- Orchestration: ${c.model}/${c.effort} \xB7 spec: ${c.spec} \xB7 tests: ${c.tests} \xB7 fan-out: ${c.fanout} \xB7 ~${c.expectedPoints} pt`,"",`Claim it: \`prjct claim ${i.id}\` \u2014 then \`prjct work "${i.description.slice(0,60)}"\``];console.log(l.join(`
2142
- `))}else f.info(`next: [${i.id.slice(0,8)}] ${i.description}`);return{success:!0,next:i,orchestration:c}}async claim(e=null,t=process.cwd(),r={}){let s=await G(t,r);if(!s.ok)return s.result;let i=await this.resolveId(s.value,(e??"").trim());if(!i)return this.fail("Usage: prjct claim <task-id>",r);let o=r.as??process.env.PRJCT_AGENT??"claude",c=kt.claim(s.value,i,o),l=c?`claimed ${i.slice(0,8)} as ${o}`:`claim lost \u2014 ${i.slice(0,8)} is already taken`;return r.md?console.log(`${c?"\u2713":"\u2717"} ${l}`):c?f.done(l):f.fail(l),{success:c,id:i,claimant:o}}async depend(e=null,t=process.cwd(),r={}){let s=await G(t,r);if(!s.ok)return s.result;let i=(e??"").trim();if(!i||!r.on)return this.fail("Usage: prjct depend <id> --on <id> [--type blocks|parent|related|discovered-from]",r);let o=r.type??"blocks";if(!BC.includes(o))return this.fail(`Unknown dep type '${r.type}'. Use: ${BC.join(" | ")}`,r);let c=await this.resolveId(s.value,i),l=await this.resolveId(s.value,r.on.trim());if(!c||!l)return this.fail("Could not resolve one of the ids",r);try{kt.addDependency(s.value,c,l,o)}catch(d){return this.fail(d instanceof Error?d.message:"dependency rejected",r)}let u=`${c.slice(0,8)} \u2014${o}\u2192 ${l.slice(0,8)}`;return r.md?console.log(`\u2713 ${u}`):f.done(u),{success:!0,fromId:c,toId:l,depType:o}}async phases(e=null,t=process.cwd(),r={}){let s=await G(t,r);if(!s.ok)return s.result;let i=kt.phases(s.value);if(i.length===0){let o="No open work in the graph.";return r.md?console.log(`> ${o}`):f.info(o),{success:!0,phases:0}}if(r.md){let o=["# Execution phases (topological)","","Items in the SAME phase have no dependency path between them \u2014 safe to fan out in parallel.",""];for(let c of i){o.push(`## Phase ${c.phase} \u2014 ${c.items.length} item(s), parallelizable`);for(let l of c.items){let u=tr(l.description),d=mn(u);o.push(`- \`${l.id.slice(0,8)}\` ${l.description.slice(0,80)} _(${d.model}/${d.effort}, ~${d.expectedPoints} pt)_`)}o.push("")}console.log(o.join(`
2142
+ `))}else f.info(`next: [${i.id.slice(0,8)}] ${i.description}`);return{success:!0,next:i,orchestration:c}}async claim(e=null,t=process.cwd(),r={}){let s=await G(t,r);if(!s.ok)return s.result;let i=await this.resolveId(s.value,(e??"").trim());if(!i)return this.fail("Usage: prjct claim <task-id>",r);let o=r.as??process.env.PRJCT_AGENT??"claude",c=kt.claim(s.value,i,o),l=c?`claimed ${i.slice(0,8)} as ${o}`:`claim lost \u2014 ${i.slice(0,8)} is already taken`;return r.md?console.log(`${c?"\u2713":"\u2717"} ${l}`):c?f.done(l):f.fail(l),{success:c,id:i,claimant:o}}async depend(e=null,t=process.cwd(),r={}){let s=await G(t,r);if(!s.ok)return s.result;let i=(e??"").trim();if(!i||!r.on)return this.fail("Usage: prjct depend <id> --on <id> [--type blocks|parent|related|discovered-from]",r);let o=r.type??"blocks";if(!BC.includes(o))return this.fail(`Unknown dep type '${r.type}'. Use: ${BC.join(" | ")}`,r);let c=await this.resolveId(s.value,i),l=await this.resolveId(s.value,r.on.trim());if(!c||!l)return this.fail("Could not resolve one of the ids",r);try{kt.addDependency(s.value,c,l,o)}catch(d){return this.fail(d instanceof Error?d.message:"dependency rejected",r)}let u=`${c.slice(0,8)} \u2014${o}\u2192 ${l.slice(0,8)}`;return r.md?console.log(`\u2713 ${u}`):f.done(u),{success:!0,fromId:c,toId:l,depType:o}}async phases(e=null,t=process.cwd(),r={}){let s=await G(t,r);if(!s.ok)return s.result;let i=kt.phases(s.value);if(i.length===0){let o="No open work in the graph.";return r.md?console.log(`> ${o}`):f.info(o),{success:!0,phases:0}}if(r.md){let o=["# Execution phases (topological)","","Items in the SAME phase have no dependency path between them \u2014 safe to fan out in parallel.",""];for(let l of i){o.push(`## Phase ${l.phase} \u2014 ${l.items.length} item(s), parallelizable`);for(let u of l.items.slice(0,12)){let d=tr(u.description),p=mn(d);o.push(`- \`${u.id.slice(0,8)}\` ${u.description.slice(0,80)} _(${p.model}/${p.effort}, ~${p.expectedPoints} pt)_`)}l.items.length>12&&o.push(`- _\u2026and ${l.items.length-12} more (full list in --json / prjct ready)_`),o.push("")}console.log(o.join(`
2143
2143
  `))}else for(let o of i)f.info(`phase ${o.phase}: ${o.items.length} item(s)`);return{success:!0,phases:i.length,plan:i}}async expand(e=null,t=process.cwd(),r={}){let s=await G(t,r);if(!s.ok)return s.result;let i=(e??"").trim().split(/\s+(?=(?:[^"]*"[^"]*")*[^"]*$)/).map(p=>p.replace(/^"|"$/g,"")).filter(Boolean),o=i[0];if(!o)return this.fail('Usage: prjct expand <id> ["subtask 1" "subtask 2" ...]',r);let c=await this.resolveId(s.value,o);if(!c)return this.fail(`Unknown item '${o}'`,r);let l=i.slice(1);if(l.length===0){let m=(await Ie.getTasks(s.value)).find(k=>k.id===c)?.description??c,g=kt.getComplexity(s.value,c);if(!g){let k=tr(m),b=mn(k);g={score:b.expectedPoints,recommendedSubtasks:b.expectedPoints>=5?Math.min(b.expectedPoints,6):0,expansionPrompt:`Decompose "${m}" into ${Math.min(b.expectedPoints,6)} independent, testable subtasks; make dependencies explicit; each subtask \u2264 2 points.`,reasoning:`Triage level ${k.level}; ~${b.expectedPoints} points.`},kt.recordComplexity(s.value,c,{score:g.score,recommendedSubtasks:g.recommendedSubtasks,expansionPrompt:g.expansionPrompt??void 0,reasoning:g.reasoning??void 0})}if(r.md){let k=[`# Expand \`${c.slice(0,8)}\` \u2014 ${m.slice(0,90)}`,"",`- Complexity: ${g.score} pt \xB7 recommended subtasks: ${g.recommendedSubtasks}`,...g.reasoning?[`- Reasoning: ${g.reasoning}`]:[],"",g.recommendedSubtasks>0?`${g.expansionPrompt}
2144
2144
 
2145
2145
  Persist your decomposition: \`prjct expand ${c.slice(0,8)} "subtask 1" "subtask 2" ...\``:"Small enough \u2014 no decomposition needed. Work it directly."];console.log(k.join(`