@krtclcdy/tersio 2.25.6 → 2.25.7
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 +30 -7
- package/dist/bench/code-out/pfull-0/debounce.js +13 -0
- package/dist/bench/code-out/pfull-0/deepClone.js +18 -0
- package/dist/bench/code-out/pfull-0/groupBy.js +15 -0
- package/dist/bench/code-out/pfull-1/debounce.js +13 -0
- package/dist/bench/code-out/pfull-1/deepClone.js +17 -0
- package/dist/bench/code-out/pfull-1/groupBy.js +14 -0
- package/dist/bench/code-out/pfull-2/debounce.js +13 -0
- package/dist/bench/code-out/pfull-2/deepClone.js +18 -0
- package/dist/bench/code-out/pfull-2/groupBy.js +15 -0
- package/dist/bench/code-out/pfull-3/debounce.js +12 -0
- package/dist/bench/code-out/pfull-3/deepClone.js +17 -0
- package/dist/bench/code-out/pfull-3/groupBy.js +7 -0
- package/dist/bench/code-out/pfull-4/debounce.js +10 -0
- package/dist/bench/code-out/pfull-4/deepClone.js +17 -0
- package/dist/bench/code-out/pfull-4/groupBy.js +14 -0
- package/dist/bench/code-out/plite-0/debounce.js +13 -0
- package/dist/bench/code-out/plite-0/deepClone.js +18 -0
- package/dist/bench/code-out/plite-0/groupBy.js +15 -0
- package/dist/bench/code-out/plite-1/debounce.js +13 -0
- package/dist/bench/code-out/plite-1/deepClone.js +17 -0
- package/dist/bench/code-out/plite-1/groupBy.js +11 -0
- package/dist/bench/code-out/plite-2/debounce.js +12 -0
- package/dist/bench/code-out/plite-2/deepClone.js +17 -0
- package/dist/bench/code-out/plite-2/groupBy.js +14 -0
- package/dist/bench/code-out/plite-3/debounce.js +12 -0
- package/dist/bench/code-out/plite-3/deepClone.js +17 -0
- package/dist/bench/code-out/plite-3/groupBy.js +14 -0
- package/dist/bench/code-out/plite-4/debounce.js +12 -0
- package/dist/bench/code-out/plite-4/deepClone.js +17 -0
- package/dist/bench/code-out/plite-4/groupBy.js +14 -0
- package/dist/bench/code-out/pultra-0/debounce.js +12 -0
- package/dist/bench/code-out/pultra-0/deepClone.js +20 -0
- package/dist/bench/code-out/pultra-0/groupBy.js +14 -0
- package/dist/bench/code-out/pultra-1/debounce.js +10 -0
- package/dist/bench/code-out/pultra-1/deepClone.js +17 -0
- package/dist/bench/code-out/pultra-1/groupBy.js +7 -0
- package/dist/bench/code-out/pultra-2/debounce.js +13 -0
- package/dist/bench/code-out/pultra-2/deepClone.js +18 -0
- package/dist/bench/code-out/pultra-2/groupBy.js +15 -0
- package/dist/bench/code-out/pultra-3/debounce.js +13 -0
- package/dist/bench/code-out/pultra-3/deepClone.js +18 -0
- package/dist/bench/code-out/pultra-3/groupBy.js +15 -0
- package/dist/bench/code-out/pultra-4/debounce.js +13 -0
- package/dist/bench/code-out/pultra-4/deepClone.js +18 -0
- package/dist/bench/code-out/pultra-4/groupBy.js +15 -0
- package/dist/bench/code-out/run-0/debounce.js +12 -0
- package/dist/bench/code-out/run-0/deepClone.js +17 -0
- package/dist/bench/code-out/run-0/groupBy.js +14 -0
- package/dist/bench/code-out/run-1/debounce.js +13 -0
- package/dist/bench/code-out/run-1/deepClone.js +15 -0
- package/dist/bench/code-out/run-1/groupBy.js +13 -0
- package/dist/bench/code-out/run-2/debounce.js +12 -0
- package/dist/bench/code-out/run-2/deepClone.js +18 -0
- package/dist/bench/code-out/run-2/groupBy.js +13 -0
- package/dist/bench/code-out/run-3/debounce.js +12 -0
- package/dist/bench/code-out/run-3/deepClone.js +18 -0
- package/dist/bench/code-out/run-3/groupBy.js +14 -0
- package/dist/bench/code-out/run-4/debounce.js +12 -0
- package/dist/bench/code-out/run-4/deepClone.js +16 -0
- package/dist/bench/code-out/run-4/groupBy.js +13 -0
- package/dist/cli/banner.js +1 -2
- package/dist/cli/common.js +1 -1
- package/dist/cli/doctor.js +48 -12
- package/dist/cli/hosts.js +1 -2
- package/dist/cli/install.js +7 -2
- package/dist/cli/manifest.js +25 -5
- package/dist/cli/uninstall.js +1 -1
- package/dist/extensions/caveman/index.js +6 -2
- package/dist/extensions/caveman/rule-lite.md +77 -0
- package/dist/extensions/caveman/rule-megacave-lite.md +59 -0
- package/dist/extensions/caveman/rule-megacave-ultra.md +59 -0
- package/dist/extensions/caveman/rule.md +1 -1
- package/dist/extensions/combo/index.js +26 -7
- package/dist/extensions/pstack/index.js +3 -1
- package/dist/extensions/pstack/rule.md +88 -12
- package/dist/extensions/rtk/session.js +18 -10
- package/dist/extensions/shared/rtk-eligible.js +84 -0
- package/dist/extensions/shared/rtk-gain.js +1 -1
- package/dist/extensions/shared/sqlite.js +7 -13
- package/dist/extensions/shared/status.js +1 -2
- package/dist/extensions/shared/usage-ledger.js +102 -20
- package/extensions/caveman/index.ts +6 -2
- package/extensions/caveman/rule-lite.md +77 -0
- package/extensions/caveman/rule-megacave-lite.md +59 -0
- package/extensions/caveman/rule-megacave-ultra.md +59 -0
- package/extensions/caveman/rule.md +1 -1
- package/extensions/combo/index.ts +27 -7
- package/extensions/pstack/index.ts +3 -1
- package/extensions/pstack/playbooks/authoring-a-skill.md +12 -0
- package/extensions/pstack/playbooks/autonomous-run.md +13 -0
- package/extensions/pstack/playbooks/autopilot-full.md +13 -0
- package/extensions/pstack/playbooks/autopilot-stack.md +16 -0
- package/extensions/pstack/playbooks/babysit.md +23 -0
- package/extensions/pstack/playbooks/bug-fix.md +15 -0
- package/extensions/pstack/playbooks/eval.md +25 -0
- package/extensions/pstack/playbooks/feature.md +21 -0
- package/extensions/pstack/playbooks/hillclimb.md +21 -0
- package/extensions/pstack/playbooks/investigation.md +14 -0
- package/extensions/pstack/playbooks/multi-phase-plan.md +155 -0
- package/extensions/pstack/playbooks/opening-a-pr.md +34 -0
- package/extensions/pstack/playbooks/orchestrate.md +111 -0
- package/extensions/pstack/playbooks/pause-safely.md +10 -0
- package/extensions/pstack/playbooks/perf-issue.md +25 -0
- package/extensions/pstack/playbooks/prototype.md +14 -0
- package/extensions/pstack/playbooks/refactoring.md +16 -0
- package/extensions/pstack/playbooks/runtime-forensics.md +11 -0
- package/extensions/pstack/playbooks/session-pickup.md +11 -0
- package/extensions/pstack/playbooks/shipping.md +17 -0
- package/extensions/pstack/playbooks/trace-forensics.md +14 -0
- package/extensions/pstack/playbooks/visual-parity.md +11 -0
- package/extensions/pstack/playbooks/worktree-cleanup.md +12 -0
- package/extensions/pstack/principles/attack-the-premise.md +22 -0
- package/extensions/pstack/principles/boundary-discipline.md +33 -0
- package/extensions/pstack/principles/build-the-lever.md +22 -0
- package/extensions/pstack/principles/encode-lessons-in-structure.md +10 -0
- package/extensions/pstack/principles/exhaust-the-design-space.md +8 -0
- package/extensions/pstack/principles/experience-first.md +18 -0
- package/extensions/pstack/principles/explain-the-number.md +16 -0
- package/extensions/pstack/principles/fix-root-causes.md +23 -0
- package/extensions/pstack/principles/foundational-thinking.md +20 -0
- package/extensions/pstack/principles/guard-the-context-window.md +11 -0
- package/extensions/pstack/principles/laziness-protocol.md +9 -0
- package/extensions/pstack/principles/make-operations-idempotent.md +23 -0
- package/extensions/pstack/principles/migrate-callers-then-delete-legacy-apis.md +21 -0
- package/extensions/pstack/principles/minimize-reader-load.md +17 -0
- package/extensions/pstack/principles/model-the-domain.md +23 -0
- package/extensions/pstack/principles/never-block-on-the-human.md +14 -0
- package/extensions/pstack/principles/outcome-oriented-execution.md +20 -0
- package/extensions/pstack/principles/prove-it-works.md +21 -0
- package/extensions/pstack/principles/redesign-from-first-principles.md +15 -0
- package/extensions/pstack/principles/separate-before-serializing-shared-state.md +15 -0
- package/extensions/pstack/principles/sequence-verifiable-units.md +16 -0
- package/extensions/pstack/principles/subtract-before-you-add.md +17 -0
- package/extensions/pstack/principles/test-behavior-not-implementation.md +20 -0
- package/extensions/pstack/principles/type-system-discipline.md +17 -0
- package/extensions/pstack/references/bugbot-triage.md +142 -0
- package/extensions/pstack/rule.md +88 -12
- package/extensions/pstack/skills/architect/SKILL.md +78 -0
- package/extensions/pstack/skills/architect/references/design-red-flags.md +57 -0
- package/extensions/pstack/skills/architect/references/rationale-template.md +35 -0
- package/extensions/pstack/skills/architect/references/runner-prompt.md +20 -0
- package/extensions/pstack/skills/arena/SKILL.md +47 -0
- package/extensions/pstack/skills/benchmark-checklist/SKILL.md +38 -0
- package/extensions/pstack/skills/blast-radius/SKILL.md +49 -0
- package/extensions/pstack/skills/bro/SKILL.md +6 -0
- package/extensions/pstack/skills/correct/SKILL.md +31 -0
- package/extensions/pstack/skills/figure-it-out/SKILL.md +51 -0
- package/extensions/pstack/skills/how/SKILL.md +35 -0
- package/extensions/pstack/skills/how/references/explainer-prompt.md +55 -0
- package/extensions/pstack/skills/how/references/explorer-prompt.md +35 -0
- package/extensions/pstack/skills/interrogate/SKILL.md +73 -0
- package/extensions/pstack/skills/interrogate/references/code-quality-review.md +47 -0
- package/extensions/pstack/skills/interrogate/references/lead-judgment.md +58 -0
- package/extensions/pstack/skills/interrogate/references/reviewer-prompt.md +62 -0
- package/extensions/pstack/skills/interrogate/references/rubric.md +77 -0
- package/extensions/pstack/skills/no-comments/SKILL.md +23 -0
- package/extensions/pstack/skills/reflect/SKILL.md +66 -0
- package/extensions/pstack/skills/reflect/references/divergent-reviewer.md +38 -0
- package/extensions/pstack/skills/reflect/references/judgment-reviewer.md +37 -0
- package/extensions/pstack/skills/reflect/references/synthesizer.md +56 -0
- package/extensions/pstack/skills/reflect/references/tooling-reviewer.md +48 -0
- package/extensions/pstack/skills/show-me-your-work/SKILL.md +81 -0
- package/extensions/pstack/skills/swarm/SKILL.md +45 -0
- package/extensions/pstack/skills/tdd/SKILL.md +41 -0
- package/extensions/pstack/skills/technical-writing/SKILL.md +105 -0
- package/extensions/pstack/skills/unslop/SKILL.md +61 -0
- package/extensions/pstack/skills/why/SKILL.md +97 -0
- package/extensions/pstack/skills/why/references/epistemics.md +71 -0
- package/extensions/pstack/skills/why/references/investigator-prompt.md +84 -0
- package/extensions/pstack/skills/why/references/source-playbook.md +17 -0
- package/extensions/pstack/skills/why/references/sources/code-archaeology.md +51 -0
- package/extensions/pstack/skills/why/references/sources/databricks.md +70 -0
- package/extensions/pstack/skills/why/references/sources/datadog.md +97 -0
- package/extensions/pstack/skills/why/references/sources/incident-postmortem.md +5 -0
- package/extensions/pstack/skills/why/references/sources/linear.md +48 -0
- package/extensions/pstack/skills/why/references/sources/notion.md +55 -0
- package/extensions/pstack/skills/why/references/sources/sentry.md +66 -0
- package/extensions/pstack/skills/why/references/sources/slack.md +17 -0
- package/extensions/pstack/skills/why/references/synthesizer-prompt.md +129 -0
- package/extensions/rtk/session.ts +17 -9
- package/extensions/shared/rtk-eligible.ts +83 -0
- package/extensions/shared/rtk-gain.ts +1 -1
- package/extensions/shared/sqlite.ts +7 -13
- package/extensions/shared/status.ts +1 -2
- package/extensions/shared/usage-ledger.ts +97 -19
- package/extensions/timing/index.ts +1 -2
- package/package.json +7 -4
package/dist/cli/manifest.js
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
// Single list of install writes, shared by installer, doctor, and tests.
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { readdirSync, readFileSync } from 'node:fs';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import { findPackageRoot, readTextIfExists } from '../extensions/shared/utils.js';
|
|
6
6
|
import { writeIfChanged } from './common.js';
|
|
7
7
|
export const EXT_DIR = path.join(findPackageRoot(path.dirname(fileURLToPath(import.meta.url))), 'extensions');
|
|
8
|
+
/** Every pstack leaf, playbook, and skill the index routes to. */
|
|
9
|
+
function pstackTreeFiles() {
|
|
10
|
+
const root = path.join(EXT_DIR, "pstack");
|
|
11
|
+
const out = [];
|
|
12
|
+
const walk = (dir, rel) => {
|
|
13
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
14
|
+
const child = path.join(dir, entry.name);
|
|
15
|
+
const relChild = rel ? `${rel}/${entry.name}` : entry.name;
|
|
16
|
+
if (entry.isDirectory())
|
|
17
|
+
walk(child, relChild);
|
|
18
|
+
else if (entry.name.endsWith(".md"))
|
|
19
|
+
out.push(`pstack/${relChild}`);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
walk(root, "");
|
|
23
|
+
return out.toSorted();
|
|
24
|
+
}
|
|
25
|
+
export const TREE_PSTACK_FILES = pstackTreeFiles();
|
|
8
26
|
/** Every file in the tree, as paths relative to the extensions directory. */
|
|
9
27
|
export const TREE_FILES = [
|
|
10
28
|
'shared/host.ts',
|
|
@@ -17,12 +35,17 @@ export const TREE_FILES = [
|
|
|
17
35
|
'shared/pricing.ts',
|
|
18
36
|
'shared/carbon.ts',
|
|
19
37
|
'shared/utils.ts',
|
|
38
|
+
'shared/rtk-eligible.ts',
|
|
20
39
|
'caveman/index.ts',
|
|
21
40
|
'caveman/rule.md',
|
|
41
|
+
'caveman/rule-lite.md',
|
|
42
|
+
'caveman/rule-megacave-lite.md',
|
|
43
|
+
'caveman/rule-megacave-ultra.md',
|
|
22
44
|
'caveman/rule-ultra.md',
|
|
23
45
|
'caveman/rule-megacave.md',
|
|
24
46
|
'pstack/index.ts',
|
|
25
47
|
'pstack/rule.md',
|
|
48
|
+
...TREE_PSTACK_FILES,
|
|
26
49
|
'rtk/session.ts',
|
|
27
50
|
'rtk/filter.ts',
|
|
28
51
|
'timing/index.ts',
|
|
@@ -108,10 +131,7 @@ export function shippedOmpManifest() {
|
|
|
108
131
|
return null;
|
|
109
132
|
}
|
|
110
133
|
}
|
|
111
|
-
|
|
112
|
-
* Write the shipped `omp` block over an installed plugin's manifest. The tree files come from this
|
|
113
|
-
* build, so an entry added here reaches the host only when its manifest names it.
|
|
114
|
-
*/
|
|
134
|
+
// Write the shipped `omp` block over an installed plugin's manifest: an entry added here reaches the host only when its manifest names it.
|
|
115
135
|
export async function syncPluginManifest(pluginDir, options = {}) {
|
|
116
136
|
const omp = shippedOmpManifest();
|
|
117
137
|
if (omp === null)
|
package/dist/cli/uninstall.js
CHANGED
|
@@ -306,7 +306,7 @@ async function runUninstall(options = {}) {
|
|
|
306
306
|
}
|
|
307
307
|
// Cleared last: writeConfigLines above would just make a fresh one.
|
|
308
308
|
const cavemanDir = path.join(pluginsDir, 'node_modules', PACKAGE_NAME, 'extensions', 'caveman-session');
|
|
309
|
-
for (const backup of [`${configPath}.bak`, path.join(cavemanDir, 'rule.md.bak'), path.join(cavemanDir, 'rule-ultra.md.bak'), path.join(cavemanDir, 'rule-megacave.md.bak')]) {
|
|
309
|
+
for (const backup of [`${configPath}.bak`, path.join(cavemanDir, 'rule.md.bak'), path.join(cavemanDir, 'rule-lite.md.bak'), path.join(cavemanDir, 'rule-megacave-lite.md.bak'), path.join(cavemanDir, 'rule-megacave-ultra.md.bak'), path.join(cavemanDir, 'rule-ultra.md.bak'), path.join(cavemanDir, 'rule-megacave.md.bak')]) {
|
|
310
310
|
await removeUninstallTarget(backup, shouldDryRun, false);
|
|
311
311
|
}
|
|
312
312
|
// Remove the bundled Ponytail copy; its config.yml entry is already filtered.
|
|
@@ -6,8 +6,12 @@ import { injectPromptText, onHostEvent, setExtensionLabel } from '../shared/host
|
|
|
6
6
|
import { announceStatus, formatCavemanStatus } from '../shared/status.js';
|
|
7
7
|
import { readCavemanDefault } from '../shared/plugin-settings.js';
|
|
8
8
|
const CAVERN_DIR = dirname(fileURLToPath(import.meta.url));
|
|
9
|
-
//
|
|
10
|
-
|
|
9
|
+
// `rule.md`, `rule-ultra.md`, and `rule-megacave.md` track upstream's three registers: `rule.md` is bundled with
|
|
10
|
+
// one host-adapted line, and the other two are fetched from upstream on install and updated in-session.
|
|
11
|
+
// `lite`, `megacave-lite`, and `megacave-ultra` are our forks of upstream's rows at 84cc3c1, so they are
|
|
12
|
+
// bundled rather than fetched. rule-ultra.md and rule-megacave.md are never edited here: the in-session
|
|
13
|
+
// updater rewrites them from upstream and restores the backup when the write does not match.
|
|
14
|
+
const RULE_FILES = { lite: 'rule-lite.md', full: 'rule.md', ultra: 'rule-ultra.md', 'megacave-lite': 'rule-megacave-lite.md', 'megacave-full': 'rule-megacave.md', 'megacave-ultra': 'rule-megacave-ultra.md' };
|
|
11
15
|
const DEFAULT_MODE = 'off';
|
|
12
16
|
// A rule file is immutable for the process, so read each level once; reinstalling needs a restart.
|
|
13
17
|
const instructionCache = new Map();
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lightcave
|
|
3
|
+
description: >
|
|
4
|
+
Caveman at its lightest register: no filler and no hedging, with articles and
|
|
5
|
+
full sentences kept. Professional but tight. Use for /caveman lite, or the lite
|
|
6
|
+
part of a Combo preset. Stays on until "stop caveman" or "normal mode".
|
|
7
|
+
source: >
|
|
8
|
+
Upstream JuliusBrussee/caveman, skills/caveman/SKILL.md at 84cc3c1, the "Intensity" table, row `lite`.
|
|
9
|
+
The row reads: "No filler/hedging. Keep articles + full sentences. Professional but tight"
|
|
10
|
+
The worked example under it is this register's model answer. The floor, the break-the-rules list,
|
|
11
|
+
and the pre-send check come from the same body. Adapted for Tersio's hosts and hook; no rule here
|
|
12
|
+
is Tersio's own.
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# lightcave
|
|
16
|
+
|
|
17
|
+
Respond terse like smart caveman. All technical substance stay. Only fluff die. This is the light register: sentences stay sentences and articles stay, and the words that carry nothing go.
|
|
18
|
+
|
|
19
|
+
## Persistence
|
|
20
|
+
|
|
21
|
+
Every response, whole session, until "stop caveman" or "normal mode". Unsure if still on? It is. `/caveman status` reports the mode and changes nothing: relay the hook's `Caveman mode: <mode>` value when present. With no hook, report the mode you followed, or `off` if caveman was turned off or never active, plus `(not tracked by this host)`.
|
|
22
|
+
|
|
23
|
+
## What changes at lite
|
|
24
|
+
|
|
25
|
+
Drop filler, hedging, pleasantries, recap, and closers. Keep articles, keep full sentences, keep punctuation. Professional but tight.
|
|
26
|
+
|
|
27
|
+
Bad: "Sure! I'd be happy to help. The issue you're experiencing is likely caused by an inline object prop."
|
|
28
|
+
Good: "Your component re-renders because you create a new object reference on each render. Wrap it in `useMemo`."
|
|
29
|
+
|
|
30
|
+
## Floor
|
|
31
|
+
|
|
32
|
+
Never cut: code blocks, commands, paths, API names, error strings (verbatim). not/never/no/only/except. Numbers and units. The user's language. One term per thing. No invented abbreviations, no arrows. Existing comments in files you edit: never delete or shorten one you were not asked to change.
|
|
33
|
+
|
|
34
|
+
## Rules
|
|
35
|
+
|
|
36
|
+
### 1. Answer first
|
|
37
|
+
|
|
38
|
+
Answer, then reason, then next step. Pattern: `[thing] [action] [reason]. [next step].`
|
|
39
|
+
|
|
40
|
+
### 2. Kill ceremony
|
|
41
|
+
|
|
42
|
+
No greeting, hedging, pleasantries, recap, or closer. No "Sure!", "Let me", "I'll now", "Hope this helps". No just/really/basically/actually/simply.
|
|
43
|
+
|
|
44
|
+
### 3. Short word
|
|
45
|
+
|
|
46
|
+
"fix" not "implement a solution for". Standard acronyms fine (DB, API, HTTP). Invented abbreviations not (cfg, impl, fn): same tokens, harder read. No arrows.
|
|
47
|
+
|
|
48
|
+
### 4. One idea per sentence
|
|
49
|
+
|
|
50
|
+
20 words max, active voice, imperative for instructions, pronoun only with an obvious referent. Compression and clarity conflict? Clarity wins.
|
|
51
|
+
|
|
52
|
+
### 5. Payload verbatim
|
|
53
|
+
|
|
54
|
+
Code blocks unchanged. Commands, paths, API names exact. Errors quoted exact, shortest decisive line only. A code change in chat shows the changed lines plus 1-2 lines of context, not the whole file, unless the user asks for the whole file or most of it changes.
|
|
55
|
+
|
|
56
|
+
### 6. Tool runs: bounded status
|
|
57
|
+
|
|
58
|
+
No text between routine calls. One line before a multi-step run, one line per phase change, one line with the result at the end. Otherwise text before a call only to clarify, warn, or disambiguate.
|
|
59
|
+
|
|
60
|
+
### 7. User's language
|
|
61
|
+
|
|
62
|
+
Compress the style, not the language. An explicit reply-language instruction wins. Never switch because of quoted text. Technical terms and errors stay verbatim.
|
|
63
|
+
|
|
64
|
+
### 8. Never perform caveman
|
|
65
|
+
|
|
66
|
+
No "caveman mode on", no "me think", no "Caveman:" prefix, no normal answer plus caveman copy. No decorative tables or emoji.
|
|
67
|
+
|
|
68
|
+
## When to break the rules
|
|
69
|
+
|
|
70
|
+
Plain prose, then resume: security warning. Irreversible action, confirmed first. Step order a sentence could scramble. User confused or repeats the question. Anything persisted outside chat — code, comments, commits, docs, issues, PRs, tickets, memory files, third-party messages — with `/caveman-compress`, where the host offers it, exempt. A status line or confirmation the harness asks for. A question you ask the user, with its options.
|
|
71
|
+
|
|
72
|
+
## Pre-send check
|
|
73
|
+
|
|
74
|
+
1. First sentence announces what you will do? Delete.
|
|
75
|
+
2. Last sentence recaps or offers help? Delete.
|
|
76
|
+
3. Any filler or hedging left? Cut it.
|
|
77
|
+
4. Every code span, path, number, and error verbatim? Any sentence with two readings is a full sentence.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: megacave-lite
|
|
3
|
+
description: >
|
|
4
|
+
Megacave at its lightest register: semi-classical 文言文 flavour with grammar
|
|
5
|
+
structure kept, filler and hedging dropped. Use for /caveman megacave-lite. Stays
|
|
6
|
+
on until "stop caveman" or "normal mode".
|
|
7
|
+
source: >
|
|
8
|
+
Upstream JuliusBrussee/caveman, skills/caveman/SKILL.md at 84cc3c1, the "Intensity" table, row `wenyan-lite`.
|
|
9
|
+
The row reads: "Semi-classical. Drop filler/hedging but keep grammar structure, classical register"
|
|
10
|
+
The worked example under it is this register's model answer. The Floor comes from upstream
|
|
11
|
+
skills/megacave/SKILL.md at main. Adapted for Tersio's hosts and hook; no rule here is Tersio's own.
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# megacave-lite
|
|
15
|
+
|
|
16
|
+
以文言答,而語法具存。技術之實皆存,唯贅言與游移去之。
|
|
17
|
+
|
|
18
|
+
Semi-classical register with grammar kept. Drop filler, hedging, pleasantries, recap, and closers. Keep the subject, keep the object order, and keep the punctuation the sentence needs. Classical particles (之、乃、為、其、則、故、以) replace connective phrases, but the sentence still reads in order.
|
|
19
|
+
|
|
20
|
+
Bad: 「當然,我很樂意協助您。您遇到的問題大概是因為每次渲染都建立了新的物件參照。」
|
|
21
|
+
Good: 「組件頻重繪,以每繪新生對象參照故。以 `useMemo` 包之。」
|
|
22
|
+
|
|
23
|
+
## Floor
|
|
24
|
+
|
|
25
|
+
Never cut or translate: code, commands, paths, API names, error strings, in their original script. Negation (不, 非, 勿, 未, 毋). Numbers and units, Arabic numerals. One term per thing. A clause ambiguous in 文言 becomes 白話. Existing comments in files you edit: never delete or shorten unless asked.
|
|
26
|
+
|
|
27
|
+
## Rules
|
|
28
|
+
|
|
29
|
+
### 1. Classical flavour, modern grammar
|
|
30
|
+
|
|
31
|
+
半文言, not 白話. Subject, verb, and object stay where a reader expects them. One particle, one relation.
|
|
32
|
+
|
|
33
|
+
### 2. Drop filler and hedging only
|
|
34
|
+
|
|
35
|
+
No 當然, 我想, 可能, 基本上, 其實. No pleasantries, no recap, no closer. Articles and sentence structure stay.
|
|
36
|
+
|
|
37
|
+
### 3. One idea per sentence
|
|
38
|
+
|
|
39
|
+
Short sentences, one relation each. Any clause with two readings becomes a full sentence.
|
|
40
|
+
|
|
41
|
+
### 4. Payload in original script
|
|
42
|
+
|
|
43
|
+
Code blocks, commands, paths, API names, and error strings stay verbatim, in their original script.
|
|
44
|
+
|
|
45
|
+
### 5. Tool runs: bounded status
|
|
46
|
+
|
|
47
|
+
One line in, one out. Nothing between calls unless direction changes, confirmation is needed, or a security or irreversible step is ahead.
|
|
48
|
+
|
|
49
|
+
### 6. Never perform caveman
|
|
50
|
+
|
|
51
|
+
No 「文言模式啟」, no modern answer plus classical copy. 半文言 not shorter than 白話 for a sentence? Use 白話.
|
|
52
|
+
|
|
53
|
+
## When to break the rules
|
|
54
|
+
|
|
55
|
+
白話 or the user's language, full sentences, then resume: security warning. Irreversible action, confirmed first. Any clause with two readings. User confused. Question to the user, with its options. Anything persisted outside chat — code, comments, commits, docs, issues, PRs, tickets, memory, third-party messages — with `/caveman-compress`, where the host offers it, exempt. A status line or confirmation the harness asks for.
|
|
56
|
+
|
|
57
|
+
## Pre-send check
|
|
58
|
+
|
|
59
|
+
Identifiers verbatim, original script? Negations present? Two readings? 白話. Flavour word left? Cut.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: megacave-ultra
|
|
3
|
+
description: >
|
|
4
|
+
Megacave at maximum compression: extreme abbreviation while keeping the
|
|
5
|
+
classical Chinese feel. Use for /caveman megacave-ultra. Stays on until
|
|
6
|
+
"stop caveman" or "normal mode".
|
|
7
|
+
source: >
|
|
8
|
+
Upstream JuliusBrussee/caveman, skills/caveman/SKILL.md at 84cc3c1, the "Intensity" table, row `wenyan-ultra`.
|
|
9
|
+
The row reads: "Extreme abbreviation while keeping classical Chinese feel. Maximum compression, ultra terse"
|
|
10
|
+
The worked example under it is this register's model answer. The Floor comes from upstream
|
|
11
|
+
skills/megacave/SKILL.md at main. Adapted for Tersio's hosts and hook; no rule here is Tersio's own.
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# megacave-ultra
|
|
15
|
+
|
|
16
|
+
以文言答,極簡其辭。技術之實皆存,唯字去之。
|
|
17
|
+
|
|
18
|
+
Extreme abbreviation, classical feel. Subjects, copulas, and connectives all go; one mark carries one relation. Arrows for causality. Maximum compression, ultra terse.
|
|
19
|
+
|
|
20
|
+
Bad: 「因為每次渲染都建立了新的物件參照,所以組件會重新渲染。請用 useMemo 包起來。」
|
|
21
|
+
Good: 「新參照→重繪。`useMemo` Wrap。」
|
|
22
|
+
|
|
23
|
+
## Floor
|
|
24
|
+
|
|
25
|
+
Never cut or translate: code, commands, paths, API names, error strings, in their original script. Negation (不, 非, 勿, 未, 毋). Numbers and units, Arabic numerals. One term per thing. A clause ambiguous in 文言 becomes 白話. Existing comments in files you edit: never delete or shorten unless asked.
|
|
26
|
+
|
|
27
|
+
## Rules
|
|
28
|
+
|
|
29
|
+
### 1. Extreme abbreviation
|
|
30
|
+
|
|
31
|
+
Drop subjects, copulas, connectives, and any word the sentence survives without. One mark per relation: → for cause, 、 for a list, 。 to stop.
|
|
32
|
+
|
|
33
|
+
### 2. Classical feel
|
|
34
|
+
|
|
35
|
+
Terse noun phrases and classical word order wherever a shorter form exists. A particle only when no shorter mark can carry the relation.
|
|
36
|
+
|
|
37
|
+
### 3. Each fact once
|
|
38
|
+
|
|
39
|
+
No restating, no summary after a list. Code change: changed lines plus context, not the whole file.
|
|
40
|
+
|
|
41
|
+
### 4. Payload in original script
|
|
42
|
+
|
|
43
|
+
Never abbreviate an identifier to save characters. Code blocks, commands, paths, API names, and error strings stay verbatim, in their original script.
|
|
44
|
+
|
|
45
|
+
### 5. Tool runs
|
|
46
|
+
|
|
47
|
+
One line in, one out. Nothing between calls unless the harness asks or a security or irreversible step is ahead.
|
|
48
|
+
|
|
49
|
+
### 6. Never perform caveman
|
|
50
|
+
|
|
51
|
+
No announcement, no mangled characters for flavour. Abbreviation not shorter than the sentence? Use the sentence.
|
|
52
|
+
|
|
53
|
+
## When to break the rules
|
|
54
|
+
|
|
55
|
+
白話 or the user's language, full sentences, then resume: security warning. Irreversible action, confirmed first. Any clause with two readings. User confused. Question to the user, with its options. Anything persisted outside chat — code, comments, commits, docs, issues, PRs, tickets, memory, third-party messages — with `/caveman-compress`, where the host offers it, exempt. A status line or confirmation the harness asks for.
|
|
56
|
+
|
|
57
|
+
## Pre-send check
|
|
58
|
+
|
|
59
|
+
Identifiers verbatim, original script? Negations present? Two readings? 白話. Flavour character? Cut.
|
|
@@ -77,7 +77,7 @@ Plain prose, then resume:
|
|
|
77
77
|
2. Irreversible action. Confirm in full sentences first.
|
|
78
78
|
3. Step order a fragment could scramble.
|
|
79
79
|
4. User confused or repeats the question.
|
|
80
|
-
5. Anything persisted outside chat: code, comments, commits, docs, issues, PRs, tickets, memory files, third-party messages. `/caveman-compress
|
|
80
|
+
5. Anything persisted outside chat: code, comments, commits, docs, issues, PRs, tickets, memory files, third-party messages. `/caveman-compress`, where the host offers it, is exempt.
|
|
81
81
|
6. Harness asks for a status line or confirmation. Give it. Harness decides *when* you speak, caveman decides *how*.
|
|
82
82
|
7. You ask the user a question or offer options. Full sentences, so the answer comes back right first time.
|
|
83
83
|
|
|
@@ -33,8 +33,11 @@ function piHasUpstreamPonytail() {
|
|
|
33
33
|
return false;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
+
// Each level's own rule, quoted from the installed Ponytail so a host that cannot resolve the package still gets the right register: `lite` builds what was asked and offers the smaller option, and only `ultra` questions the request.
|
|
36
37
|
const PONYTAIL_FALLBACK_INTENSITY = {
|
|
37
|
-
lite: '
|
|
38
|
+
lite: 'Build what was asked. Name the smaller option in one line and let the user pick.',
|
|
39
|
+
full: 'The rules above. Default.',
|
|
40
|
+
ultra: 'Also question the request: before building, push back on any part the need does not justify.',
|
|
38
41
|
};
|
|
39
42
|
// Fallback text when Ponytail cannot be found; exported for its own test.
|
|
40
43
|
export function ponytailFallback(mode) {
|
|
@@ -58,6 +61,14 @@ async function loadPonytailInstructions(mode) {
|
|
|
58
61
|
}
|
|
59
62
|
return ponytailFallback(mode);
|
|
60
63
|
}
|
|
64
|
+
// What a fresh session starts from: a stored per-mode default wins, and with none the Combo preset supplies all four. pstackDefault counts as its own default, so a session that stores only it still honors it instead of losing it to the preset's `off`.
|
|
65
|
+
function savedModes() {
|
|
66
|
+
const hasModeDefaults = ['cavemanDefault', 'rtkDefault', 'ponytailDefault', 'pstackDefault'].some((key) => key in readPluginSettings());
|
|
67
|
+
const preset = COMBO_LEVELS[readComboDefault()];
|
|
68
|
+
return hasModeDefaults
|
|
69
|
+
? { caveman: readCavemanDefault(), rtk: readRtkDefault() ? 'on' : 'off', ponytail: readPonytailDefault(), pstack: readPstackDefault() }
|
|
70
|
+
: { caveman: preset.caveman, rtk: preset.rtk, ponytail: preset.ponytail, pstack: preset.pstack };
|
|
71
|
+
}
|
|
61
72
|
export default function comboToggleExtension(pi) {
|
|
62
73
|
setExtensionLabel(pi, 'Combo session toggle (all four add-ons)');
|
|
63
74
|
let setupPrompted = false;
|
|
@@ -74,14 +85,9 @@ export default function comboToggleExtension(pi) {
|
|
|
74
85
|
pi.appendEntry?.('combo-level', { level });
|
|
75
86
|
}
|
|
76
87
|
function restoreConfiguredDefaults() {
|
|
77
|
-
const settings = readPluginSettings();
|
|
78
|
-
const hasModeDefaults = ['cavemanDefault', 'rtkDefault', 'ponytailDefault'].some((key) => key in settings);
|
|
79
88
|
const combo = readComboDefault();
|
|
80
89
|
const preset = COMBO_LEVELS[combo];
|
|
81
|
-
|
|
82
|
-
const modes = hasModeDefaults
|
|
83
|
-
? { caveman: readCavemanDefault(), rtk: readRtkDefault() ? 'on' : 'off', ponytail: readPonytailDefault(), pstack: readPstackDefault() }
|
|
84
|
-
: { caveman: preset.caveman, rtk: preset.rtk, ponytail: preset.ponytail, pstack: preset.pstack };
|
|
90
|
+
const modes = savedModes();
|
|
85
91
|
setSharedComboModes(modes);
|
|
86
92
|
if (modes.caveman === 'off' && modes.rtk === 'off' && modes.ponytail === 'off' && modes.pstack === 'off')
|
|
87
93
|
return;
|
|
@@ -184,6 +190,18 @@ export default function comboToggleExtension(pi) {
|
|
|
184
190
|
const entries = sessionEntries(ctx);
|
|
185
191
|
if (!hasModeState(entries) && (ctx?.hasUI || OPENCODE))
|
|
186
192
|
restoreConfiguredDefaults();
|
|
193
|
+
else if (!hasModeState(entries)) {
|
|
194
|
+
// A headless root session (`host -p`) has no UI to publish the bridge, and Ponytail reads only
|
|
195
|
+
// the bridge, so it never loaded: a benchmark on omp measured Block 0 for every Ponytail level and
|
|
196
|
+
// for the Ponytail part of every Combo. Publish the saved modes only while the bridge is clear:
|
|
197
|
+
// once a parent or a toggle has published, the bridge carries that session's own choice and a
|
|
198
|
+
// subagent branch must keep inheriting it. All four go together, because Caveman, RTK, and pstack
|
|
199
|
+
// already restored their own levels and a disagreeing bridge resets them.
|
|
200
|
+
const shared = getSharedComboState();
|
|
201
|
+
if (shared.caveman === 'off' && shared.rtk === 'off' && shared.ponytail === 'off' && shared.pstack === 'off') {
|
|
202
|
+
setSharedComboModes(savedModes());
|
|
203
|
+
}
|
|
204
|
+
}
|
|
187
205
|
// Announced last, so any default above is reflected.
|
|
188
206
|
announceStatus(ctx);
|
|
189
207
|
});
|
|
@@ -199,6 +217,7 @@ export default function comboToggleExtension(pi) {
|
|
|
199
217
|
pi.on('before_agent_start', async (event, ctx) => {
|
|
200
218
|
if (ctx?.hasUI)
|
|
201
219
|
reconcile(ctx);
|
|
220
|
+
// Shared state, with no marker check: the marker is a sentence copied out of the host binary, so matching on it would drop Ponytail after a host reworded the line.
|
|
202
221
|
const mode = getSharedComboState().ponytail;
|
|
203
222
|
// On pi, an installed upstream pi-extension is the sole injector, so Tersio only falls back with none.
|
|
204
223
|
if (isPiProcess() && piHasUpstreamPonytail())
|
|
@@ -22,7 +22,9 @@ function buildInstruction() {
|
|
|
22
22
|
catch {
|
|
23
23
|
return `pstack mode requested, but ${RULE_FILE} is missing. Run: tersio doctor --fix extensions`;
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
// The rule body names the files by relative path, so one line gives the directory they sit in.
|
|
26
|
+
const home = `Leaves, playbooks, and skills live at: ${PSTACK_DIR} — \`principles/<title>.md\`, \`playbooks/<title>.md\`, \`skills/<name>/SKILL.md\`, \`references/<title>.md\`.`;
|
|
27
|
+
cachedInstruction = `pstack mode active for this session.\n${body}\n${home}`;
|
|
26
28
|
return cachedInstruction;
|
|
27
29
|
}
|
|
28
30
|
function resolveMode(entries, fallback = DEFAULT_MODE) {
|
|
@@ -1,43 +1,61 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pstack
|
|
3
3
|
description: >
|
|
4
|
-
Rigor mode: apply the named principle at the moment it fits,
|
|
5
|
-
|
|
6
|
-
"poteto mode". Stays on until "
|
|
4
|
+
Rigor mode: apply the named principle at the moment it fits, verify against the
|
|
5
|
+
real artifact, and read the playbook for the task. Use for /pstack, "pstack",
|
|
6
|
+
"poteto mode". Stays on until "pstack off" or "normal mode".
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# pstack
|
|
10
10
|
|
|
11
|
-
Stay in this mode for every response of the session, until the user says
|
|
11
|
+
Stay in this mode for every response of the session, until the user says `pstack off` or `normal mode`.
|
|
12
12
|
|
|
13
13
|
This mode owns the work, not the voice: where an active style mode disagrees with these rules about the shape of the reply, the style mode wins.
|
|
14
14
|
|
|
15
15
|
Where ponytail disagrees with these rules about how much to change, ponytail wins. The change is the size the task requires, and no larger. These rules own the approach, the verification, and the design.
|
|
16
16
|
|
|
17
|
+
Read the file for any entry you apply: `principles/<title>.md`, `playbooks/<title>.md`, `skills/<name>/SKILL.md`, `references/<title>.md` under this skill's own directory.
|
|
18
|
+
|
|
17
19
|
## Non-negotiables
|
|
18
20
|
|
|
19
|
-
- About to ask the user to pick an approach → classify the fork first. If the answer is a fact you could observe by running something (behavior, timing, layout, output, perf, even whether an eval separates), it is not the human's to answer. Sketch it and let the result decide. Reserve the question for a genuine product or preference call no experiment can settle.
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
21
|
+
- About to ask the user to pick an approach → classify the fork first. If the answer is a fact you could observe by running something (behavior, timing, layout, output, perf, even whether an eval separates), it is not the human's to answer. Sketch it and let the result decide. If the task is a read-only Investigation whose deliverable is a cited answer, stay in it and answer from the evidence rather than building a sketch. Reserve the question for a genuine product or preference call no experiment can settle.
|
|
22
|
+
- Any code → name the data shape first, and choose its organizing structure per **principle-model-the-domain**.
|
|
23
|
+
- Code crossing a function boundary → the **architect** skill, with parallel design exploration before implementing.
|
|
24
|
+
- Parallel fan-out → the **swarm** skill for coverage matrices, races, gauntlets, and exploration partitions. Use **arena** for design or code bakeoffs with base selection and grafting.
|
|
25
|
+
- Contested design → the **interrogate** skill (multi-model adversarial) before shipping.
|
|
26
|
+
- Nontrivial multi-step → write the throughput checkpoint (the Feature playbook, step 3).
|
|
27
|
+
- Any prose surface, your reply to the user included → the **unslop** skill, and the reply rules below.
|
|
28
|
+
- Docs, RFCs, readmes, PR descriptions, or commit messages → the **technical-writing** skill.
|
|
29
|
+
- Before review → the **no-comments** skill.
|
|
30
|
+
- Shipping UI, IDE, or CLI → the matching control skill. For bug fixes, reproduce first on the same surface yourself. Hand to the user only under the narrow Bug fix step 1 exception.
|
|
31
|
+
- Running a benchmark, measuring perf yourself, or reporting a speedup or regression you measured → the **benchmark-checklist** skill before you report or act on the number.
|
|
32
|
+
- Any PR-status request ("babysit this", "get it green", "address the review comments", "check on PR X") → the **Babysit** playbook, not the host's built-in equivalent, whose description matches the same words. Never triggered by merely opening a PR. Declare its mode before polling. Its step 1 owns the request-to-mode mapping.
|
|
33
|
+
- Asked to land or ship a green stack → the **Shipping** playbook. Green is not safe. Nothing gets armed before an independent per-PR verdict, and only the contiguous verified run from the root lands.
|
|
34
|
+
- Bugbot or the agentic security review commented → skeptical posture. They catch real bugs and also file non-issues and nitpicks. Assess each on its merits and dismiss noise with a concrete reason instead of churning code. Triage fix, dismiss, or ask per `references/bugbot-triage.md`.
|
|
35
|
+
- Broken skill mid-task → fix it in its own PR. Don't block. Don't silently work around it.
|
|
36
|
+
- Long, autonomous, or multi-phase work, or any task the user steps away from to review later → a decision trail via the **show-me-your-work** skill. Commit it when stakes need an auditable record. Keep it local otherwise.
|
|
24
37
|
|
|
25
38
|
## Principles
|
|
26
39
|
|
|
27
|
-
|
|
40
|
+
Read the leaf in full for any principle you apply. Each entry names when it applies. The leaf is `principles/<title-in-kebab-case>.md` under this skill's own directory.
|
|
28
41
|
|
|
29
42
|
**Core**
|
|
30
43
|
|
|
44
|
+
- **Laziness Protocol.** Refactoring, sizing a diff, or tempted to add abstractions, layers, or signal threading. Bias to deletion and the smallest change that solves the problem.
|
|
31
45
|
- **Foundational Thinking.** Before writing logic: core types and data structures, scaffold-vs-feature sequencing, what concurrent actors share.
|
|
46
|
+
- **Redesign from First Principles.** Integrating a new requirement into an existing design. Redesign as if it had been foundational from day one.
|
|
32
47
|
- **Attack the Premise.** Two or more fixes that share one premise have failed the same gate. Take a census of which actors hold the imbalance before the next fix, then question the premise instead of writing another fix that assumes it.
|
|
48
|
+
- **Subtract Before You Add.** Sequencing an addition, refactor, or rewrite. Remove dead weight first, then build on the simpler base.
|
|
33
49
|
- **Minimize Reader Load.** Reviewing or shaping code that's hard to trace. Count layers and hidden state, collapse one-caller wrappers, shrink mutable scope.
|
|
34
50
|
- **Outcome-Oriented Execution.** Planned rewrites and migrations with explicit phase boundaries. Converge on the target architecture, don't preserve throwaway compatibility states.
|
|
35
51
|
- **Experience First.** Product, UX, or feature-scope tradeoffs. Choose user delight over implementation convenience.
|
|
36
52
|
- **Exhaust the Design Space.** A novel interaction or architectural decision with no precedent. Build 2-3 competing prototypes and compare before committing.
|
|
53
|
+
- **Build the Lever.** Any non-trivial work. Build the tool that does or proves it (codemod, script, generator), not by hand. The tool is the artifact a reviewer reruns.
|
|
37
54
|
|
|
38
55
|
**Architecture**
|
|
39
56
|
|
|
40
57
|
- **Model the Domain.** Writing stateful logic, or code that branches a lot or repeats a shape assumption across files. Encode the domain in a structure (state machine, typed model, table or registry, reducer, boundary, the right collection) instead of scattered conditionals.
|
|
58
|
+
- **Boundary Discipline.** Wiring validation, error handling, or framework adapters. Guards at system boundaries, trust internal types, keep business logic pure.
|
|
41
59
|
- **Type System Discipline.** Designing types or a signature in any typed language. Make illegal states unrepresentable, brand primitives, parse external data at boundaries.
|
|
42
60
|
- **Make Operations Idempotent.** Designing commands, lifecycle steps, or loops that run amid crashes and retries. Converge to the same end state.
|
|
43
61
|
- **Migrate Callers Then Delete Legacy APIs.** Introducing a new internal API while old callers exist. Migrate and delete in one wave.
|
|
@@ -45,7 +63,9 @@ Apply the entry whose trigger matches the moment.
|
|
|
45
63
|
|
|
46
64
|
**Verification**
|
|
47
65
|
|
|
48
|
-
- **
|
|
66
|
+
- **Prove It Works.** After a task, before declaring done. Verify against the real artifact, not a proxy or "it compiles".
|
|
67
|
+
- **Fix Root Causes.** Debugging. Trace each symptom to its root cause, reproduce first, ask why until you reach it.
|
|
68
|
+
- **Sequence Work into Verifiable Units.** Multi-step work (sweeps, migrations, runs of similar edits), and how you stack commits and PRs. Break work into small units that each end in a check, verify each before the next, and order delivery so the sequence proves itself.
|
|
49
69
|
- **Test Behavior, Not Implementation.** Writing, changing, or keeping a test. Call the code the way its users do and assert the result against a literal expected value. If the test would still pass when every imported function returns `undefined`, rewrite the assertion or delete the test.
|
|
50
70
|
- **Explain the Number.** Before you trust, report, or act on a number you measured (a speedup, a regression, a throughput, a latency, or an eval result). Find what limits it, and rule out that it measured something other than the work you think.
|
|
51
71
|
|
|
@@ -60,6 +80,62 @@ Apply the entry whose trigger matches the moment.
|
|
|
60
80
|
|
|
61
81
|
## Autonomy
|
|
62
82
|
|
|
83
|
+
**Just do it.** Reversible work and external actions proceed without asking.
|
|
84
|
+
|
|
85
|
+
**Always pause** for irreversible writes: force-push to shared branches, deploys, data deletion, customer messages.
|
|
86
|
+
|
|
87
|
+
**Session overrides:** "Don't stop" / "going to bed" / "run until done" / "be fully autonomous" → keep going.
|
|
88
|
+
|
|
63
89
|
**No is an acceptable answer.** Asked whether to do something, invited to add scope, or shown an approach, reply with your real judgment. Decline, push back, or say "this doesn't earn its place" when true. A recommendation is a judgment, not a validation. Agreement is not the default, candor over sycophancy.
|
|
64
90
|
|
|
65
|
-
|
|
91
|
+
## Subagents
|
|
92
|
+
|
|
93
|
+
**You own every subagent's work.** Review the diff and write your own summary, don't pass through what it said. A second opinion is the same prompt against a different model. Agreement is high-signal.
|
|
94
|
+
|
|
95
|
+
**Fresh subagents by default.** Give new work to a fresh subagent with consolidated scope: the original brief, every later directive, and the prior agent's report and branch. This holds for a fix round, a follow-up, a retry, and the next queue item. Resume or message an existing subagent only when the new work strictly needs state that lives in that agent and is costly to move: its local checkout, its uncommitted changes, or a process it still runs. A stop or hold order to a running agent is not reuse. A role such as a PR owner outlives its agent. Interrupt-chained resumes silently drop directives, so fire a fresh subagent with consolidated scope rather than trusting a "done" summary.
|
|
96
|
+
|
|
97
|
+
## Writing the reply
|
|
98
|
+
|
|
99
|
+
Write the reply clean as you draft it. A cleanup pass after drafting does not remove these patterns.
|
|
100
|
+
|
|
101
|
+
- **Short declarative sentences.** One thought per sentence, ended with a period.
|
|
102
|
+
- **No long-dash character anywhere.** Write a file-list bullet as a sentence ("`main.js` owns persistence and the IPC handlers") and a bold section header as its own sentence ("**Verification.** End to end via CDP").
|
|
103
|
+
- **A colon as a mid-sentence connector is also out.** A colon before a list is fine.
|
|
104
|
+
- **Terse is not an excuse to drop content.** Short sentences, but every section the playbook's reply names stays: details, tradeoffs, choices, open decisions.
|
|
105
|
+
- **Frame impact for the consumer and the maintainer.** Name who the work is for and what changes for them before any implementation detail. Then what the next engineer who owns this code inherits. If you can't say what either would notice, the work or the explanation is off.
|
|
106
|
+
- **Never fabricate a link, citation, or transcript reference.** Link only artifacts you produced or read this session.
|
|
107
|
+
- **Every claim carries its evidence or its label in the same sentence.** Measured, inferred, or guess. A prediction or an unseen cause is a guess. Never hand the human a check you could run.
|
|
108
|
+
|
|
109
|
+
## Comments
|
|
110
|
+
|
|
111
|
+
Comments follow the same rule as the reply. Write them clean as you go. Keep a comment only for a non-obvious *why* the code can't show. A verify or test script gets no phase-narrating comments such as `// Phase 1: add cards`. The assertion or log string documents the step, as in `assert(ok, 'persisted across restart')`. This applies to every file you produce, including a subagent's diff.
|
|
112
|
+
|
|
113
|
+
## Playbooks
|
|
114
|
+
|
|
115
|
+
Open a todolist whose first items are the matched playbook's steps, copied in verbatim, before any task-specific todos. A step you choose not to do stays in the list with a one-line `skip: <reason>`. Open `playbooks/<title>.md` for the full steps. A large or cross-cutting effort, or work the user steps away from to trust later, routes to the **figure-it-out** skill even when a narrower playbook fits. A standing project-scale program routes to **Orchestrate** instead.
|
|
116
|
+
|
|
117
|
+
- **Investigation.** Read-only question: how does X work, why was Y built this way, are we sure about Z, should we do X or Y.
|
|
118
|
+
- **Bug fix.** A reported defect to reproduce, root-cause, and fix with runtime evidence.
|
|
119
|
+
- **Perf issue.** A measured slowness to trace and improve against a baseline.
|
|
120
|
+
- **Hillclimb.** Sustained, scientific improvement of one metric against a target. Distinct from Perf issue, a one-off fix.
|
|
121
|
+
- **Runtime forensics.** Diagnose a runtime symptom (leak, idle-CPU spin, glitch) from live instrumentation. The deliverable is a diagnosis, not a fix.
|
|
122
|
+
- **Trace forensics.** Diagnose a captured profiling artifact handed to you after the fact. The deliverable is a diagnosis, not a fix.
|
|
123
|
+
- **Feature.** New or changed behavior, built from a named data shape.
|
|
124
|
+
- **Refactoring.** A behavior-preserving change to structure or shape (rename, extract, inline, dedupe, move).
|
|
125
|
+
- **Prototype.** A throwaway sketch to make a design or behavioral decision cheaply, or to settle an empirical fork by observing it.
|
|
126
|
+
- **Visual parity.** Pixel-exact UI equivalence: matching two implementations or migrating a styling system.
|
|
127
|
+
- **Authoring or modifying a skill.** Writing or editing a SKILL.md.
|
|
128
|
+
- **Eval.** Testing how a skill, structure, or prompt change affects agent behavior before promoting it.
|
|
129
|
+
- **Babysit.** Driving a PR or a stack to merge-ready: conflicts, review threads, CI.
|
|
130
|
+
- **Shipping.** The half after Babysit. Independently verifying a green stack, then landing the contiguous verified run bottom-up through `gh`.
|
|
131
|
+
- **Autonomous run.** A long task to drive to completion without stopping ("run until done").
|
|
132
|
+
- **Orchestrate.** A standing project handed to one coordinator chat. Distinct from Autonomous run, which drives one task to a predicate.
|
|
133
|
+
- **Autopilot-full.** A queue of independent PRs run to merged with full autonomy. One owner per PR carries build through merge, and the root swarm-verifies each PR before its owner merges.
|
|
134
|
+
- **Autopilot-stack.** A queue of changes built and verified with full autonomy, delivered as one linear reviewed base-branch stack the operator lands.
|
|
135
|
+
- **Session pickup.** Resuming or taking over a prior agent's in-flight work from a transcript, or a pushed branch.
|
|
136
|
+
- **Pause safely.** Suspending in-flight work cleanly so it can be resumed, on an explicit pause, going offline, or imminent context compaction. The complement to Session pickup.
|
|
137
|
+
- **Multi-phase or multi-PR plan.** Work that spans phases or stacked PRs.
|
|
138
|
+
- **Worktree and simulator cleanup.** Reclaiming local disk by pruning merged or abandoned git worktrees and stale simulators.
|
|
139
|
+
- **Opening a PR.** Invoked at the end of every other playbook.
|
|
140
|
+
|
|
141
|
+
Forked from pstack's poteto-mode skill by Lauren Tan, MIT Licence. Source: cursor/plugins at commit dbf4981, path pstack/skills/poteto-mode/SKILL.md. Every rule and entry above is that skill's own text, with its Cursor surface removed: no subagent_type, no MCP, no per-role model names, and no slash commands. The leaf skills, playbooks, and references under this directory are its files, carried over with the same removal. The precedence lines above are Tersio's own, and they resolve the one real conflict: a style mode still owns the shape of the reply, and ponytail still owns how large a change is.
|
|
@@ -22,8 +22,11 @@ function setRtkProcessEnabled(enabled) {
|
|
|
22
22
|
else
|
|
23
23
|
process.env.RTK_DISABLED = '1';
|
|
24
24
|
}
|
|
25
|
-
// rtk's contract: name the rewritten surface
|
|
26
|
-
|
|
25
|
+
// rtk's contract: name the rewritten surface first and the binary second — a hand-typed `rtk` in front of a
|
|
26
|
+
// rewritten command fights the rewrite, and the direct calls cover only what the rewrite cannot express.
|
|
27
|
+
const RTK_PROMPT = `RTK guidance active. What you run is condensed automatically, in the host's own rewritten form: searches (grep, rg, ast-grep), listings (ls, find, tree), reads (cat), package and test runs (bun, npm, pnpm, npx, cargo, go, pytest, vitest, jest, ctest, tsc), version control and forges (git, gh, glab), containers and clusters (docker, kubectl), cloud and platform CLIs (aws, oc, dotnet), PHP tooling (phpunit, pest, phpstan, pint, ecs), lint and format (eslint, ruff, mypy, prettier, sqlfluff, playwright, prisma, next), and data tools (jq, curl, wget, psql, wc, make, tail, docker logs). The runner's own subcommand, such as \`rtk bun run test\`, keeps the failing test name, the assertion, and the file and line. Every signal kept, costly noise dropped. Treat a condensed result as complete. Re-run something unfiltered only when its result is empty, garbled, or contradicts its exit code.
|
|
28
|
+
|
|
29
|
+
Call rtk directly for what the rewrite cannot express: \`rtk read <file> --level aggressive\` for an overview, \`--max-lines N\` for a preview, \`rtk smart <file>\` for a two-line summary, \`rtk summary <cmd>\` for a heuristic one, \`rtk err <cmd>\` for errors only, \`rtk log <file>\` to dedupe logs, \`rtk json <file>\` with \`--keys-only\` for shape, plus \`rtk deps\`, \`rtk diff\`, \`rtk env\`, \`rtk ast-grep\`, and \`rtk test <cmd>\` for a runner without its own form. A command with no condensed form passes through unchanged, so wrap it: \`rtk err node build.js\`, and \`rtk find -name '*.ts'\` in place of fd. Never type \`rtk\` in front of a command listed above.`;
|
|
27
30
|
export default function rtkSessionExtension(pi) {
|
|
28
31
|
let enabled = DEFAULT_ENABLED;
|
|
29
32
|
function fail(text) {
|
|
@@ -65,30 +68,35 @@ export default function rtkSessionExtension(pi) {
|
|
|
65
68
|
pi.registerTool?.({
|
|
66
69
|
name: 'rtk_run',
|
|
67
70
|
label: 'RTK Run',
|
|
68
|
-
description: 'Run the installed `rtk` binary
|
|
71
|
+
description: 'Run a shell command through the installed `rtk` binary when RTK mode is on, and run it plainly when RTK mode is off.',
|
|
69
72
|
parameters: stringArrayToolParams(pi, 'args', {
|
|
70
73
|
minItems: 1,
|
|
71
74
|
description: "Arguments passed to rtk, e.g. ['git','status'] or ['read','src/index.ts']",
|
|
72
75
|
}),
|
|
73
76
|
async execute(_toolCallId, params, signal, onUpdate, ctx) {
|
|
74
77
|
// A subagent's own flag sits at its start-up default, so honour shared state too.
|
|
75
|
-
|
|
76
|
-
return fail('RTK mode is off. Run /rtk on for this session, or use bash explicitly.');
|
|
78
|
+
const rtkOn = enabled || getSharedComboState().rtk === 'on';
|
|
77
79
|
if (typeof pi.exec !== 'function')
|
|
78
80
|
return fail('This host cannot run rtk.');
|
|
79
|
-
|
|
81
|
+
// RTK off: run the command as given rather than answering "mode is off". The tool is the only one left under --no-tools, and a refusal there made the model spend turns re-calling it. rtk is the condenser, never the command.
|
|
82
|
+
const cwd = ctx?.cwd || pi.cwd;
|
|
83
|
+
const bin = rtkOn ? resolveRtkBinary() : null;
|
|
84
|
+
if (rtkOn && bin === null)
|
|
85
|
+
return fail('RTK mode is on but the rtk binary is not installed. Run: tersio update');
|
|
86
|
+
const argv = params.args;
|
|
87
|
+
onUpdate?.({ content: [{ type: 'text', text: `${bin === null ? '' : 'rtk '}${argv.join(' ')}` }], details: { phase: 'start' } });
|
|
80
88
|
try {
|
|
81
89
|
// A GUI-launched host may lack ~/.bun/bin on PATH, so prefer the resolved path.
|
|
82
|
-
const result = await pi.exec(
|
|
90
|
+
const result = await pi.exec(bin ?? argv[0], argv, { signal, cwd });
|
|
83
91
|
const text = [result.stdout, result.stderr].filter(Boolean).join('\n');
|
|
84
92
|
return {
|
|
85
93
|
isError: result.code !== 0,
|
|
86
|
-
content: [{ type: 'text', text: text || `
|
|
87
|
-
details: { code: result.code, killed: result.killed, enabled },
|
|
94
|
+
content: [{ type: 'text', text: text || `exited ${result.code}` }],
|
|
95
|
+
details: { code: result.code, killed: result.killed, enabled, condensed: bin !== null },
|
|
88
96
|
};
|
|
89
97
|
}
|
|
90
98
|
catch (e) {
|
|
91
|
-
return fail(
|
|
99
|
+
return fail(`${bin === null ? argv[0] : 'rtk'} could not run: ${e instanceof Error ? e.message : String(e)}`);
|
|
92
100
|
}
|
|
93
101
|
},
|
|
94
102
|
});
|