@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.
- package/LICENSE +21 -0
- package/README.md +590 -0
- package/mcp/dist/capabilities/cli.js +61 -0
- package/mcp/dist/capabilities/index.js +15 -0
- package/mcp/dist/capabilities/mcp.js +61 -0
- package/mcp/dist/capabilities/types.js +57 -0
- package/mcp/dist/capabilities/vscode.js +61 -0
- package/mcp/dist/capabilities/web-ui.js +61 -0
- package/mcp/dist/cli-actions.js +302 -0
- package/mcp/dist/cli-config.js +580 -0
- package/mcp/dist/cli-extract.js +305 -0
- package/mcp/dist/cli-govern.js +371 -0
- package/mcp/dist/cli-graph.js +169 -0
- package/mcp/dist/cli-hooks-citations.js +44 -0
- package/mcp/dist/cli-hooks-context.js +56 -0
- package/mcp/dist/cli-hooks-globs.js +83 -0
- package/mcp/dist/cli-hooks-output.js +130 -0
- package/mcp/dist/cli-hooks-retrieval.js +2 -0
- package/mcp/dist/cli-hooks-session.js +1402 -0
- package/mcp/dist/cli-hooks.js +350 -0
- package/mcp/dist/cli-namespaces.js +989 -0
- package/mcp/dist/cli-ops.js +253 -0
- package/mcp/dist/cli-search.js +407 -0
- package/mcp/dist/cli.js +108 -0
- package/mcp/dist/content-archive.js +278 -0
- package/mcp/dist/content-citation.js +391 -0
- package/mcp/dist/content-dedup.js +622 -0
- package/mcp/dist/content-learning.js +472 -0
- package/mcp/dist/content-metadata.js +186 -0
- package/mcp/dist/content-validate.js +462 -0
- package/mcp/dist/core-finding.js +54 -0
- package/mcp/dist/core-project.js +36 -0
- package/mcp/dist/core-search.js +50 -0
- package/mcp/dist/data-access.js +400 -0
- package/mcp/dist/data-tasks.js +821 -0
- package/mcp/dist/embedding.js +344 -0
- package/mcp/dist/entrypoint.js +387 -0
- package/mcp/dist/finding-context.js +172 -0
- package/mcp/dist/finding-impact.js +181 -0
- package/mcp/dist/finding-journal.js +122 -0
- package/mcp/dist/finding-lifecycle.js +259 -0
- package/mcp/dist/governance-audit.js +22 -0
- package/mcp/dist/governance-locks.js +96 -0
- package/mcp/dist/governance-policy.js +648 -0
- package/mcp/dist/governance-scores.js +355 -0
- package/mcp/dist/hooks.js +449 -0
- package/mcp/dist/impact-scoring.js +22 -0
- package/mcp/dist/index-query.js +168 -0
- package/mcp/dist/index.js +205 -0
- package/mcp/dist/init-config.js +336 -0
- package/mcp/dist/init-preferences.js +62 -0
- package/mcp/dist/init-setup.js +1305 -0
- package/mcp/dist/init-shared.js +29 -0
- package/mcp/dist/init.js +1730 -0
- package/mcp/dist/link-checksums.js +62 -0
- package/mcp/dist/link-context.js +257 -0
- package/mcp/dist/link-doctor.js +591 -0
- package/mcp/dist/link-skills.js +212 -0
- package/mcp/dist/link.js +596 -0
- package/mcp/dist/logger.js +15 -0
- package/mcp/dist/machine-identity.js +38 -0
- package/mcp/dist/mcp-config.js +254 -0
- package/mcp/dist/mcp-data.js +315 -0
- package/mcp/dist/mcp-extract-facts.js +78 -0
- package/mcp/dist/mcp-extract.js +133 -0
- package/mcp/dist/mcp-finding.js +557 -0
- package/mcp/dist/mcp-graph.js +339 -0
- package/mcp/dist/mcp-hooks.js +256 -0
- package/mcp/dist/mcp-memory.js +58 -0
- package/mcp/dist/mcp-ops.js +328 -0
- package/mcp/dist/mcp-search.js +628 -0
- package/mcp/dist/mcp-session.js +651 -0
- package/mcp/dist/mcp-skills.js +189 -0
- package/mcp/dist/mcp-tasks.js +551 -0
- package/mcp/dist/mcp-types.js +7 -0
- package/mcp/dist/memory-ui-assets.js +6 -0
- package/mcp/dist/memory-ui-data.js +513 -0
- package/mcp/dist/memory-ui-graph.js +1910 -0
- package/mcp/dist/memory-ui-page.js +353 -0
- package/mcp/dist/memory-ui-scripts.js +1387 -0
- package/mcp/dist/memory-ui-server.js +1218 -0
- package/mcp/dist/memory-ui-styles.js +555 -0
- package/mcp/dist/memory-ui.js +9 -0
- package/mcp/dist/package-metadata.js +13 -0
- package/mcp/dist/phren-art.js +52 -0
- package/mcp/dist/phren-core.js +108 -0
- package/mcp/dist/phren-dotenv.js +67 -0
- package/mcp/dist/phren-paths.js +476 -0
- package/mcp/dist/proactivity.js +172 -0
- package/mcp/dist/profile-store.js +228 -0
- package/mcp/dist/project-config.js +85 -0
- package/mcp/dist/project-locator.js +25 -0
- package/mcp/dist/project-topics.js +1134 -0
- package/mcp/dist/provider-adapters.js +176 -0
- package/mcp/dist/runtime-profile.js +18 -0
- package/mcp/dist/session-checkpoints.js +131 -0
- package/mcp/dist/session-utils.js +68 -0
- package/mcp/dist/shared-content.js +8 -0
- package/mcp/dist/shared-embedding-cache.js +143 -0
- package/mcp/dist/shared-fragment-graph.js +456 -0
- package/mcp/dist/shared-governance.js +4 -0
- package/mcp/dist/shared-index.js +1334 -0
- package/mcp/dist/shared-ollama.js +192 -0
- package/mcp/dist/shared-paths.js +1 -0
- package/mcp/dist/shared-retrieval.js +796 -0
- package/mcp/dist/shared-search-fallback.js +375 -0
- package/mcp/dist/shared-sqljs.js +42 -0
- package/mcp/dist/shared-stemmer.js +171 -0
- package/mcp/dist/shared-vector-index.js +199 -0
- package/mcp/dist/shared.js +114 -0
- package/mcp/dist/shell-entry.js +209 -0
- package/mcp/dist/shell-input.js +943 -0
- package/mcp/dist/shell-palette.js +119 -0
- package/mcp/dist/shell-render.js +252 -0
- package/mcp/dist/shell-state-store.js +81 -0
- package/mcp/dist/shell-types.js +13 -0
- package/mcp/dist/shell-view-list.js +14 -0
- package/mcp/dist/shell-view.js +707 -0
- package/mcp/dist/shell.js +352 -0
- package/mcp/dist/skill-files.js +117 -0
- package/mcp/dist/skill-registry.js +279 -0
- package/mcp/dist/skill-state.js +28 -0
- package/mcp/dist/startup-embedding.js +57 -0
- package/mcp/dist/status.js +323 -0
- package/mcp/dist/synonyms.json +670 -0
- package/mcp/dist/task-hygiene.js +251 -0
- package/mcp/dist/task-lifecycle.js +347 -0
- package/mcp/dist/tasks-github.js +76 -0
- package/mcp/dist/telemetry.js +165 -0
- package/mcp/dist/test-global-setup.js +37 -0
- package/mcp/dist/tool-registry.js +104 -0
- package/mcp/dist/update.js +97 -0
- package/mcp/dist/utils.js +543 -0
- package/package.json +67 -0
- package/skills/README.md +7 -0
- package/skills/consolidate/SKILL.md +152 -0
- package/skills/discover/SKILL.md +175 -0
- package/skills/init/SKILL.md +216 -0
- package/skills/profiles/SKILL.md +121 -0
- package/skills/sync/SKILL.md +261 -0
- package/starter/README.md +74 -0
- package/starter/global/CLAUDE.md +89 -0
- package/starter/global/skills/humanize.md +30 -0
- package/starter/global/skills/pipeline.md +35 -0
- package/starter/global/skills/release.md +35 -0
- package/starter/machines.yaml +8 -0
- package/starter/my-api/.claude/skills/README.md +7 -0
- package/starter/my-api/CLAUDE.md +33 -0
- package/starter/my-api/FINDINGS.md +9 -0
- package/starter/my-api/summary.md +7 -0
- package/starter/my-api/tasks.md +7 -0
- package/starter/my-first-project/.claude/skills/README.md +7 -0
- package/starter/my-first-project/CLAUDE.md +49 -0
- package/starter/my-first-project/FINDINGS.md +24 -0
- package/starter/my-first-project/summary.md +11 -0
- package/starter/my-first-project/tasks.md +25 -0
- package/starter/my-frontend/.claude/skills/README.md +7 -0
- package/starter/my-frontend/CLAUDE.md +33 -0
- package/starter/my-frontend/FINDINGS.md +9 -0
- package/starter/my-frontend/summary.md +7 -0
- package/starter/my-frontend/tasks.md +7 -0
- package/starter/profiles/default.yaml +4 -0
- package/starter/profiles/personal.yaml +4 -0
- package/starter/profiles/work.yaml +4 -0
- package/starter/templates/README.md +7 -0
- package/starter/templates/frontend/CLAUDE.md +23 -0
- package/starter/templates/frontend/FINDINGS.md +7 -0
- package/starter/templates/frontend/reference/README.md +4 -0
- package/starter/templates/frontend/summary.md +7 -0
- package/starter/templates/frontend/tasks.md +11 -0
- package/starter/templates/library/CLAUDE.md +22 -0
- package/starter/templates/library/FINDINGS.md +7 -0
- package/starter/templates/library/reference/README.md +4 -0
- package/starter/templates/library/summary.md +7 -0
- package/starter/templates/library/tasks.md +11 -0
- package/starter/templates/monorepo/CLAUDE.md +21 -0
- package/starter/templates/monorepo/FINDINGS.md +7 -0
- package/starter/templates/monorepo/reference/README.md +4 -0
- package/starter/templates/monorepo/summary.md +7 -0
- package/starter/templates/monorepo/tasks.md +11 -0
- package/starter/templates/python-project/CLAUDE.md +21 -0
- package/starter/templates/python-project/FINDINGS.md +7 -0
- package/starter/templates/python-project/reference/README.md +4 -0
- package/starter/templates/python-project/summary.md +7 -0
- package/starter/templates/python-project/tasks.md +10 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: consolidate
|
|
3
|
+
description: Find patterns across project findings and surface insights that apply everywhere.
|
|
4
|
+
dependencies:
|
|
5
|
+
- git
|
|
6
|
+
---
|
|
7
|
+
# phren-consolidate - Cross-project synthesis
|
|
8
|
+
|
|
9
|
+
> Find patterns across project findings and surface insights that apply everywhere.
|
|
10
|
+
|
|
11
|
+
Read every project's FINDINGS.md, find patterns that show up across multiple projects, and write them to a shared global findings file.
|
|
12
|
+
|
|
13
|
+
The point: something you learned on one project probably applies elsewhere. Phren connects those fragments across projects.
|
|
14
|
+
|
|
15
|
+
## Prerequisites
|
|
16
|
+
|
|
17
|
+
This skill needs at least two projects with FINDINGS.md files to be useful. If you haven't captured any findings yet, use `add_finding()` during a session first.
|
|
18
|
+
|
|
19
|
+
**Works with or without profiles.** If profiles are set up, it scans projects in the active profile. If not, it scans all project directories in the phren repo.
|
|
20
|
+
|
|
21
|
+
## When to run
|
|
22
|
+
|
|
23
|
+
- Monthly, or when the user asks
|
|
24
|
+
- After a burst of work across multiple projects
|
|
25
|
+
- When starting a new project (to seed it with relevant cross-cutting knowledge)
|
|
26
|
+
|
|
27
|
+
## What to do
|
|
28
|
+
|
|
29
|
+
### 1. Find the phren directory
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
PHREN_DIR="${PHREN_DIR:-$HOME/.phren}"
|
|
33
|
+
ls "$PHREN_DIR" 2>/dev/null
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
If it doesn't exist, tell the user:
|
|
37
|
+
> "No phren directory found at ~/.phren. This skill needs a phren repo with project findings. Run `phren-init` to set one up, or set PHREN_DIR if yours is elsewhere."
|
|
38
|
+
|
|
39
|
+
### 2. Gather ALL findings
|
|
40
|
+
|
|
41
|
+
Try the profile-aware path first, fall back to scanning all directories:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
MACHINE=$(cat ~/.phren/.machine-id 2>/dev/null || hostname)
|
|
45
|
+
# look up profile in machines.yaml to get the project list
|
|
46
|
+
|
|
47
|
+
# fallback: scan all project directories
|
|
48
|
+
FINDINGS_FILES=()
|
|
49
|
+
for dir in "$PHREN_DIR"/*/; do
|
|
50
|
+
if [ -f "$dir/FINDINGS.md" ]; then
|
|
51
|
+
PROJECT_NAME=$(basename "$dir")
|
|
52
|
+
FINDINGS_FILES+=("$PROJECT_NAME:$dir/FINDINGS.md")
|
|
53
|
+
fi
|
|
54
|
+
done
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Read **every** FINDINGS.md file found. Don't sample or skip any. For each file, track which project it came from.
|
|
58
|
+
|
|
59
|
+
If no FINDINGS.md files exist anywhere, tell the user:
|
|
60
|
+
> "No FINDINGS.md files found in any project. Use `add_finding()` during a work session to start capturing findings."
|
|
61
|
+
|
|
62
|
+
If only one project has a FINDINGS.md, tell the user:
|
|
63
|
+
> "Only found findings for <project>. Need at least two projects to find cross-cutting patterns. Use `add_finding()` in other projects first."
|
|
64
|
+
|
|
65
|
+
### 3. Find cross-cutting patterns
|
|
66
|
+
|
|
67
|
+
Compare findings across all projects. A pattern counts as cross-cutting when the **same insight, technique, or pitfall** appears in 2+ projects. Don't just look for keyword overlap; look for conceptual overlap.
|
|
68
|
+
|
|
69
|
+
Be specific. Not "testing is important" but "mocking at service boundaries instead of HTTP layer caught integration bugs in both my-app and backend."
|
|
70
|
+
|
|
71
|
+
Common categories (use only the ones that have actual matches):
|
|
72
|
+
|
|
73
|
+
- **Build and tooling**: cache issues, config pitfalls, CI patterns
|
|
74
|
+
- **Testing**: mocking strategies, fixture patterns, what to test vs skip
|
|
75
|
+
- **TypeScript/JS**: type tricks, async pitfalls, framework quirks
|
|
76
|
+
- **State management**: reactivity pitfalls, update ordering, stale closures
|
|
77
|
+
- **API patterns**: error handling, retry logic, auth flows
|
|
78
|
+
- **Performance**: what actually mattered vs premature optimization
|
|
79
|
+
- **Git and workflow**: branching patterns, commit conventions, release steps
|
|
80
|
+
- **Dependencies**: version conflicts, peer dep issues, lock file handling
|
|
81
|
+
|
|
82
|
+
Don't force categories. If only one project mentions something, it stays project-specific. If a pattern genuinely spans projects, include it even if it doesn't fit a neat category.
|
|
83
|
+
|
|
84
|
+
### 4. Check existing global findings
|
|
85
|
+
|
|
86
|
+
Before writing, read `$PHREN_DIR/global/FINDINGS.md` if it exists. Don't duplicate entries that are already there. Update existing entries if there's new evidence or additional projects that confirm the pattern.
|
|
87
|
+
|
|
88
|
+
### 5. Write global findings
|
|
89
|
+
|
|
90
|
+
File: `$PHREN_DIR/global/FINDINGS.md`
|
|
91
|
+
|
|
92
|
+
```markdown
|
|
93
|
+
# Cross-project findings
|
|
94
|
+
|
|
95
|
+
Last consolidated: <date>
|
|
96
|
+
Sources: <list of project names scanned>
|
|
97
|
+
|
|
98
|
+
## Build and tooling
|
|
99
|
+
- Clear dist/ after any tsconfig change, the build cache doesn't invalidate (my-app, backend)
|
|
100
|
+
- Lock file conflicts: delete and regenerate, don't try to merge (my-app, frontend)
|
|
101
|
+
|
|
102
|
+
## Testing
|
|
103
|
+
- Mock at the service boundary, not the HTTP layer (backend, frontend)
|
|
104
|
+
- Session-scoped fixtures cause flaky parallel tests (backend, my-app)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Rules for each entry:
|
|
108
|
+
- Include which projects it came from in parentheses
|
|
109
|
+
- Be specific enough that someone could act on it without reading the original findings
|
|
110
|
+
- If two projects describe the same thing differently, synthesize into one clear statement
|
|
111
|
+
- Keep entries to 1-2 lines max
|
|
112
|
+
|
|
113
|
+
### 6. Report
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
phren-consolidate
|
|
117
|
+
|
|
118
|
+
Scanned: my-app (12 findings), backend (8 findings), frontend (5 findings)
|
|
119
|
+
|
|
120
|
+
Found 6 cross-cutting patterns:
|
|
121
|
+
Build: 2 patterns (cache invalidation, lock file handling)
|
|
122
|
+
Testing: 2 patterns (mock boundaries, fixture scoping)
|
|
123
|
+
TypeScript: 2 patterns (strict nulls, path aliases)
|
|
124
|
+
|
|
125
|
+
New patterns added: 4
|
|
126
|
+
Existing patterns updated: 2 (added new project evidence)
|
|
127
|
+
Skipped: 0 (already captured)
|
|
128
|
+
|
|
129
|
+
Updated: $PHREN_DIR/global/FINDINGS.md
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### 7. Commit (if git repo)
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
cd "$PHREN_DIR"
|
|
136
|
+
git add global/FINDINGS.md
|
|
137
|
+
git commit -m "update global findings"
|
|
138
|
+
git push # only if remote exists
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## What not to do
|
|
142
|
+
|
|
143
|
+
- Don't include findings that only apply to one project. Those stay in the project's own file.
|
|
144
|
+
- Don't water down specifics to make them "general." If it's about Angular signals specifically, say so.
|
|
145
|
+
- Don't duplicate what's already in global findings. Update existing entries if there's new evidence.
|
|
146
|
+
- Don't create a wall of text. Keep it scannable. Bullet points, grouped by theme.
|
|
147
|
+
- Don't invent patterns. If two findings use the same word but describe different problems, they're not a pattern.
|
|
148
|
+
|
|
149
|
+
## Related skills
|
|
150
|
+
|
|
151
|
+
- `add_finding()`: capture findings during a session via MCP
|
|
152
|
+
- `phren-sync`: sync the consolidated findings to other machines
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: discover
|
|
3
|
+
description: Audit your phren repo and tell you exactly what needs attention.
|
|
4
|
+
dependencies:
|
|
5
|
+
- git
|
|
6
|
+
- gh
|
|
7
|
+
---
|
|
8
|
+
# phren-discover - Phren health check
|
|
9
|
+
|
|
10
|
+
> Let phren audit your project store and tell you exactly what needs attention.
|
|
11
|
+
|
|
12
|
+
Phren scans your project directory for missing files, stale content, skill gaps, and stuck task items. He outputs a concrete, prioritized action list.
|
|
13
|
+
|
|
14
|
+
**Works standalone.** Just needs a phren directory.
|
|
15
|
+
|
|
16
|
+
## When to run
|
|
17
|
+
|
|
18
|
+
- Weekly or monthly maintenance
|
|
19
|
+
- When you feel like things are getting messy
|
|
20
|
+
- Before starting a new project (to see what you've been neglecting)
|
|
21
|
+
- When the user asks "what should I work on"
|
|
22
|
+
|
|
23
|
+
## What to do
|
|
24
|
+
|
|
25
|
+
### 1. Find the phren directory
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
PHREN_DIR="${PHREN_DIR:-$HOME/.phren}"
|
|
29
|
+
ls "$PHREN_DIR" 2>/dev/null
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
If it doesn't exist:
|
|
33
|
+
> "No phren directory found at ~/.phren. Run `phren-init` to set one up."
|
|
34
|
+
|
|
35
|
+
### 2. Scan all projects
|
|
36
|
+
|
|
37
|
+
For each project directory in `$PHREN_DIR/*/` (skip `global/`, `profiles/`):
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
for dir in "$PHREN_DIR"/*/; do
|
|
41
|
+
PROJECT=$(basename "$dir")
|
|
42
|
+
[ "$PROJECT" = "global" ] || [ "$PROJECT" = "profiles" ] && continue
|
|
43
|
+
|
|
44
|
+
[ -f "$dir/CLAUDE.md" ] && echo "$PROJECT: has CLAUDE.md" || echo "$PROJECT: MISSING CLAUDE.md"
|
|
45
|
+
[ -f "$dir/summary.md" ] && echo "$PROJECT: has summary.md" || echo "$PROJECT: MISSING summary.md"
|
|
46
|
+
[ -f "$dir/FINDINGS.md" ] && echo "$PROJECT: has FINDINGS.md" || echo "$PROJECT: MISSING FINDINGS.md"
|
|
47
|
+
[ -f "$dir/tasks.md" ] && echo "$PROJECT: has tasks.md" || echo "$PROJECT: MISSING tasks.md"
|
|
48
|
+
done
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 3. Check staleness
|
|
52
|
+
|
|
53
|
+
For projects that are in a git-tracked phren, check when files were last modified:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
cd "$PHREN_DIR"
|
|
57
|
+
for dir in */; do
|
|
58
|
+
PROJECT=$(basename "$dir")
|
|
59
|
+
[ "$PROJECT" = "global" ] || [ "$PROJECT" = "profiles" ] && continue
|
|
60
|
+
|
|
61
|
+
if [ -f "$dir/FINDINGS.md" ]; then
|
|
62
|
+
LAST_MODIFIED=$(git log -1 --format="%cr" -- "$dir/FINDINGS.md" 2>/dev/null || stat -c %Y "$dir/FINDINGS.md" 2>/dev/null || stat -f %m "$dir/FINDINGS.md" 2>/dev/null)
|
|
63
|
+
echo "$PROJECT/FINDINGS.md: last updated $LAST_MODIFIED"
|
|
64
|
+
fi
|
|
65
|
+
|
|
66
|
+
if [ -f "$dir/CLAUDE.md" ]; then
|
|
67
|
+
LAST_MODIFIED=$(git log -1 --format="%cr" -- "$dir/CLAUDE.md" 2>/dev/null || stat -c %Y "$dir/CLAUDE.md" 2>/dev/null || stat -f %m "$dir/CLAUDE.md" 2>/dev/null)
|
|
68
|
+
echo "$PROJECT/CLAUDE.md: last updated $LAST_MODIFIED"
|
|
69
|
+
fi
|
|
70
|
+
done
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Flag anything not updated in 30+ days as stale.
|
|
74
|
+
|
|
75
|
+
### 4. Detect skill gaps
|
|
76
|
+
|
|
77
|
+
Look at patterns in tasks.md files and FINDINGS.md files across projects. A skill gap is when:
|
|
78
|
+
- Multiple projects repeat the same manual process (e.g., "remember to update the changelog," which should be a skill)
|
|
79
|
+
- A FINDINGS.md entry says "next time, do X first," which is a skill waiting to happen
|
|
80
|
+
- A task item keeps getting deferred, and might need a skill to make it easier
|
|
81
|
+
|
|
82
|
+
Also check global/skills/ to see what skills exist, and whether any project's workflow isn't covered.
|
|
83
|
+
|
|
84
|
+
### 5. Check task health
|
|
85
|
+
|
|
86
|
+
For each project with a tasks.md:
|
|
87
|
+
- Count total items, completed items, items with no recent progress
|
|
88
|
+
- Flag tasks where nothing has been completed recently
|
|
89
|
+
- Flag tasks with items older than 60 days that haven't moved
|
|
90
|
+
|
|
91
|
+
### 6. Scaffold missing summary.md files
|
|
92
|
+
|
|
93
|
+
For each project with a missing summary.md, output the template and offer to create it:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
Project: myapp
|
|
97
|
+
MISSING: summary.md
|
|
98
|
+
|
|
99
|
+
Template:
|
|
100
|
+
```
|
|
101
|
+
# myapp
|
|
102
|
+
|
|
103
|
+
What:
|
|
104
|
+
Stack:
|
|
105
|
+
Status: active
|
|
106
|
+
Run:
|
|
107
|
+
Watch out:
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Want me to fill this in for myapp?
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
If yes, gather the 5 fields from the user and write the file to `$PHREN_DIR/myapp/summary.md`.
|
|
114
|
+
|
|
115
|
+
### 7. Output the report
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
phren-discover
|
|
119
|
+
|
|
120
|
+
## Section 1: Missing files
|
|
121
|
+
|
|
122
|
+
Projects without core files:
|
|
123
|
+
|
|
124
|
+
| Project | CLAUDE.md | summary.md | FINDINGS.md | tasks.md |
|
|
125
|
+
|---------|-----------|------------|--------------|------------|
|
|
126
|
+
| myapp | ok | MISSING | MISSING | ok |
|
|
127
|
+
| api | ok | ok | ok | MISSING |
|
|
128
|
+
|
|
129
|
+
## Section 2: Stale content
|
|
130
|
+
|
|
131
|
+
Files not updated in 30+ days:
|
|
132
|
+
- my-app/FINDINGS.md: last updated 45 days ago
|
|
133
|
+
- frontend/CLAUDE.md: last updated 62 days ago
|
|
134
|
+
|
|
135
|
+
## Section 3: Skill gaps
|
|
136
|
+
|
|
137
|
+
Things you do repeatedly that could be skills:
|
|
138
|
+
- "Update changelog before release" appears in 3 project tasks. Consider a `/changelog` skill.
|
|
139
|
+
- my-app FINDINGS.md mentions "always run parity check" 4 times. Already have `/parity`, but it's not in the workflow skill.
|
|
140
|
+
|
|
141
|
+
## Section 4: Task health
|
|
142
|
+
|
|
143
|
+
- my-app: 12 items (3 completed, 2 stale > 60 days)
|
|
144
|
+
- backend: 5 items (0 completed, all stale)
|
|
145
|
+
- frontend: 8 items (6 completed, healthy)
|
|
146
|
+
|
|
147
|
+
Stuck items:
|
|
148
|
+
- backend#2: "Add rate limiting" (added 90 days ago, no progress)
|
|
149
|
+
- my-app#7: "Improve query performance" (added 75 days ago, no progress)
|
|
150
|
+
|
|
151
|
+
## Top 3 things to work on next
|
|
152
|
+
|
|
153
|
+
1. **Add FINDINGS.md to myapp.** You've been working on it actively but capturing nothing. Use `add_finding()` during your next session.
|
|
154
|
+
2. **Unstick api-server task.** 5 items, 0 completed. Either work them or trim them. Stale tasks are worse than no task.
|
|
155
|
+
3. **Create a `/changelog` skill.** You're doing it manually in 3 projects. 15 minutes to write the skill saves hours over time.
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
The "Top 3" section is the most important part. Make these:
|
|
159
|
+
- Concrete (not "improve documentation" but "add FINDINGS.md to myapp")
|
|
160
|
+
- Prioritized (highest impact first)
|
|
161
|
+
- Actionable (someone could start right now)
|
|
162
|
+
|
|
163
|
+
## What not to do
|
|
164
|
+
|
|
165
|
+
- Don't flag missing files in projects that are archived or inactive
|
|
166
|
+
- Don't recommend creating files just for completeness; only flag what would actually help
|
|
167
|
+
- Don't be vague in the Top 3. Every item should be a clear next action.
|
|
168
|
+
- Don't pad the report with things that are fine. Focus on what needs attention.
|
|
169
|
+
|
|
170
|
+
## Related skills
|
|
171
|
+
|
|
172
|
+
- `phren-init`: scaffold missing files for a project
|
|
173
|
+
- `add_finding()`: capture findings via MCP (fixes "missing FINDINGS.md")
|
|
174
|
+
- `phren-consolidate`: synthesize cross-project patterns
|
|
175
|
+
- `/tasks`: work on stuck task items
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: init
|
|
3
|
+
description: Set up a new project in phren with summary, CLAUDE.md, task, and skill templates.
|
|
4
|
+
dependencies:
|
|
5
|
+
- git
|
|
6
|
+
---
|
|
7
|
+
# phren-init - Scaffold a new project
|
|
8
|
+
|
|
9
|
+
> Set up a new project in phren with summary, CLAUDE.md, task, and skill templates.
|
|
10
|
+
|
|
11
|
+
Tell phren about a new project, or bootstrap phren himself if you're starting fresh.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
phren-init my-new-project # scaffold a specific project
|
|
17
|
+
phren-init # list existing projects, suggest unconfigured ones
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## First: find or create the phren directory
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
PHREN_DIR="${PHREN_DIR:-$HOME/.phren}"
|
|
24
|
+
ls "$PHREN_DIR" 2>/dev/null
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
If the phren directory doesn't exist, offer to create it:
|
|
28
|
+
> "No phren repo found. Want me to create one at ~/.phren? This will set up the base directory structure (global/, profiles/, machines.yaml)."
|
|
29
|
+
|
|
30
|
+
If the user says yes, create the base structure:
|
|
31
|
+
```bash
|
|
32
|
+
mkdir -p "$PHREN_DIR"/{global/skills,profiles}
|
|
33
|
+
# Create a starter machines.yaml
|
|
34
|
+
# Create a starter profile
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Then continue with the project scaffolding below.
|
|
38
|
+
|
|
39
|
+
## With a project name
|
|
40
|
+
|
|
41
|
+
### 1. Check it doesn't already exist
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
ls "$PHREN_DIR/<project-name>/" 2>/dev/null
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
If it exists, tell the user and ask if they want to reset it or just update specific files.
|
|
48
|
+
|
|
49
|
+
### 2. Create the project directory
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
mkdir -p "$PHREN_DIR/<project-name>/skills"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 3. Create summary.md
|
|
56
|
+
|
|
57
|
+
This is the project's identity card. Five lines, no more.
|
|
58
|
+
|
|
59
|
+
```markdown
|
|
60
|
+
# <project-name>
|
|
61
|
+
|
|
62
|
+
What: <one sentence about what this project does>
|
|
63
|
+
Stack: <languages, frameworks, key deps>
|
|
64
|
+
Status: <active / maintenance / new / archived>
|
|
65
|
+
Run: <the main command to start it, e.g. "npm run dev">
|
|
66
|
+
Watch out: <the one thing that trips people up>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Ask the user for these if you can't figure them out from the project directory. If the project directory exists on disk (e.g. `~/<project-name>/`), read its package.json, pyproject.toml, README, or similar to pre-fill.
|
|
70
|
+
|
|
71
|
+
### 4. Create CLAUDE.md
|
|
72
|
+
|
|
73
|
+
```markdown
|
|
74
|
+
# <project-name>
|
|
75
|
+
|
|
76
|
+
<One paragraph: what this project is and what it does.>
|
|
77
|
+
|
|
78
|
+
## Commands
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
<dev command>
|
|
82
|
+
<build command>
|
|
83
|
+
<test command>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Architecture
|
|
87
|
+
|
|
88
|
+
<!-- Fill this in as the project grows -->
|
|
89
|
+
|
|
90
|
+
## Conventions
|
|
91
|
+
|
|
92
|
+
<!-- Project-specific rules, patterns, naming conventions -->
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Pre-fill from the project's existing README or package.json if available. Leave architecture and conventions as placeholders with the HTML comments.
|
|
96
|
+
|
|
97
|
+
### 5. Create tasks.md
|
|
98
|
+
|
|
99
|
+
```markdown
|
|
100
|
+
# <project-name> tasks
|
|
101
|
+
|
|
102
|
+
## Active
|
|
103
|
+
|
|
104
|
+
## Queue
|
|
105
|
+
|
|
106
|
+
## Done
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 6. Create skills README
|
|
110
|
+
|
|
111
|
+
```markdown
|
|
112
|
+
# <project-name> skills
|
|
113
|
+
|
|
114
|
+
Project-specific skills go here. Add `.md` files and phren will resolve them together with global skills, then mirror the effective set into the project's `.claude/skills/` directory on sync.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Write this to `$PHREN_DIR/<project-name>/skills/README.md`.
|
|
118
|
+
|
|
119
|
+
### 7. Add to profile(s)
|
|
120
|
+
|
|
121
|
+
Check if profiles exist:
|
|
122
|
+
```bash
|
|
123
|
+
ls "$PHREN_DIR/profiles/"*.yaml 2>/dev/null
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
If profiles exist, ask: "Which profile should this project be in?" and show the options.
|
|
127
|
+
|
|
128
|
+
If no profiles exist, offer to create one:
|
|
129
|
+
> "No profiles set up yet. Want me to create a 'default' profile with this project in it?"
|
|
130
|
+
|
|
131
|
+
Then add the project name to the chosen profile's `projects` list.
|
|
132
|
+
|
|
133
|
+
### 8. Commit (if git repo)
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
cd "$PHREN_DIR"
|
|
137
|
+
git add <project-name>/
|
|
138
|
+
git add profiles/ # if modified
|
|
139
|
+
git commit -m "add <project-name>"
|
|
140
|
+
git push # only if remote exists
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
If phren isn't a git repo yet, walk them through the full setup:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
cd "$PHREN_DIR"
|
|
147
|
+
git init
|
|
148
|
+
git add -A
|
|
149
|
+
git commit -m "initial phren setup"
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Then check if `gh` is available:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
which gh && gh auth status
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
If yes, offer to create the GitHub repo:
|
|
159
|
+
> "Your phren isn't on GitHub yet. Want me to create a private repo and push it? That's what lets you sync across machines."
|
|
160
|
+
|
|
161
|
+
If they say yes:
|
|
162
|
+
```bash
|
|
163
|
+
gh repo create my-phren --private --source=. --push
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
If `gh` isn't available, show the manual steps:
|
|
167
|
+
> "Create a private repo at github.com/new, then:
|
|
168
|
+
> git remote add origin git@github.com:YOU/my-phren.git
|
|
169
|
+
> git push -u origin main
|
|
170
|
+
>
|
|
171
|
+
> Once it's on GitHub, clone it on any machine and run `phren-sync` to activate."
|
|
172
|
+
|
|
173
|
+
### 9. Report
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
phren-init <project-name>
|
|
177
|
+
|
|
178
|
+
Created:
|
|
179
|
+
$PHREN_DIR/<project-name>/summary.md
|
|
180
|
+
$PHREN_DIR/<project-name>/CLAUDE.md
|
|
181
|
+
$PHREN_DIR/<project-name>/tasks.md
|
|
182
|
+
$PHREN_DIR/<project-name>/skills/README.md
|
|
183
|
+
|
|
184
|
+
Added to profile: default
|
|
185
|
+
|
|
186
|
+
Run phren-sync to activate on this machine.
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Without a project name
|
|
190
|
+
|
|
191
|
+
When user just runs `phren-init` with no args:
|
|
192
|
+
|
|
193
|
+
1. If phren directory exists, list all directories that have a `summary.md` (configured projects)
|
|
194
|
+
2. Look for directories in `~/` that look like projects (have package.json, pyproject.toml, Cargo.toml, go.mod, etc.) but don't have a phren entry
|
|
195
|
+
3. Show both lists and suggest adding unconfigured ones
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
phren-init: project scan
|
|
199
|
+
|
|
200
|
+
Configured in phren:
|
|
201
|
+
myapp, api-server
|
|
202
|
+
|
|
203
|
+
Found on this machine but not in phren:
|
|
204
|
+
~/side-project (has package.json)
|
|
205
|
+
~/experiments/rust-thing (has Cargo.toml)
|
|
206
|
+
|
|
207
|
+
Run phren-init <name> to add one.
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
If phren doesn't exist at all, offer to bootstrap it from scratch.
|
|
211
|
+
|
|
212
|
+
## Related skills
|
|
213
|
+
|
|
214
|
+
- `phren-sync`: activate the new project on this machine after init
|
|
215
|
+
- `phren-discover`: find what to build next in a project
|
|
216
|
+
- `/tasks`: manage the project's task queue
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: profiles
|
|
3
|
+
description: Manage machine-to-profile and profile-to-project mappings in phren.
|
|
4
|
+
dependencies:
|
|
5
|
+
- git
|
|
6
|
+
---
|
|
7
|
+
# phren-profiles - Manage your profiles
|
|
8
|
+
|
|
9
|
+
> **Multi-machine only.** This skill is for users who sync phren across multiple machines and need to control which projects appear where. If you only use one machine, you can skip this -- `phren-sync` handles everything you need.
|
|
10
|
+
|
|
11
|
+
> Add projects to profiles, move projects between profiles, create new profiles, and check what's in each one.
|
|
12
|
+
|
|
13
|
+
Manage which projects appear on which machines by editing your profile definitions. Each machine maps to one profile, and each profile is a list of projects.
|
|
14
|
+
|
|
15
|
+
## Prerequisites
|
|
16
|
+
|
|
17
|
+
You need a phren repo. The profiles live in `~/.phren/profiles/` and machine mappings live in `~/.phren/machines.yaml`.
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
~/.phren/
|
|
21
|
+
profiles/
|
|
22
|
+
work.yaml
|
|
23
|
+
personal.yaml
|
|
24
|
+
machines.yaml
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
If you don't have a phren repo yet, start with `phren-init`.
|
|
28
|
+
|
|
29
|
+
## What's a profile?
|
|
30
|
+
|
|
31
|
+
A profile is a YAML file listing projects for a machine role. Example:
|
|
32
|
+
|
|
33
|
+
```yaml
|
|
34
|
+
name: work
|
|
35
|
+
description: Work laptop with company projects
|
|
36
|
+
projects:
|
|
37
|
+
- global
|
|
38
|
+
- my-api
|
|
39
|
+
- frontend
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
When you sync on a machine mapped to this profile, only those projects appear. Personal projects stay off work machines.
|
|
43
|
+
|
|
44
|
+
## How to use it
|
|
45
|
+
|
|
46
|
+
### "Add a project to a profile"
|
|
47
|
+
|
|
48
|
+
User says: "add my-project to my work profile"
|
|
49
|
+
|
|
50
|
+
1. Find the profile file: `~/.phren/profiles/work.yaml`
|
|
51
|
+
2. Read it and find the `projects:` list
|
|
52
|
+
3. Add the project name if it's not already there
|
|
53
|
+
4. Commit the change
|
|
54
|
+
|
|
55
|
+
### "Create a new profile"
|
|
56
|
+
|
|
57
|
+
User says: "create a new profile called staging"
|
|
58
|
+
|
|
59
|
+
1. Create a new file: `~/.phren/profiles/staging.yaml`
|
|
60
|
+
2. Fill it with the required structure:
|
|
61
|
+
|
|
62
|
+
```yaml
|
|
63
|
+
name: staging
|
|
64
|
+
description: Staging servers and experiments
|
|
65
|
+
projects:
|
|
66
|
+
- global
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
3. Ask which projects should be in this new profile (can add more later)
|
|
70
|
+
4. Commit the file
|
|
71
|
+
|
|
72
|
+
### "Show me what's in a profile"
|
|
73
|
+
|
|
74
|
+
User says: "what's in my personal profile?"
|
|
75
|
+
|
|
76
|
+
1. Find `~/.phren/profiles/personal.yaml`
|
|
77
|
+
2. Read it and display the projects list
|
|
78
|
+
|
|
79
|
+
### "Move a project between profiles"
|
|
80
|
+
|
|
81
|
+
User says: "move my-project from personal to work"
|
|
82
|
+
|
|
83
|
+
1. Find `~/.phren/profiles/personal.yaml` and remove the project
|
|
84
|
+
2. Find `~/.phren/profiles/work.yaml` and add the project
|
|
85
|
+
3. Commit both changes
|
|
86
|
+
|
|
87
|
+
### "Set this machine's profile"
|
|
88
|
+
|
|
89
|
+
User says: "this machine is my work laptop"
|
|
90
|
+
|
|
91
|
+
1. Get the current machine name: `cat ~/.phren/.machine-id` or `hostname`
|
|
92
|
+
2. Ask which profile to use (show available profiles from `~/.phren/profiles/`)
|
|
93
|
+
3. Add/update the line in `~/.phren/machines.yaml`: `work-laptop: work`
|
|
94
|
+
4. Commit the change
|
|
95
|
+
5. Run `phren-sync` to activate
|
|
96
|
+
|
|
97
|
+
### "List my profiles"
|
|
98
|
+
|
|
99
|
+
If the user asks what profiles exist:
|
|
100
|
+
|
|
101
|
+
1. List all files in `~/.phren/profiles/`
|
|
102
|
+
2. For each one, read the name and description fields
|
|
103
|
+
3. Show which machine is mapped to each profile (from `machines.yaml`)
|
|
104
|
+
|
|
105
|
+
## After making changes
|
|
106
|
+
|
|
107
|
+
Always commit to the phren git repo:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
cd ~/.phren
|
|
111
|
+
git add profiles/ machines.yaml
|
|
112
|
+
git commit -m "update profiles"
|
|
113
|
+
git push # only if remote exists
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Then suggest running `phren-sync` to activate changes on this machine.
|
|
117
|
+
|
|
118
|
+
## Related skills
|
|
119
|
+
|
|
120
|
+
- `phren-sync`: sync your profiles to this machine and activate them
|
|
121
|
+
- `phren-init`: create a new project or bootstrap phren from scratch
|