@phren/cli 0.0.1

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.
Files changed (185) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +590 -0
  3. package/mcp/dist/capabilities/cli.js +61 -0
  4. package/mcp/dist/capabilities/index.js +15 -0
  5. package/mcp/dist/capabilities/mcp.js +61 -0
  6. package/mcp/dist/capabilities/types.js +57 -0
  7. package/mcp/dist/capabilities/vscode.js +61 -0
  8. package/mcp/dist/capabilities/web-ui.js +61 -0
  9. package/mcp/dist/cli-actions.js +302 -0
  10. package/mcp/dist/cli-config.js +580 -0
  11. package/mcp/dist/cli-extract.js +305 -0
  12. package/mcp/dist/cli-govern.js +371 -0
  13. package/mcp/dist/cli-graph.js +169 -0
  14. package/mcp/dist/cli-hooks-citations.js +44 -0
  15. package/mcp/dist/cli-hooks-context.js +56 -0
  16. package/mcp/dist/cli-hooks-globs.js +83 -0
  17. package/mcp/dist/cli-hooks-output.js +130 -0
  18. package/mcp/dist/cli-hooks-retrieval.js +2 -0
  19. package/mcp/dist/cli-hooks-session.js +1402 -0
  20. package/mcp/dist/cli-hooks.js +350 -0
  21. package/mcp/dist/cli-namespaces.js +989 -0
  22. package/mcp/dist/cli-ops.js +253 -0
  23. package/mcp/dist/cli-search.js +407 -0
  24. package/mcp/dist/cli.js +108 -0
  25. package/mcp/dist/content-archive.js +278 -0
  26. package/mcp/dist/content-citation.js +391 -0
  27. package/mcp/dist/content-dedup.js +622 -0
  28. package/mcp/dist/content-learning.js +472 -0
  29. package/mcp/dist/content-metadata.js +186 -0
  30. package/mcp/dist/content-validate.js +462 -0
  31. package/mcp/dist/core-finding.js +54 -0
  32. package/mcp/dist/core-project.js +36 -0
  33. package/mcp/dist/core-search.js +50 -0
  34. package/mcp/dist/data-access.js +400 -0
  35. package/mcp/dist/data-tasks.js +821 -0
  36. package/mcp/dist/embedding.js +344 -0
  37. package/mcp/dist/entrypoint.js +387 -0
  38. package/mcp/dist/finding-context.js +172 -0
  39. package/mcp/dist/finding-impact.js +181 -0
  40. package/mcp/dist/finding-journal.js +122 -0
  41. package/mcp/dist/finding-lifecycle.js +259 -0
  42. package/mcp/dist/governance-audit.js +22 -0
  43. package/mcp/dist/governance-locks.js +96 -0
  44. package/mcp/dist/governance-policy.js +648 -0
  45. package/mcp/dist/governance-scores.js +355 -0
  46. package/mcp/dist/hooks.js +449 -0
  47. package/mcp/dist/impact-scoring.js +22 -0
  48. package/mcp/dist/index-query.js +168 -0
  49. package/mcp/dist/index.js +205 -0
  50. package/mcp/dist/init-config.js +336 -0
  51. package/mcp/dist/init-preferences.js +62 -0
  52. package/mcp/dist/init-setup.js +1305 -0
  53. package/mcp/dist/init-shared.js +29 -0
  54. package/mcp/dist/init.js +1730 -0
  55. package/mcp/dist/link-checksums.js +62 -0
  56. package/mcp/dist/link-context.js +257 -0
  57. package/mcp/dist/link-doctor.js +591 -0
  58. package/mcp/dist/link-skills.js +212 -0
  59. package/mcp/dist/link.js +596 -0
  60. package/mcp/dist/logger.js +15 -0
  61. package/mcp/dist/machine-identity.js +38 -0
  62. package/mcp/dist/mcp-config.js +254 -0
  63. package/mcp/dist/mcp-data.js +315 -0
  64. package/mcp/dist/mcp-extract-facts.js +78 -0
  65. package/mcp/dist/mcp-extract.js +133 -0
  66. package/mcp/dist/mcp-finding.js +557 -0
  67. package/mcp/dist/mcp-graph.js +339 -0
  68. package/mcp/dist/mcp-hooks.js +256 -0
  69. package/mcp/dist/mcp-memory.js +58 -0
  70. package/mcp/dist/mcp-ops.js +328 -0
  71. package/mcp/dist/mcp-search.js +628 -0
  72. package/mcp/dist/mcp-session.js +651 -0
  73. package/mcp/dist/mcp-skills.js +189 -0
  74. package/mcp/dist/mcp-tasks.js +551 -0
  75. package/mcp/dist/mcp-types.js +7 -0
  76. package/mcp/dist/memory-ui-assets.js +6 -0
  77. package/mcp/dist/memory-ui-data.js +513 -0
  78. package/mcp/dist/memory-ui-graph.js +1910 -0
  79. package/mcp/dist/memory-ui-page.js +353 -0
  80. package/mcp/dist/memory-ui-scripts.js +1387 -0
  81. package/mcp/dist/memory-ui-server.js +1218 -0
  82. package/mcp/dist/memory-ui-styles.js +555 -0
  83. package/mcp/dist/memory-ui.js +9 -0
  84. package/mcp/dist/package-metadata.js +13 -0
  85. package/mcp/dist/phren-art.js +52 -0
  86. package/mcp/dist/phren-core.js +108 -0
  87. package/mcp/dist/phren-dotenv.js +67 -0
  88. package/mcp/dist/phren-paths.js +476 -0
  89. package/mcp/dist/proactivity.js +172 -0
  90. package/mcp/dist/profile-store.js +228 -0
  91. package/mcp/dist/project-config.js +85 -0
  92. package/mcp/dist/project-locator.js +25 -0
  93. package/mcp/dist/project-topics.js +1134 -0
  94. package/mcp/dist/provider-adapters.js +176 -0
  95. package/mcp/dist/runtime-profile.js +18 -0
  96. package/mcp/dist/session-checkpoints.js +131 -0
  97. package/mcp/dist/session-utils.js +68 -0
  98. package/mcp/dist/shared-content.js +8 -0
  99. package/mcp/dist/shared-embedding-cache.js +143 -0
  100. package/mcp/dist/shared-fragment-graph.js +456 -0
  101. package/mcp/dist/shared-governance.js +4 -0
  102. package/mcp/dist/shared-index.js +1334 -0
  103. package/mcp/dist/shared-ollama.js +192 -0
  104. package/mcp/dist/shared-paths.js +1 -0
  105. package/mcp/dist/shared-retrieval.js +796 -0
  106. package/mcp/dist/shared-search-fallback.js +375 -0
  107. package/mcp/dist/shared-sqljs.js +42 -0
  108. package/mcp/dist/shared-stemmer.js +171 -0
  109. package/mcp/dist/shared-vector-index.js +199 -0
  110. package/mcp/dist/shared.js +114 -0
  111. package/mcp/dist/shell-entry.js +209 -0
  112. package/mcp/dist/shell-input.js +943 -0
  113. package/mcp/dist/shell-palette.js +119 -0
  114. package/mcp/dist/shell-render.js +252 -0
  115. package/mcp/dist/shell-state-store.js +81 -0
  116. package/mcp/dist/shell-types.js +13 -0
  117. package/mcp/dist/shell-view-list.js +14 -0
  118. package/mcp/dist/shell-view.js +707 -0
  119. package/mcp/dist/shell.js +352 -0
  120. package/mcp/dist/skill-files.js +117 -0
  121. package/mcp/dist/skill-registry.js +279 -0
  122. package/mcp/dist/skill-state.js +28 -0
  123. package/mcp/dist/startup-embedding.js +57 -0
  124. package/mcp/dist/status.js +323 -0
  125. package/mcp/dist/synonyms.json +670 -0
  126. package/mcp/dist/task-hygiene.js +251 -0
  127. package/mcp/dist/task-lifecycle.js +347 -0
  128. package/mcp/dist/tasks-github.js +76 -0
  129. package/mcp/dist/telemetry.js +165 -0
  130. package/mcp/dist/test-global-setup.js +37 -0
  131. package/mcp/dist/tool-registry.js +104 -0
  132. package/mcp/dist/update.js +97 -0
  133. package/mcp/dist/utils.js +543 -0
  134. package/package.json +67 -0
  135. package/skills/README.md +7 -0
  136. package/skills/consolidate/SKILL.md +152 -0
  137. package/skills/discover/SKILL.md +175 -0
  138. package/skills/init/SKILL.md +216 -0
  139. package/skills/profiles/SKILL.md +121 -0
  140. package/skills/sync/SKILL.md +261 -0
  141. package/starter/README.md +74 -0
  142. package/starter/global/CLAUDE.md +89 -0
  143. package/starter/global/skills/humanize.md +30 -0
  144. package/starter/global/skills/pipeline.md +35 -0
  145. package/starter/global/skills/release.md +35 -0
  146. package/starter/machines.yaml +8 -0
  147. package/starter/my-api/.claude/skills/README.md +7 -0
  148. package/starter/my-api/CLAUDE.md +33 -0
  149. package/starter/my-api/FINDINGS.md +9 -0
  150. package/starter/my-api/summary.md +7 -0
  151. package/starter/my-api/tasks.md +7 -0
  152. package/starter/my-first-project/.claude/skills/README.md +7 -0
  153. package/starter/my-first-project/CLAUDE.md +49 -0
  154. package/starter/my-first-project/FINDINGS.md +24 -0
  155. package/starter/my-first-project/summary.md +11 -0
  156. package/starter/my-first-project/tasks.md +25 -0
  157. package/starter/my-frontend/.claude/skills/README.md +7 -0
  158. package/starter/my-frontend/CLAUDE.md +33 -0
  159. package/starter/my-frontend/FINDINGS.md +9 -0
  160. package/starter/my-frontend/summary.md +7 -0
  161. package/starter/my-frontend/tasks.md +7 -0
  162. package/starter/profiles/default.yaml +4 -0
  163. package/starter/profiles/personal.yaml +4 -0
  164. package/starter/profiles/work.yaml +4 -0
  165. package/starter/templates/README.md +7 -0
  166. package/starter/templates/frontend/CLAUDE.md +23 -0
  167. package/starter/templates/frontend/FINDINGS.md +7 -0
  168. package/starter/templates/frontend/reference/README.md +4 -0
  169. package/starter/templates/frontend/summary.md +7 -0
  170. package/starter/templates/frontend/tasks.md +11 -0
  171. package/starter/templates/library/CLAUDE.md +22 -0
  172. package/starter/templates/library/FINDINGS.md +7 -0
  173. package/starter/templates/library/reference/README.md +4 -0
  174. package/starter/templates/library/summary.md +7 -0
  175. package/starter/templates/library/tasks.md +11 -0
  176. package/starter/templates/monorepo/CLAUDE.md +21 -0
  177. package/starter/templates/monorepo/FINDINGS.md +7 -0
  178. package/starter/templates/monorepo/reference/README.md +4 -0
  179. package/starter/templates/monorepo/summary.md +7 -0
  180. package/starter/templates/monorepo/tasks.md +11 -0
  181. package/starter/templates/python-project/CLAUDE.md +21 -0
  182. package/starter/templates/python-project/FINDINGS.md +7 -0
  183. package/starter/templates/python-project/reference/README.md +4 -0
  184. package/starter/templates/python-project/summary.md +7 -0
  185. package/starter/templates/python-project/tasks.md +10 -0
