prjct-cli 2.4.43 → 2.5.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.
- package/CHANGELOG.md +7 -0
- package/dist/bin/prjct-core.mjs +3 -3
- package/dist/daemon/entry.mjs +99 -99
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/bin/prjct-core.mjs
CHANGED
|
@@ -644,14 +644,14 @@ ${e.join(`
|
|
|
644
644
|
## User Patterns
|
|
645
645
|
${n.userPatterns.slice(0,8).map(t=>`- ${t}`).join(`
|
|
646
646
|
`)}
|
|
647
|
-
`}function Pb(n){return[wb(n),kb(n),bb(n),vb(n),Sb(n),Tb(n.commands),Eb(n),Cb(n)].filter(Boolean).join("")}function Rb(n){return["# prjct","","## Use when","","You want to:","- recall prior project decisions, learnings, or shipped features","- capture a thought, todo, or insight without a commitment","- run a workflow the project already registered","- understand your role and the MCPs available in this project","","## What's here","",yb(n),"",Pb(n),"","### Primitives","",'- `prjct capture "<anything>"` \u2014 inbox dump (zero ceremony)','- `prjct remember <type> "<content>" [--tags]` \u2014 typed memory entry',"- `prjct context memory [topic]` \u2014 recall with optional keyword filter","- `prjct workflow list` / `prjct workflow run <name>` \u2014 registered workflows","- `prjct seed list` \u2014 active packs (memory types + workflow slots)","","Base memory types: `fact \xB7 decision \xB7 learning \xB7 gotcha \xB7 pattern \xB7 anti-pattern \xB7 shipped \xB7 inbox \xB7 todo \xB7 idea \xB7 insight \xB7 question \xB7 source \xB7 person`. Any lowercase string works (e.g. `recipe`, `okr`, `stakeholder`).","","### Data paths","","- `.prjct/wiki/_generated/` \u2014 agent-crawlable markdown (regenerated on ship/remember)","- `.prjct/wiki/captured/` \u2014 drop notes with frontmatter, run `prjct context wiki sync` to ingest","- `.prjct/prjct.config.json` \u2014 persona + active packs","","## Quality workflows","","Five named workflows for shipping quality. Each has an explicit methodology, modes, and stop conditions. Each persists findings via `prjct remember` so the vault accumulates project-specific knowledge across sessions.","","### `review` \u2014 Production Bug Hunt + Completeness Gate","",'Use when: user asks to review code, a PR, a recent diff, or "is this ready to ship".',"","Modes (pick one based on context):",'- `expansion` \u2014 adversarial scope ("what could break", "what is missing")',"- `polish` \u2014 final pass on already-correct code (naming, ergonomics, comments)","- `triage` \u2014 fast pass that flags everything but only auto-fixes the obvious","","Methodology:","1. Read git diff + relevant memory (decisions, gotchas) for affected files.","2. Find bugs that pass CI but blow up in production: race conditions, off-by-one, error swallow, leaked resources, partial writes, retry storms.","3. Auto-fix only the OBVIOUS (typos, wrong var names, missing await on a promise that is then discarded). Anything ambiguous \u2192 flag, do not touch.","4. Stop conditions: max 3 auto-fixes per file (more = the file needs a human); never refactor outside the diff scope.",'5. Persist: `prjct remember gotcha "<bug + how to avoid>"` for each finding; `prjct remember decision "<auto-fix applied>"` for each fix.',"","### `qa` \u2014 Real Browser, Atomic Fixes, Regression Tests","","Use when: user asks to test the app, validate a UI change, find UI bugs, or check accessibility.","","Methodology:","1. Use a real browser (Playwright MCP if available; otherwise document the manual steps).","2. Walk the golden path + 2-3 edge cases for the affected feature.","3. For each bug: atomic commit with `fix:` prefix + a regression test that fails without the fix.","4. Stop conditions: max 3 failed fixes per bug \u2014 escalate to a human with details (what was tried, why it failed).",'5. Persist: `prjct remember gotcha "<UI bug + reproducer>"`; `prjct remember decision "<fix + regression test path>"`.',"","### `security` \u2014 OWASP Top 10 + STRIDE Threat Model","",'Use when: user asks for a security review, a CSO check, a vulnerability scan, or "is this safe to ship".',"","Methodology:","1. Walk OWASP Top 10 against the diff: injection, broken auth, sensitive data exposure, XXE, broken access control, security misconfig, XSS, insecure deserialization, vulnerable deps, insufficient logging.","2. Run STRIDE on each new endpoint / data flow: Spoofing, Tampering, Repudiation, Info disclosure, DoS, Elevation of privilege.","3. Confidence gate: only report findings rated 8/10+ on exploit feasibility AND impact. Below = note in appendix only.","4. False-positive exclusions: skip CSRF on idempotent GET, skip SQL injection on parameterized queries, skip XSS on already-escaped templates, skip leaks on logged-error-codes-without-PII. (List grows with project context \u2014 capture exclusions as `prjct remember decision`).",'5. Each finding includes a CONCRETE exploit scenario (curl + payload, or click sequence). Abstract "could be exploited" is not actionable.','6. Persist: `prjct remember gotcha "<finding + exploit + fix>"` for every 8/10+ finding.',"","### `investigate` \u2014 Iron Law: no fix without investigation","",'Use when: user reports a bug, behavior is unexpected, tests fail intermittently, "why does X happen".',"","Methodology:","1. Iron Law: NO code fix until you can state the root cause in one sentence.","2. Trace the data flow from user input to symptom. Include logs, network, state.","3. Form a hypothesis. Design a test that proves or disproves it.","4. Stop condition: max 3 failed hypotheses per bug \u2014 escalate with what was tried.","5. Auto-freeze: limit edits to the module under investigation (mention this constraint to the user).",'6. Persist: `prjct remember learning "<root cause discovered>"`; `prjct remember decision "<fix + why it works>"`; `prjct remember gotcha "<related bug surfaced during investigation>"`.',"","### `ship` (endurecido) \u2014 Coverage Gate + Auto-Document","","Use when: user asks to ship, deploy, merge, or finalize work.","","Methodology (additions to the existing `prjct ship`):","1. Bootstrap a test framework if the project has none (bun test / vitest / jest based on stack).","2. Coverage gate: BLOCK ship if coverage drops more than 2% from the previous version.","3. Auto-document: scan the diff against README / ARCHITECTURE / CHANGELOG / CLAUDE.md \u2192 propose updates for any drift.","4. PR description: include {Summary, Tests added (delta), Coverage delta, Risk areas touched (cross-reference `_generated/analysis/risk-areas/`), Reviews already run on this branch}.",'5. Persist: `prjct remember decision "<release notes + coverage delta>"` so the next sprint sees the trend.',"","### Outputs convention","","Every workflow above persists findings VIA `prjct remember <type>` \u2014 never to ad-hoc files. The wiki regen exposes them in `_generated/memory/<type>.md` and `_generated/analysis/`. Tag with `--tags workflow:<name>,task:<id>` so the user can query a sprint cleanly with `prjct context --tags task=<id>`.","","## Gotchas","",'- Memory recall is best-effort \u2014 an empty result means no match, not "nothing exists".',"- Tags are freeform strings \u2014 reuse existing vocabulary before inventing new keys.","- Secret-like content is refused by `remember` and `capture` unless `--force`.",'- Bare `prjct "<text>"` routes to `capture` (inbox), not `task`. Use `prjct task` explicitly for work that needs a branch/worktree.',"- Hooks in `~/.claude/settings.json` already inject persona + topical memory on SessionStart / UserPromptSubmit \u2014 you rarely need to call prjct by hand at session start.",""].join(`
|
|
647
|
+
`}function Pb(n){return[wb(n),kb(n),bb(n),vb(n),Sb(n),Tb(n.commands),Eb(n),Cb(n)].filter(Boolean).join("")}function Rb(n){return["# prjct","","## Use when","","You want to:","- recall prior project decisions, learnings, or shipped features","- capture a thought, todo, or insight without a commitment","- run a workflow the project already registered","- understand your role and the MCPs available in this project","","## What's here","",yb(n),"",Pb(n),"","### Primitives","",'- `prjct capture "<anything>"` \u2014 inbox dump (zero ceremony)','- `prjct remember <type> "<content>" [--tags]` \u2014 typed memory entry',"- `prjct context memory [topic]` \u2014 recall with optional keyword filter","- `prjct workflow list` / `prjct workflow run <name>` \u2014 registered workflows","- `prjct seed list` \u2014 active packs (memory types + workflow slots)","","Base memory types: `fact \xB7 decision \xB7 learning \xB7 gotcha \xB7 pattern \xB7 anti-pattern \xB7 shipped \xB7 inbox \xB7 todo \xB7 idea \xB7 insight \xB7 question \xB7 source \xB7 person`. Any lowercase string works (e.g. `recipe`, `okr`, `stakeholder`).","","### Data paths","","- `.prjct/wiki/_generated/` \u2014 agent-crawlable markdown (regenerated on ship/remember)","- `.prjct/wiki/captured/` \u2014 drop notes with frontmatter, run `prjct context wiki sync` to ingest","- `.prjct/prjct.config.json` \u2014 persona + active packs","","## Quality workflows","","Six named workflows for shipping quality. Each has an explicit methodology, modes, and stop conditions. Each persists findings via `prjct remember` so the vault accumulates project-specific knowledge across sessions.","","### Subagent dispatch \u2014 context-rot defense","","Workflows that read many files (`review`, `security`, `investigate`, `audit`) MUST dispatch the read-and-analyze step as a subagent via the Agent tool with `subagent_type: \"general-purpose\"`. The subagent runs in a fresh context window and returns only the conclusion \u2014 the parent does not accumulate intermediate file reads. Without this, the parent's context fills with diffs, source files, and memory excerpts, leaving little budget for the user's actual conversation.","","Dispatch pattern:","","1. Parent collects diff scope (`git diff <base>...HEAD --name-only`) and relevant memory (`prjct context memory <topic>`).",'2. Parent calls the Agent tool with: `{ description: "<workflow> on <scope>", subagent_type: "general-purpose", prompt: <methodology + diff scope + memory excerpts + output schema> }`.',"3. Subagent reads files, applies methodology, returns structured findings keyed by `file:line` with severity + fix recommendation.","4. Parent persists each finding via `prjct remember` and surfaces a ranked summary to the user. Never echo subagent intermediate output.","","Skip the subagent only for: diffs under 5 files, conversational follow-ups on a previous finding, or when the parent already has the relevant files in context.","","### Decision-brief format \u2014 AskUserQuestion","","When asking the user a non-trivial decision (architectural choice, destructive action, scope ambiguity, anything ship-and-regret), structure the question as a decision brief:","","```","D<N> \u2014 <one-line title>","ELI10: <plain English a 16-year-old could follow, 2-4 sentences>","Stakes if we pick wrong: <one sentence on what breaks>","Recommendation: <choice> because <reason>","A) <option> (recommended)"," \u2705 <pro \u226540 chars, concrete, observable>"," \u274C <con \u226540 chars, honest>","B) <option>"," \u2705 <pro>"," \u274C <con>","Net: <one-line synthesis of the tradeoff>","```","","Skip the format for: trivial yes/no, routine continue-or-stop, conversational confirmations. Use it whenever the wrong call would cost more than 5 minutes to undo.","","### `review` \u2014 Production Bug Hunt + Completeness Gate","",'Use when: user asks to review code, a PR, a recent diff, or "is this ready to ship".',"","Modes (pick one based on context):",'- `expansion` \u2014 adversarial scope ("what could break", "what is missing")',"- `polish` \u2014 final pass on already-correct code (naming, ergonomics, comments)","- `triage` \u2014 fast pass that flags everything but only auto-fixes the obvious","","Methodology:",'1. **Dispatch as subagent** when the diff touches >5 files (see "Subagent dispatch" above). The subagent reads the diff + memory in a fresh context and returns a finding list.',"2. Read git diff + relevant memory (decisions, gotchas) for affected files.","3. Find bugs that pass CI but blow up in production: race conditions, off-by-one, error swallow, leaked resources, partial writes, retry storms.","4. Auto-fix only the OBVIOUS (typos, wrong var names, missing await on a promise that is then discarded). Anything ambiguous \u2192 flag, do not touch.","5. Stop conditions: max 3 auto-fixes per file (more = the file needs a human); never refactor outside the diff scope.",'6. Persist: `prjct remember gotcha "<bug + how to avoid>"` for each finding; `prjct remember decision "<auto-fix applied>"` for each fix.',"","### `qa` \u2014 Real Browser, Atomic Fixes, Regression Tests","","Use when: user asks to test the app, validate a UI change, find UI bugs, or check accessibility.","","Methodology:","1. Use a real browser (Playwright MCP if available; otherwise document the manual steps).","2. Walk the golden path + 2-3 edge cases for the affected feature.","3. For each bug: atomic commit with `fix:` prefix + a regression test that fails without the fix.","4. Stop conditions: max 3 failed fixes per bug \u2014 escalate to a human with details (what was tried, why it failed).",'5. Persist: `prjct remember gotcha "<UI bug + reproducer>"`; `prjct remember decision "<fix + regression test path>"`.',"","### `security` \u2014 OWASP Top 10 + STRIDE Threat Model","",'Use when: user asks for a security review, a CSO check, a vulnerability scan, or "is this safe to ship".',"","Methodology:",'1. **Dispatch as subagent** for any review touching authentication, payment, file I/O, shell exec, or DB queries (see "Subagent dispatch" above). Security review is read-heavy \u2014 context rot here costs more than elsewhere.',"2. Walk OWASP Top 10 against the diff: injection, broken auth, sensitive data exposure, XXE, broken access control, security misconfig, XSS, insecure deserialization, vulnerable deps, insufficient logging.","3. Run STRIDE on each new endpoint / data flow: Spoofing, Tampering, Repudiation, Info disclosure, DoS, Elevation of privilege.","4. Confidence gate: only report findings rated 8/10+ on exploit feasibility AND impact. Below = note in appendix only.","5. False-positive exclusions: skip CSRF on idempotent GET, skip SQL injection on parameterized queries, skip XSS on already-escaped templates, skip leaks on logged-error-codes-without-PII. (List grows with project context \u2014 capture exclusions as `prjct remember decision`).",'6. Each finding includes a CONCRETE exploit scenario (curl + payload, or click sequence). Abstract "could be exploited" is not actionable.','7. Persist: `prjct remember gotcha "<finding + exploit + fix>"` for every 8/10+ finding.',"","### `investigate` \u2014 Iron Law: no fix without investigation","",'Use when: user reports a bug, behavior is unexpected, tests fail intermittently, "why does X happen".',"","Methodology:","1. **Dispatch the trace+hypothesis phase as a subagent** when the bug spans more than one module. Subagent reads logs, source, recent diffs in fresh context and returns root-cause hypothesis + supporting evidence. Parent stays focused on the fix decision.","2. Iron Law: NO code fix until you can state the root cause in one sentence.","3. Trace the data flow from user input to symptom. Include logs, network, state.","4. Form a hypothesis. Design a test that proves or disproves it.","5. Stop condition: max 3 failed hypotheses per bug \u2014 escalate with what was tried.","6. Auto-freeze: limit edits to the module under investigation (mention this constraint to the user).",'7. Persist: `prjct remember learning "<root cause discovered>"`; `prjct remember decision "<fix + why it works>"`; `prjct remember gotcha "<related bug surfaced during investigation>"`.',"","### `ship` (endurecido) \u2014 Coverage Gate + Auto-Document","","Use when: user asks to ship, deploy, merge, or finalize work.","","Methodology (additions to the existing `prjct ship`):","1. Bootstrap a test framework if the project has none (bun test / vitest / jest based on stack).","2. Coverage gate: BLOCK ship if coverage drops more than 2% from the previous version.","3. Auto-document: scan the diff against README / ARCHITECTURE / CHANGELOG / CLAUDE.md \u2192 propose updates for any drift.","4. PR description: include {Summary, Tests added (delta), Coverage delta, Risk areas touched (cross-reference `_generated/analysis/risk-areas/`), Reviews already run on this branch}.",'5. Persist: `prjct remember decision "<release notes + coverage delta>"` so the next sprint sees the trend.',"","### `audit` \u2014 One-shot orchestrator (review + security + investigate)","",'Use when: user asks for a full quality audit, a "ship-ready check", "review everything", or wants the equivalent of a multi-discipline review before merge.',"","Methodology (orchestrator \u2014 dispatches the heavy work):",'1. Collect diff scope: `git diff <base>...HEAD --name-only --stat`. If diff is empty, abort with "Nothing to audit on this branch."',"2. Dispatch THREE subagents IN PARALLEL via the Agent tool \u2014 one tool-use block per subagent, all in the SAME message so they actually run concurrently:"," - Subagent A \u2014 `review` methodology against the diff (Production Bug Hunt + Completeness Gate)."," - Subagent B \u2014 `security` methodology against the diff (OWASP Top 10 + STRIDE, 8/10+ findings only)."," - Subagent C \u2014 `investigate` methodology, ONLY if the user mentioned a specific bug, recent failure, or anomaly. Skip otherwise.","3. Each subagent receives: methodology spec, diff scope, relevant memory excerpts (`prjct context memory <topic> --tags severity:high`), and the structured output schema (`severity | file:line | issue | fix`).","4. Parent merges the three reports, dedupes findings (same file:line + same root cause = one entry, take highest severity), and ranks by severity \xD7 blast-radius.","5. Surface the ranked list. For high-severity items that touch shared infra (`risk-areas/` cross-reference), use the decision-brief format before any auto-fix.","6. Persist: each finding \u2192 `prjct remember gotcha` with `--tags workflow:audit,subagent:<a|b|c>,severity:<level>`.","",'Stop conditions: any subagent reports a "blocking" finding (severity=high AND exploit feasibility=high) \u2192 halt audit, surface the finding immediately, do not run the merge step.',"","Anti-patterns:","- Running review/security/investigate sequentially instead of as parallel subagents (3\xD7 the wall time, 3\xD7 the parent context cost).","- Letting the parent read every file the subagents read (defeats the entire context-rot defense).","- Auto-fixing security findings without the decision-brief gate.","","### Outputs convention","","Every workflow above persists findings VIA `prjct remember <type>` \u2014 never to ad-hoc files. The wiki regen exposes them in `_generated/memory/<type>.md` and `_generated/analysis/`. Tag with `--tags workflow:<name>,task:<id>` so the user can query a sprint cleanly with `prjct context --tags task=<id>`.","","## Gotchas","",'- Memory recall is best-effort \u2014 an empty result means no match, not "nothing exists".',"- Tags are freeform strings \u2014 reuse existing vocabulary before inventing new keys.","- Secret-like content is refused by `remember` and `capture` unless `--force`.",'- Bare `prjct "<text>"` routes to `capture` (inbox), not `task`. Use `prjct task` explicitly for work that needs a branch/worktree.',"- Hooks in `~/.claude/settings.json` already inject persona + topical memory on SessionStart / UserPromptSubmit \u2014 you rarely need to call prjct by hand at session start.",""].join(`
|
|
648
648
|
`)}function jb(n,e){let t=n.userInvocable!==!1;return`---
|
|
649
649
|
description: "${n.description}"
|
|
650
650
|
allowed-tools: [${n.allowedTools.map(s=>`"${s}"`).join(", ")}]
|
|
651
651
|
user-invocable: ${t}
|
|
652
652
|
---`}function xb(n,e){return`${jb(n,e)}
|
|
653
653
|
|
|
654
|
-
${n.body(e)}`}var qc,zc,ym,wm=k(()=>{"use strict";ms();jn();c(yb,"formatProjectHeader");c(wb,"formatPatterns");c(kb,"formatAntiPatterns");c(bb,"formatGotchas");c(vb,"formatRecentShipped");c(Sb,"formatVelocity");c(Tb,"formatCommands");c(Eb,"formatState");c(Cb,"formatUserPatterns");c(Pb,"formatRichContext");qc=[{name:"prjct",description:"Project memory + quality workflows. Use to recall prior decisions/learnings/gotchas, run quality reviews (review, qa, security, investigate), ship safely, or capture insights. Lookup-first: check the vault before re-reading source.",allowedTools:["Bash","Read","Write","Edit","Glob","Grep","Task"],condition:c(()=>!0,"condition"),body:c(n=>Rb(n),"body")}];c(Rb,"buildPrjctSkillBody");c(jb,"buildFrontmatter");c(xb,"buildSkillContent");zc=class{static{c(this,"SkillGenerator")}async generateAndInstall(e,t={backlogCount:0,completedTaskCount:0,pausedTaskCount:0,hasActiveTask:!1},s){let r={generated:[],skipped:[]},o={projectName:e.stats.name,stack:[...e.stats.languages,...e.stats.frameworks].filter(Boolean).join("/")||e.stats.ecosystem,branch:e.git.branch,commands:e.commands,projectId:e.projectId,version:s?.version??e.stats.version??"0.0.0",fileCount:s?.fileCount??e.stats.fileCount??0,patterns:s?.patterns??[],antiPatterns:s?.antiPatterns??[],recentShipped:s?.recentShipped??[],velocity:s?.velocity??null,backlogCount:s?.backlogCount??t.backlogCount,completedTaskCount:s?.completedTaskCount??t.completedTaskCount,pausedTaskCount:s?.pausedTaskCount??t.pausedTaskCount,knownGotchas:s?.knownGotchas??[],hasActiveTask:s?.hasActiveTask??t.hasActiveTask,activeTaskDescription:s?.activeTaskDescription??"",pausedTasks:s?.pausedTasks??[],topBacklog:s?.topBacklog??[],ideasCount:s?.ideasCount??0,shippedCount:s?.shippedCount??0,userPatterns:s?.userPatterns??[]},i=Wr.join(hb.homedir(),".claude","skills");for(let l of qc){if(!l.condition(t)){r.skipped.push({name:l.name,reason:"condition not met"}),await Hr.rm(Wr.join(i,l.name),{recursive:!0,force:!0}).catch(()=>{});continue}try{let u=xb(l,o),d=Wr.join(i,l.name),p=Wr.join(d,"SKILL.md");await Hr.mkdir(d,{recursive:!0}),await Hr.writeFile(p,u,"utf-8"),r.generated.push({name:l.name,path:p})}catch(u){X.debug(`Failed to generate skill ${l.name}`,{error:he(u)}),r.skipped.push({name:l.name,reason:he(u)})}}let a=new Set(qc.map(l=>l.name));try{let l=await Hr.readdir(i,{withFileTypes:!0}).catch(()=>[]);for(let u of l)u.isDirectory()&&u.name.startsWith("prjct-")&&!a.has(u.name)&&await Hr.rm(Wr.join(i,u.name),{recursive:!0,force:!0}).catch(()=>{})}catch{}return r.generated.length>0&&X.info("Generated native workflow skills",{count:r.generated.length,skills:r.generated.map(l=>l.name)}),r}getDefinitions(){return qc}},ym=new zc});var km=k(()=>{"use strict"});import Ab from"node:fs/promises";import bm from"node:path";var ri,vm=k(()=>{"use strict";J();ri=class{static{c(this,"StackDetector")}projectPath;constructor(e){this.projectPath=e}async detect(){let e={hasFrontend:!1,hasBackend:!1,hasDatabase:!1,hasDocker:!1,hasTesting:!1,frontendType:null,frameworks:[]},t=await this.readPackageJson();if(t){let s={...t.dependencies,...t.devDependencies};this.detectFrontend(s,e),this.detectBackend(s,e),this.detectDatabase(s,e),this.detectTesting(s,t,e),this.collectFrameworks(s,e)}return e.hasDocker=await this.detectDocker(),e}detectFrontend(e,t){(e.react||e.vue||e.svelte||e["@angular/core"])&&(t.hasFrontend=!0,t.frontendType="web"),(e["react-native"]||e.expo)&&(t.hasFrontend=!0,t.frontendType=t.frontendType==="web"?"both":"mobile")}detectBackend(e,t){["express","fastify","hono","koa","@nestjs/core","nest","@hapi/hapi","restify","polka"].some(r=>e[r])&&(t.hasBackend=!0)}detectDatabase(e,t){["prisma","@prisma/client","mongoose","pg","mysql2","sequelize","typeorm","drizzle-orm","knex","better-sqlite3","mongodb","redis","ioredis"].some(r=>e[r])&&(t.hasDatabase=!0)}detectTesting(e,t,s){["jest","vitest","mocha","@testing-library/react","@testing-library/vue","cypress","playwright","@playwright/test","ava","tap","bun-types"].some(o=>e[o]||t.devDependencies?.[o])&&(s.hasTesting=!0)}async detectDocker(){let e=["Dockerfile","docker-compose.yml","docker-compose.yaml",".dockerignore"];for(let t of e)if(await this.fileExistsInProject(t))return!0;return!1}collectFrameworks(e,t){e.react&&t.frameworks.push("React"),e.next&&t.frameworks.push("Next.js"),e.vue&&t.frameworks.push("Vue"),e.nuxt&&t.frameworks.push("Nuxt"),e.svelte&&t.frameworks.push("Svelte"),e["@angular/core"]&&t.frameworks.push("Angular"),e["react-native"]&&t.frameworks.push("React Native"),e.expo&&t.frameworks.push("Expo"),e.express&&t.frameworks.push("Express"),e.fastify&&t.frameworks.push("Fastify"),e.hono&&t.frameworks.push("Hono"),e.koa&&t.frameworks.push("Koa"),(e["@nestjs/core"]||e.nest)&&t.frameworks.push("NestJS"),e.astro&&t.frameworks.push("Astro"),e.remix&&t.frameworks.push("Remix"),e.gatsby&&t.frameworks.push("Gatsby")}async readPackageJson(){try{let e=bm.join(this.projectPath,"package.json"),t=await Ab.readFile(e,"utf-8");return JSON.parse(t)}catch{return null}}async fileExistsInProject(e){return T(bm.join(this.projectPath,e))}}});import Xc from"node:path";async function Sm(n){let e={branch:"main",commits:0,contributors:0,hasChanges:!1,stagedFiles:[],modifiedFiles:[],untrackedFiles:[],recentCommits:[],weeklyCommits:0},t={cwd:n},s=c(d=>d.catch(()=>null),"safe"),[r,o,i,a,l,u]=await Promise.all([s(_("git branch --show-current",t)),s(_("git rev-list --count HEAD",t)),s(_("git shortlog -sn --all",t)),s(_("git status --porcelain",t)),s(_('git log --oneline -20 --pretty=format:"%h|%s|%ad" --date=short',t)),s(_('git log --oneline --since="1 week ago"',t))]);if(r&&(e.branch=r.stdout.trim()||"main"),o&&(e.commits=parseInt(o.stdout.trim(),10)||0),i&&(e.contributors=i.stdout.split(`
|
|
654
|
+
${n.body(e)}`}var qc,zc,ym,wm=k(()=>{"use strict";ms();jn();c(yb,"formatProjectHeader");c(wb,"formatPatterns");c(kb,"formatAntiPatterns");c(bb,"formatGotchas");c(vb,"formatRecentShipped");c(Sb,"formatVelocity");c(Tb,"formatCommands");c(Eb,"formatState");c(Cb,"formatUserPatterns");c(Pb,"formatRichContext");qc=[{name:"prjct",description:"Project memory + quality workflows. Use to recall prior decisions/learnings/gotchas, run quality reviews (review, qa, security, investigate, audit), ship safely, or capture insights. Heavy reviews dispatch as subagents to avoid context rot. Lookup-first: check the vault before re-reading source.",allowedTools:["Bash","Read","Write","Edit","Glob","Grep","Task"],condition:c(()=>!0,"condition"),body:c(n=>Rb(n),"body")}];c(Rb,"buildPrjctSkillBody");c(jb,"buildFrontmatter");c(xb,"buildSkillContent");zc=class{static{c(this,"SkillGenerator")}async generateAndInstall(e,t={backlogCount:0,completedTaskCount:0,pausedTaskCount:0,hasActiveTask:!1},s){let r={generated:[],skipped:[]},o={projectName:e.stats.name,stack:[...e.stats.languages,...e.stats.frameworks].filter(Boolean).join("/")||e.stats.ecosystem,branch:e.git.branch,commands:e.commands,projectId:e.projectId,version:s?.version??e.stats.version??"0.0.0",fileCount:s?.fileCount??e.stats.fileCount??0,patterns:s?.patterns??[],antiPatterns:s?.antiPatterns??[],recentShipped:s?.recentShipped??[],velocity:s?.velocity??null,backlogCount:s?.backlogCount??t.backlogCount,completedTaskCount:s?.completedTaskCount??t.completedTaskCount,pausedTaskCount:s?.pausedTaskCount??t.pausedTaskCount,knownGotchas:s?.knownGotchas??[],hasActiveTask:s?.hasActiveTask??t.hasActiveTask,activeTaskDescription:s?.activeTaskDescription??"",pausedTasks:s?.pausedTasks??[],topBacklog:s?.topBacklog??[],ideasCount:s?.ideasCount??0,shippedCount:s?.shippedCount??0,userPatterns:s?.userPatterns??[]},i=Wr.join(hb.homedir(),".claude","skills");for(let l of qc){if(!l.condition(t)){r.skipped.push({name:l.name,reason:"condition not met"}),await Hr.rm(Wr.join(i,l.name),{recursive:!0,force:!0}).catch(()=>{});continue}try{let u=xb(l,o),d=Wr.join(i,l.name),p=Wr.join(d,"SKILL.md");await Hr.mkdir(d,{recursive:!0}),await Hr.writeFile(p,u,"utf-8"),r.generated.push({name:l.name,path:p})}catch(u){X.debug(`Failed to generate skill ${l.name}`,{error:he(u)}),r.skipped.push({name:l.name,reason:he(u)})}}let a=new Set(qc.map(l=>l.name));try{let l=await Hr.readdir(i,{withFileTypes:!0}).catch(()=>[]);for(let u of l)u.isDirectory()&&u.name.startsWith("prjct-")&&!a.has(u.name)&&await Hr.rm(Wr.join(i,u.name),{recursive:!0,force:!0}).catch(()=>{})}catch{}return r.generated.length>0&&X.info("Generated native workflow skills",{count:r.generated.length,skills:r.generated.map(l=>l.name)}),r}getDefinitions(){return qc}},ym=new zc});var km=k(()=>{"use strict"});import Ab from"node:fs/promises";import bm from"node:path";var ri,vm=k(()=>{"use strict";J();ri=class{static{c(this,"StackDetector")}projectPath;constructor(e){this.projectPath=e}async detect(){let e={hasFrontend:!1,hasBackend:!1,hasDatabase:!1,hasDocker:!1,hasTesting:!1,frontendType:null,frameworks:[]},t=await this.readPackageJson();if(t){let s={...t.dependencies,...t.devDependencies};this.detectFrontend(s,e),this.detectBackend(s,e),this.detectDatabase(s,e),this.detectTesting(s,t,e),this.collectFrameworks(s,e)}return e.hasDocker=await this.detectDocker(),e}detectFrontend(e,t){(e.react||e.vue||e.svelte||e["@angular/core"])&&(t.hasFrontend=!0,t.frontendType="web"),(e["react-native"]||e.expo)&&(t.hasFrontend=!0,t.frontendType=t.frontendType==="web"?"both":"mobile")}detectBackend(e,t){["express","fastify","hono","koa","@nestjs/core","nest","@hapi/hapi","restify","polka"].some(r=>e[r])&&(t.hasBackend=!0)}detectDatabase(e,t){["prisma","@prisma/client","mongoose","pg","mysql2","sequelize","typeorm","drizzle-orm","knex","better-sqlite3","mongodb","redis","ioredis"].some(r=>e[r])&&(t.hasDatabase=!0)}detectTesting(e,t,s){["jest","vitest","mocha","@testing-library/react","@testing-library/vue","cypress","playwright","@playwright/test","ava","tap","bun-types"].some(o=>e[o]||t.devDependencies?.[o])&&(s.hasTesting=!0)}async detectDocker(){let e=["Dockerfile","docker-compose.yml","docker-compose.yaml",".dockerignore"];for(let t of e)if(await this.fileExistsInProject(t))return!0;return!1}collectFrameworks(e,t){e.react&&t.frameworks.push("React"),e.next&&t.frameworks.push("Next.js"),e.vue&&t.frameworks.push("Vue"),e.nuxt&&t.frameworks.push("Nuxt"),e.svelte&&t.frameworks.push("Svelte"),e["@angular/core"]&&t.frameworks.push("Angular"),e["react-native"]&&t.frameworks.push("React Native"),e.expo&&t.frameworks.push("Expo"),e.express&&t.frameworks.push("Express"),e.fastify&&t.frameworks.push("Fastify"),e.hono&&t.frameworks.push("Hono"),e.koa&&t.frameworks.push("Koa"),(e["@nestjs/core"]||e.nest)&&t.frameworks.push("NestJS"),e.astro&&t.frameworks.push("Astro"),e.remix&&t.frameworks.push("Remix"),e.gatsby&&t.frameworks.push("Gatsby")}async readPackageJson(){try{let e=bm.join(this.projectPath,"package.json"),t=await Ab.readFile(e,"utf-8");return JSON.parse(t)}catch{return null}}async fileExistsInProject(e){return T(bm.join(this.projectPath,e))}}});import Xc from"node:path";async function Sm(n){let e={branch:"main",commits:0,contributors:0,hasChanges:!1,stagedFiles:[],modifiedFiles:[],untrackedFiles:[],recentCommits:[],weeklyCommits:0},t={cwd:n},s=c(d=>d.catch(()=>null),"safe"),[r,o,i,a,l,u]=await Promise.all([s(_("git branch --show-current",t)),s(_("git rev-list --count HEAD",t)),s(_("git shortlog -sn --all",t)),s(_("git status --porcelain",t)),s(_('git log --oneline -20 --pretty=format:"%h|%s|%ad" --date=short',t)),s(_('git log --oneline --since="1 week ago"',t))]);if(r&&(e.branch=r.stdout.trim()||"main"),o&&(e.commits=parseInt(o.stdout.trim(),10)||0),i&&(e.contributors=i.stdout.split(`
|
|
655
655
|
`).filter(d=>d.trim()).length),a){let d=a.stdout.trim().split(`
|
|
656
656
|
`).filter(Boolean);e.hasChanges=d.length>0;for(let p of d){let m=p.substring(0,2),g=p.substring(3);m.startsWith("A")||m.startsWith("M ")?e.stagedFiles.push(g):m.includes("M")?e.modifiedFiles.push(g):m.startsWith("??")&&e.untrackedFiles.push(g)}}return l&&(e.recentCommits=l.stdout.split(`
|
|
657
657
|
`).filter(Boolean).map(d=>{let[p,m,g]=d.split("|");return{hash:p,message:m,date:g}})),u&&(e.weeklyCommits=u.stdout.split(`
|
|
@@ -1381,7 +1381,7 @@ ${B.yellow(`Command '${n}' not found.`)}
|
|
|
1381
1381
|
|
|
1382
1382
|
Run 'prjct help' to see all available commands.
|
|
1383
1383
|
`}function bC(){let n=[];n.push(""),n.push(B.cyan.bold("All Commands")),n.push("");let e=Object.entries(Yr).sort((t,s)=>t[1].order-s[1].order);for(let[t,s]of e){let r=nr.filter(o=>o.group===t);if(r.length!==0){n.push(`${B.bold(s.title)} ${B.dim(`(${r.length} commands)`)}`),n.push(B.dim(s.description)),n.push("");for(let o of r){let i=`p. ${o.name}`.padEnd(18),a=o.description.length>45?`${o.description.slice(0,42)}...`:o.description;n.push(` ${i} ${a}`)}n.push("")}}return n.push(B.dim("Run 'prjct help <command>' for detailed help on a specific command.")),n.push(""),n.join(`
|
|
1384
|
-
`)}function vC(n){return n?n==="commands"||n==="all"?bC():kC(n):hC()}var Ph,fC,jh=k(()=>{"use strict";hu();Ne();Ph=[{name:"start",description:"First-time setup wizard",example:"prjct start"},{name:"init",description:"Initialize project in current directory",example:"prjct init"},{name:"sync",description:"Sync project state and update context files",example:"prjct sync"},{name:"watch",description:"Auto-sync on file changes",example:"prjct watch",options:["--verbose","--debounce=<ms>","--interval=<sec>"]},{name:"hooks",description:"Manage git hooks for auto-sync",example:"prjct hooks install",subcommands:["install","uninstall","status"]},{name:"doctor",description:"Check system health and dependencies",example:"prjct doctor"},{name:"context",description:"Smart context filtering tools for AI",example:'prjct context files "add auth"',subcommands:["files","signatures","imports","recent","summary"]},{name:"stop",description:"Stop the background daemon",example:"prjct stop",options:["--force"]},{name:"restart",description:"Restart the background daemon",example:"prjct restart"},{name:"uninstall",description:"Complete system removal of prjct",example:"prjct uninstall --backup",options:["--force","--backup","--dry-run","--keep-package"]}],fC=[{flag:"-q, --quiet",description:"Suppress all output (errors to stderr only)"},{flag:"-v, --version",description:"Show version and provider status"},{flag:"-h, --help",description:"Show this help message"}];c(hC,"formatMainHelp");c(yC,"formatTerminalCommandHelp");c(wC,"formatAgentCommandHelp");c(kC,"formatCommandHelp");c(bC,"formatCommandList");c(vC,"getHelp")});var xh=Uh((pH,SC)=>{SC.exports={name:"prjct-cli",version:"2.
|
|
1384
|
+
`)}function vC(n){return n?n==="commands"||n==="all"?bC():kC(n):hC()}var Ph,fC,jh=k(()=>{"use strict";hu();Ne();Ph=[{name:"start",description:"First-time setup wizard",example:"prjct start"},{name:"init",description:"Initialize project in current directory",example:"prjct init"},{name:"sync",description:"Sync project state and update context files",example:"prjct sync"},{name:"watch",description:"Auto-sync on file changes",example:"prjct watch",options:["--verbose","--debounce=<ms>","--interval=<sec>"]},{name:"hooks",description:"Manage git hooks for auto-sync",example:"prjct hooks install",subcommands:["install","uninstall","status"]},{name:"doctor",description:"Check system health and dependencies",example:"prjct doctor"},{name:"context",description:"Smart context filtering tools for AI",example:'prjct context files "add auth"',subcommands:["files","signatures","imports","recent","summary"]},{name:"stop",description:"Stop the background daemon",example:"prjct stop",options:["--force"]},{name:"restart",description:"Restart the background daemon",example:"prjct restart"},{name:"uninstall",description:"Complete system removal of prjct",example:"prjct uninstall --backup",options:["--force","--backup","--dry-run","--keep-package"]}],fC=[{flag:"-q, --quiet",description:"Suppress all output (errors to stderr only)"},{flag:"-v, --version",description:"Show version and provider status"},{flag:"-h, --help",description:"Show this help message"}];c(hC,"formatMainHelp");c(yC,"formatTerminalCommandHelp");c(wC,"formatAgentCommandHelp");c(kC,"formatCommandHelp");c(bC,"formatCommandList");c(vC,"getHelp")});var xh=Uh((pH,SC)=>{SC.exports={name:"prjct-cli",version:"2.5.0",description:"Context layer for AI agents. Project context for Claude Code, Gemini CLI, and more.",main:"dist/bin/prjct.mjs",bin:{prjct:"bin/prjct"},publishConfig:{access:"public",registry:"https://registry.npmjs.org"},scripts:{build:"node scripts/build.js","build:node":"node scripts/build.js",release:"node scripts/release.js","release:patch":"node scripts/release.js patch","release:minor":"node scripts/release.js minor","release:major":"node scripts/release.js major",postinstall:"node scripts/postinstall.js",prepare:"lefthook install","update-commands":`bun -e "const installer = require('./core/infrastructure/command-installer'); installer.syncCommands().then(r => console.log('Commands updated:', r)).catch(e => console.error('Error:', e.message))"`,"install-global":"./scripts/install.sh",update:"./scripts/update.sh",test:"bun test","test:watch":"bun test --watch","test:coverage":"bun test --coverage",typecheck:"tsc --noEmit -p core/tsconfig.json","typecheck:watch":"tsc --noEmit -p core/tsconfig.json --watch",validate:"bun scripts/validate-commands.js",lint:"biome lint .","lint:fix":"biome lint --write .",knip:"knip","lint:meta":"bun core/cli/lint-meta-commentary.ts",format:"biome format --write .","format:check":"biome format .",check:"biome check .","check:fix":"biome check --write ."},keywords:["claude-code","gemini-cli","ai-agents","context-layer","developer-tools","ai-assistant","productivity","mcp","llm","coding-agents"],author:"prjct.app",license:"MIT",dependencies:{"@clack/prompts":"1.0.0","@modelcontextprotocol/sdk":"1.29.0","better-sqlite3":"12.9.0",chalk:"4.1.2",chokidar:"5.0.0","date-fns":"4.1.0",glob:"13.0.1","jsonc-parser":"3.3.1",zod:"3.25.76"},overrides:{"path-to-regexp":"8.4.0","brace-expansion":"5.0.5"},devDependencies:{"@biomejs/biome":"2.3.13","@types/better-sqlite3":"7.6.13","@types/bun":"latest","@types/chokidar":"2.1.7",esbuild:"0.25.0",knip:"6.3.1",lefthook:"2.1.0",typescript:"5.9.3"},repository:{type:"git",url:"git+https://github.com/jlopezlira/prjct-cli.git"},bugs:{url:"https://github.com/jlopezlira/prjct-cli/issues"},homepage:"https://prjct.app",packageManager:"bun@1.2.23",engines:{bun:">=1.0.0",node:">=22.22.2"},files:["assets/","bin/prjct","dist/","templates/","scripts/postinstall.js","scripts/ensure-bun.sh","scripts/install.sh","LICENSE","README.md","CHANGELOG.md"],prepublishOnly:"node scripts/build.js",trustedDependencies:["chalk"]}});var jC={};import Ah from"node:os";import Bi from"node:path";import Pe from"chalk";async function TC(){let[n,...e]=process.argv.slice(2);if(["-v","--version","version"].includes(n)){let s=await Promise.resolve().then(()=>Hh(xh()));await PC(s.version),process.exit(0)}if(["-h","--help",void 0].includes(n)&&(RC(),process.exit(0)),n&&Fi(n)&&!q.getByName(n)){let s=Li[n];s&&(f.failWithHint({message:`'prjct ${n}' was removed in v2. ${s.note}`,hint:`Use: ${s.replacement}`}),process.exit(1))}if(n&&!q.getByName(n)&&!(e.length===0&&$r(n)!==null)){let r=[n,...e.filter(i=>!i.startsWith("-"))].join(" "),o=e.filter(i=>i.startsWith("-"));n="capture",e=[r,...o]}let t=e.includes("--md");t||f.start();try{let s=q.getByName(n);if(!s){let m=$r(n),g=m?`Did you mean 'prjct ${m}'? Run 'prjct --help' for all commands`:"Run 'prjct --help' to see available commands";f.failWithHint(jr("UNKNOWN_COMMAND",{message:`Unknown command: ${n}`,hint:g})),t||f.end(),process.exit(1)}if(s.deprecated){let m=s.replacedBy?`Use 'prjct ${s.replacedBy}' instead`:"Run 'prjct --help' to see available commands";f.failWithHint({message:`Command '${n}' is deprecated`,hint:m}),t||f.end(),process.exit(1)}s.implemented||(f.failWithHint({message:`Command '${n}' is not yet implemented`,hint:"Run 'prjct --help' to see available commands",docs:"https://github.com/jlopezlira/prjct-cli"}),t||f.end(),process.exit(1));let{parsedArgs:r,options:o}=CC(s,e),i=!process.stdin.isTTY||o.md===!0||o.json===!0;s.requiresLlm&&!i&&(f.failWithHint({message:`'prjct ${n}' requires an AI agent to process its output`,hint:`Use 'p. ${n}' inside Claude/Cursor, or add --md flag`}),t||f.end(),process.exit(1));let a=EC(s,r);a&&(f.failWithHint(a),t||f.end(),process.exit(1));let l=null,u=Date.now();try{l=await j.getProjectId(process.cwd()),l&&(await Cn.expireIfStale(l),await Cn.touch(l))}catch{}let d=new js,p;if(n==="analyze")p=await d.analyze(o);else if(n==="setup")p=await d.setup(o);else if(n==="update")p=await d.update(o);else{let m=r.join(" ")||null,g=o.md===!0,P={task:c(h=>d.task(h,process.cwd(),{md:g}),"task"),init:c(h=>d.init({idea:h,yes:o.yes===!0,pack:o.pack?String(o.pack):void 0,persona:o.persona?String(o.persona):void 0}),"init"),ship:c(h=>d.ship(h,process.cwd(),{md:g}),"ship"),workflow:c(h=>d.workflowPrefs(h,process.cwd(),{md:g}),"workflow"),sync:c(()=>d.sync(process.cwd(),{preview:o.preview===!0||o["dry-run"]===!0,yes:o.yes===!0,json:o.json===!0,md:g,package:o.package?String(o.package):void 0,full:o.full===!0}),"sync"),"analysis-save-llm":c(h=>h?d.saveLlmAnalysis(h,process.cwd(),{md:g}):Promise.resolve({success:!1,error:"analysis-save-llm requires a JSON payload as positional arg"}),"analysis-save-llm"),regen:c(()=>d.regenVault(process.cwd(),{md:g}),"regen"),start:c(()=>d.start(),"start"),context:c(h=>d.context(h),"context"),status:c(h=>d.status(h,process.cwd(),{md:g}),"status"),tag:c(h=>d.tag(h,process.cwd(),{md:g}),"tag"),remember:c(h=>d.remember(h,process.cwd(),{md:g,tags:o.tags?String(o.tags):void 0}),"remember"),login:c(()=>d.login({md:g,url:o.url?String(o.url):void 0}),"login"),logout:c(()=>d.logout(),"logout"),auth:c(h=>d.auth(h,{md:g}),"auth"),seed:c(h=>d.seed(h,process.cwd(),{md:g}),"seed"),install:c(()=>d.install(null,process.cwd(),{md:g}),"install"),capture:c(h=>d.capture(h,process.cwd(),{md:g,tags:o.tags?String(o.tags):void 0,force:o.force===!0}),"capture"),mcp:c(h=>d.mcp(h,process.cwd(),{md:g}),"mcp")}[n];if(P)p=await P(m);else throw new Error(`Command '${n}' has no handler`)}if(l){let m=Date.now()-u;try{await Cn.trackCommand(l,n,m)}catch{}try{await xr.recordTiming(l,"command_duration",m,{command:n});let g=globalThis.__perfStartNs;if(g){let w=Number(process.hrtime.bigint()-g)/1e6;await xr.recordTiming(l,"startup_time",w)}await xr.recordMemory(l,{command:n})}catch{}}p?.message&&console.log(p.message),t||f.end(),process.exit(p?.success?0:1)}catch(s){console.error("Error:",b(s)),process.env.DEBUG&&console.error(ea(s)),t||f.end(),process.exit(1)}}function EC(n,e){if(!n.params)return null;let t=n.params.match(/<[^>]+>/g);if(!t||t.length===0)return null;if(e.length<t.length){let s=t.map(o=>o.slice(1,-1)).join(", "),r=n.usage.terminal||`prjct ${n.name} ${n.params}`;return jr("MISSING_PARAM",{message:`Missing required parameter: ${s}`,hint:`Usage: ${r}`})}return null}function CC(n,e){let t=[],s={};for(let r=0;r<e.length;r++){let o=e[r];if(o.startsWith("--")){let i=o.slice(2);r+1<e.length&&!e[r+1].startsWith("--")?s[i]=e[++r]:s[i]=!0}else t.push(o)}return{parsedArgs:t,options:s}}async function PC(n){let e=await ss(),t=Bi.join(Ah.homedir(),".claude","commands","p.md"),s=Bi.join(Ah.homedir(),".gemini","commands","p.toml"),[r,o,i,a]=await Promise.all([T(t),T(s),T(Bi.join(process.cwd(),".cursor","commands","sync.md")),T(Bi.join(process.cwd(),".cursor"))]),l=await Sr();if(console.log(`
|
|
1385
1385
|
${Pe.cyan("p/")} prjct v${n}
|
|
1386
1386
|
${Pe.dim("Context layer for AI coding agents")}
|
|
1387
1387
|
|