agent-personalizer 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -1
- package/CONTRIBUTING.md +3 -3
- package/README.md +12 -10
- package/RELEASING.md +8 -7
- package/SECURITY.md +1 -1
- package/bin/agent-personalizer.js +21 -32
- package/bin/cli-util.cjs +28 -0
- package/bin/global.cjs +4 -4
- package/bin/install-plan.cjs +4 -3
- package/bin/learn.cjs +10 -3
- package/bin/sessions.cjs +195 -35
- package/bin/uninstall.cjs +3 -3
- package/check/gate.cjs +116 -17
- package/docs/guarantees.md +1 -1
- package/docs/install.md +6 -6
- package/docs/learning.md +7 -7
- package/docs/paste-guide.md +8 -6
- package/docs/tiers.md +1 -1
- package/hooks/README.md +17 -1
- package/hooks/gemini-cli/session-start.sh +15 -0
- package/llms.txt +6 -4
- package/package.json +6 -3
- package/render/onboarding.cjs +30 -47
- package/render/render.cjs +24 -15
- package/rules/00-read-the-profile-first.md +3 -0
- package/rules/20-one-owner-per-rule.md +3 -0
- package/rules/30-folder-index-is-part-of-the-change.md +3 -0
- package/rules/40-sign-every-edit.md +4 -1
- package/skills/agent-personalizer/SKILL.md +104 -0
- package/templates/GEMINI.md +30 -0
- package/examples/freelance-illustrator/.agent-personalizer.json +0 -57
- package/examples/freelance-illustrator/AGENTS.md +0 -244
- package/examples/freelance-illustrator/AGENT_ONBOARDING.md +0 -67
- package/examples/freelance-illustrator/CLAUDE.md +0 -248
- package/examples/freelance-illustrator/LEARNED.md +0 -14
- package/examples/freelance-illustrator/USER.md +0 -54
- package/examples/freelance-illustrator/notes/README.md +0 -39
- package/examples/freelance-illustrator/notes/decisions.md +0 -18
- package/examples/freelance-illustrator/notes/inbox/2026-09-03-shot-list-for-six-prints.md +0 -14
- package/examples/freelance-illustrator/notes/inbox/README.md +0 -19
- package/examples/freelance-illustrator/notes/sessions/2026-W36.md +0 -41
- package/examples/freelance-illustrator/rules/00-read-the-profile-first.md +0 -24
- package/examples/freelance-illustrator/rules/10-evidence-before-assertion.md +0 -24
- package/examples/freelance-illustrator/rules/20-one-owner-per-rule.md +0 -24
- package/examples/freelance-illustrator/rules/30-folder-index-is-part-of-the-change.md +0 -26
- package/examples/freelance-illustrator/rules/40-sign-every-edit.md +0 -25
- package/examples/freelance-illustrator/rules/50-output-style.md +0 -21
- package/examples/freelance-illustrator/rules/60-act-or-ask.md +0 -30
- package/examples/freelance-illustrator/rules/65-ask-before-it-repeats.md +0 -18
- package/examples/freelance-illustrator/rules/70-their-words-point-at-the-thing.md +0 -15
- package/examples/freelance-illustrator/rules/80-symptoms-are-not-causes.md +0 -15
- package/examples/freelance-illustrator/rules/90-surface-what-they-cant-see.md +0 -15
- package/examples/freelance-illustrator/rules/README.md +0 -61
- package/examples/lab-technician/.agent-personalizer.json +0 -38
- package/examples/lab-technician/AGENTS.md +0 -243
- package/examples/lab-technician/AGENT_ONBOARDING.md +0 -64
- package/examples/lab-technician/CLAUDE.md +0 -247
- package/examples/lab-technician/LEARNED.md +0 -14
- package/examples/lab-technician/USER.md +0 -53
- package/examples/lab-technician/notes/README.md +0 -26
- package/examples/lab-technician/notes/decisions.md +0 -4
- package/examples/lab-technician/notes/inbox/2026-10-06-observation-table.md +0 -3
- package/examples/lab-technician/notes/inbox/README.md +0 -7
- package/examples/lab-technician/notes/sessions/2026-W41.md +0 -7
- package/examples/lab-technician/rules/00-read-the-profile-first.md +0 -24
- package/examples/lab-technician/rules/10-evidence-before-assertion.md +0 -24
- package/examples/lab-technician/rules/20-one-owner-per-rule.md +0 -24
- package/examples/lab-technician/rules/30-folder-index-is-part-of-the-change.md +0 -26
- package/examples/lab-technician/rules/40-sign-every-edit.md +0 -25
- package/examples/lab-technician/rules/50-output-style.md +0 -21
- package/examples/lab-technician/rules/60-act-or-ask.md +0 -30
- package/examples/lab-technician/rules/65-ask-before-it-repeats.md +0 -18
- package/examples/lab-technician/rules/70-their-words-point-at-the-thing.md +0 -15
- package/examples/lab-technician/rules/80-symptoms-are-not-causes.md +0 -15
- package/examples/lab-technician/rules/90-surface-what-they-cant-see.md +0 -15
- package/examples/lab-technician/rules/README.md +0 -61
- package/examples/product-designer/.agent-personalizer.json +0 -38
- package/examples/product-designer/AGENTS.md +0 -243
- package/examples/product-designer/AGENT_ONBOARDING.md +0 -63
- package/examples/product-designer/CLAUDE.md +0 -247
- package/examples/product-designer/LEARNED.md +0 -14
- package/examples/product-designer/USER.md +0 -53
- package/examples/product-designer/notes/README.md +0 -26
- package/examples/product-designer/notes/decisions.md +0 -4
- package/examples/product-designer/notes/inbox/2026-10-06-cancellation-wording.md +0 -8
- package/examples/product-designer/notes/inbox/README.md +0 -7
- package/examples/product-designer/notes/sessions/2026-W41.md +0 -7
- package/examples/product-designer/rules/00-read-the-profile-first.md +0 -24
- package/examples/product-designer/rules/10-evidence-before-assertion.md +0 -24
- package/examples/product-designer/rules/20-one-owner-per-rule.md +0 -24
- package/examples/product-designer/rules/30-folder-index-is-part-of-the-change.md +0 -26
- package/examples/product-designer/rules/40-sign-every-edit.md +0 -25
- package/examples/product-designer/rules/50-output-style.md +0 -21
- package/examples/product-designer/rules/60-act-or-ask.md +0 -30
- package/examples/product-designer/rules/65-ask-before-it-repeats.md +0 -18
- package/examples/product-designer/rules/70-their-words-point-at-the-thing.md +0 -15
- package/examples/product-designer/rules/80-symptoms-are-not-causes.md +0 -15
- package/examples/product-designer/rules/90-surface-what-they-cant-see.md +0 -15
- package/examples/product-designer/rules/README.md +0 -61
package/docs/learning.md
CHANGED
|
@@ -43,13 +43,13 @@ The saved AI selection chooses the sources. The reader takes up to 20 of the new
|
|
|
43
43
|
| Selected target | Local source |
|
|
44
44
|
|---|---|
|
|
45
45
|
| `claude` | Claude Code: `~/.claude/projects/<project>/<session>.jsonl`, directly inside each project folder |
|
|
46
|
-
| `agents` | Codex: `~/.codex/sessions/**/rollout-*.jsonl`, plus `~/.codex/memories/*.md` |
|
|
47
|
-
| `gemini` | Gemini CLI: `~/.gemini/tmp/<hash>/chats/session-*.jsonl` and
|
|
46
|
+
| `agents` | Codex: `~/.codex/sessions/**/rollout-*.jsonl`, plus `~/.codex/memories/*.md` and `~/.codex/memories_v2/**/*.md` |
|
|
47
|
+
| `gemini` | Gemini CLI: `~/.gemini/tmp/<slug-or-hash>/chats/session-*.jsonl` (and `.json`), `~/.cache/.gemini/tmp/<slug>/chats/` when sandboxed, and older `logs.json` |
|
|
48
48
|
| `chatgpt`, `prompt` | No local session reader |
|
|
49
49
|
|
|
50
|
-
By default, only sessions associated with the `--dir` folder or one of its subfolders are included. Claude Code and Codex sessions are matched by their recorded working directory; Gemini CLI
|
|
50
|
+
By default, only sessions associated with the `--dir` folder or one of its subfolders are included. Claude Code and Codex sessions are matched by their recorded working directory; Gemini CLI resolves project slugs from `~/.gemini/projects.json` and `.project_root` markers, with its legacy SHA-256 project folder as a fallback. If a session does not provide enough path information to match it safely, it is skipped. Use `npx agent-personalizer learn --dir . --all-projects` to include sessions from every project.
|
|
51
51
|
|
|
52
|
-
The digest contains typed user messages and, when Codex is selected, up to 20 of the newest Codex memory files in a separate section. These memory notes are global to your Codex account, not limited to this folder. AI replies, tool output, reasoning, automation sessions and injected context are dropped. Messages and memory notes over 2,000 characters are dropped whole. Gemini chat snapshots
|
|
52
|
+
The digest contains typed user messages and, when Codex is selected, up to 20 of the newest Codex memory files in a separate section. These memory notes are global to your Codex account, not limited to this folder. AI replies, tool output, reasoning, automation sessions and injected context are dropped. Messages and memory notes over 2,000 characters are dropped whole. Gemini chat records reconstruct final conversation state across append-only records, snapshots, patches and rewinds; a message repeated in the chat and logs is included once. The all-projects option affects session history; the memory file limit still applies.
|
|
53
53
|
|
|
54
54
|
The reader streams session files, skips oversized lines and stops a file at its size limit. Symlinks, unreadable files, other-project sessions and unknown or malformed formats are skipped and counted. Codex session headers are inspected to determine their project; message content from other projects is not scanned. The terminal lists files read and skip counts; message text is never printed there. Vendor format changes may mean fewer usable sessions until the reader is updated.
|
|
55
55
|
|
|
@@ -65,7 +65,7 @@ Messages and memory notes that look like secrets are dropped whole and counted u
|
|
|
65
65
|
|
|
66
66
|
## What your AI asks and keeps
|
|
67
67
|
|
|
68
|
-
Start your AI in the installed folder. Claude Code
|
|
68
|
+
Start your AI in the installed folder. Claude Code and Gemini CLI have `/personalize`; Codex receives the same procedure in its home file. At level 3, the session-start contract points to `/personalize` (or the home-file procedure for `agents`) while a digest has not been handled.
|
|
69
69
|
|
|
70
70
|
Each question includes a count and one short quote, such as "You've asked me to shorten replies 3 times this week. Make it a rule?" Fewer real patterns means fewer questions. Entries already confirmed or declined are never asked again.
|
|
71
71
|
|
|
@@ -97,10 +97,10 @@ npx agent-personalizer --uninstall --dir .
|
|
|
97
97
|
|
|
98
98
|
## How the loop closes
|
|
99
99
|
|
|
100
|
-
The installed home files carry the learning procedure; Claude Code also gets `.claude/commands/personalize.md`. At level 3, the session-start contract points at `/personalize` while a digest id is unasked. Your AI asks the questions, writes the statuses and digest id to `LEARNED.md`, then re-renders. Only current confirmed entries apply. A summary in `USER.md` can lag until an installer re-run; `LEARNED.md` owns entry status.
|
|
100
|
+
The installed home files carry the learning procedure; Claude Code also gets `.claude/commands/personalize.md` and Gemini CLI gets `.gemini/commands/personalize.toml`. At level 3, the session-start contract points at `/personalize` (or the home-file procedure for `agents`) while a digest id is unasked. Your AI asks the questions, writes the statuses and digest id to `LEARNED.md`, then re-renders. Only current confirmed entries apply. A summary in `USER.md` can lag until an installer re-run; `LEARNED.md` owns entry status.
|
|
101
101
|
|
|
102
102
|
Nothing watches the digest or verifies model behaviour in the background. You can verify the files with `npx agent-personalizer --dir .`, then at level 3, `node render/render.cjs --dir . --check`. A clean check exits 0; drift exits 1; invalid input exits 2. Check `LEARNED.md` for the approved or declined line and the digest id under `## Asked`. Re-paste ChatGPT's boxes after changes. With no shell, the AI tells you to run the re-render command.
|
|
103
103
|
|
|
104
|
-
The reader uses Node
|
|
104
|
+
The reader uses Node 22 built-ins and no network. Formats, unreadable files, symlinks, oversized lines and private matches are counted as skips. The digest header records the selected sources, files and counts; the terminal lists read paths without message text. Report a reader failure or leak through the channels in [SECURITY.md](../SECURITY.md).
|
|
105
105
|
|
|
106
106
|
The installer does not upload the digest. Other software can sync or share its containing folder; choose a private local folder if you want the copy to stay on this computer. The local `LEARNED.md` is the source of truth for entries; generated blocks and paste files are checked copies, and the digest is disposable evidence.
|
package/docs/paste-guide.md
CHANGED
|
@@ -5,9 +5,9 @@ The renderer writes one file per AI. This page says where each AI reads it, and
|
|
|
5
5
|
| Rendered file | Who reads it | How it is read |
|
|
6
6
|
|---|---|---|
|
|
7
7
|
| `CLAUDE.md` | Claude Code | Automatically, from the project, or `~/.claude/CLAUDE.md` for every project with `--global`. Nothing to paste. |
|
|
8
|
-
| `AGENT_ONBOARDING.md` | any AI | Named as the second thing to read in `CLAUDE.md` and `
|
|
9
|
-
| `AGENTS.md` | Codex CLI, Cursor, and other agents that adopted the AGENTS.md convention | Automatically, from the repository root; `--global` writes `~/.codex/AGENTS.md` for all projects. Nothing to paste. |
|
|
10
|
-
| `GEMINI.md` | Gemini CLI | Automatically, from the folder; `--global` writes `~/.gemini/GEMINI.md` for all projects. Nothing to paste. |
|
|
8
|
+
| `AGENT_ONBOARDING.md` | any AI | Named as the second thing to read in `CLAUDE.md`, `AGENTS.md` and `GEMINI.md`. Paste it wherever the AI has no file access (below). |
|
|
9
|
+
| `AGENTS.md` | Codex CLI, Cursor, Hermes Agent, and other agents that adopted the AGENTS.md convention | Automatically, from the repository root; `--global` writes `~/.codex/AGENTS.md` for all projects. Nothing to paste. |
|
|
10
|
+
| `GEMINI.md` | Gemini CLI and Google Antigravity | Automatically, from the folder; `--global` writes `~/.gemini/GEMINI.md` for all projects (also read by Google Antigravity alongside `~/.gemini/config/GEMINI.md`). Nothing to paste. |
|
|
11
11
|
| `SOUL.md` | Hermes Agent | `--global --ai hermes` appends a marked block to `~/.hermes/SOUL.md`. In a project, use `--ai agents` for `AGENTS.md`. A different `HERMES_HOME` changes where Hermes reads the global file. |
|
|
12
12
|
| `chatgpt-box1.txt`, `chatgpt-box2.txt` and `chatgpt-custom-instructions.md` | ChatGPT | Profile and response text to paste, with a preview and counts. |
|
|
13
13
|
| `system-prompt.md` | anything with a system-prompt field, shared bots, API calls | Paste as the system prompt. Universal rules only, no profile, safe to share. |
|
|
@@ -38,7 +38,7 @@ Open Settings → Personalization and enable customization. Copy the exported pr
|
|
|
38
38
|
- **Response instructions:** `chatgpt-box2.txt` is the plain onboarding and selected rule text.
|
|
39
39
|
- **Preview:** `chatgpt-custom-instructions.md` carries both exports inside fences with their character counts.
|
|
40
40
|
|
|
41
|
-
The configured budget is 1,500 characters per export in `render/targets.json
|
|
41
|
+
The configured baseline budget is 1,500 characters per export in `render/targets.json`: ChatGPT Free and Go accounts cap custom instructions at 1,500 characters, while Plus, Pro, Business, Enterprise and Education accounts allow up to 5,000 characters under Settings → Personalization (`More about you` and `Custom instructions`). With onboarding answers, box 1 compacts the generated profile while its structure still parses, and preserves custom profile text in full when it does not. Box 2 places the onboarding block (always-ask, off-limits, write policy, then style) before the selected session rules. Confirmed entries are retained; declined "Never ask again" entries may be shortened to fit the budget. Proposed entries are omitted. The preview reports each count. Over-budget text is written in full and flagged OVER BUDGET; `--strict` refuses the write. Review the text against your account's displayed limits. For the full onboarding, entries and rule source, create a ChatGPT Project and upload `AGENT_ONBOARDING.md`, `LEARNED.md` and `rules/` as project files.
|
|
42
42
|
|
|
43
43
|
## Codex CLI
|
|
44
44
|
|
|
@@ -55,9 +55,11 @@ Verified against [OpenAI's Codex AGENTS.md documentation](https://learn.chatgpt.
|
|
|
55
55
|
|
|
56
56
|
Reads `AGENTS.md` at the project root. Older setups use `.cursor/rules/`; if yours does, point one rule file at `AGENTS.md` rather than copying its text, so there is one owner.
|
|
57
57
|
|
|
58
|
-
## Gemini CLI
|
|
58
|
+
## Gemini CLI and Google Antigravity
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
Gemini CLI reads `GEMINI.md` from the folder (and parent folders), plus `~/.gemini/GEMINI.md` when installed with `--global --ai gemini`. Project installs also add `.gemini/commands/personalize.toml` for `/personalize`, and level-3 installs provide `hooks/gemini-cli/session-start.sh` for `.gemini/settings.json` (see [`hooks/README.md`](../hooks/README.md)).
|
|
61
|
+
|
|
62
|
+
Google Antigravity also reads project `GEMINI.md` files (from the workspace root up to the current folder) and `~/.gemini/GEMINI.md` for compatibility; its primary global instruction file is `~/.gemini/config/GEMINI.md`, which enforces a 24,000-byte per-file limit after includes. Use `--compact` if a custom rule set approaches the 20,000-character warning budget.
|
|
61
63
|
|
|
62
64
|
## Anything else
|
|
63
65
|
|
package/docs/tiers.md
CHANGED
|
@@ -55,7 +55,7 @@ The four file targets have a 20,000-character warning budget for the whole rende
|
|
|
55
55
|
|
|
56
56
|
**What.** The handful of rules that must win at the moment of decision, injected in full at the start of every session. Not pointers. Full text.
|
|
57
57
|
|
|
58
|
-
**Where.** A session-start hook (Claude Code
|
|
58
|
+
**Where.** A session-start hook (Claude Code and Gemini CLI both support `SessionStart` hooks; see [`hooks/README.md`](../hooks/README.md)). For AIs without hooks, a block you paste at the top of the first message, or a saved prompt that starts every session.
|
|
59
59
|
|
|
60
60
|
**Prevents.** A tool's own instructions beating yours by default. Installed skills, plugins and tool descriptions each say "use me." A rule that says "use the other one first" loses that argument if it is only stated in a document the AI may or may not have opened. Injection makes sure your rule is at least in the room; it does not settle the argument on every host.
|
|
61
61
|
|
package/hooks/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# hooks/
|
|
2
2
|
|
|
3
|
-
Tier 3 from the tiers doc (https://github.com/aunysillyme/agent-personalizer/blob/v0.
|
|
3
|
+
Tier 3 from the tiers doc (https://github.com/aunysillyme/agent-personalizer/blob/v0.10.0/docs/tiers.md): the few rules that must be in context at the moment of decision, injected in full at the start of every session. Injection puts the text in front of the model; whether the model follows it is up to the model and the host. This is the strongest placement available, not a guarantee.
|
|
4
4
|
|
|
5
5
|
Which rules? The ones with `inject: true` in their frontmatter. Keep that set small. Every injected rule costs tokens every session.
|
|
6
6
|
|
|
@@ -26,6 +26,22 @@ The contract is target-aware: `--contract-target claude` applies each rule's `su
|
|
|
26
26
|
|
|
27
27
|
**Subagents do not get SessionStart.** A subagent you spawn from a session sees none of this unless you pass it in the task. That is why the rendered `CLAUDE.md` also carries pointers to every rule: the pointer survives, the injection does not.
|
|
28
28
|
|
|
29
|
+
## Gemini CLI
|
|
30
|
+
|
|
31
|
+
`gemini-cli/session-start.sh` wraps `--contract --contract-target gemini` in Gemini CLI's structured `SessionStart` JSON output (`hookSpecificOutput.additionalContext`), so the contract enters model context rather than displaying only as a terminal status message. Register it in the project's `.gemini/settings.json`:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"hooks": {
|
|
36
|
+
"SessionStart": [
|
|
37
|
+
{ "hooks": [ { "type": "command", "command": "sh \"$GEMINI_PROJECT_DIR/hooks/gemini-cli/session-start.sh\"" } ] }
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
For user-level `~/.gemini/settings.json`, use the absolute path to the installed project instead, for example `sh "/path/to/project/hooks/gemini-cli/session-start.sh"`.
|
|
44
|
+
|
|
29
45
|
## Everything else (plain-prompt fallback)
|
|
30
46
|
|
|
31
47
|
For an AI with no hook system, generate the contract once and paste it at the top of the first message, or save it as the opening block of a reusable prompt:
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Gemini CLI SessionStart hook: injects the rendered session-start contract as JSON additionalContext.
|
|
3
|
+
set -eu
|
|
4
|
+
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
5
|
+
exec node -e '
|
|
6
|
+
const { spawnSync } = require("child_process");
|
|
7
|
+
const path = require("path");
|
|
8
|
+
const root = process.argv[1];
|
|
9
|
+
const r = spawnSync(process.execPath, [path.join(root, "render/render.cjs"), "--dir", root, "--contract", "--contract-target", "gemini"], { encoding: "utf8" });
|
|
10
|
+
if (r.status !== 0) {
|
|
11
|
+
process.stderr.write(r.stderr || r.stdout || "");
|
|
12
|
+
process.exit(r.status || 1);
|
|
13
|
+
}
|
|
14
|
+
process.stdout.write(JSON.stringify({ hookSpecificOutput: { hookEventName: "SessionStart", additionalContext: r.stdout } }) + "\n");
|
|
15
|
+
' "$ROOT"
|
package/llms.txt
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# agent-personalizer
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> AI custom instructions from approved entries: a profile and rules for Claude Code, Codex, Cursor, Gemini CLI, Hermes Agent and ChatGPT, rendered from one source and kept in sync.
|
|
4
4
|
|
|
5
|
-
Install with `npx agent-personalizer`. Node
|
|
5
|
+
Install with `npx agent-personalizer`. Node 24 or 26 (active LTS) is recommended; 22 or later runs. Headless setup: `npx agent-personalizer --dir . --ai claude,agents --level 1 --yes --defaults`.
|
|
6
6
|
|
|
7
7
|
The installer asks which AIs you use and whether it may learn from your recent sessions, with No as the default. It writes USER.md, LEARNED.md, AGENT_ONBOARDING.md and each selected AI's instruction files. With a yes, it reads up to 20 recent sessions from Claude Code, Codex and Gemini CLI, plus Codex memory notes, and saves a local digest. The user's AI asks up to five evidence-backed questions; confirmed entries reach every selected personal target and declined entries are never asked again. Level 2 adds local notes scaffolds for local and fallback notes tools. Level 3 adds editable rules, a renderer, a session-start hook, a drift check and a forbidden-string gate.
|
|
8
8
|
|
|
9
9
|
Re-runs ask nothing, keep saved answers and update untouched installed files and pointer lines. Edited copies stay and are named, old notes folders stay in place, and upgrades refresh untouched tools. USER.md supplies every profile export, including ChatGPT; LEARNED.md owns the shared entries. `npx agent-personalizer learn --dir .` asks for consent before collecting new evidence. `learn --forget` deletes the digest. Uninstall keeps a LEARNED.md with entries, removes the digest and restores untouched files byte for byte; neither touches the AI apps' history. Preview removal with `npx agent-personalizer --uninstall --dir . --dry`.
|
|
10
10
|
|
|
11
|
-
Session data stays local until the user's AI reads it and sends it to its provider again. Only reuse history you may share, filter other people's details with check/forbidden.local.txt and check agreements for work accounts. The tool makes no network calls. It is not affiliated with Anthropic, OpenAI or
|
|
11
|
+
Session data stays local until the user's AI reads it and sends it to its provider again. Only reuse history you may share, filter other people's details with check/forbidden.local.txt and check agreements for work accounts. The tool makes no network calls. It is not affiliated with Anthropic, OpenAI, Google, Anysphere or Nous Research, and their saved formats can change.
|
|
12
12
|
|
|
13
13
|
## Docs
|
|
14
14
|
|
|
@@ -26,8 +26,10 @@ Session data stays local until the user's AI reads it and sends it to its provid
|
|
|
26
26
|
- [model-orchestrator](https://github.com/aunysillyme/model-orchestrator): Model router for AI coding agents: routes routine work to cheaper models with routing rules, 8 subagents, hooks and a CLI runner
|
|
27
27
|
- [repo-build-skill](https://github.com/aunysillyme/repo-build-skill): Skill pack that teaches your AI to build, release and launch a GitHub repo: stack pick, README, AGENTS.md, llms.txt, repo SEO and AEO, trusted publishing.
|
|
28
28
|
- [website-build-skill](https://github.com/aunysillyme/website-build-skill): A skill pack that turns your AI into an expert website builder: current research, design, code, accessibility, speed, SEO and security, alone or as a team.
|
|
29
|
-
- [lean-browser-use](https://github.com/aunysillyme/lean-browser-use): Cut browser use cost
|
|
29
|
+
- [lean-browser-use](https://github.com/aunysillyme/lean-browser-use): Cut Claude Code browser use cost 3% to 25% (about 14% in 2 runs): fresh runner subagent, bulk reads, 3 guards and a token meter. One npx command.
|
|
30
30
|
- [lean-computer-use](https://github.com/aunysillyme/lean-computer-use): Background Mac computer control for AI agents: desk tools, a fresh runner subagent, retry guards and a transcript token meter, installed with one command
|
|
31
|
+
- [decompose](https://github.com/aunysillyme-dev/aunx-decompose): Task planner and wave checker for AI coding agents: splits prompts into checkable units and parallel waves, rejecting cycles and overlapping writes
|
|
32
|
+
- [aunx-skills](https://github.com/aunysillyme-dev/aunx-skills): Ten standalone agent skills for Claude Code, Codex, Cursor and Gemini CLI: full output keeper, number guard, docs fetch ladder, rename sweep and more
|
|
31
33
|
<!-- set:end -->
|
|
32
34
|
|
|
33
35
|
## Optional
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-personalizer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "AI custom instructions from approved entries: a profile and rules for Claude Code, Codex, Cursor, Gemini CLI, Hermes Agent and ChatGPT, kept in sync from one source.",
|
|
5
5
|
"author": "aunysillyme (https://github.com/aunysillyme)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
"codex",
|
|
19
19
|
"cursor",
|
|
20
20
|
"gemini-cli",
|
|
21
|
+
"google-antigravity",
|
|
22
|
+
"hermes-agent",
|
|
21
23
|
"chatgpt",
|
|
22
24
|
"personalization",
|
|
23
25
|
"agent-onboarding",
|
|
@@ -42,7 +44,7 @@
|
|
|
42
44
|
"test": "sh test/run.sh"
|
|
43
45
|
},
|
|
44
46
|
"engines": {
|
|
45
|
-
"node": ">=
|
|
47
|
+
"node": ">=22"
|
|
46
48
|
},
|
|
47
49
|
"files": [
|
|
48
50
|
"bin",
|
|
@@ -50,11 +52,12 @@
|
|
|
50
52
|
"rules",
|
|
51
53
|
"templates",
|
|
52
54
|
"hooks",
|
|
55
|
+
"skills",
|
|
53
56
|
"check/gate.cjs",
|
|
54
57
|
"check/forbidden.example.txt",
|
|
55
58
|
"docs",
|
|
56
59
|
"!docs/*.gif",
|
|
57
|
-
"examples",
|
|
60
|
+
"examples/answers.json",
|
|
58
61
|
"README.md",
|
|
59
62
|
"LICENSE",
|
|
60
63
|
"CLA.md",
|
package/render/onboarding.cjs
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
DOCS points at the matching tag on GitHub so an installed copy never links to a file the
|
|
18
18
|
destination does not have.
|
|
19
19
|
*/
|
|
20
|
-
const VERSION = '0.
|
|
20
|
+
const VERSION = '0.10.0';
|
|
21
21
|
const DOCS = `https://github.com/aunysillyme/agent-personalizer/blob/v${VERSION}/docs`;
|
|
22
22
|
|
|
23
23
|
/* THE single source for notes tools. Add a tool here and nowhere else: the saved choice option, the
|
|
@@ -72,52 +72,49 @@ const NOTES_PENDING_MARK = 'no local notes folder yet, so no folder rules yet';
|
|
|
72
72
|
const notesLater = (base) => `\`--level 2\` creates \`${base}/\``;
|
|
73
73
|
|
|
74
74
|
const LEGACY = [
|
|
75
|
-
{ id: 'name',
|
|
76
|
-
{ id: 'pronouns',
|
|
77
|
-
{ id: 'work',
|
|
78
|
-
{ id: 'focus',
|
|
75
|
+
{ id: 'name', type: 'text', default: 'the user' },
|
|
76
|
+
{ id: 'pronouns', type: 'text', default: '' },
|
|
77
|
+
{ id: 'work', type: 'text', default: '' },
|
|
78
|
+
{ id: 'focus', type: 'text', default: '' },
|
|
79
79
|
];
|
|
80
80
|
const QUESTIONS = [
|
|
81
|
-
{ id: 'tone',
|
|
81
|
+
{ id: 'tone', type: 'choice', default: 'direct',
|
|
82
82
|
options: [['direct', 'direct answers, no hedging, say what you think'], ['balanced', 'direct but soften disagreement'], ['gentle', 'lead with what works before what does not']] },
|
|
83
|
-
{ id: 'length',
|
|
83
|
+
{ id: 'length', type: 'choice', default: 'short',
|
|
84
84
|
options: [['short', 'short by default, detail on request'], ['adaptive', 'as long as the question needs'], ['thorough', 'complete every time']] },
|
|
85
|
-
{ id: 'mistakes',
|
|
85
|
+
{ id: 'mistakes', type: 'choice', default: 'one-line',
|
|
86
86
|
options: [['one-line', 'state the correction in one line and move on'], ['brief', 'correction plus one line on the cause'], ['full', 'correction plus the full cause']] },
|
|
87
|
-
{ id: 'unsure',
|
|
87
|
+
{ id: 'unsure', type: 'choice', default: 'ask-when-it-changes-the-build',
|
|
88
88
|
options: [['ask-when-it-changes-the-build', 'settle facts itself; ask only when the answer changes what gets built', 'settle facts yourself; ask only when the answer changes what gets built'], ['ask-first', 'ask before doing anything uncertain'], ['assume-and-say', 'proceed on a stated assumption, never ask']] },
|
|
89
|
-
{ id: 'lead_with',
|
|
89
|
+
{ id: 'lead_with', type: 'choice', default: 'verdict',
|
|
90
90
|
options: [['verdict', 'the answer or the verdict'], ['summary', 'a one-paragraph summary'], ['context', 'the context, then the answer']] },
|
|
91
|
-
{ id: 'structure',
|
|
91
|
+
{ id: 'structure', type: 'choice', default: 'bullets',
|
|
92
92
|
options: [['bullets', 'lead-in line, then bullets, one item per line'], ['prose', 'short paragraphs'], ['tables-when-comparing', 'bullets by default, a table when comparing three or more things']] },
|
|
93
|
-
{ id: 'evidence',
|
|
93
|
+
{ id: 'evidence', type: 'choice', default: 'inline',
|
|
94
94
|
options: [['inline', 'in the reply: paths, counts, dates'], ['linked', 'a link to where it lives'], ['none', 'not needed']] },
|
|
95
|
-
{ id: 'never',
|
|
96
|
-
{ id: 'read_first',
|
|
97
|
-
{ id: 'notes_tool',
|
|
95
|
+
{ id: 'never', type: 'list', default: [] },
|
|
96
|
+
{ id: 'read_first', type: 'list', default: ['USER.md', 'AGENT_ONBOARDING.md'] },
|
|
97
|
+
{ id: 'notes_tool', type: 'choice', default: 'folder',
|
|
98
98
|
options: Object.entries(TOOL).map(([k, t]) => [k, t.label]) },
|
|
99
|
-
{ id: 'obsidian_tc',
|
|
99
|
+
{ id: 'obsidian_tc', type: 'choice', default: 'no',
|
|
100
100
|
options: [['no', 'not installed; the AI works on the vault folder directly'], ['yes', 'installed and connected; the AI reaches the vault through it']] },
|
|
101
|
-
{ id: 'notes_tool_name',
|
|
102
|
-
{ id: 'notes_path',
|
|
103
|
-
{ id: 'tracker',
|
|
104
|
-
{ id: 'write_policy',
|
|
101
|
+
{ id: 'notes_tool_name', type: 'text', default: '' },
|
|
102
|
+
{ id: 'notes_path', type: 'text', default: 'notes' },
|
|
103
|
+
{ id: 'tracker', type: 'text', default: 'none' },
|
|
104
|
+
{ id: 'write_policy', type: 'choice', default: 'notes-freely',
|
|
105
105
|
options: [['notes-freely', 'anywhere under the notes folder, under the folder rules'], ['logs-and-inbox-only', 'only the session log, decisions log and inbox'], ['ask-before-every-write', 'ask before every write']] },
|
|
106
|
-
{ id: 'file_naming',
|
|
106
|
+
{ id: 'file_naming', type: 'choice', default: 'kebab-case',
|
|
107
107
|
options: [['kebab-case', 'my-note-title.md'], ['snake_case', 'my_note_title.md'], ['any', 'no rule']] },
|
|
108
|
-
{ id: 'signature',
|
|
108
|
+
{ id: 'signature', type: 'choice', default: 'yes',
|
|
109
109
|
options: [['yes', 'one line, overwritten each edit'], ['no', 'no signature']] },
|
|
110
|
-
{ id: 'off_limits',
|
|
111
|
-
{ id: 'always_ask',
|
|
110
|
+
{ id: 'off_limits', type: 'list', default: [] },
|
|
111
|
+
{ id: 'always_ask', type: 'multi',
|
|
112
112
|
default: ['delete', 'publish', 'send', 'spend', 'settings', 'standing-rules'],
|
|
113
113
|
options: [['delete', 'deleting or overwriting anything'], ['publish', 'publishing or posting anything public'], ['send', 'sending a message on your behalf'], ['spend', 'spending money'], ['settings', 'changing account or system settings'], ['standing-rules', 'creating a standing rule, schedule or automation']] },
|
|
114
114
|
];
|
|
115
115
|
|
|
116
116
|
const SETTINGS = [...LEGACY, ...QUESTIONS];
|
|
117
117
|
const IDS = new Set(SETTINGS.map(q => q.id));
|
|
118
|
-
// The installer asks only which AIs and whether it may read sessions.
|
|
119
|
-
const QUICK = [];
|
|
120
|
-
function asks() { return false; }
|
|
121
118
|
/* only the answers that differ from the defaults: what the installer stores, so the config reads as
|
|
122
119
|
"what this person chose" and a future default applies to everyone who never chose otherwise */
|
|
123
120
|
/* PINNED answers are always stored, default or not: they govern what the AI may touch, so a future
|
|
@@ -131,15 +128,6 @@ function defaults() {
|
|
|
131
128
|
return a;
|
|
132
129
|
}
|
|
133
130
|
|
|
134
|
-
/* Interview defaults preserve even an empty saved answer. Asked answers override saved values;
|
|
135
|
-
package defaults fill only missing keys. Validation remains the caller's final step. */
|
|
136
|
-
function interviewDefault(q, saved) {
|
|
137
|
-
return saved && Object.hasOwn(saved, q.id) ? saved[q.id] : q.default;
|
|
138
|
-
}
|
|
139
|
-
function interviewAnswers(saved, asked = {}) {
|
|
140
|
-
return { ...defaults(), ...saved, ...asked };
|
|
141
|
-
}
|
|
142
|
-
|
|
143
131
|
/* Strict validation: unknown keys, wrong types and unknown choices are errors, never defaults.
|
|
144
132
|
Returns the completed answer set (missing keys take their default). */
|
|
145
133
|
const RESERVED = /<!--\s*agent-personalizer/i;
|
|
@@ -176,22 +164,13 @@ function validate(input) {
|
|
|
176
164
|
const reserved = out.notes_path.split('/').find(segment => ['.git', '.github', 'node_modules'].includes(segment.toLowerCase()));
|
|
177
165
|
if (kindOf(out) === 'disk' && reserved)
|
|
178
166
|
throw new Error(`"notes_path" must not contain the reserved segment "${reserved}"`);
|
|
179
|
-
const owned = ['.agent-personalizer', '.agent-personalizer.json', '.claude', 'render', 'rules', 'check', 'hooks', 'USER.md', 'LEARNED.md', 'CLAUDE.md', 'AGENTS.md', 'GEMINI.md', 'AGENT_ONBOARDING.md', 'system-prompt.md', 'chatgpt-custom-instructions.md', 'chatgpt-box1.txt', 'chatgpt-box2.txt'];
|
|
167
|
+
const owned = ['.agent-personalizer', '.agent-personalizer.json', '.claude', '.gemini', 'render', 'rules', 'check', 'hooks', 'USER.md', 'LEARNED.md', 'CLAUDE.md', 'AGENTS.md', 'GEMINI.md', 'AGENT_ONBOARDING.md', 'system-prompt.md', 'chatgpt-custom-instructions.md', 'chatgpt-box1.txt', 'chatgpt-box2.txt'];
|
|
180
168
|
if (kindOf(out) === 'disk' && owned.some(p => out.notes_path.toLowerCase() === p.toLowerCase() || out.notes_path.toLowerCase().startsWith(p.toLowerCase() + '/')))
|
|
181
169
|
throw new Error('"notes_path" must be outside agent-personalizer tool-owned paths, including .agent-personalizer/');
|
|
182
170
|
return out;
|
|
183
171
|
}
|
|
184
172
|
const SAFE_REL = /^(?!\.\.?(?:\/|$))[A-Za-z0-9._ -]+(?:\/(?!\.\.?(?:\/|$))[A-Za-z0-9._ -]+)*$/;
|
|
185
173
|
|
|
186
|
-
/* Parse one typed interview answer (a string) for a question; '' means the default. */
|
|
187
|
-
function parseAnswer(q, raw) {
|
|
188
|
-
const s = String(raw).trim();
|
|
189
|
-
if (s === '') return Array.isArray(q.default) ? [...q.default] : q.default;
|
|
190
|
-
if (q.type === 'text') return s;
|
|
191
|
-
if (q.type === 'choice') return s;
|
|
192
|
-
return s.split(',').map(x => x.trim()).filter(Boolean);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
174
|
const label = (q, v) => { const o = q.options && q.options.find(x => x[0] === v); return o ? o[1] : v; };
|
|
196
175
|
/* The interview asks the HUMAN about the AI, so an option's label is third person ("settle facts
|
|
197
176
|
itself"). USER.md, AGENT_ONBOARDING.md and the session-start contract all address the AI
|
|
@@ -552,4 +531,8 @@ After the questions are answered (or no real patterns exist), add the full diges
|
|
|
552
531
|
As you work, on the second correction of the same thing, ask once, naming both moments, "Make it a rule?" Save a yes or no with the same status and re-render. Check confirmed and declined entries before asking.`;
|
|
553
532
|
}
|
|
554
533
|
|
|
555
|
-
|
|
534
|
+
function geminiPersonalizeToml() {
|
|
535
|
+
return `description = "Review the session learning digest and ask up to 5 preference questions."\nprompt = '''\n${learningProcedure()}\n'''\n`;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
module.exports = { parseLearned, entriesBlock, learningProcedure, geminiPersonalizeToml, LEGACY, QUESTIONS, PINNED, TOOL, VERSION, DOCS, FALLBACK, notesPending, defaults, sparse, validate, renderUser, renderOnboarding, contractBlock, compactProfile, compactProfileFromUser, kindOf, baseFor };
|
package/render/render.cjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
render.cjs: USER.md + rules/*.md -> per-AI instruction files.
|
|
5
5
|
|
|
6
6
|
usage:
|
|
7
|
-
node render/render.cjs [--dir <project>] [--targets claude,agents,gemini,chatgpt,prompt] [--check] [--strict] [--rules <dir>]
|
|
7
|
+
node render/render.cjs [--dir <project>] [--targets claude,agents,gemini,hermes,chatgpt,prompt,onboarding] [--compact] [--check] [--strict] [--rules <dir>]
|
|
8
8
|
node render/render.cjs [--dir <project>] --contract [--contract-target claude] [--no-personal]
|
|
9
9
|
node render/render.cjs --help | -h · --version | -v
|
|
10
10
|
|
|
@@ -270,6 +270,9 @@ function rulesDir(root, explicit) {
|
|
|
270
270
|
}
|
|
271
271
|
function loadRules(root, explicit) {
|
|
272
272
|
const rdir = rulesDir(root, explicit || null);
|
|
273
|
+
const pkgRules = (() => { try { return fs.realpathSync(path.resolve(__dirname, '..', 'rules')); } catch (_) { return ''; } })();
|
|
274
|
+
const realRdir = (() => { try { return fs.realpathSync(rdir); } catch (_) { return rdir; } })();
|
|
275
|
+
const packageOwned = realRdir === pkgRules;
|
|
273
276
|
const out = [];
|
|
274
277
|
for (const f of fs.readdirSync(rdir).sort()) {
|
|
275
278
|
if (f === 'README.md') continue;
|
|
@@ -280,7 +283,7 @@ function loadRules(root, explicit) {
|
|
|
280
283
|
const { meta, body } = parseFrontmatter(text, where);
|
|
281
284
|
const sections = parseSections(body, where);
|
|
282
285
|
if (!sections.universal) die(`${where}: missing "## universal" block`);
|
|
283
|
-
out.push({ file: f, meta, sections });
|
|
286
|
+
out.push({ file: f, meta, sections, packageOwned });
|
|
284
287
|
}
|
|
285
288
|
return out;
|
|
286
289
|
}
|
|
@@ -369,14 +372,14 @@ function pendingDigest(root, entries) {
|
|
|
369
372
|
} finally { if (fd !== undefined) fs.closeSync(fd); }
|
|
370
373
|
}
|
|
371
374
|
|
|
372
|
-
function renderTarget(key, target, profile, rules, cfg, root, learned) {
|
|
375
|
+
function renderTarget(key, target, profile, rules, cfg, root, learned, boilerplate = text => text) {
|
|
373
376
|
if (target.source === 'onboarding') {
|
|
374
377
|
if (!cfg || !cfg.onboarding) die(`target "${key}": no onboarding answers in .agent-personalizer.json. Run the installer, or pass --answers <file>`);
|
|
375
|
-
return onboarding.renderOnboarding(cfg.onboarding, { notesScaffolded: notesScaffolded(root, cfg.onboarding) });
|
|
378
|
+
return boilerplate(onboarding.renderOnboarding(cfg.onboarding, { notesScaffolded: notesScaffolded(root, cfg.onboarding) }));
|
|
376
379
|
}
|
|
377
380
|
rules = rulesAtLevel(rules, cfg);
|
|
378
381
|
const answers = answersOf(cfg);
|
|
379
|
-
const lines = [`## ${target.header}
|
|
382
|
+
const lines = [boilerplate(`## ${target.header}`), '', boilerplate('_Generated by agent-personalizer from `USER.md`, `LEARNED.md`, `rules/` and your saved preferences. Edit those, then re-render. Do not edit between the markers._'), ''];
|
|
380
383
|
if (target.boxes) {
|
|
381
384
|
// The profile's own bytes win over stored answers. A generated profile can still be compact,
|
|
382
385
|
// but custom structure or prose stays in full. Box 2 uses the contract and inject:true rules
|
|
@@ -406,26 +409,27 @@ function renderTarget(key, target, profile, rules, cfg, root, learned) {
|
|
|
406
409
|
const fenceFor = (text) => { let n = 3; for (const m of text.matchAll(/(`{3,}|~{3,})/g)) n = Math.max(n, m[1].length + 1); return '`'.repeat(n); };
|
|
407
410
|
const f1 = fenceFor(box1), f2 = fenceFor(box2);
|
|
408
411
|
renderTarget.boxes = { box1: box1 + '\n', box2: box2 + '\n' }; // plain paste files, written beside the markdown
|
|
409
|
-
lines.push('### Box 1: "What would you like ChatGPT to know about you?"', '', '_Copy only the text inside the fence below (or paste the whole of `chatgpt-box1.txt`, the same text as a plain file)._', '', f1, box1, f1, warn('Box 1', box1), '');
|
|
410
|
-
lines.push('### Box 2: "How would you like ChatGPT to respond?"', '', '_Copy only the text inside the fence below (or paste the whole of `chatgpt-box2.txt`)._', '', f2, box2, f2, warn('Box 2', box2));
|
|
411
|
-
if (!answers) lines.push('', '> No onboarding answers in `.agent-personalizer.json`, so this is the full profile and every rule. Run the installer
|
|
412
|
-
else lines.push('', `> ChatGPT has no file access, so only the rules marked \`inject: true\` are here (${picked.length}). The rest live in \`rules/\`; for a ChatGPT Project, upload \`AGENT_ONBOARDING.md\` and \`rules/\` as project files instead of pasting.`);
|
|
412
|
+
lines.push('### Box 1: Profile ("More about you" / "What would you like ChatGPT to know about you?")', '', '_Copy only the text inside the fence below (or paste the whole of `chatgpt-box1.txt`, the same text as a plain file)._', '', f1, box1, f1, warn('Box 1', box1), '');
|
|
413
|
+
lines.push('### Box 2: Response instructions ("Custom instructions" / "How would you like ChatGPT to respond?")', '', '_Copy only the text inside the fence below (or paste the whole of `chatgpt-box2.txt`)._', '', f2, box2, f2, warn('Box 2', box2));
|
|
414
|
+
if (!answers) lines.push('', '> No onboarding answers in `.agent-personalizer.json`, so this is the full profile and every rule. Run the installer for the compact, budgeted form.');
|
|
415
|
+
else lines.push('', `> ChatGPT has no file access, so only the rules marked \`inject: true\` are here (${picked.length}). Free and Go accounts allow 1,500 characters per field; Plus, Pro, Business, Enterprise and Education allow up to 5,000 characters. The rest live in \`rules/\`; for a ChatGPT Project, upload \`AGENT_ONBOARDING.md\` and \`rules/\` as project files instead of pasting.`);
|
|
413
416
|
renderTarget.overBudget = (renderTarget.overBudget || []).concat(over.map(l => `${target.file}: ${l}`));
|
|
414
417
|
return lines.join('\n');
|
|
415
418
|
}
|
|
416
419
|
if (target.profile && profile) lines.push('## Profile', '', profile.body, '');
|
|
417
420
|
if (target.personal && target.profile) {
|
|
418
|
-
lines.push(onboarding.entriesBlock(learned), '', `_LEARNED.md source: ${learned.hash}_
|
|
419
|
-
if (['claude', 'agents', 'gemini', 'hermes'].includes(key)) lines.push(onboarding.learningProcedure(), '');
|
|
421
|
+
lines.push(onboarding.entriesBlock(learned), '', boilerplate(`_LEARNED.md source: ${learned.hash}_`), '');
|
|
422
|
+
if (['claude', 'agents', 'gemini', 'hermes'].includes(key)) lines.push(boilerplate(onboarding.learningProcedure()), '');
|
|
420
423
|
}
|
|
421
424
|
lines.push('## Rules', '');
|
|
422
425
|
for (const r of rulesFor(rules, key, answers)) {
|
|
426
|
+
const qualifyRule = r.packageOwned ? boilerplate : text => text;
|
|
423
427
|
if (cfg && cfg.compact && FILE_TARGETS.has(key) && r.meta.inject !== true) {
|
|
424
428
|
const practice = r.sections.universal.split('\n').find(line => line.startsWith('In practice:'));
|
|
425
429
|
if (!practice) die(`${r.file}: compact mode needs an In practice: line in the universal block`);
|
|
426
430
|
const link = cfg.level === 1 || cfg.level === 2 ? `https://github.com/aunysillyme/agent-personalizer/blob/v${onboarding.VERSION}/rules/${r.file}` : `rules/${r.file}`;
|
|
427
|
-
lines.push(`- **${r.meta.title || r.meta.id || r.file}**: ${practice} [Full rule](${link})
|
|
428
|
-
} else lines.push(renderRule(r, target), '');
|
|
431
|
+
lines.push(qualifyRule(`- **${r.meta.title || r.meta.id || r.file}**: ${practice} [Full rule](${link})`), '');
|
|
432
|
+
} else lines.push(qualifyRule(renderRule(r, target)), '');
|
|
429
433
|
}
|
|
430
434
|
return lines.join('\n').trimEnd();
|
|
431
435
|
}
|
|
@@ -512,7 +516,11 @@ function main() {
|
|
|
512
516
|
}
|
|
513
517
|
if (withPersonal) {
|
|
514
518
|
out.push(onboarding.entriesBlock(learned), '');
|
|
515
|
-
if (['claude', 'agents', 'gemini'].includes(key) && pendingDigest(root, learned))
|
|
519
|
+
if (['claude', 'agents', 'gemini'].includes(key) && pendingDigest(root, learned)) {
|
|
520
|
+
out.push(key === 'agents'
|
|
521
|
+
? '[agent-personalizer] New session digest: follow "Learn from my sessions" in AGENTS.md to review up to 5 questions.'
|
|
522
|
+
: '[agent-personalizer] New session digest: run /personalize to review up to 5 questions.');
|
|
523
|
+
}
|
|
516
524
|
}
|
|
517
525
|
process.stdout.write(out.join('\n'));
|
|
518
526
|
return;
|
|
@@ -708,6 +716,7 @@ function renderedContents(root, cfg, options = {}) {
|
|
|
708
716
|
const rules = loadRules(root, null);
|
|
709
717
|
const profile = Object.hasOwn(options, 'profileSource') ? profileFromSource(options.profileSource) : loadProfile(root);
|
|
710
718
|
const learned = options.learned || readLearned(root);
|
|
719
|
+
const boilerplate = typeof options.boilerplate === 'function' ? options.boilerplate : text => text;
|
|
711
720
|
renderTarget.boxes = null;
|
|
712
721
|
renderTarget.overBudget = [];
|
|
713
722
|
renderTarget.fileBudget = [];
|
|
@@ -715,7 +724,7 @@ function renderedContents(root, cfg, options = {}) {
|
|
|
715
724
|
const target = TARGETS[key];
|
|
716
725
|
if (!target) die(`unknown target "${key}"`);
|
|
717
726
|
safeTargetPath(root, target.file, key);
|
|
718
|
-
const block = renderTarget(key, target, profile, rules, cfg, root, learned);
|
|
727
|
+
const block = renderTarget(key, target, profile, rules, cfg, root, learned, boilerplate);
|
|
719
728
|
const out = [{ key, rel: target.file, block }];
|
|
720
729
|
if (target.boxes) for (const [which, rel] of Object.entries(target.boxFiles || {})) {
|
|
721
730
|
safeTargetPath(root, rel, `${key}:${which}`);
|
|
@@ -19,6 +19,9 @@ For learned entries, `LEARNED.md` owns the current status; a summary in the prof
|
|
|
19
19
|
## binding:agents
|
|
20
20
|
`USER.md` sits next to `AGENTS.md`. Read it before the first tool call.
|
|
21
21
|
|
|
22
|
+
## binding:gemini
|
|
23
|
+
`USER.md` sits next to `GEMINI.md`. In Gemini CLI and Google Antigravity, `GEMINI.md` loads automatically; read `USER.md` before the first tool call.
|
|
24
|
+
|
|
22
25
|
## origin
|
|
23
26
|
Written after: an AI produced a week of correctly formatted, well-reasoned work in the wrong voice, for the wrong audience, because the profile lived in a file nothing told it to open. A second week went to an AI that knew the person well and still wrote into the wrong folder, because nothing told it where writes were allowed.
|
|
24
27
|
Prevents: fluent output aimed at nobody in particular.
|
|
@@ -19,6 +19,9 @@ Pointer form in `CLAUDE.md`: a one-line rule followed by `[owner: rules/<file>.m
|
|
|
19
19
|
## binding:agents
|
|
20
20
|
Pointer form in `AGENTS.md`: a one-line rule followed by `[owner: rules/<file>.md]`.
|
|
21
21
|
|
|
22
|
+
## binding:gemini
|
|
23
|
+
Pointer form in `GEMINI.md`: a one-line rule followed by `[owner: rules/<file>.md]`.
|
|
24
|
+
|
|
22
25
|
## origin
|
|
23
26
|
Written after: a routing rule was corrected in its owning document and, four days later, four other surfaces still carried the old version. One of them was quoted back to the user as if her own decision had been the reverse. The drift detector was green throughout, because it checked each surface against the rule as last recorded, not against the owner.
|
|
24
27
|
Prevents: the same rule disagreeing with itself in five places.
|
|
@@ -21,6 +21,9 @@ Restate this rule in each folder's README so the folder carries its own contract
|
|
|
21
21
|
## binding:agents
|
|
22
22
|
Check the folder's README before reporting a write as done.
|
|
23
23
|
|
|
24
|
+
## binding:gemini
|
|
25
|
+
Check the folder's README before reporting a write as done.
|
|
26
|
+
|
|
24
27
|
## origin
|
|
25
28
|
Written after: an AI trusted a folder index that described a file deleted two weeks earlier, and built a plan on it. Agents read a notes folder by trusting the index over the files, because that is what an index is for.
|
|
26
29
|
Prevents: a stale index, which is worse than a missing one because it is believed.
|
|
@@ -18,7 +18,10 @@ The ten-word summary is the audit trail a human reads first. Say what changed, n
|
|
|
18
18
|
Name and model as the platform reports them, e.g. `Claude <model-id>`.
|
|
19
19
|
|
|
20
20
|
## binding:agents
|
|
21
|
-
Name and model as the platform reports them, e.g. `Codex <model-id>`.
|
|
21
|
+
Name and model as the platform reports them, e.g. `Codex <model-id>`, `Cursor <model-id>` or `Hermes <model-id>`.
|
|
22
|
+
|
|
23
|
+
## binding:gemini
|
|
24
|
+
Name and model as the platform reports them, e.g. `Gemini <model-id>`.
|
|
22
25
|
|
|
23
26
|
## origin
|
|
24
27
|
Written after: three AIs and one human edited the same file over a month and nobody could say which change came from whom, or which model had written the paragraph that turned out to be wrong.
|