@@ -0,0 +1,24 @@
1
+ # my-first-project findings
2
+
3
+ Fragments accumulated over time. Captured automatically during sessions and committed on exit.
4
+
5
+ <!-- How findings work:
6
+
7
+ Phren captures insights as you code. When Claude discovers something non-obvious
8
+ (a pitfall, a pattern, a decision with context), it calls add_finding() and the
9
+ insight lands here. The Stop hook auto-commits after every response.
10
+
11
+ Entries are grouped by date. Old entries get confidence-decayed over time, so stale
12
+ findings fade from retrieval naturally. You can remove wrong entries with
13
+ remove_finding() or clean up bulk with `phren shell` > :find remove.
14
+
15
+ Example entries (delete these once you have real ones):
16
+
17
+ ## 2026-03-06
18
+
19
+ - The auth middleware runs before rate limiting, order matters in the middleware stack
20
+ <!-- phren:cite {"created_at":"2026-03-06T00:00:00.000Z"} -->
21
+ - `npm run dev` needs PORT set or it defaults to 3001, not 3000
22
+ <!-- phren:cite {"created_at":"2026-03-06T00:00:00.000Z"} -->
23
+
24
+ -->
@@ -0,0 +1,11 @@
1
+ # my-first-project
2
+
3
+ **What:** Replace this with one sentence about what the project does
4
+ **Stack:** The key tech: language, framework, main deps
5
+ **Status:** active
6
+ **Run:** the command you use most (e.g. npm run dev)
7
+ **Watch out:** the one thing that will bite you if you forget it
8
+
9
+ <!-- This summary is the first thing phren shows Claude about your project.
10
+ Keep it short: 5 lines max. Think of it as the elevator pitch that helps
11
+ Claude understand what it's working on before reading any code. -->
@@ -0,0 +1,25 @@
1
+ # my-first-project tasks
2
+
3
+ ## Active
4
+
5
+ ### P0: Getting started
6
+
7
+ - [ ] Fill in CLAUDE.md with your project's commands, architecture, and conventions
8
+ - [ ] Update summary.md with a real description of your project
9
+
10
+ ## Queue
11
+
12
+ ### P1: Phren setup
13
+
14
+ - [ ] Push this phren repo to a private GitHub repo for backup
15
+ - [ ] Run `phren doctor` to verify everything is wired up
16
+ - [ ] Add a second project with `phren-init <name>` or `phren shell`
17
+
18
+ ### P2: Nice to have
19
+
20
+ - [ ] Set up profiles for work vs personal machines in profiles/
21
+ - [ ] Add project-specific skills to the project `skills/` directory
22
+
23
+ ## Done
24
+
25
+ - [x] Run `npx phren init` to set up phren
@@ -0,0 +1,7 @@
1
+ # my-frontend skills
2
+
3
+ | Skill | What it does |
4
+ |-------|-------------|
5
+ | `/verify` | Pre-commit gate |
6
+
7
+ Add project-specific skills here.
@@ -0,0 +1,33 @@
1
+ # CLAUDE.md
2
+
3
+ ## Project overview
4
+
5
+ **Purpose**: Frontend app. Replace this with a real description of what it does.
6
+ **Stack**: React, TypeScript, Vite (or whatever you're using)
7
+ **Status**: active
8
+ **Version**: 0.0.0
9
+
10
+ ## Commands
11
+
12
+ ```bash
13
+ # Install: npm install
14
+ # Run: npm run dev
15
+ # Test: npm test
16
+ # Build: npm run build
17
+ ```
18
+
19
+ ## Project skills
20
+
21
+ Source skills live in the phren project `skills/` directory. Phren resolves global + project-local skills and mirrors the effective set into repo-local `.claude/skills/`.
22
+
23
+ ## Architecture
24
+
25
+ <!-- Component structure, routing, state management approach -->
26
+
27
+ ## Key patterns
28
+
29
+ <!-- Naming rules, component patterns, things to never do -->
30
+
31
+ <!-- Tip: If this file grows past ~100 lines, split it using @import directives.
32
+ Example: @CLAUDE-architecture.md, @CLAUDE-commands.md, @CLAUDE-conventions.md
33
+ See phren README for details. -->
@@ -0,0 +1,9 @@
1
+ # my-frontend findings
2
+
3
+ Findings accumulated over time. Captured automatically during sessions and committed on exit.
4
+
5
+ <!-- Example entry:
6
+ ## 2026-03-04
7
+ - HMR breaks if you rename a component file without restarting the dev server
8
+ - The API base URL in .env.local must not have a trailing slash
9
+ -->
@@ -0,0 +1,7 @@
1
+ # my-frontend
2
+
3
+ **What:** Frontend app: replace with what yours actually does
4
+ **Stack:** React, TypeScript, Vite (or whatever you're using)
5
+ **Status:** active
6
+ **Run:** npm run dev
7
+ **Watch out:** API base URL set in .env.local: needs to match whatever port my-api runs on
@@ -0,0 +1,7 @@
1
+ # my-frontend tasks
2
+
3
+ ## Active
4
+
5
+ ## Queue
6
+
7
+ - [ ] Add your tasks here
@@ -0,0 +1,4 @@
1
+ name: default
2
+ description: Default profile
3
+ projects:
4
+ - global
@@ -0,0 +1,4 @@
1
+ name: personal
2
+ description: "Personal machine defaults"
3
+ projects:
4
+ - global
@@ -0,0 +1,4 @@
1
+ name: work
2
+ description: "Work machine defaults"
3
+ projects:
4
+ - global
@@ -0,0 +1,7 @@
1
+ # starter/templates/
2
+
3
+ Project templates bundled in the npm package, used by `npx phren init --template <name>`.
4
+
5
+ Each subdirectory (frontend, library, monorepo, python-project) contains pre-filled project files with sensible defaults for that project type. When a user runs init with `--template`, these files are copied into their `~/.phren/<project>/` directory. For other project types, adaptive init infers topics and structure from repo content.
6
+
7
+ Users interact with this directory indirectly through the `--template` flag during init. To add a new template type, create a subdirectory here with the standard project files.
@@ -0,0 +1,23 @@
1
+ # {{project}}
2
+
3
+ Frontend application.
4
+
5
+ ## Commands
6
+
7
+ ```bash
8
+ npm install
9
+ npm run dev
10
+ npm run build
11
+ npm test
12
+ ```
13
+
14
+ ## Architecture
15
+
16
+ <!-- Fill in: routing, state management, component structure -->
17
+
18
+ ## Conventions
19
+
20
+ - Components in src/components/
21
+ - Pages/routes in src/pages/ or src/routes/
22
+ - Shared utilities in src/lib/
23
+ - CSS modules or Tailwind for styling
@@ -0,0 +1,7 @@
1
+ # {{project}} Findings
2
+
3
+ <!-- consolidated: 2024-01-01 -->
4
+
5
+ ## {{date}}
6
+
7
+ - Example: component hot reload breaks when editing files imported by both client and server bundles. Move shared types to a separate module.
@@ -0,0 +1,4 @@
1
+ # {{project}} Reference
2
+
3
+ Deep reference material: API details, data models, integration specs.
4
+ Too long for CLAUDE.md? Put it here. Phren indexes these files automatically.
@@ -0,0 +1,7 @@
1
+ # {{project}}
2
+
3
+ What: Frontend web application
4
+ Stack: TypeScript, React
5
+ Status: new
6
+ Run: `npm run dev`
7
+ Watch out: check node version matches .nvmrc
@@ -0,0 +1,11 @@
1
+ # {{project}} tasks
2
+
3
+ ## Active
4
+
5
+ ## Queue
6
+
7
+ - Set up routing
8
+ - Add authentication flow
9
+ - Configure deployment pipeline
10
+
11
+ ## Done
@@ -0,0 +1,22 @@
1
+ # {{project}}
2
+
3
+ Reusable library published to a package registry.
4
+
5
+ ## Commands
6
+
7
+ ```bash
8
+ npm install
9
+ npm run build
10
+ npm test
11
+ npm publish
12
+ ```
13
+
14
+ ## Architecture
15
+
16
+ <!-- Fill in: entry point, exports, module format -->
17
+
18
+ ## Conventions
19
+
20
+ - Source in src/, tests in src/ alongside modules
21
+ - Exports defined in package.json exports field
22
+ - Semantic versioning, changelog on every release
@@ -0,0 +1,7 @@
1
+ # {{project}} Findings
2
+
3
+ <!-- consolidated: 2024-01-01 -->
4
+
5
+ ## {{date}}
6
+
7
+ - Example: dual CJS/ESM builds need separate tsconfig files. A single config with `module: "NodeNext"` only covers one output format.
@@ -0,0 +1,4 @@
1
+ # {{project}} Reference
2
+
3
+ Deep reference material: API details, data models, integration specs.
4
+ Too long for CLAUDE.md? Put it here. Phren indexes these files automatically.
@@ -0,0 +1,7 @@
1
+ # {{project}}
2
+
3
+ What: Reusable library
4
+ Stack: TypeScript, vitest
5
+ Status: new
6
+ Run: `npm test`
7
+ Watch out: build before publish
@@ -0,0 +1,11 @@
1
+ # {{project}} tasks
2
+
3
+ ## Active
4
+
5
+ ## Queue
6
+
7
+ - Define public API surface
8
+ - Add usage examples to README
9
+ - Set up CI with automated publishing
10
+
11
+ ## Done
@@ -0,0 +1,21 @@
1
+ # {{project}}
2
+
3
+ Monorepo with multiple packages.
4
+
5
+ ## Commands
6
+
7
+ ```bash
8
+ npm install
9
+ npm run build --workspaces
10
+ npm test --workspaces
11
+ ```
12
+
13
+ ## Architecture
14
+
15
+ <!-- Fill in package layout and dependencies -->
16
+
17
+ ## Conventions
18
+
19
+ - Each package in packages/ is independently versioned
20
+ - Shared types in packages/shared
21
+ - Use workspace references for inter-package deps
@@ -0,0 +1,7 @@
1
+ # {{project}} Findings
2
+
3
+ <!-- consolidated: 2024-01-01 -->
4
+
5
+ ## {{date}}
6
+
7
+ - Example: workspace hoisting can shadow a package's own dependency version. Pin critical deps in each package.json, not just the root.
@@ -0,0 +1,4 @@
1
+ # {{project}} Reference
2
+
3
+ Deep reference material: API details, data models, integration specs.
4
+ Too long for CLAUDE.md? Put it here. Phren indexes these files automatically.
@@ -0,0 +1,7 @@
1
+ # {{project}}
2
+
3
+ What: Monorepo with multiple packages
4
+ Stack: TypeScript, npm workspaces
5
+ Status: new
6
+ Run: `npm run dev`
7
+ Watch out: install from root, not inside individual packages
@@ -0,0 +1,11 @@
1
+ # {{project}} tasks
2
+
3
+ ## Active
4
+
5
+ ## Queue
6
+
7
+ - Define package boundaries
8
+ - Set up shared build pipeline
9
+ - Add changeset for versioning
10
+
11
+ ## Done
@@ -0,0 +1,21 @@
1
+ # {{project}}
2
+
3
+ Python project.
4
+
5
+ ## Commands
6
+
7
+ ```bash
8
+ python -m venv .venv && source .venv/bin/activate
9
+ pip install -e ".[dev]"
10
+ pytest
11
+ ```
12
+
13
+ ## Architecture
14
+
15
+ <!-- Fill in as the project grows -->
16
+
17
+ ## Conventions
18
+
19
+ - Use pyproject.toml for packaging
20
+ - Type hints on public APIs
21
+ - Tests in tests/ directory
@@ -0,0 +1,7 @@
1
+ # {{project}} Findings
2
+
3
+ <!-- consolidated: 2024-01-01 -->
4
+
5
+ ## {{date}}
6
+
7
+ - Example: `pip install -e .` with pyproject.toml requires the build backend (setuptools/hatchling) listed in build-system.requires, not just in dev deps.
@@ -0,0 +1,4 @@
1
+ # {{project}} Reference
2
+
3
+ Deep reference material: API details, data models, integration specs.
4
+ Too long for CLAUDE.md? Put it here. Phren indexes these files automatically.
@@ -0,0 +1,7 @@
1
+ # {{project}}
2
+
3
+ What: Python project
4
+ Stack: Python, pytest
5
+ Status: new
6
+ Run: `pytest`
7
+ Watch out: activate venv before running
@@ -0,0 +1,10 @@
1
+ # {{project}} tasks
2
+
3
+ ## Active
4
+
5
+ ## Queue
6
+
7
+ - Set up CI pipeline
8
+ - Add type checking with mypy
9
+
10
+ ## Done