getadvantage 0.2.0 → 0.3.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/README.md +4 -1
- package/handoff.mjs +5 -3
- package/index.mjs +20 -3
- package/init.mjs +2 -0
- package/models.mjs +40 -0
- package/package.json +1 -1
- package/switch.mjs +60 -0
package/README.md
CHANGED
|
@@ -26,6 +26,7 @@ npx getadvantage # run the pre-deploy checks (GO / NO-GO)
|
|
|
26
26
|
npx getadvantage brief # generate / refresh the project brain
|
|
27
27
|
npx getadvantage init # auto-load the brain at every session start
|
|
28
28
|
npx getadvantage handoff # save your place for the next session
|
|
29
|
+
npx getadvantage switch # move to a new tool/model without losing context
|
|
29
30
|
```
|
|
30
31
|
|
|
31
32
|
Or add it to your project:
|
|
@@ -49,7 +50,9 @@ whichever reads better to you.
|
|
|
49
50
|
| `ship-safe` (default `check`) | Read-only pre-deploy checks → exit `0` on **GO**, `1` on **NO-GO**. Add `--build` for a full build. |
|
|
50
51
|
| `ship-safe brief` | Generate / refresh `PROJECT-BRIEF.md` — the **COLD** layer (what the project *is*). `--check` warns if it's stale; it never blocks. |
|
|
51
52
|
| `ship-safe handoff` | Refresh the brief **and** write `HANDOFF.md` — the **HOT** layer (where you *left off*). Your notes are preserved across refreshes; it never overwrites a `HANDOFF.md` it didn't create. |
|
|
52
|
-
| `ship-safe init` | Wire the brain into your agent's instructions file (`CLAUDE.md` / `AGENTS.md` / `.cursorrules`) so `PROJECT-BRIEF.md` + `HANDOFF.md` load automatically at session start. |
|
|
53
|
+
| `ship-safe init` | Wire the brain into your agent's instructions file (`CLAUDE.md` / `AGENTS.md` / `.cursorrules` / `.windsurfrules` / `.clinerules`) so `PROJECT-BRIEF.md` + `HANDOFF.md` load automatically at session start. |
|
|
54
|
+
| `ship-safe switch [tool]` | Switch tools/models without losing context — saves your place, wires every AI-tool file, and prints the prompt to start the new session. |
|
|
55
|
+
| `ship-safe models` | A plain-language playbook for choosing + switching AI models (principles, not benchmarks). |
|
|
53
56
|
| `ship-safe gauge` | A quick "is this session getting heavy?" read (repo activity since your last handoff) that nudges a reset before things slow down — a heuristic, not a token count. |
|
|
54
57
|
| `ship-safe ledger` | Show the session ledger — the running log of save-points each `handoff` records. |
|
|
55
58
|
| `ship-safe deploy` | _(Advanced)_ Deploy from a clean, detached worktree and confirm the deployment URL's project prefix. Runs a real `vercel --prod`; the project prefix is derived from your linked `.vercel` (or pass `--expect-prefix`). |
|
package/handoff.mjs
CHANGED
|
@@ -268,9 +268,11 @@ export function runHandoff(o) {
|
|
|
268
268
|
c.yellow(" ▸ First handoff — fill in the short narrative (Where we are / Next steps) so the next session knows the plan."),
|
|
269
269
|
);
|
|
270
270
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
271
|
+
if (!o.quiet) {
|
|
272
|
+
console.log(c.gray(" Next session, paste this to pick up instantly:"));
|
|
273
|
+
console.log(c.cyan(` Read PROJECT-BRIEF.md and ${relPath(handoffAbs, cwd)}, then continue where we left off.`));
|
|
274
|
+
console.log(c.gray(" Commit both files — your brain lives in the repo, not your tool."));
|
|
275
|
+
}
|
|
274
276
|
return 0;
|
|
275
277
|
}
|
|
276
278
|
|
package/index.mjs
CHANGED
|
@@ -38,6 +38,8 @@ import { runHandoff } from "./handoff.mjs";
|
|
|
38
38
|
import { runLedger } from "./ledger.mjs";
|
|
39
39
|
import { runGauge } from "./gauge.mjs";
|
|
40
40
|
import { runInit } from "./init.mjs";
|
|
41
|
+
import { runSwitch } from "./switch.mjs";
|
|
42
|
+
import { runModels } from "./models.mjs";
|
|
41
43
|
|
|
42
44
|
function parseArgs(argv) {
|
|
43
45
|
// First non-flag token is the subcommand; default to "check".
|
|
@@ -58,7 +60,7 @@ function parseArgs(argv) {
|
|
|
58
60
|
positional.push(a);
|
|
59
61
|
}
|
|
60
62
|
}
|
|
61
|
-
return { cmd: positional[0] || "check", flags };
|
|
63
|
+
return { cmd: positional[0] || "check", arg: positional[1], flags };
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
function header() {
|
|
@@ -85,7 +87,11 @@ ${c.bold("Commands")}
|
|
|
85
87
|
${c.cyan("ledger")} Show the session ledger — the running log of save-points (the project's
|
|
86
88
|
history); each ${c.bold("handoff")} adds an entry.
|
|
87
89
|
${c.cyan("init")} Wire the brain into your agent's instructions file (CLAUDE.md / AGENTS.md /
|
|
88
|
-
.cursorrules) so the brief + handoff load
|
|
90
|
+
.cursorrules / .windsurfrules / .clinerules) so the brief + handoff load at session start.
|
|
91
|
+
${c.cyan("switch")} Switch tools/models without losing context: saves your place, wires every
|
|
92
|
+
AI-tool file, and prints the prompt to start the new session. ${c.dim("(switch <tool>)")}
|
|
93
|
+
${c.cyan("models")} A plain-language playbook for choosing + switching AI models (which model
|
|
94
|
+
for which job) — principles, not benchmarks.
|
|
89
95
|
${c.cyan("deploy")} Run check, then deploy from a clean detached worktree and confirm the
|
|
90
96
|
deployment URL prefix. Performs a real ${c.bold("vercel --prod")}.
|
|
91
97
|
|
|
@@ -111,13 +117,14 @@ ${c.bold("Examples")}
|
|
|
111
117
|
ship-safe brief generate / refresh the project brain
|
|
112
118
|
ship-safe init auto-load the brain at every session start
|
|
113
119
|
ship-safe handoff save your place for the next session
|
|
120
|
+
ship-safe switch cursor move to a new tool/model without losing context
|
|
114
121
|
ship-safe gauge is this session getting heavy?
|
|
115
122
|
ship-safe deploy --expect-prefix myproject-
|
|
116
123
|
`);
|
|
117
124
|
}
|
|
118
125
|
|
|
119
126
|
async function main() {
|
|
120
|
-
const { cmd, flags } = parseArgs(process.argv.slice(2));
|
|
127
|
+
const { cmd, arg, flags } = parseArgs(process.argv.slice(2));
|
|
121
128
|
|
|
122
129
|
if (cmd === "help" || flags.help) {
|
|
123
130
|
printHelp();
|
|
@@ -166,6 +173,16 @@ async function main() {
|
|
|
166
173
|
process.exit(code);
|
|
167
174
|
}
|
|
168
175
|
|
|
176
|
+
if (cmd === "switch") {
|
|
177
|
+
header();
|
|
178
|
+
process.exit(runSwitch({ cwd, target: arg }));
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (cmd === "models") {
|
|
182
|
+
header();
|
|
183
|
+
process.exit(runModels());
|
|
184
|
+
}
|
|
185
|
+
|
|
169
186
|
if (cmd === "gauge") {
|
|
170
187
|
header();
|
|
171
188
|
process.exit(runGauge({ cwd }));
|
package/init.mjs
CHANGED
package/models.mjs
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Ship-Safe — MODEL PLAYBOOK (`ship-safe models`).
|
|
2
|
+
//
|
|
3
|
+
// A plain-language guide to choosing + switching AI models, for people who don't
|
|
4
|
+
// want to track benchmarks. HONESTY (hard): model strengths shift constantly and
|
|
5
|
+
// depend on YOUR task — this is PRINCIPLE-based guidance, never a "best model"
|
|
6
|
+
// claim or a benchmark. The real point: because your brain is portable
|
|
7
|
+
// (PROJECT-BRIEF.md + HANDOFF.md live in the repo), switching is cheap, so you can
|
|
8
|
+
// match the model to the job and move freely.
|
|
9
|
+
//
|
|
10
|
+
// Node built-ins only. ESM. Read-only (prints; writes nothing).
|
|
11
|
+
|
|
12
|
+
import { c } from "./util.mjs";
|
|
13
|
+
|
|
14
|
+
export function runModels() {
|
|
15
|
+
const L = [
|
|
16
|
+
"",
|
|
17
|
+
c.bold(" Choosing + switching AI models — a plain-language playbook"),
|
|
18
|
+
"",
|
|
19
|
+
" Your context lives in the repo (PROJECT-BRIEF.md + HANDOFF.md), so switching",
|
|
20
|
+
" models or tools is cheap. Match the model to the job:",
|
|
21
|
+
"",
|
|
22
|
+
` ${c.cyan("Routine / boilerplate")} repetitive edits, simple components, formatting, copy.`,
|
|
23
|
+
" A cheaper, faster model is usually plenty. Save the strong one for the hard parts.",
|
|
24
|
+
"",
|
|
25
|
+
` ${c.cyan("Hard reasoning")} architecture, tricky bugs, security, big refactors.`,
|
|
26
|
+
" Reach for the strongest model you have — the quality gap shows up right here.",
|
|
27
|
+
"",
|
|
28
|
+
` ${c.cyan("Slow or down?")} a provider is lagging or offline — switch and keep moving`,
|
|
29
|
+
" (ChatGPT, Claude, Gemini, Qwen, …). Run `ship-safe switch` first so the next one",
|
|
30
|
+
" starts with your brain instead of a blank slate.",
|
|
31
|
+
"",
|
|
32
|
+
c.gray(" Rule of thumb: try a cheaper model first, escalate when it struggles. Don't get"),
|
|
33
|
+
c.gray(" locked to one — verify what works for YOUR task, and switch freely."),
|
|
34
|
+
"",
|
|
35
|
+
c.gray(" (Principles, not benchmarks — model strengths change; your portable brain doesn't.)"),
|
|
36
|
+
"",
|
|
37
|
+
];
|
|
38
|
+
for (const line of L) console.log(line);
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "getadvantage",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "The getAdvantage CLI — a local, dependency-free pre-deploy gate + portable project brain for AI-built apps. Plain-language GO / NO-GO, a repo-resident PROJECT-BRIEF.md any model reads first, and a session handoff so you can switch models or tools without re-explaining your project.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/switch.mjs
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// Ship-Safe — SWITCH WITHOUT LOSS (`ship-safe switch`).
|
|
2
|
+
//
|
|
3
|
+
// The portability move. Your brain lives in the REPO (PROJECT-BRIEF.md +
|
|
4
|
+
// HANDOFF.md), not in any one tool or model — so switching from Claude to Cursor
|
|
5
|
+
// to Qwen (or just starting a fresh session) should cost nothing. `switch` makes
|
|
6
|
+
// that a single command:
|
|
7
|
+
// 1. saves your place + refreshes the brain (handoff),
|
|
8
|
+
// 2. wires every AI-tool entry file so the new tool auto-loads it (init),
|
|
9
|
+
// 3. prints the exact paste-ready prompt to start the new session.
|
|
10
|
+
//
|
|
11
|
+
// Optionally name the tool/model you're switching TO for a tailored tip:
|
|
12
|
+
// ship-safe switch cursor
|
|
13
|
+
//
|
|
14
|
+
// Node built-ins only. ESM. (Delegates to handoff + init.)
|
|
15
|
+
|
|
16
|
+
import { c } from "./util.mjs";
|
|
17
|
+
import { runHandoff } from "./handoff.mjs";
|
|
18
|
+
import { runInit } from "./init.mjs";
|
|
19
|
+
|
|
20
|
+
// A friendly per-target line. Unknown targets get the generic guidance.
|
|
21
|
+
const TOOL_TIPS = {
|
|
22
|
+
claude: "Claude Code reads CLAUDE.md at startup — it'll pick up your brain automatically.",
|
|
23
|
+
"claude-code": "Claude Code reads CLAUDE.md at startup — it'll pick up your brain automatically.",
|
|
24
|
+
cursor: "Cursor reads .cursorrules at startup — it'll pick up your brain automatically.",
|
|
25
|
+
windsurf: "Windsurf reads .windsurfrules at startup — it'll pick up your brain automatically.",
|
|
26
|
+
cline: "Cline reads .clinerules at startup — it'll pick up your brain automatically.",
|
|
27
|
+
copilot: "GitHub Copilot reads .github/copilot-instructions.md — it'll pick up your brain.",
|
|
28
|
+
codex: "Codex (and AGENTS.md-aware tools) read AGENTS.md — it'll pick up your brain.",
|
|
29
|
+
qwen: "Qwen / any model: paste the prompt below to load your brain into the new chat.",
|
|
30
|
+
chatgpt: "ChatGPT / any model: paste the prompt below to load your brain into the new chat.",
|
|
31
|
+
gemini: "Gemini / any model: paste the prompt below to load your brain into the new chat.",
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export function runSwitch(o) {
|
|
35
|
+
const cwd = o.cwd;
|
|
36
|
+
const target = (o.target || "").toLowerCase();
|
|
37
|
+
|
|
38
|
+
console.log(c.bold("\n Switching without loss — your brain lives in the repo, not the tool.\n"));
|
|
39
|
+
|
|
40
|
+
// 1. Save your place + refresh the brain.
|
|
41
|
+
console.log(c.cyan(" 1. Saving your place"));
|
|
42
|
+
const ho = runHandoff({ cwd, quiet: true });
|
|
43
|
+
if (ho !== 0) {
|
|
44
|
+
console.log(c.yellow(" (Couldn't refresh the handoff — see the note above; continuing.)"));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// 2. Wire every AI-tool entry file so whatever you switch to auto-loads it.
|
|
48
|
+
console.log(c.cyan("\n 2. Wiring your tools"));
|
|
49
|
+
runInit({ cwd });
|
|
50
|
+
|
|
51
|
+
// 3. The exact prompt to start the new session/tool/model.
|
|
52
|
+
console.log(c.cyan("\n 3. Start the new session"));
|
|
53
|
+
if (target && TOOL_TIPS[target]) {
|
|
54
|
+
console.log(` ${c.gray(TOOL_TIPS[target])}`);
|
|
55
|
+
}
|
|
56
|
+
console.log(" Open your new tool or model and paste this:");
|
|
57
|
+
console.log(c.bold("\n Read PROJECT-BRIEF.md and HANDOFF.md, then continue where we left off.\n"));
|
|
58
|
+
console.log(c.gray(" Same project, new model — no re-explaining. Need help choosing one? `ship-safe models`."));
|
|
59
|
+
return 0;
|
|
60
|
+
}
|