prompt-profile 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Eric Tsai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,255 @@
1
- # Temporary Holding Version
1
+ # prompt-profile
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Analyze your past prompts from AI coding agents (Claude Code, Codex) locally and generate a
4
+ personal profile.
5
+
6
+ ![Synthetic sample share card](docs/sample-card.png)
7
+
8
+ [Sample HTML report](https://htmlpreview.github.io/?https://github.com/EricTsai83/prompt-profile/blob/main/docs/sample-report.html)
9
+ · [Sample profile JSON](docs/sample-profile.json) (all sample data is hand-written and fictional).
10
+
11
+ The same profile in the other looks (`--look signal`, `afterhours`, `studio`):
12
+
13
+ | Signal | Afterhours | Studio |
14
+ | ------------------------------------------- | --------------------------------------------------- | ------------------------------------------- |
15
+ | ![Signal look](docs/sample-card-signal.png) | ![Afterhours look](docs/sample-card-afterhours.png) | ![Studio look](docs/sample-card-studio.png) |
16
+
17
+ ## Quick start
18
+
19
+ 1. Install [Claude Code](https://claude.com/claude-code) or [Codex](https://github.com/openai/codex)
20
+ and log in once (`claude`, or `codex login`). prompt-profile uses it to analyse your prompts;
21
+ **no API key needed**.
22
+ 2. Run it (Node.js ≥ 22):
23
+
24
+ ```bash
25
+ npx prompt-profile
26
+ ```
27
+
28
+ 3. It reads your local history, shows how many prompts it found and how many CLI calls the
29
+ analysis will take, and asks `Continue?`. The calls use your Claude / ChatGPT subscription
30
+ quota. To see what would be sent first, run `npx prompt-profile --dry-run` (calls nothing).
31
+ 4. When it is done, the report opens in your browser. Everything is written to
32
+ `./prompt-profile-report/`.
33
+
34
+ Want to look around for free first? `npx prompt-profile stats` shows statistics without any LLM
35
+ call.
36
+
37
+ ## Install
38
+
39
+ ```bash
40
+ npx prompt-profile # run without installing
41
+ npm i -g prompt-profile # or install the `prompt-profile` command
42
+ prompt-profile --help
43
+ ```
44
+
45
+ No Node.js? Every [GitHub Release](https://github.com/EricTsai83/prompt-profile/releases) has a
46
+ standalone executable for macOS (`darwin-arm64` for Apple silicon, `darwin-x64`), Linux
47
+ (`linux-x64`, `linux-arm64`) and Windows (`windows-x64`), with a `SHA256SUMS` file. Download the
48
+ archive for your platform from the release page, then:
49
+
50
+ ```bash
51
+ tar -xzf prompt-profile-<version>-darwin-arm64.tar.gz
52
+ ./prompt-profile-<version>-darwin-arm64/prompt-profile
53
+ # macOS, if the archive was downloaded with a browser (the binary is not notarised):
54
+ xattr -d com.apple.quarantine ./prompt-profile-<version>-darwin-arm64/prompt-profile
55
+ ```
56
+
57
+ On Windows, `tar -xzf` works in PowerShell too; run `prompt-profile.exe` from the extracted
58
+ folder. Move the executable to a folder on your `PATH` to run it as `prompt-profile`.
59
+
60
+ ## Requirements
61
+
62
+ - Node.js ≥ 22, or the standalone executable (no Node.js needed)
63
+ - [Claude Code](https://claude.com/claude-code) (`claude`) or [Codex](https://github.com/openai/codex)
64
+ (`codex`) installed and logged in
65
+ - **No API key needed**: the analysis runs your own logged-in `claude -p` or `codex exec` in the
66
+ background and **uses your subscription quota**. The base call estimate is shown
67
+ before confirmation. Intermediate merges and up to two retries per call can add calls;
68
+ use `--max-calls` to set a hard limit on CLI invocations, including retries.
69
+
70
+ ## What you get
71
+
72
+ Written to `./prompt-profile-report/` (change it with `--out`):
73
+
74
+ - `report.html`: your private, single-file report that works offline:
75
+ - who you are: archetype, a 24-hour clock of your busiest hours, four measured habits with
76
+ their definitions, your top traits with a quote each and how widely they are supported
77
+ - **how to improve your prompts**: 2–4 suggestions, each with a real prompt of yours and a
78
+ suggested rewrite, plus signals such as frequent corrections or very short follow-ups
79
+ - **how you work with AI**: a capability map (plan, delegate, extend, verify, ship) with the
80
+ skills you used and what each does, subagent types, MCP servers, models, pull requests,
81
+ parallel sessions and prompt-writing habits; counted from tool metadata and the skill
82
+ descriptions recorded in your transcripts, never tool inputs, outputs or skill arguments
83
+ - what changed since your last report, a daily calendar and a weekday × hour heatmap (hover
84
+ or tap for the count and main projects), project chapters, the five dimensions, and how it
85
+ was measured
86
+ - a language switch when there is more than one language
87
+
88
+ It shows everything by default, quotes and project folder names included. To share it, leave
89
+ parts out with `--exclude` (below).
90
+
91
+ - `card.png`: a 1200 × 630 share card in the default language, plus `card.<lang>.png` for each
92
+ other language (**omits evidence quotes**)
93
+ - `profile.json`: the raw profile data (re-create the report with `prompt-profile render`)
94
+
95
+ ### Leaving parts out
96
+
97
+ `--exclude` (on the main command and on `render`) takes a comma list:
98
+
99
+ | Part | Left out |
100
+ | -------------- | ---------------------------------------------------------------------------------------------------- |
101
+ | `quotes` | Evidence quotes and the before / after rewrites |
102
+ | `projects` | Project names, shown as "Project A, B…", also inside the generated text and on the card |
103
+ | `dates` | Exact dates: no daily calendar, the data period by month |
104
+ | `coaching` | "Improve your prompts" and "since your last report" |
105
+ | `funfacts` | Fun facts |
106
+ | `custom-names` | Names and descriptions of your own skills, custom agent types and private MCP servers (only counted) |
107
+ | `personal` | All of the above |
108
+
109
+ ```bash
110
+ prompt-profile render prompt-profile-report/profile.json --exclude personal
111
+ # → prompt-profile-report/variants/classic-without-personal/report.html; the full report is kept
112
+ ```
113
+
114
+ ### The final check
115
+
116
+ Before anything is written, every displayed text of the profile (generated text, quotes,
117
+ rewrites, names, skill descriptions) is checked with the same rules that redact prompts before
118
+ the LLM sees them. The terminal says where and which rule — never the matched text:
119
+
120
+ ```
121
+ Contains 34 quotes · 8 project names · exact dates · 4 improvements · 3 fun facts
122
+ Check 2 masked: email (Traits › 2), home-path (Fun facts › 1)
123
+ Before sharing, skim the quotes yourself: the check is rule-based.
124
+ ```
125
+
126
+ | | Rules | `--check mask` (default) | `--check warn` | `--check strict` |
127
+ | ------------- | ------------------------------------------------------------------------------------------------------- | ------------------------ | -------------- | ------------------------ |
128
+ | Secrets | private keys, API tokens, JWTs, bearer tokens, connection strings, `password=`… , random-looking tokens | masked | masked | nothing written (exit 1) |
129
+ | Personal data | email, home path, username, internal URL, phone, Taiwan ID, credit card | masked | kept, listed | nothing written (exit 1) |
130
+
131
+ `--allow email,phone` skips personal rules (e.g. a public address you want shown); secrets can
132
+ never be allowed. The masked profile is what is written: `profile.json`, the report and the
133
+ cards agree.
134
+
135
+ ## Usage
136
+
137
+ ```bash
138
+ prompt-profile # analyse the last 6 months and write the report
139
+ prompt-profile --since 3m # 1m / 3m / 6m / 1y / all (also <n>d, <n>w)
140
+ prompt-profile --engine codex # which CLI analyses your prompts (default: auto, Claude Code first)
141
+ prompt-profile --model <name> # model passed to claude / codex
142
+ prompt-profile --out <dir> # output folder
143
+ prompt-profile --max-calls 40 # cap CLI invocations, including merges and retries
144
+ prompt-profile --full # no sampling, analyse everything (slower, uses more quota)
145
+ prompt-profile --no-cache # do not read the analysis cache
146
+ prompt-profile --yes # skip the confirmation (required in non-interactive sessions)
147
+ prompt-profile --dry-run # write what would be sent to the LLM into --out, call nothing
148
+ prompt-profile --verbose # full errors and LLM call timings
149
+ prompt-profile --lang zh-TW,en # report languages, the first is the default (en, zh-TW)
150
+ prompt-profile --look signal # classic (default) / signal / afterhours / studio
151
+ prompt-profile --card-hide stats,graphic # leave traits / stats / graphic out of card.png
152
+
153
+ prompt-profile stats # statistics only, no LLM (free and fast)
154
+ prompt-profile render profile.json # re-create the report from an existing profile.json
155
+ prompt-profile cache clear # delete the analysis cache
156
+
157
+ prompt-profile render profile.json --look studio --card-hide stats
158
+ # a new look, written to variants/studio-no-stats/
159
+ ```
160
+
161
+ Looks and `--card-hide` only change how the report and card are drawn: no new analysis and no
162
+ LLM calls, and the original report is kept. `--card-hide` changes the share card only; the
163
+ private report and `profile.json` still contain everything, including quotes. The card never
164
+ contains quotes or project names in any look.
165
+
166
+ Languages: without `--lang`, a Chinese system locale gives a Traditional Chinese report with an
167
+ English switch (`zh-TW,en`); any other locale gives English. The profile is written in English
168
+ and then translated, one extra CLI call per extra language; quotes stay as you wrote them.
169
+
170
+ Exit codes: `0` success · `1` error · `2` usage / needs `--yes` · `3` no data · `4` no usable LLM
171
+ CLI · `5` rate limited · `130` interrupted (a re-run resumes from the cache).
172
+
173
+ ## Privacy
174
+
175
+ **Files read** (read-only):
176
+
177
+ | Source | Paths (override with an environment variable) |
178
+ | ----------- | ------------------------------------------------------------------------------- |
179
+ | Claude Code | `~/.claude/projects/*/*.jsonl`, `~/.claude/history.jsonl` (`CLAUDE_CONFIG_DIR`) |
180
+ | Codex | `~/.codex/sessions/**/rollout-*.jsonl`, `~/.codex/history.jsonl` (`CODEX_HOME`) |
181
+
182
+ **Prompt selection and preprocessing**: adapters select user prompts, excluding recognized system
183
+ messages, tool output and sub-agent conversations, then:
184
+
185
+ - pasted code / logs are collapsed into `[pasted code: N lines]`
186
+ - API keys, tokens, passwords, private keys, connection strings, emails, phone numbers, national
187
+ IDs, credit card numbers, internal URLs, UUIDs / hashes, home-folder paths and usernames that
188
+ match the supported rules are redacted **before** anything is sent (and before long
189
+ prompts are shortened); this is best-effort, not a guarantee that every secret is found
190
+ - projects are reduced to their folder name, never the full path
191
+ - `prompt-profile --dry-run` previews selected map chunks; generated observations, statistics
192
+ used by the final step, system instructions and retry messages are not a complete network dump
193
+
194
+ Selected, cleaned and redacted prompt text is sent **off your machine** through your logged-in
195
+ CLI to its model service, along with project basenames. Intermediate observations, supporting
196
+ quotes and usage statistics are sent during merge/final analysis. Text that does not match a
197
+ redaction rule can remain unchanged, including names and confidential prose.
198
+
199
+ Reports, `profile.json`, dry-run exports and analysis caches are written locally and are not
200
+ uploaded by prompt-profile. They can contain personal information. Created folders use `0700`
201
+ and files use `0600`; existing folder permissions are not changed. `cache clear` removes analysis
202
+ entries only, and reports deletion errors rather than claiming success. Delete reports and dry-run
203
+ exports separately when no longer needed.
204
+
205
+ Claude runs with safe mode, tools disabled, strict MCP configuration and disabled hooks. Codex
206
+ runs with `--ignore-user-config`, disabled hooks/notifications, a read-only sandbox and an ephemeral
207
+ session. Codex still uses your existing login, but user-configured providers and model defaults
208
+ are ignored; specify the model with `--model`. Both use fresh temporary working folders.
209
+ Administrator policy, environment settings and CLI/provider diagnostics can still apply. These
210
+ controls are tested on specific versions, and do not promise zero CLI/provider logs or traffic.
211
+ See [runner notes](src/llm/NOTES.md) and the [security policy](SECURITY.md).
212
+
213
+ prompt-profile has no telemetry. The report makes no network requests and its fonts ship with
214
+ the package. The one exception is the Chinese share card: on first use it downloads Noto Sans TC
215
+ (about 11 MB, from a pinned GitHub commit), checks its SHA-256 and caches it; no prompt data is
216
+ sent. The borrowed CLI manages its own network requests and provider data retention.
217
+
218
+ ## FAQ
219
+
220
+ **How much quota does it use?** By default at most 30 chunks (about 40,000 characters each) are
221
+ analysed, plus intermediate merges for large histories and one final call. Each call may retry
222
+ twice. The displayed count is a base estimate, not an upper bound; `--max-calls` limits total CLI
223
+ invocations rather than tokens, provider requests or money.
224
+ Chunks analysed before are read from the cache on the next run.
225
+
226
+ **Can I use an API key?** Not at the moment: by design it only borrows your logged-in CLI.
227
+
228
+ **Is the report accurate?** Every trait and dimension cites quotes from your prompts, and the
229
+ program checks that each quote really exists in them. Invalid and duplicate quotes are removed;
230
+ multiple excerpts of one prompt do not count as independent support, and high-confidence traits
231
+ require support from multiple sessions. Quote matching does not prove the interpretation is correct.
232
+ Dimensions without verified quotes are marked as insufficiently supported.
233
+
234
+ **Why are some prompts not counted?** Short acknowledgements ("ok", "continue"), resent duplicates,
235
+ notifications sent by the tools themselves, long templates repeated across sessions, and slash
236
+ commands of sessions that contain nothing else (scripts and tools) are excluded. Each run shows
237
+ how many were excluded.
238
+
239
+ **My prompts are not in English.** That is fine: prompts in any language are analysed (Chinese
240
+ gets extra handling for acknowledgements and corrections). The report comes in English and
241
+ Traditional Chinese (`--lang`, see [Usage](#usage)); quotes stay in their original language.
242
+
243
+ prompt-profile is not affiliated with or endorsed by Anthropic or OpenAI.
244
+
245
+ ## Development
246
+
247
+ See [CONTRIBUTING.md](CONTRIBUTING.md), [AGENTS.md](AGENTS.md) and [plans/](plans/README.md).
248
+ CI covers Linux (Node.js 22/24) and macOS (Node.js 24); Windows is unverified.
249
+ CLI behavior was checked with Claude Code 2.1.309 and codex-cli 0.164.0; upgrade the CLI if an
250
+ isolation flag is not recognized. `pnpm test:package` checks the installed npm tarball, including
251
+ bundled prompts, fonts, WASM rendering and file permissions.
252
+
253
+ ## License
254
+
255
+ MIT