agent-personalizer 0.4.0 → 0.4.2
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
|
@@ -19,24 +19,24 @@ Everything here is the generalized shape of a system that runs in production eve
|
|
|
19
19
|
|
|
20
20
|
**What this tool does, and does not do.** It writes files: a profile, an onboarding manual generated from your answers, rule files, rendered instruction files, a session-start hook, a drift check and a privacy gate. Those are the implemented parts and the harness tests every one of them. What it does not do: make an AI comply. Text in a file, or injected at session start, is the strongest placement available, and the stories in `docs/tiers.md` are one setup's experience of what held; they are not a measured guarantee across models or hosts, and nothing here measures compliance. Anything described as the AI "keeping" or "doing" is an instruction the AI is given, not a process this repo runs. The two [companion tools](#companion-tools) are where a rule becomes something a machine enforces.
|
|
21
21
|
|
|
22
|
-
**Privacy:** the tool itself runs entirely on your machine: no network calls, no telemetry, no environment variables read, writes only into the folder you name. The one network step is `npx` fetching the package from
|
|
22
|
+
**Privacy:** the tool itself runs entirely on your machine: no network calls, no telemetry, no environment variables read, writes only into the folder you name. The one network step is `npx` fetching the package from the npm registry (or GitHub) before the tool runs; nothing in this repo opens a connection after that. Runs on macOS and Linux, and the Node entry points (installer, renderer, gate) are smoke-tested on Windows in CI; the harness and the session hook are POSIX shell, so on Windows run those under WSL or Git Bash.
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
26
26
|
## Quick start
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
|
-
npx
|
|
29
|
+
npx agent-personalizer
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
The installer asks which AIs you use and which level you want, then writes only the matching files into the folder you point it at. It never writes secrets. `--help` lists every flag; `--quick` asks the seven questions that change behaviour and defaults the rest; `--answers file.json` (or `--answers -` from stdin) scripts it.
|
|
32
|
+
Published on npm with provenance from this repository's own workflow (`npx github:aunysillyme/agent-personalizer` still works and runs the same code straight from the tag). The installer asks which AIs you use and which level you want, then writes only the matching files into the folder you point it at. It never writes secrets. `--help` lists every flag; `--quick` asks the seven questions that change behaviour and defaults the rest; `--answers file.json` (or `--answers -` from stdin) scripts it.
|
|
33
33
|
|
|
34
34
|
No Node? Copy `templates/USER.md` and `templates/CLAUDE.md` (or `templates/AGENTS.md`) into your project by hand. That is level 1.
|
|
35
35
|
|
|
36
36
|
If `npx` stops with `EPERM` and a note about root-owned files in `~/.npm`, npm cannot write its cache. Point it at a local one for this run, no `sudo` needed:
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
-
npm_config_cache=./.npm-cache npx
|
|
39
|
+
npm_config_cache=./.npm-cache npx agent-personalizer
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
---
|
|
@@ -132,8 +132,8 @@ bin/ the npx installer
|
|
|
132
132
|
examples/ one invented user, end to end
|
|
133
133
|
docs/ tiers.md, companions.md, paste-guide.md
|
|
134
134
|
CHANGELOG.md keyed on audit rounds
|
|
135
|
-
.github/ harness.yml: the checks on every push and PR, Ubuntu and macOS x Node 18/20/22, plus a Windows smoke job; publish.yml: npm with provenance,
|
|
136
|
-
test/ run.sh:
|
|
135
|
+
.github/ harness.yml: the checks on every push and PR, Ubuntu and macOS x Node 18/20/22, plus a Windows smoke job; publish.yml: npm publish with provenance, dispatched per tag
|
|
136
|
+
test/ run.sh: 83 checks, exact exit codes, adversarial fixtures (symlinks, traversal, malformed markers, CRLF, partial renders)
|
|
137
137
|
```
|
|
138
138
|
|
|
139
139
|
## Changelog
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/*
|
|
4
4
|
agent-personalizer installer.
|
|
5
5
|
|
|
6
|
-
npx
|
|
6
|
+
npx agent-personalizer [--dir <folder>] [--ai claude,agents,gemini,chatgpt,prompt] [--level 1|2|3|4]
|
|
7
7
|
[--answers <file.json>] [--defaults] [--yes]
|
|
8
8
|
|
|
9
9
|
Interactive when flags are missing and stdin is a terminal. Non-interactive with flags.
|
|
@@ -44,12 +44,12 @@ const AI_LABEL = { claude: 'Claude (Claude Code, Claude apps)', agents: 'Codex /
|
|
|
44
44
|
function die(msg) { console.error(`agent-personalizer: ${msg}`); process.exit(2); }
|
|
45
45
|
|
|
46
46
|
const VALUE_OPTS = ['--dir', '--ai', '--level', '--answers'];
|
|
47
|
-
const FLAG_OPTS = ['--yes', '--defaults', '--quick', '--help', '--version'];
|
|
47
|
+
const FLAG_OPTS = ['--yes', '--defaults', '--quick', '--help', '--version', '-h', '-v'];
|
|
48
48
|
const USAGE = `agent-personalizer ${require(path.join(PKG, 'package.json')).version}
|
|
49
49
|
|
|
50
|
-
npx
|
|
50
|
+
npx agent-personalizer [--dir <folder>] [--ai claude,agents,gemini,chatgpt,prompt] [--level 1|2|3|4]
|
|
51
51
|
[--answers <file.json> | --answers - | --defaults] [--quick] [--yes]
|
|
52
|
-
[--help] [--version]
|
|
52
|
+
[--help | -h] [--version | -v]
|
|
53
53
|
|
|
54
54
|
Interactive when flags are missing and stdin is a terminal; the onboarding interview runs then.
|
|
55
55
|
--quick ask only the seven questions that change behaviour (name, tone, length, notes tool and path,
|
|
@@ -81,8 +81,8 @@ function parseArgs() {
|
|
|
81
81
|
}
|
|
82
82
|
const ARGS = parseArgs();
|
|
83
83
|
function arg(name, dflt) { return name in ARGS ? ARGS[name] : dflt; }
|
|
84
|
-
if (ARGS['--help']) { process.stdout.write(USAGE); process.exit(0); }
|
|
85
|
-
if (ARGS['--version']) { process.stdout.write(require(path.join(PKG, 'package.json')).version + '\n'); process.exit(0); }
|
|
84
|
+
if (ARGS['--help'] || ARGS['-h']) { process.stdout.write(USAGE); process.exit(0); }
|
|
85
|
+
if (ARGS['--version'] || ARGS['-v']) { process.stdout.write(require(path.join(PKG, 'package.json')).version + '\n'); process.exit(0); }
|
|
86
86
|
|
|
87
87
|
async function ask(q, dflt) {
|
|
88
88
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
@@ -176,7 +176,8 @@ async function main() {
|
|
|
176
176
|
answersSource = `from ${label}`;
|
|
177
177
|
} else if (arg('--defaults', false) || !interactive) {
|
|
178
178
|
answers = onboarding.defaults();
|
|
179
|
-
|
|
179
|
+
if (!arg('--defaults', false) && !process.stdin.isTTY) console.error('agent-personalizer: stdin is not a terminal, so the interview cannot run; using the default answers (pass --answers <file.json>, --answers -, or --defaults to silence this)');
|
|
180
|
+
answersSource = process.stdin.isTTY ? 'defaults (pass --answers <file.json>, or run without --yes, to answer the interview)' : 'defaults (stdin is not a terminal; pass --answers <file.json> or --answers - to script them)';
|
|
180
181
|
} else {
|
|
181
182
|
const quick = !!arg('--quick', false);
|
|
182
183
|
console.log(`\nOnboarding: how should an AI work with you? Enter accepts the default in brackets.${quick ? ' Quick interview: 7 questions, the rest default.' : ` ${onboarding.QUESTIONS.length} questions; --quick asks 7.`}\n`);
|
|
@@ -364,7 +365,7 @@ async function main() {
|
|
|
364
365
|
|
|
365
366
|
const DOCS = onboarding.DOCS;
|
|
366
367
|
// the rerun command a user can actually type: the npx form when this ran from npm's cache, else the local path that just worked
|
|
367
|
-
const SELF = /[\\/]_npx[\\/]|[\\/]node_modules[\\/]/.test(PKG) ? 'npx
|
|
368
|
+
const SELF = /[\\/]_npx[\\/]|[\\/]node_modules[\\/]/.test(PKG) ? 'npx agent-personalizer' : `node ${path.relative(process.cwd(), path.join(PKG, 'bin', 'agent-personalizer.js')) || 'bin/agent-personalizer.js'}`;
|
|
368
369
|
console.log('\nNext:');
|
|
369
370
|
console.log(' 1. Read AGENT_ONBOARDING.md once: that is what every AI will be told about working with you. Re-run this installer with new answers to change it.');
|
|
370
371
|
console.log(' USER.md is yours to edit freely; the onboarding file is regenerated from .agent-personalizer.json.');
|
package/check/gate.cjs
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
usage:
|
|
11
11
|
node check/gate.cjs [--dir <root>] [--list <file>] scan; exit 0 clean, 1 on hits, 2 on setup error
|
|
12
12
|
node check/gate.cjs --self-test prove the gate can go red on a seeded hit
|
|
13
|
+
node check/gate.cjs --help | -h · --version | -v
|
|
13
14
|
|
|
14
15
|
Fail-closed: a missing or empty list is exit 2, never a pass; a list that git tracks is exit 2.
|
|
15
16
|
The list file may never be tracked by git; every repository enclosing its REAL path is
|
|
@@ -44,7 +45,7 @@ const SKIP_DIRS = new Set(['.git']); // --all means every file; git mode lets
|
|
|
44
45
|
function die(msg) { console.error(`GATE SETUP ERROR: ${msg}`); process.exit(2); }
|
|
45
46
|
|
|
46
47
|
const VALUE_OPTS = ['--dir', '--list'];
|
|
47
|
-
const FLAG_OPTS = ['--self-test', '--all'];
|
|
48
|
+
const FLAG_OPTS = ['--self-test', '--all', '--help', '-h', '--version', '-v'];
|
|
48
49
|
/* Parse argv once, strictly: value options at most once each, flags at most once, nothing unknown. */
|
|
49
50
|
function parseArgs() {
|
|
50
51
|
const out = {};
|
|
@@ -330,6 +331,13 @@ function selfTest() {
|
|
|
330
331
|
}
|
|
331
332
|
|
|
332
333
|
function main() {
|
|
334
|
+
if (arg('--version', false) || arg('-v', false)) {
|
|
335
|
+
// the version lives in the sibling module that is copied with this file; standalone copies say so
|
|
336
|
+
let v = 'unknown (render/onboarding.cjs not beside this file)';
|
|
337
|
+
try { v = require(path.join(__dirname, '..', 'render', 'onboarding.cjs')).VERSION; } catch (_) {}
|
|
338
|
+
process.stdout.write(`agent-personalizer gate ${v}\n`); return;
|
|
339
|
+
}
|
|
340
|
+
if (arg('--help', false) || arg('-h', false)) { const src = fs.readFileSync(__filename, 'utf8'); process.stdout.write(src.slice(src.indexOf('/*') + 2, src.indexOf('*/')).trim() + '\n'); return; }
|
|
333
341
|
if (!!arg('--self-test', false)) return selfTest();
|
|
334
342
|
let root = path.resolve(arg('--dir', path.join(__dirname, '..')));
|
|
335
343
|
if (!fs.existsSync(root) || !fs.statSync(root).isDirectory()) die(`--dir ${root} is not a directory`);
|
|
@@ -37,7 +37,7 @@ _Generated by agent-personalizer from Mara's own answers (stored in `.agent-pers
|
|
|
37
37
|
|
|
38
38
|
### Where you may write
|
|
39
39
|
|
|
40
|
-
- **Notes live in Obsidian:** reach them as the vault at `notes/`, through **obsidian-tc** (governed MCP: folder ACLs, human-in-the-loop confirmation for destructive tools, audit log) rather than raw filesystem access; see https://github.com/aunysillyme/agent-personalizer/blob/v0.4.
|
|
40
|
+
- **Notes live in Obsidian:** reach them as the vault at `notes/`, through **obsidian-tc** (governed MCP: folder ACLs, human-in-the-loop confirmation for destructive tools, audit log) rather than raw filesystem access; see https://github.com/aunysillyme/agent-personalizer/blob/v0.4.2/docs/companions.md.
|
|
41
41
|
- You may create and edit files anywhere under `notes/`, under that folder's rules. Nowhere else without being asked.
|
|
42
42
|
- **Every folder you write into has a README.** Any write, edit or delete means that README is corrected in the same pass: the file's one-line description, the folder's status, settled decisions, next steps. A stale index is worse than none, because the next agent believes it.
|
|
43
43
|
- **Session log:** append a dated section to this week's note in `notes/sessions/`. **Decisions:** one line each in `notes/decisions.md`. **Inbox:** one file per item in `notes/inbox/`; finished items are deleted, not marked done.
|
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.4.
|
|
3
|
+
Tier 3 from the tiers doc (https://github.com/aunysillyme/agent-personalizer/blob/v0.4.2/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
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-personalizer",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Personalize any AI with dynamic instructions. One profile, one rule source, rendered for Claude, Codex, Cursor, Gemini and ChatGPT.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "github:aunysillyme/agent-personalizer",
|
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.4.
|
|
20
|
+
const VERSION = '0.4.2';
|
|
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 interview option, the
|
package/render/render.cjs
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
usage:
|
|
7
7
|
node render/render.cjs [--dir <project>] [--targets claude,agents,gemini,chatgpt,prompt] [--check] [--strict] [--rules <dir>]
|
|
8
8
|
node render/render.cjs [--dir <project>] --contract [--contract-target claude] [--no-personal]
|
|
9
|
-
node render/render.cjs --help
|
|
9
|
+
node render/render.cjs --help | -h · --version | -v
|
|
10
10
|
|
|
11
11
|
--rules where the rule files live. Default: <dir>/rules when it exists (a level-3 install,
|
|
12
12
|
or this repo), else the rules/ folder beside this renderer's own package (a level-1
|
|
@@ -82,7 +82,7 @@ const RULE_FILE_RE = /^\d{2}-[A-Za-z0-9._-]+\.md$/;
|
|
|
82
82
|
|
|
83
83
|
|
|
84
84
|
const VALUE_OPTS = ['--dir', '--targets', '--contract-target', '--rules'];
|
|
85
|
-
const FLAG_OPTS = ['--check', '--contract', '--no-personal', '--strict', '--help'];
|
|
85
|
+
const FLAG_OPTS = ['--check', '--contract', '--no-personal', '--strict', '--help', '-h', '--version', '-v'];
|
|
86
86
|
/* Parse argv once, strictly: value options at most once each, flags at most once, nothing unknown. */
|
|
87
87
|
function parseArgs() {
|
|
88
88
|
const out = {};
|
|
@@ -385,7 +385,8 @@ function between(existing, file) {
|
|
|
385
385
|
|
|
386
386
|
function main() {
|
|
387
387
|
ARGS = parseArgs();
|
|
388
|
-
if (arg('--
|
|
388
|
+
if (arg('--version', false) || arg('-v', false)) { process.stdout.write(onboarding.VERSION + '\n'); return; }
|
|
389
|
+
if (arg('--help', false) || arg('-h', false)) { const src = fs.readFileSync(__filename, 'utf8'); process.stdout.write(src.slice(src.indexOf('/*') + 2, src.indexOf('*/')).trim() + `\n\nagent-personalizer renderer ${onboarding.VERSION}\n`); return; }
|
|
389
390
|
const requested = path.resolve(arg('--dir', process.cwd()));
|
|
390
391
|
let root;
|
|
391
392
|
try { root = fs.realpathSync(requested); } catch (_) { die(`--dir ${requested} does not exist`); }
|