prompt-profile 0.1.4 → 0.1.5

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/README.md CHANGED
@@ -1,44 +1,49 @@
1
1
  # prompt-profile
2
2
 
3
- Analyze your past prompts from AI coding agents (Claude Code, Codex) locally and generate a
4
- personal profile.
3
+ Read your past prompts from AI coding agents (Claude Code, Codex) on your computer, analyse them
4
+ with the `claude` or `codex` CLI you are already logged in to, and get a personal profile report.
5
+ Reading, cleaning, redaction and the report happen locally; the selected, redacted prompts are sent
6
+ through that CLI to its model service and use your subscription quota (no API key).
5
7
 
6
- ![Synthetic sample share card](docs/sample-card.png)
8
+ ![Synthetic sample share card](https://erictsai83.github.io/prompt-profile/sample-card.png)
7
9
 
8
10
  [Sample HTML report](https://erictsai83.github.io/prompt-profile/sample-report.html)
9
- · [Sample profile JSON](docs/sample-profile.json) (all sample data is hand-written and fictional).
11
+ · [Sample profile JSON](https://erictsai83.github.io/prompt-profile/sample-profile.json) (all sample data is hand-written and fictional;
12
+ every example is rendered by the current code on each change to `main`).
10
13
 
11
- ### A real report
14
+ ### Example reports
12
15
 
13
- The author's own report, from about 1,700 real prompts over six months, published as written:
16
+ The same fictional profile, rendered two ways:
14
17
 
15
- - [Full report](https://erictsai83.github.io/prompt-profile/demo/full/report.html): what you see on your own machine, with quotes from
16
- real prompts, suggested rewrites, project names, exact dates and fun facts.
18
+ - [Full report](https://erictsai83.github.io/prompt-profile/demo/full/report.html): what you see on your own machine, with prompt
19
+ quotes, suggested rewrites, project names, exact dates and fun facts.
17
20
  - [Shareable report](https://erictsai83.github.io/prompt-profile/demo/without-personal/report.html): the same profile rendered with
18
21
  `--exclude personal`: no quotes, rewrites or fun facts, projects shown as "Project A, B…",
19
22
  dates by month. This is what you would post publicly.
20
23
 
21
- The share card is the same for both: it never contains quotes or project names. The full report
24
+ The card never contains prompt quotes. Project names may appear in normal mode;
25
+ `--exclude projects` (also included in `--exclude personal`) anonymizes known project names
26
+ in both the report and card, including generated identity text. The full report
22
27
  in every look (`--look`; render only, no new analysis):
23
28
 
24
29
  <table>
25
30
  <tr>
26
31
  <td width="50%" align="center">
27
- <a href="https://erictsai83.github.io/prompt-profile/demo/full/report.html"><img src="docs/demo/card.png" width="420" alt="Classic card"></a><br>
32
+ <a href="https://erictsai83.github.io/prompt-profile/demo/full/report.html"><img src="https://erictsai83.github.io/prompt-profile/demo/full/card.png" width="420" alt="Classic card"></a><br>
28
33
  <a href="https://erictsai83.github.io/prompt-profile/demo/full/report.html">Classic</a> (default)
29
34
  </td>
30
35
  <td width="50%" align="center">
31
- <a href="https://erictsai83.github.io/prompt-profile/demo/signal/report.html"><img src="docs/demo/signal/card.png" width="420" alt="Signal card"></a><br>
36
+ <a href="https://erictsai83.github.io/prompt-profile/demo/signal/report.html"><img src="https://erictsai83.github.io/prompt-profile/demo/signal/card.png" width="420" alt="Signal card"></a><br>
32
37
  <a href="https://erictsai83.github.io/prompt-profile/demo/signal/report.html">Signal</a>
33
38
  </td>
34
39
  </tr>
35
40
  <tr>
36
41
  <td width="50%" align="center">
37
- <a href="https://erictsai83.github.io/prompt-profile/demo/afterhours/report.html"><img src="docs/demo/afterhours/card.png" width="420" alt="Afterhours card"></a><br>
42
+ <a href="https://erictsai83.github.io/prompt-profile/demo/afterhours/report.html"><img src="https://erictsai83.github.io/prompt-profile/demo/afterhours/card.png" width="420" alt="Afterhours card"></a><br>
38
43
  <a href="https://erictsai83.github.io/prompt-profile/demo/afterhours/report.html">Afterhours</a>
39
44
  </td>
40
45
  <td width="50%" align="center">
41
- <a href="https://erictsai83.github.io/prompt-profile/demo/studio/report.html"><img src="docs/demo/studio/card.png" width="420" alt="Studio card"></a><br>
46
+ <a href="https://erictsai83.github.io/prompt-profile/demo/studio/report.html"><img src="https://erictsai83.github.io/prompt-profile/demo/studio/card.png" width="420" alt="Studio card"></a><br>
42
47
  <a href="https://erictsai83.github.io/prompt-profile/demo/studio/report.html">Studio</a>
43
48
  </td>
44
49
  </tr>
@@ -49,7 +54,7 @@ in every look (`--look`; render only, no new analysis):
49
54
  1. Install [Claude Code](https://claude.com/claude-code) or [Codex](https://github.com/openai/codex)
50
55
  and log in once (`claude`, or `codex login`). prompt-profile uses it to analyse your prompts;
51
56
  **no API key needed**.
52
- 2. Run it (Node.js ≥ 22):
57
+ 2. Run it (Node.js ≥ 24):
53
58
 
54
59
  ```bash
55
60
  npx prompt-profile@latest
@@ -57,14 +62,34 @@ in every look (`--look`; render only, no new analysis):
57
62
 
58
63
  `@latest` makes npx fetch the newest version instead of reusing one it cached earlier.
59
64
 
60
- 3. It reads your local history, shows how many prompts it found and how many CLI calls the
61
- analysis will take, and asks `Continue?`. The calls use your Claude / ChatGPT subscription
62
- quota. To see what would be sent first, run `npx prompt-profile@latest --dry-run` (calls nothing).
65
+ 3. Before anything is sent it shows a summary and asks `Continue?`:
66
+
67
+ ```
68
+ ● Range: last 3m · 2026-07-28 → 2026-10-28
69
+ In range: Claude Code 1,204 · Codex 311 prompts
70
+ 1,515 prompts in 182 sessions after cleaning → 1,515 selected in 24 chunks
71
+ No sampling: every chunk is analysed
72
+ Read, cleaned and redacted on this computer; the report and analysis cache are written only here.
73
+ ● Sent off this computer: the selected, redacted prompts go through your logged-in Claude Code CLI (claude -p) to its model service
74
+ No API key: uses your subscription quota, base estimate 25 calls (24 chunks + 1 final profile)
75
+ Intermediate merges and retries (up to 2 per call) can add calls.
76
+ No hard limit: add --max-calls <n> to stop after n CLI calls.
77
+ Free first: --dry-run writes what would be sent without calling any LLM; `prompt-profile stats` shows statistics.
78
+ ```
79
+
80
+ (Illustrative numbers.) The calls use your Claude / ChatGPT subscription quota.
81
+
63
82
  4. When it is done, the report opens in your browser. Everything is written to
64
83
  `./prompt-profile-report/`.
65
84
 
66
- Want to look around for free first? `npx prompt-profile@latest stats` shows statistics without any LLM
67
- call.
85
+ ### Look first, for free
86
+
87
+ - `npx prompt-profile@latest --dry-run` prints the same summary, then writes the exact chunks that
88
+ would be sent to `--out` (`chunks/*.txt`, `plan.json`) and calls no LLM. The chunks are your
89
+ redacted prompt text: keep them private and delete them when done.
90
+ - `npx prompt-profile@latest stats` shows statistics; nothing leaves your computer.
91
+
92
+ Both work without a logged-in CLI.
68
93
 
69
94
  ## Install
70
95
 
@@ -92,7 +117,7 @@ folder. Move the executable to a folder on your `PATH` to run it as `prompt-prof
92
117
 
93
118
  ## Requirements
94
119
 
95
- - Node.js ≥ 22, or the standalone executable (no Node.js needed)
120
+ - Node.js ≥ 24, or the standalone executable (no Node.js needed)
96
121
  - [Claude Code](https://claude.com/claude-code) (`claude`) or [Codex](https://github.com/openai/codex)
97
122
  (`codex`) installed and logged in
98
123
  - **No API key needed**: the analysis runs your own logged-in `claude -p` or `codex exec` in the
@@ -102,27 +127,48 @@ folder. Move the executable to a folder on your `PATH` to run it as `prompt-prof
102
127
 
103
128
  ## What you get
104
129
 
130
+ The CLI writes HTML, `profile.json`, and `card*.png`; it does not automatically export PDF.
131
+ For a static PDF, open `report.html`, select a language, then use your browser’s Print → Save
132
+ as PDF. Printing includes both report views in that language. The offline HTML stays interactive;
133
+ both formats use the same profile without another analysis call. Files in `output/pdf/` are
134
+ fictional development review exports, not automatic CLI outputs.
135
+
105
136
  Written to `./prompt-profile-report/` (change it with `--out`):
106
137
 
107
- - `report.html`: your private, single-file report that works offline:
108
- - who you are: archetype, a 24-hour clock of your busiest hours, four measured habits with
109
- their definitions, your top traits with a quote each and how widely they are supported
110
- - **how to improve your prompts**: 2–4 suggestions, each with a real prompt of yours and a
111
- suggested rewrite, plus signals such as frequent corrections or very short follow-ups
112
- - **how you work with AI**: a capability map (plan, delegate, extend, verify, ship) with the
113
- skills you used and what each does, subagent types, MCP servers, models, pull requests,
114
- parallel sessions and prompt-writing habits; counted from tool metadata and the skill
115
- descriptions recorded in your transcripts, never tool inputs, outputs or skill arguments
116
- - what changed since your last report, a daily calendar and a weekday × hour heatmap (hover
117
- or tap for the count and main projects), project chapters, the five dimensions, and how it
118
- was measured
138
+ - `report.html`: your private, single-file report that works offline, with two pages:
139
+ - **Who they are** (opens first): archetype, up to three observations with medium or high
140
+ confidence each with one of your own prompts, observed collaboration preferences, the portrait story with its quotes,
141
+ and fun facts
142
+ - **Facts & evidence**: every measurement with its source and denominator: four measured
143
+ habits with their definitions, tool and prompt-wording shares, a daily calendar and a
144
+ weekday × hour heatmap (hover or tap for the count and main projects), project chapters,
145
+ all traits with their quotes and how widely they are supported, the evidence for and
146
+ against each preference, the five dimensions and how it was measured
147
+ - **how you work with AI** (facts page): a capability map (plan, delegate, extend, verify,
148
+ ship) with the skills you used and what each does, subagent types, MCP servers, models,
149
+ pull requests, parallel sessions and prompt-writing habits; counted from tool metadata and
150
+ the skill descriptions recorded in your transcripts, never tool inputs, outputs or skill
151
+ arguments
152
+ - **how you steer the AI** (facts page): in how many of the analysed conversations with
153
+ follow-ups you redirected the AI's approach, and separately how often you asked it to fix a
154
+ broken result, with examples; one-shot requests are not counted against you
155
+ - **how to improve your prompts** (facts page): 2–4 suggestions, each with a real prompt of
156
+ yours and a suggested rewrite, plus signals such as very short
157
+ follow-ups, and what changed since your last report
158
+ - **usage during this period** (facts page only): Claude Code and Codex side by side with
159
+ the plan each runs on, tokens by kind, the share of each tool, months and models, and the
160
+ **API list-price equivalent** in USD. Detailed breakdowns stay here; the card can show a
161
+ compact token total and API estimate. The "Who they are" page does not show usage
119
162
  - a language switch when there is more than one language
120
163
 
121
164
  It shows everything by default, quotes and project folder names included. To share it, leave
122
165
  parts out with `--exclude` (below).
123
166
 
124
167
  - `card.png`: a 1200 × 630 share card in the default language, plus `card.<lang>.png` for each
125
- other language (**omits evidence quotes**)
168
+ other language (**omits evidence quotes**). Includes the introduction, up to two supported
169
+ behaviors, prompt/conversation counts, token usage and an API estimate in USD. Missing and
170
+ partial pricing are labeled; `--exclude usage` removes usage from HTML and PNG.
171
+ `--card-hide stats` hides the card’s measured summary
126
172
  - `profile.json`: the raw profile data (re-create the report with `prompt-profile render`)
127
173
 
128
174
  ### Leaving parts out
@@ -137,6 +183,7 @@ Written to `./prompt-profile-report/` (change it with `--out`):
137
183
  | `coaching` | "Improve your prompts" and "since your last report" |
138
184
  | `funfacts` | Fun facts |
139
185
  | `custom-names` | Names and descriptions of your own skills, custom agent types and private MCP servers (only counted) |
186
+ | `usage` | Plans, token counts and API list-price equivalents |
140
187
  | `personal` | All of the above |
141
188
 
142
189
  ```bash
@@ -168,20 +215,22 @@ cards agree.
168
215
  ## Usage
169
216
 
170
217
  ```bash
171
- prompt-profile # analyse the last 6 months and write the report
218
+ prompt-profile # analyse the last 3 months and write the report
172
219
  prompt-profile --since 3m # 1m / 3m / 6m / 1y / all (also <n>d, <n>w)
173
220
  prompt-profile --engine codex # which CLI analyses your prompts (default: auto, Claude Code first)
174
221
  prompt-profile --model <name> # model passed to claude / codex
222
+ prompt-profile --effort medium # reasoning effort: low / medium / high / xhigh / max (default: the CLI's)
175
223
  prompt-profile --out <dir> # output folder
176
224
  prompt-profile --max-calls 40 # cap CLI invocations, including merges and retries
177
225
  prompt-profile --full # no sampling, analyse everything (slower, uses more quota)
178
226
  prompt-profile --no-cache # do not read the analysis cache
179
227
  prompt-profile --yes # skip the confirmation (required in non-interactive sessions)
180
- prompt-profile --dry-run # write what would be sent to the LLM into --out, call nothing
228
+ prompt-profile --dry-run # free: the summary, plus what would be sent written into --out
181
229
  prompt-profile --verbose # full errors and LLM call timings
182
230
  prompt-profile --lang zh-TW,en # report languages, the first is the default (en, zh-TW)
183
- prompt-profile --look signal # classic (default) / signal / afterhours / studio
231
+ prompt-profile --look signal # classic (default) / signal / afterhours / studio / prism / slate / folio
184
232
  prompt-profile --card-hide stats,graphic # leave traits / stats / graphic out of card.png
233
+ prompt-profile --name Eric # title the report "Eric’s prompt profile" (not stored in profile.json)
185
234
 
186
235
  prompt-profile stats # statistics only, no LLM (free and fast)
187
236
  prompt-profile render profile.json # re-create the report from an existing profile.json
@@ -194,7 +243,8 @@ prompt-profile render profile.json --look studio --card-hide stats
194
243
  Looks and `--card-hide` only change how the report and card are drawn: no new analysis and no
195
244
  LLM calls, and the original report is kept. `--card-hide` changes the share card only; the
196
245
  private report and `profile.json` still contain everything, including quotes. The card never
197
- contains quotes or project names in any look.
246
+ contains prompt quotes in any look. Project names follow the same `--exclude projects` choice
247
+ as the report.
198
248
 
199
249
  Languages: without `--lang`, a Chinese system locale gives a Traditional Chinese report with an
200
250
  English switch (`zh-TW,en`); any other locale gives English. The profile is written in English
@@ -203,14 +253,55 @@ and then translated, one extra CLI call per extra language; quotes stay as you w
203
253
  Exit codes: `0` success · `1` error · `2` usage / needs `--yes` · `3` no data · `4` no usable LLM
204
254
  CLI · `5` rate limited · `130` interrupted (a re-run resumes from the cache).
205
255
 
256
+ ## Small histories and stopped runs
257
+
258
+ **Small histories.** A role, featured observations and prompt coaching each need verified quotes
259
+ from at least two sessions (the same rule that sets trait confidence and preference axes). When
260
+ nothing in a profile reaches that, the report is titled "Early observations": it states how many
261
+ prompts and sessions it is based on, keeps the observations, five dimensions and measurements,
262
+ and leaves out the generated role and the "Improve your prompts" section. The card does the same.
263
+ The terminal says so after the run; a longer `--since` range or more history adds evidence.
264
+
265
+ **If a run stops.** Progress is shown by phase (chunks, merges, the final profile, verification,
266
+ translations, writing files); there is no time estimate. When a run stops early, the error says
267
+ what was saved and prints the exact command to run again:
268
+
269
+ | What happened | What is saved | What a re-run does |
270
+ | --------------------------------------------------------------------- | ------------------------------------------------------- | ----------------------------------------------------------------------------- |
271
+ | Ctrl-C, rate limit, timeout, malformed output, too many failed chunks | Finished chunk results in the analysis cache; no report | Reuses cached chunks and merges; the final profile and translations run again |
272
+ | `--max-calls` reached | Same; cached results do not use the budget again | Same; raise `--max-calls` if it stops again |
273
+ | The final profile step failed | Chunk results | Repeats only the final profile and translation calls |
274
+ | An intermediate merge failed (large histories) | Chunk results and finished merges | Repeats the unfinished merges, then the final profile and translations |
275
+ | A translation failed | The report, without that language | The printed command adds it (final profile + translation) |
276
+ | A card was not created (e.g. the Chinese font download failed) | The report and `profile.json` | `prompt-profile render <profile.json>` retries the cards, no analysis |
277
+
278
+ The re-run command keeps your flags and leaves out `--no-cache`, so it reads the cache. When
279
+ prompt-profile was started with npx, the printed commands start with `npx prompt-profile@<version>`
280
+ (the same version, so the cache matches); otherwise with the installed `prompt-profile`.
281
+ A CLI's own error message can quote what it was sent, so it is shown only with `--verbose`.
282
+
206
283
  ## Privacy
207
284
 
208
285
  **Files read** (read-only):
209
286
 
210
- | Source | Paths (override with an environment variable) |
211
- | ----------- | ------------------------------------------------------------------------------- |
212
- | Claude Code | `~/.claude/projects/*/*.jsonl`, `~/.claude/history.jsonl` (`CLAUDE_CONFIG_DIR`) |
213
- | Codex | `~/.codex/sessions/**/rollout-*.jsonl`, `~/.codex/history.jsonl` (`CODEX_HOME`) |
287
+ | Source | Paths (override with an environment variable) |
288
+ | ----------- | ------------------------------------------------------------------------------------------------------------------ |
289
+ | Claude Code | `~/.claude/projects/*/*.jsonl`, `~/.claude/history.jsonl` (`CLAUDE_CONFIG_DIR`) |
290
+ | Codex | `~/.codex/sessions/**/rollout-*.jsonl` (and zstd-compressed `.jsonl.zst`), `~/.codex/history.jsonl` (`CODEX_HOME`) |
291
+
292
+ **Usage and plan** (the "Usage during this period" section): token counts and model names from
293
+ the same logs (Claude Code subagent transcripts in `projects/*/*/subagents/` included), the plan
294
+ from `claude auth status --json` (`subscriptionType` only), an undocumented rate-limit hint from
295
+ `~/.claude.json` (`oauthAccount.userRateLimitTier` only), and the ChatGPT plan type from
296
+ `~/.codex/auth.json`, decoded locally from the id token's payload. No token, API key, email,
297
+ account or organization id is stored, cached, logged or sent; a missing or unreadable file gives
298
+ "unknown", never an error. Usage, plans and amounts stay on your machine: they are not sent to
299
+ the LLM. Amounts are computed from an embedded list-price table (no download) and are an **API
300
+ list-price equivalent**: what the usage would cost on the public API, not what you paid. Neither
301
+ provider offers a way to read a subscription's usage as a bill, so this is how every local usage
302
+ tool works (Claude Code's own session cost does the same); responses in fast mode (Claude
303
+ `speed: "fast"`, Codex priority) use the fast-mode list prices, and a model or tier without a
304
+ listed price stays "unknown" rather than being estimated.
214
305
 
215
306
  **Prompt selection and preprocessing**: adapters select user prompts, excluding recognized system
216
307
  messages, tool output and sub-agent conversations, then:
@@ -226,7 +317,7 @@ messages, tool output and sub-agent conversations, then:
226
317
 
227
318
  Selected, cleaned and redacted prompt text is sent **off your machine** through your logged-in
228
319
  CLI to its model service, along with project basenames. Intermediate observations, supporting
229
- quotes and usage statistics are sent during merge/final analysis. Text that does not match a
320
+ quotes and prompt statistics are sent during merge/final analysis. Text that does not match a
230
321
  redaction rule can remain unchanged, including names and confidential prose.
231
322
 
232
323
  Reports, `profile.json`, dry-run exports and analysis caches are written locally and are not
@@ -286,3 +377,41 @@ bundled prompts, fonts, WASM rendering and file permissions.
286
377
  ## License
287
378
 
288
379
  MIT
380
+
381
+ ### Collaboration portraits
382
+
383
+ Reports have two locally switchable views: a chart-led overview of collaboration preferences,
384
+ workflow techniques and activity; and a detailed third-person portrait for readers who may not
385
+ know the person, with interactions, supporting quotes, skill descriptions and suggestions.
386
+ Evidence is expanded by default. Language and view switches work offline without JavaScript;
387
+ printing includes both views.
388
+ Quotes are verified against redacted prompts. Only the user's side of an interaction is
389
+ available; requests do not prove successful outcomes. Statistics and contextual observations
390
+ remain available alongside the narrative in their respective views. Older profiles remain renderable.
391
+
392
+ Four original preference axes describe how the person starts (define/explore), paces work
393
+ (stepwise/whole task), assigns decisions (direct/delegate), and converges (criteria/refinement).
394
+ A complete combination receives a stable role name. Each preference needs verified evidence
395
+ from at least two sessions; contradictory or insufficient evidence stays unresolved, and no
396
+ complete role is assigned. These are contextual observations, not psychological assessments,
397
+ ability scores or a validated personality instrument. The system is independent of MBTI.
398
+
399
+ Re-analyse to generate the new portrait; rendering an older profile does not create new
400
+ analysis. `pnpm dev:report` renders an entirely fictional portrait for local inspection.
401
+
402
+ ### Choose a report template
403
+
404
+ - **Prism** puts supported signature behaviors above a clear visual overview.
405
+ - **Slate** combines a compact identity workspace with precise activity charts.
406
+ - **Folio** gives the portrait and evidence a quieter, connected reading rhythm.
407
+
408
+ Each includes a matching 1200 × 630 card. [Browse fictional examples](https://erictsai83.github.io/prompt-profile/demo/templates/index.html).
409
+ Existing looks and the classic default remain available. Change presentation without reanalysis:
410
+
411
+ ```bash
412
+ prompt-profile render profile.json --look prism
413
+ prompt-profile render profile.json --look slate
414
+ prompt-profile render profile.json --look folio --card-hide stats
415
+ ```
416
+
417
+ The card hiding options affect only the card; report exclusions remain available through `--exclude`.