@ericrisco/rsc 4.1.11 → 4.2.1
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/manifest.json +6 -6
- package/package.json +2 -1
- package/scripts/lib/prompt-audit.js +110 -0
- package/scripts/lib/review-ledger.js +14 -3
- package/scripts/prompt-audit.js +48 -0
- package/scripts/rsc.js +4 -2
- package/skills/ads/SKILL.md +7 -7
- package/skills/agent-safety/SKILL.md +1 -1
- package/skills/asdd/SKILL.md +2 -2
- package/skills/asdd/references/model-routing.md +5 -5
- package/skills/astro/SKILL.md +1 -1
- package/skills/astro/scripts/verify.sh +1 -1
- package/skills/author-skill/SKILL.md +5 -5
- package/skills/author-skill/references/eval-authoring.md +6 -7
- package/skills/automation-flows/SKILL.md +1 -1
- package/skills/building-agents/SKILL.md +17 -12
- package/skills/building-agents/references/agent-loops-and-harness.md +3 -2
- package/skills/building-agents/references/evals-and-observability.md +7 -5
- package/skills/building-agents/references/provider-abstraction.md +31 -30
- package/skills/chrome-extension/SKILL.md +1 -1
- package/skills/cold-outreach/SKILL.md +1 -1
- package/skills/cold-outreach/references/templates.md +7 -3
- package/skills/compliance/SKILL.md +8 -8
- package/skills/compliance/evals/README.md +1 -1
- package/skills/compliance/evals/cases.yaml +2 -2
- package/skills/compliance/references/frameworks.md +7 -7
- package/skills/content-engine/SKILL.md +1 -1
- package/skills/cost-tracking/SKILL.md +29 -21
- package/skills/cost-tracking/references/pricing-tables.md +6 -5
- package/skills/course-builder/SKILL.md +4 -3
- package/skills/course-builder/references/outcomes-and-blooms.md +1 -1
- package/skills/course-storytelling/SKILL.md +1 -1
- package/skills/course-storytelling/references/concept-landing-recipe.md +1 -1
- package/skills/csharp-dotnet/SKILL.md +2 -2
- package/skills/data-policy/SKILL.md +1 -1
- package/skills/db-migrations/SKILL.md +6 -5
- package/skills/deep-learning/SKILL.md +2 -2
- package/skills/deployment/SKILL.md +1 -1
- package/skills/deployment/references/dockerfiles-by-stack.md +1 -1
- package/skills/design/engine/RUN.md +1 -1
- package/skills/django/SKILL.md +1 -1
- package/skills/docker/SKILL.md +1 -1
- package/skills/document-processing/SKILL.md +2 -1
- package/skills/electron/SKILL.md +2 -1
- package/skills/email-connector/SKILL.md +2 -1
- package/skills/email-deliverability/SKILL.md +2 -2
- package/skills/embeddings-search/SKILL.md +3 -3
- package/skills/error-handling/SKILL.md +4 -2
- package/skills/expo/SKILL.md +1 -1
- package/skills/fable-operator/SKILL.md +2 -2
- package/skills/fal/SKILL.md +1 -1
- package/skills/fastapi/SKILL.md +18 -9
- package/skills/fastapi/references/database.md +19 -10
- package/skills/finance-ops/SKILL.md +1 -1
- package/skills/firebase/SKILL.md +1 -1
- package/skills/flutter/SKILL.md +1 -1
- package/skills/forecasting/SKILL.md +1 -1
- package/skills/forecasting/references/accuracy-and-backtesting.md +1 -1
- package/skills/forecasting/references/methods-cheatsheet.md +3 -3
- package/skills/ftd/SKILL.md +2 -3
- package/skills/fundraising/references/funnel-math.md +1 -1
- package/skills/gamedev-multiplayer/SKILL.md +2 -2
- package/skills/gamedev-multiplayer/references/unity-and-unreal-netcode.md +4 -4
- package/skills/gamedev-pathing/SKILL.md +1 -1
- package/skills/gamedev-physics/SKILL.md +3 -2
- package/skills/gamedev-physics/references/character-controllers.md +1 -1
- package/skills/gamedev-shaders/SKILL.md +2 -4
- package/skills/gamedev-shipping/SKILL.md +8 -5
- package/skills/gamedev-shipping/references/mobile-and-desktop.md +7 -3
- package/skills/gcp-essentials/SKILL.md +11 -8
- package/skills/gcp-essentials/references/networking-and-sql.md +4 -4
- package/skills/gdpr-privacy/references/dpa-and-transfers.md +1 -1
- package/skills/git-workflow/SKILL.md +3 -3
- package/skills/github-actions/SKILL.md +12 -12
- package/skills/github-actions/evals/cases.yaml +1 -1
- package/skills/github-actions/references/caching-and-matrix.md +5 -5
- package/skills/github-actions/references/oidc-deploys.md +4 -4
- package/skills/go/SKILL.md +3 -3
- package/skills/google-workspace/SKILL.md +15 -11
- package/skills/google-workspace/references/api-recipes.md +2 -2
- package/skills/google-workspace/references/auth-setup.md +1 -1
- package/skills/harness/SKILL.md +4 -3
- package/skills/harness/references/daily-curation-automation.md +1 -1
- package/skills/harness/references/providers.yaml +4 -4
- package/skills/harness/references/wiki-protocol.md +2 -1
- package/skills/hetzner/SKILL.md +13 -12
- package/skills/hetzner/references/cloud-init.md +4 -2
- package/skills/hetzner/references/plans-and-locations.md +15 -14
- package/skills/hiring/SKILL.md +3 -3
- package/skills/htmx/SKILL.md +4 -4
- package/skills/htmx/references/server-contract.md +2 -2
- package/skills/huggingface/SKILL.md +15 -15
- package/skills/huggingface/evals/cases.yaml +1 -1
- package/skills/huggingface/references/endpoints-and-spaces.md +5 -3
- package/skills/huggingface/references/hub-and-cli.md +4 -4
- package/skills/huggingface/references/inference-providers.md +1 -1
- package/skills/huggingface/scripts/verify.sh +3 -2
- package/skills/implement/SKILL.md +3 -3
- package/skills/init/SKILL.md +2 -3
- package/skills/init/references/accompaniment-and-profile.md +1 -1
- package/skills/init/references/recommend-skills.md +9 -9
- package/skills/instagram-api/SKILL.md +9 -9
- package/skills/instagram-api/evals/cases.yaml +1 -1
- package/skills/instagram-api/references/insights-metrics.md +1 -1
- package/skills/instagram-api/references/publish-reel.md +8 -7
- package/skills/invoicing/SKILL.md +8 -7
- package/skills/java/SKILL.md +3 -2
- package/skills/knowledge-ops/SKILL.md +3 -4
- package/skills/knowledge-ops/references/gardening-playbook.md +3 -3
- package/skills/kotlin-android/SKILL.md +10 -3
- package/skills/kotlin-android/references/gradle-setup.md +1 -4
- package/skills/landing-copy/SKILL.md +1 -1
- package/skills/laravel/SKILL.md +11 -11
- package/skills/lead-gen/SKILL.md +3 -3
- package/skills/linkedin-api/SKILL.md +3 -3
- package/skills/linkedin-api/evals/cases.yaml +1 -1
- package/skills/linkedin-api/references/api-reference.md +3 -3
- package/skills/linkedin-content/SKILL.md +1 -1
- package/skills/linkedin-outreach/SKILL.md +4 -4
- package/skills/linkedin-strategy/SKILL.md +2 -2
- package/skills/llm-pipeline/SKILL.md +2 -2
- package/skills/llm-pipeline/references/litellm-router.md +3 -3
- package/skills/logistics-ops/SKILL.md +6 -1
- package/skills/marketing/SKILL.md +1 -1
- package/skills/marketing/references/seo-geo.md +2 -2
- package/skills/mongodb/SKILL.md +3 -2
- package/skills/mongodb/references/aggregation.md +3 -2
- package/skills/mysql/SKILL.md +1 -1
- package/skills/mysql/references/mysql-vs-mariadb.md +1 -1
- package/skills/n8n/SKILL.md +1 -1
- package/skills/nextjs/SKILL.md +1 -1
- package/skills/observability/SKILL.md +1 -1
- package/skills/observability/references/instrumentation-recipes.md +1 -1
- package/skills/ollama/SKILL.md +1 -1
- package/skills/open-weights/SKILL.md +3 -4
- package/skills/orient/SKILL.md +4 -3
- package/skills/parallel/SKILL.md +1 -1
- package/skills/planetscale/SKILL.md +3 -3
- package/skills/planetscale/references/no-foreign-keys.md +3 -3
- package/skills/postgresdb/SKILL.md +4 -4
- package/skills/presentations/SKILL.md +1 -1
- package/skills/prompt-engineering/SKILL.md +6 -6
- package/skills/prompt-engineering/evals/cases.yaml +2 -2
- package/skills/prompt-engineering/references/output-contracts.md +18 -23
- package/skills/rag/references/pipeline.md +7 -5
- package/skills/review/SKILL.md +5 -5
- package/skills/roast-me/prompts/compute.md +5 -5
- package/skills/roast-me/prompts/roast.md +2 -2
- package/skills/sdd-init/SKILL.md +3 -3
- package/skills/ship/SKILL.md +7 -9
- package/skills/shopify/SKILL.md +6 -6
- package/skills/shopify/references/apps-graphql.md +3 -3
- package/skills/skill-scout/SKILL.md +1 -1
- package/skills/specify/SKILL.md +3 -3
- package/skills/specify/references/eliciting-requirements.md +3 -3
- package/skills/structured-extraction/SKILL.md +7 -3
- package/skills/structured-extraction/references/providers.md +8 -5
- package/skills/svelte/SKILL.md +1 -1
- package/skills/swift-ios/SKILL.md +4 -4
- package/skills/tasks/SKILL.md +1 -1
- package/skills/tauri/SKILL.md +4 -3
- package/skills/terms-conditions/SKILL.md +2 -2
- package/skills/translation-l10n/SKILL.md +2 -1
- package/skills/typescript/SKILL.md +67 -19
- package/skills/typescript/evals/README.md +3 -3
- package/skills/typescript/evals/cases.yaml +4 -1
- package/skills/typescript/references/build-and-monorepo.md +82 -26
- package/skills/typescript/references/type-system.md +15 -4
- package/skills/typescript/scripts/verify.sh +20 -10
- package/skills/unslop/SKILL.md +1 -1
- package/skills/ux/SKILL.md +1 -1
- package/skills/vercel/SKILL.md +3 -2
- package/skills/vercel/references/vercel-json.md +8 -5
- package/skills/verify/SKILL.md +3 -3
- package/skills/vllm/SKILL.md +4 -2
- package/skills/vue-nuxt/SKILL.md +5 -5
- package/skills/webhooks/SKILL.md +10 -1
- package/skills/worktrees/SKILL.md +10 -8
- package/skills/youtube-ideation/SKILL.md +1 -1
- package/targets/agents.js +26 -17
- package/targets/asdd-gate.mjs +9 -1
- package/targets/commands.js +7 -7
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
# Build & monorepo config
|
|
2
2
|
|
|
3
|
-
Field-by-field tsconfig, project references, resolution matrix,
|
|
4
|
-
declaration publishing. All targets TypeScript
|
|
3
|
+
Field-by-field tsconfig, project references, resolution matrix, running TypeScript 7 next to
|
|
4
|
+
JS-API tools, and declaration publishing. All targets TypeScript 7 (`typescript` 7.0.2,
|
|
5
|
+
binary `tsc`). Read the section you need.
|
|
5
6
|
|
|
6
7
|
## tsconfig fields that earn their place
|
|
7
8
|
|
|
8
9
|
| Field | Set to | Why |
|
|
9
10
|
| --- | --- | --- |
|
|
10
|
-
| `strict` | `true` | Turns on the whole family (`noImplicitAny`, `strictNullChecks`, `strictFunctionTypes`, …).
|
|
11
|
+
| `strict` | `true` | Turns on the whole family (`noImplicitAny`, `strictNullChecks`, `strictFunctionTypes`, …). Default in TS 7; write it anyway. |
|
|
11
12
|
| `noUncheckedIndexedAccess` | `true` | `arr[i]` / `rec[k]` become `T \| undefined` — the runtime truth. |
|
|
12
13
|
| `verbatimModuleSyntax` | `true` | Forces explicit `import type`; never emits a type-only import as a runtime `require`; blocks `export default` in CJS-emitted modules. |
|
|
13
14
|
| `isolatedModules` | `true` | Guarantees each file transpiles standalone, so esbuild/swc/babel are safe. |
|
|
14
15
|
| `skipLibCheck` | `true` | Skips type-checking `node_modules` `.d.ts` — large build-time win, negligible risk. |
|
|
15
16
|
| `resolveJsonModule` | `true` | Import `*.json` with inferred types. |
|
|
16
17
|
| `moduleDetection` | `force` | Treats every file as a module (no accidental global scripts). |
|
|
18
|
+
| `rootDir` | `"./src"` | Defaults to the tsconfig's folder; without it, `outDir` mirrors `src/` as `dist/src/`. |
|
|
19
|
+
| `types` | `["node", …]` | Defaults to `[]`: no `@types/*` global is visible until listed. `["*"]` loads them all (slower, rarely right). |
|
|
20
|
+
| `noUncheckedSideEffectImports` | `true` (default) | `import "./x.css"` must resolve; declare the module (`declare module "*.css";`) when a bundler handles it. |
|
|
21
|
+
| `erasableSyntaxOnly` | `true` (Node type stripping) | Rejects `enum`, `namespace`, parameter properties — syntax that cannot be erased. |
|
|
17
22
|
| `noEmit` | `true` (apps) | A bundler emits; `tsc` only type-checks. Libraries set it `false` to emit `.d.ts`. |
|
|
18
23
|
| `composite` | `true` (referenced pkgs) | Required for project references; enables incremental `.tsbuildinfo`. |
|
|
19
24
|
|
|
@@ -21,7 +26,7 @@ declaration publishing. All targets TypeScript 5.9. Read the section you need.
|
|
|
21
26
|
|
|
22
27
|
| | `moduleResolution: "bundler"` | `moduleResolution: "nodenext"` |
|
|
23
28
|
| --- | --- | --- |
|
|
24
|
-
| Pair `module` with | `"
|
|
29
|
+
| Pair `module` with | `"preserve"` (also `"esnext"`, `"commonjs"`) | `"nodenext"` |
|
|
25
30
|
| Who runs the output | a bundler (Vite, esbuild, webpack, Next) | Node directly |
|
|
26
31
|
| Relative import extension | omit (`import "./util"`) | required (`import "./util.js"`) |
|
|
27
32
|
| `package.json` `exports`/`imports` | resolved | resolved |
|
|
@@ -30,7 +35,9 @@ declaration publishing. All targets TypeScript 5.9. Read the section you need.
|
|
|
30
35
|
| Choose when | app/library bundled before it ships | library/script Node executes as-is |
|
|
31
36
|
|
|
32
37
|
Rule of thumb: if anything bundles the code before it runs, use `bundler`. If Node loads the
|
|
33
|
-
`.js` directly, use `nodenext` and write the `.js` extension on relative imports.
|
|
38
|
+
`.js` directly, use `nodenext` and write the `.js` extension on relative imports. Under
|
|
39
|
+
`nodenext`, `package.json` `"type": "module"` makes `.ts` files ESM; without it they are CJS.
|
|
40
|
+
`node10`/`node` and `classic` resolution do not exist in TypeScript 7.
|
|
34
41
|
|
|
35
42
|
## Project references (the monorepo backbone)
|
|
36
43
|
|
|
@@ -50,7 +57,8 @@ Layout: one `tsconfig.base.json` at the root with the strict flags, then per-pac
|
|
|
50
57
|
"moduleResolution": "nodenext",
|
|
51
58
|
"declaration": true,
|
|
52
59
|
"declarationMap": true,
|
|
53
|
-
"composite": true
|
|
60
|
+
"composite": true,
|
|
61
|
+
"types": ["node"]
|
|
54
62
|
}
|
|
55
63
|
}
|
|
56
64
|
```
|
|
@@ -64,8 +72,10 @@ Layout: one `tsconfig.base.json` at the root with the strict flags, then per-pac
|
|
|
64
72
|
}
|
|
65
73
|
```
|
|
66
74
|
|
|
67
|
-
- Build the whole graph in dependency order: `tsc -b
|
|
68
|
-
`.tsbuildinfo` and only rebuilds what changed.
|
|
75
|
+
- Build the whole graph in dependency order: `tsc -b`. It caches per package via
|
|
76
|
+
`.tsbuildinfo` and only rebuilds what changed. TypeScript 7 builds independent projects
|
|
77
|
+
concurrently (`--builders <n>`) and type-checks each with `--checkers <n>` (default 4);
|
|
78
|
+
`--singleThreaded` turns both off. Lower them when CI runners are short on memory.
|
|
69
79
|
- Each referenced package needs `composite: true` and must emit declarations.
|
|
70
80
|
- A package may only import from packages it lists under `references`; TS enforces the boundary,
|
|
71
81
|
which kills accidental cross-package coupling.
|
|
@@ -75,35 +85,77 @@ Layout: one `tsconfig.base.json` at the root with the strict flags, then per-pac
|
|
|
75
85
|
```jsonc
|
|
76
86
|
{
|
|
77
87
|
"compilerOptions": {
|
|
78
|
-
"
|
|
79
|
-
"paths": { "@core/*": ["packages/core/src/*"] }
|
|
88
|
+
"paths": { "@core/*": ["./packages/core/src/*"] }
|
|
80
89
|
}
|
|
81
90
|
}
|
|
82
91
|
```
|
|
83
92
|
|
|
93
|
+
`paths` entries resolve relative to the tsconfig that declares them; `baseUrl` does not exist
|
|
94
|
+
in TypeScript 7 (TS5102). A legacy catch-all `baseUrl: "./src"` becomes
|
|
95
|
+
`"paths": { "*": ["./src/*"] }`.
|
|
96
|
+
|
|
84
97
|
`paths` only rewrites types for the **type-checker**. The runtime/bundler must mirror it:
|
|
85
98
|
Vite (`resolve.alias`), Node (`package.json` `imports` with the `#`-prefix subpath convention),
|
|
86
99
|
or a runtime resolver. Aliases that the bundler does not mirror compile fine and crash at
|
|
87
|
-
runtime — prefer `package.json` `imports` (`"#core/*"`) when Node runs
|
|
88
|
-
resolves those natively
|
|
100
|
+
runtime — prefer `package.json` `imports` (`"#core/*"`, or `"#/*": "./dist/*"`) when Node runs
|
|
101
|
+
the code, since Node resolves those natively and TypeScript follows them under `nodenext` and
|
|
102
|
+
`bundler`.
|
|
89
103
|
|
|
90
|
-
##
|
|
104
|
+
## TypeScript 7 in practice
|
|
91
105
|
|
|
92
|
-
|
|
93
|
-
|
|
106
|
+
`npm i -D typescript` installs the native compiler; the binary is `tsc` and it takes the same
|
|
107
|
+
flags as before. Platform binaries arrive as optional dependencies
|
|
108
|
+
(`@typescript/typescript-<os>-<arch>`), so a lockfile generated on one OS must keep those
|
|
109
|
+
optional entries for CI on another.
|
|
94
110
|
|
|
95
111
|
```bash
|
|
96
|
-
npm i -D
|
|
97
|
-
npx
|
|
98
|
-
npx
|
|
112
|
+
npm i -D typescript@^7
|
|
113
|
+
npx tsc -v # Version 7.x
|
|
114
|
+
npx tsc --noEmit # check one project
|
|
115
|
+
npx tsc -b # build a project-references graph
|
|
116
|
+
npx tsc -b --builders 2 --checkers 2 # cap parallelism on a small runner
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**What 7.0 does not have: a programmatic API.** Anything that does `require("typescript")` for
|
|
120
|
+
the compiler or language-service API keeps using 6.0. The compatibility package
|
|
121
|
+
`@typescript/typescript6` ships the 6.0 API and a `tsc6` binary. Two setups:
|
|
122
|
+
|
|
123
|
+
```jsonc
|
|
124
|
+
// A. Tools import "typescript" (typescript-eslint, template tooling): alias it to 6.0,
|
|
125
|
+
// and install 7 under another name for the real `tsc`.
|
|
126
|
+
{
|
|
127
|
+
"devDependencies": {
|
|
128
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
129
|
+
"@typescript/native": "npm:typescript@^7.0.2"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
99
132
|
```
|
|
100
133
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
134
|
+
```jsonc
|
|
135
|
+
// B. Only the CLI matters: plain typescript 7, plus 6.0 for the one tool that needs it.
|
|
136
|
+
{
|
|
137
|
+
"devDependencies": {
|
|
138
|
+
"typescript": "^7.0.2",
|
|
139
|
+
"@typescript/typescript6": "^6.0.2"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Check after install which `tsc` the scripts resolve (`npx tsc -v`); in setup A, `npx tsc`
|
|
145
|
+
must print 7.x and `npx tsc6 -v` 6.0.x.
|
|
146
|
+
|
|
147
|
+
**Editors.** The language service runs over LSP. In VS Code, the TypeScript Native Preview
|
|
148
|
+
extension (`TypeScriptTeam.native-preview`) provides it, with commands to enable or disable the
|
|
149
|
+
TypeScript 7 language server per workspace. Embedded-language tooling (Vue, Svelte, Astro,
|
|
150
|
+
MDX, Angular templates) still drives 6.0; Angular projects check with `tsc` 7 on the CLI and
|
|
151
|
+
keep 6.0 in the editor.
|
|
152
|
+
|
|
153
|
+
**Migrating a 5.x project.** Upgrade to 6.0 first and clear every deprecation without
|
|
154
|
+
`ignoreDeprecations`; turn on `stableTypeOrdering` to surface the type-ordering differences
|
|
155
|
+
(it slows 6.0 checks by up to 25%, so use it for the migration only). Then switch to 7: a
|
|
156
|
+
clean 6.0 build compiles identically. `ignoreDeprecations: "6.0"` does not rescue removed
|
|
157
|
+
options on 7. The experimental `ts5to6` codemod rewrites `baseUrl` and `rootDir`. Field-level
|
|
158
|
+
replacements are in the SKILL body's "Coming from 5.x" table.
|
|
107
159
|
|
|
108
160
|
## Declaration emit & publishing a library
|
|
109
161
|
|
|
@@ -132,10 +184,14 @@ Adoption steps:
|
|
|
132
184
|
- `types`/`typesVersions` must point at the emitted `.d.ts`; put `types` **first** in each
|
|
133
185
|
`exports` condition so resolvers find it.
|
|
134
186
|
- For libraries, do not set `noEmit`; let `tsc -b` (or your bundler with dts plugin) emit.
|
|
187
|
+
- TypeScript 7 orders types deterministically
|
|
188
|
+
(`stableTypeOrdering` is always on), so emitted `.d.ts` stays stable across runs.
|
|
135
189
|
- Validate the published surface with a tool like `@arethetypeswrong/cli` before release.
|
|
136
190
|
|
|
137
191
|
## Running TS without a build
|
|
138
192
|
|
|
139
193
|
- `tsx file.ts` — fast esbuild-based runner for scripts and dev (replaces `ts-node`).
|
|
140
|
-
- Node
|
|
141
|
-
|
|
194
|
+
- Node's built-in type stripping runs `.ts` by erasing types (`node file.ts` on current Node;
|
|
195
|
+
older lines need `--experimental-strip-types`); no type-checking. Pair it with
|
|
196
|
+
`erasableSyntaxOnly: true` and `verbatimModuleSyntax: true` so only erasable syntax compiles.
|
|
197
|
+
- Both *execute*; neither *checks*. Always keep `tsc --noEmit` (or `tsc -b`) in CI.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Type-system deep dives
|
|
2
2
|
|
|
3
|
-
Recipes the SKILL body points to. All target TypeScript
|
|
3
|
+
Recipes the SKILL body points to. All target TypeScript 7. Read the relevant section, not
|
|
4
4
|
the whole file.
|
|
5
5
|
|
|
6
6
|
## Conditional types + `infer`
|
|
@@ -48,6 +48,15 @@ type CSSVar = `--${string}`;
|
|
|
48
48
|
type ParseId<T> = T extends `user_${infer N}` ? N : never; // ParseId<"user_42"> = "42"
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
+
`infer` over a template literal consumes whole code points:
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
type HeadTail<S> = S extends `${infer H}${infer R}` ? [H, R] : never;
|
|
55
|
+
type T = HeadTail<"😀abc">; // ["😀", "abc"], not half a surrogate pair
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Character-counting utility types therefore count code points, not UTF-16 units (`"😀".length` is still `2` at runtime).
|
|
59
|
+
|
|
51
60
|
## Recursive types (with care)
|
|
52
61
|
|
|
53
62
|
Recursion is allowed but the depth is bounded by the instantiation-depth limit; deep tuple
|
|
@@ -116,7 +125,9 @@ declare global {
|
|
|
116
125
|
export {}; // make this file a module so `declare global` is allowed
|
|
117
126
|
```
|
|
118
127
|
|
|
119
|
-
`type` aliases do **not** merge — only `interface` and `namespace` do.
|
|
128
|
+
`type` aliases do **not** merge — only `interface` and `namespace` do. Write internal
|
|
129
|
+
namespaces with the `namespace` keyword; `module Foo {}` is an error (TS1540), while
|
|
130
|
+
`declare module "pkg"` for module augmentation is unchanged.
|
|
120
131
|
|
|
121
132
|
## Function overloads
|
|
122
133
|
|
|
@@ -150,8 +161,8 @@ assertDefined(v);
|
|
|
150
161
|
v.toUpperCase(); // v is string here
|
|
151
162
|
```
|
|
152
163
|
|
|
153
|
-
|
|
154
|
-
`arr.filter((x) => x != null)`
|
|
164
|
+
TypeScript infers type predicates for simple filter callbacks, so
|
|
165
|
+
`arr.filter((x) => x != null)` narrows to `T[]` without a hand-written predicate in many
|
|
155
166
|
cases — but an explicit predicate is still clearer for non-trivial checks.
|
|
156
167
|
|
|
157
168
|
## `const` type parameters & `NoInfer`
|
|
@@ -4,21 +4,25 @@
|
|
|
4
4
|
# message when no TS/node is available (no false failure on a clean machine).
|
|
5
5
|
set -euo pipefail
|
|
6
6
|
|
|
7
|
-
# Resolve a type-checker:
|
|
8
|
-
#
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
# Resolve a TypeScript 7 type-checker: a `tsc` on PATH that reports 7.x, else
|
|
8
|
+
# `npx` fetching typescript@^7 (the native compiler, binary `tsc`).
|
|
9
|
+
# Strict flags are passed on the CLI; --ignoreConfig keeps any tsconfig.json out of
|
|
10
|
+
# the way (TS 7 refuses CLI file names next to a tsconfig.json without it).
|
|
11
|
+
FLAGS="--ignoreConfig --noEmit --strict --noUncheckedIndexedAccess --target esnext --module nodenext --moduleResolution nodenext"
|
|
12
|
+
if command -v tsc >/dev/null 2>&1 && tsc -v 2>/dev/null | grep -Eq 'Version ([7-9]|[1-9][0-9])\.'; then
|
|
13
|
+
CHECK="tsc"
|
|
12
14
|
elif command -v npx >/dev/null 2>&1; then
|
|
13
|
-
CHECK="npx -y -p typescript tsc"
|
|
15
|
+
CHECK="npx -y -p typescript@^7 tsc"
|
|
14
16
|
else
|
|
15
|
-
echo "SKIP: no
|
|
17
|
+
echo "SKIP: no TypeScript 7 tsc and no npx on PATH — cannot type-check. (exit 0)"
|
|
16
18
|
exit 0
|
|
17
19
|
fi
|
|
18
20
|
|
|
19
21
|
TMP="$(mktemp -d)"
|
|
20
22
|
trap 'rm -rf "$TMP"' EXIT
|
|
21
23
|
|
|
24
|
+
echo "checker: $( (cd "$TMP" && $CHECK -v) 2>/dev/null || echo unknown)"
|
|
25
|
+
|
|
22
26
|
# good.ts: exhaustive never guard MUST pass.
|
|
23
27
|
cat > "$TMP/good.ts" <<'TS'
|
|
24
28
|
type S = { k: "a" } | { k: "b" };
|
|
@@ -42,11 +46,17 @@ export function f(s: S): number {
|
|
|
42
46
|
}
|
|
43
47
|
TS
|
|
44
48
|
|
|
49
|
+
# index.ts: noUncheckedIndexedAccess — arr[0] is number | undefined, MUST fail.
|
|
50
|
+
cat > "$TMP/index.ts" <<'TS'
|
|
51
|
+
export function first(arr: number[]): number { return arr[0]; }
|
|
52
|
+
TS
|
|
53
|
+
|
|
45
54
|
run() { ( cd "$TMP" && $CHECK $FLAGS "$1" ) >/dev/null 2>&1; }
|
|
46
55
|
|
|
47
56
|
fail=0
|
|
48
|
-
if run good.ts;
|
|
49
|
-
if run bad.ts;
|
|
57
|
+
if run good.ts; then echo "PASS: good.ts type-checks"; else echo "FAIL: good.ts should compile"; fail=1; fi
|
|
58
|
+
if run bad.ts; then echo "FAIL: bad.ts should NOT compile (exhaustiveness)"; fail=1; else echo "PASS: bad.ts rejected"; fi
|
|
59
|
+
if run index.ts; then echo "FAIL: index.ts should NOT compile (noUncheckedIndexedAccess)"; fail=1; else echo "PASS: index.ts rejected"; fi
|
|
50
60
|
|
|
51
61
|
if [ "$fail" -ne 0 ]; then echo "verify.sh: FAILED"; exit 1; fi
|
|
52
|
-
echo "verify.sh: OK — strict + exhaustiveness enforced"
|
|
62
|
+
echo "verify.sh: OK — strict + exhaustiveness + indexed access enforced"
|
package/skills/unslop/SKILL.md
CHANGED
|
@@ -54,7 +54,7 @@ When a text needs both passes: audit first, register last.
|
|
|
54
54
|
|
|
55
55
|
Voiceless writing is as obvious as slopped writing. After the cuts, put something back:
|
|
56
56
|
|
|
57
|
-
- **
|
|
57
|
+
- **Keep the author's opinion.** Where the source takes a stand, state it plainly instead of flattening it into balanced pros and cons. Never add a stance the author did not take.
|
|
58
58
|
- **Vary the rhythm.** Short sentence. Then a longer one that takes its time and earns the length.
|
|
59
59
|
- **Admit complexity.** "Impressive and slightly unsettling" beats "impressive".
|
|
60
60
|
- **Use "I" when it fits.** First person is not unprofessional.
|
package/skills/ux/SKILL.md
CHANGED
|
@@ -92,7 +92,7 @@ When the task is to audit an existing interface: steps 0 and 4 first, then repor
|
|
|
92
92
|
by impact on the job, in the format of `upstream/ux-designer/GUIDE.md` › *Reviewing or auditing a
|
|
93
93
|
UI* (Blocker / Major / Minor, where, fix, reference). Inspection order and the full checklists:
|
|
94
94
|
`upstream/ux-usability-foundations/GUIDE.md` › *Workflow for critiquing* and
|
|
95
|
-
`references/checklists.md`. Split quick wins from structural changes. If nothing serious turns up,
|
|
95
|
+
`upstream/ux-usability-foundations/references/checklists.md`. Split quick wins from structural changes. If nothing serious turns up,
|
|
96
96
|
say so in one line.
|
|
97
97
|
|
|
98
98
|
## Report
|
package/skills/vercel/SKILL.md
CHANGED
|
@@ -172,8 +172,9 @@ Add the `$schema` line first — you get editor autocomplete and validation for
|
|
|
172
172
|
|
|
173
173
|
Whys:
|
|
174
174
|
|
|
175
|
-
- **`maxDuration`** caps wall-clock per invocation.
|
|
176
|
-
|
|
175
|
+
- **`maxDuration`** caps wall-clock per invocation. Under Fluid the default is 300s on every plan;
|
|
176
|
+
the ceiling is plan-bound (Hobby 300s, Pro and Enterprise 800s, 1800s in the extended-duration
|
|
177
|
+
beta). Setting `30` on Hobby is fine; setting `800` on Hobby silently can't apply.
|
|
177
178
|
- **No `memory` key here when Fluid is on** (default for new projects since 2025-04-23). Under Fluid,
|
|
178
179
|
default function memory/CPU is a *dashboard* setting, not a `vercel.json` key — putting `memory`
|
|
179
180
|
in-file is ignored or rejected. See `references/vercel-json.md`.
|
|
@@ -62,13 +62,16 @@ time, so it can compute config from env vars or API calls.
|
|
|
62
62
|
|
|
63
63
|
### Per-plan duration & memory
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
Under Fluid compute (on by default):
|
|
66
|
+
|
|
67
|
+
| Plan | `maxDuration` default → ceiling | Memory / CPU default → max |
|
|
66
68
|
| --- | --- | --- |
|
|
67
|
-
| Hobby |
|
|
68
|
-
| Pro |
|
|
69
|
-
| Enterprise |
|
|
69
|
+
| Hobby | 300s → 300s | 2 GB / 1 vCPU → 2 GB / 1 vCPU |
|
|
70
|
+
| Pro | 300s → 800s (1800s in the extended-duration beta) | 2 GB / 1 vCPU → 4 GB / 2 vCPU |
|
|
71
|
+
| Enterprise | 300s → 800s (1800s in the extended-duration beta) | 2 GB / 1 vCPU → 4 GB / 2 vCPU |
|
|
70
72
|
|
|
71
|
-
|
|
73
|
+
Above 800s, set `maxDuration` per function, not as a project default. Under Fluid the default
|
|
74
|
+
memory/CPU is a dashboard setting, not a `vercel.json` key.
|
|
72
75
|
|
|
73
76
|
## `crons`
|
|
74
77
|
|
package/skills/verify/SKILL.md
CHANGED
|
@@ -44,8 +44,8 @@ LOCATE → find the spec, the task done-checks, and which stack(s) changed
|
|
|
44
44
|
RUN → execute the relevant stack scripts/verify.sh (lint, type, test+coverage, audit),
|
|
45
45
|
or the generic gate from config.yaml when no stack ships one
|
|
46
46
|
WALK → check every task done-check and every spec acceptance criterion against real output
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
RECORD → write the verification record under 02-DOCS/wiki/sdd/, with the rollback plan (revert
|
|
48
|
+
sha, migration down, flag off), index it
|
|
49
49
|
VERDICT → PASS only if every item has passing evidence; otherwise FAIL with the gaps + handoff
|
|
50
50
|
```
|
|
51
51
|
|
|
@@ -107,7 +107,7 @@ The dangerous way a checker breaks is not a crash — it is **fail-open**: nothi
|
|
|
107
107
|
|
|
108
108
|
**Over-blocking is not the safe side.** It feels like caution and it is not: a gate that fires on correct work gets muted, worked around, or wedges the pipeline that depends on it, which is the same damage as a gate that checks nothing with the sign reversed. And it is *harder* to notice, because the failure arrives dressed as diligence.
|
|
109
109
|
|
|
110
|
-
Where this bites hardest is a check that matches text rather than structure — **"the path appears in the string" is not "the write targets that location"**.
|
|
110
|
+
Where this bites hardest is a check that matches text rather than structure — **"the path appears in the string" is not "the write targets that location"**. A gate proven only by mutants that make it fail can still block every correct input: a text match on a protected path blocks every read of that file as if it were a write to it.
|
|
111
111
|
|
|
112
112
|
So when you write the negative control, write the positive one beside it, and prefer matching **structure** (a parsed tool call, a resolved path, an exit code) over matching text that happens to contain the thing you care about.
|
|
113
113
|
|
package/skills/vllm/SKILL.md
CHANGED
|
@@ -128,11 +128,13 @@ live without merging or a second server
|
|
|
128
128
|
([LoRA docs](https://docs.vllm.ai/en/latest/features/lora.html), accessed 2026-07).
|
|
129
129
|
|
|
130
130
|
```bash
|
|
131
|
+
# --max-loras: how many adapters resident at once
|
|
132
|
+
# --max-lora-rank: must be >= the rank the adapter was trained at
|
|
131
133
|
vllm serve meta-llama/Llama-3.2-3B-Instruct \
|
|
132
134
|
--enable-lora \
|
|
133
135
|
--lora-modules sql=/adapters/sql-lora legal=/adapters/legal-lora \
|
|
134
|
-
--max-loras 2 \
|
|
135
|
-
--max-lora-rank 16
|
|
136
|
+
--max-loras 2 \
|
|
137
|
+
--max-lora-rank 16
|
|
136
138
|
```
|
|
137
139
|
|
|
138
140
|
Route to an adapter by naming it in the request `model` field: `"model": "sql"` hits the SQL adapter,
|
package/skills/vue-nuxt/SKILL.md
CHANGED
|
@@ -279,8 +279,9 @@ preset here, then hand platform specifics to [`deployment`](../deployment/SKILL.
|
|
|
279
279
|
- `defineAsyncComponent` and Nuxt's auto `Lazy<Component>` prefix to code-split below the fold.
|
|
280
280
|
- `<NuxtImg>` / `@nuxt/image` for responsive, optimized images (a top LCP lever).
|
|
281
281
|
- Shrink the SSR payload with `pick`/`transform` on `useFetch`/`useAsyncData`.
|
|
282
|
-
- Vue 3.6 **Vapor Mode** (compile-time, no-VDOM, opt-in per component via `<script setup vapor>`)
|
|
283
|
-
|
|
282
|
+
- Vue 3.6 **Vapor Mode** (compile-time, no-VDOM, opt-in per component via `<script setup vapor>`)
|
|
283
|
+
ships with Vue 3.6; check `npm view vue dist-tags` for whether 3.6 is `latest` or still
|
|
284
|
+
pre-release — treat it as opt-in, not the default.
|
|
284
285
|
- Targets: LCP < 2.5s, CLS < 0.1, INP < 200ms.
|
|
285
286
|
|
|
286
287
|
## Anti-patterns → STOP
|
|
@@ -314,9 +315,8 @@ In a project with a `02-DOCS/` layer (the [`harness`](../harness/SKILL.md) Karpa
|
|
|
314
315
|
`02-DOCS/wiki/stack/vue-nuxt.md` first and stay consistent with it. If it is missing or stale,
|
|
315
316
|
create/update it with this app's real choices — rendering mode per route (`routeRules`), the
|
|
316
317
|
`useFetch`/`useAsyncData` conventions, `useState` vs Pinia, the Nitro preset/deploy target, the
|
|
317
|
-
design-system hookup — bump its `Updated` date, and
|
|
318
|
-
|
|
319
|
-
layer? Skip silently. Technical conventions are *recorded, not gated* — never block the task.
|
|
318
|
+
design-system hookup — bump its `Updated` date, and index it in `02-DOCS/wiki/index.md` (root
|
|
319
|
+
`CLAUDE.md` keeps only a short pointer to that index). No `02-DOCS/` layer? Skip silently. Technical conventions are *recorded, not gated* — never block the task.
|
|
320
320
|
|
|
321
321
|
Nuxt 3 → 4 deltas (`app/` move, `compatibilityVersion`, shared-key data, shallowRef payload,
|
|
322
322
|
renamed APIs) and Vue 3.4 → 3.5 changes are in
|
package/skills/webhooks/SKILL.md
CHANGED
|
@@ -163,10 +163,19 @@ try {
|
|
|
163
163
|
if (e.code === "23505") return res.sendStatus(200); // already seen → ack, skip
|
|
164
164
|
throw e;
|
|
165
165
|
}
|
|
166
|
-
|
|
166
|
+
try {
|
|
167
|
+
await queue.add("process", { id, event });
|
|
168
|
+
} catch (e) {
|
|
169
|
+
// Enqueue failed: release the gate, or the provider's retry is skipped as "seen" and the event is lost.
|
|
170
|
+
await db.query("DELETE FROM seen_events WHERE id = $1", [id]);
|
|
171
|
+
return res.sendStatus(503); // transient → provider retries
|
|
172
|
+
}
|
|
167
173
|
res.sendStatus(200);
|
|
168
174
|
```
|
|
169
175
|
|
|
176
|
+
Where the queue lives in the same database, write the dedupe row and the job in one transaction
|
|
177
|
+
(outbox) instead; then neither can exist without the other.
|
|
178
|
+
|
|
170
179
|
Prefer **insert-then-process** over **process-then-mark**. Marking after the
|
|
171
180
|
work leaves a window where two concurrent deliveries both pass the "have I seen
|
|
172
181
|
it?" check and both run. Let the UNIQUE constraint (or `NX`) be the lock.
|
|
@@ -108,10 +108,10 @@ never a silent cleanup: refuse the silent path and confirm the discard with the
|
|
|
108
108
|
would be lost.
|
|
109
109
|
|
|
110
110
|
**You do not have to remember to clean up.** Once the work lands on the trunk, a `post-merge` hook
|
|
111
|
-
retires the worktree
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
retires the worktree on its own, and its branch when git deletes it safely (`branch -d`; a
|
|
112
|
+
squash-merged branch stays) — it removes only what the reaper already classifies as safe, and
|
|
113
|
+
anything holding unsaved work is refused exactly as it is above. Nothing to run, and nothing to
|
|
114
|
+
remember: the cleanup lives in a hook because an agent asked to remember it skips it.
|
|
115
115
|
|
|
116
116
|
```bash
|
|
117
117
|
# from the repo root, default branch up to date
|
|
@@ -124,7 +124,7 @@ git worktree add -b feat/<slug> .worktrees/<slug> origin/<default-branch>
|
|
|
124
124
|
the folder holding `.rsc.json`. For the repo at that root the worktree is `.worktrees/<slug>`. For a
|
|
125
125
|
project that lives in a folder under it (a workspace with `03-PROJECTS/<p>/`), it is
|
|
126
126
|
`<root>/.worktrees/<p>-<slug>`, and the path is written absolute — a relative one resolves inside
|
|
127
|
-
the project
|
|
127
|
+
the project:
|
|
128
128
|
|
|
129
129
|
```bash
|
|
130
130
|
git -C 03-PROJECTS/<p> fetch origin
|
|
@@ -173,7 +173,8 @@ Three things have to hold before a worktree is retired without asking, and each
|
|
|
173
173
|
user's, so it is asked about, never removed silently. Neither → foreign; not touched, not offered.
|
|
174
174
|
- **The branch adds nothing the trunk does not have** — asked about *content*, so a squash-merged
|
|
175
175
|
pull request counts as landed. Its branch is kept even so: git will not delete it safely, and while
|
|
176
|
-
it exists the commits survive a wrong call.
|
|
176
|
+
it exists the commits survive a wrong call. Deleting it is `tidy`'s job, after its content check
|
|
177
|
+
proves the branch landed.
|
|
177
178
|
- **Nothing inside would be lost** — not just "no pending changes": untracked and ignored files count,
|
|
178
179
|
because a worktree that git calls clean can still hold the only copy of a `.env` or a local
|
|
179
180
|
database. Installed dependencies and build output are the one carve-out.
|
|
@@ -186,7 +187,8 @@ exit through that tool's `remove`/`keep`; the reaper is for worktrees git alone
|
|
|
186
187
|
**When the command is unavailable** (no rsc in this project), the manual equivalent is: confirm it is
|
|
187
188
|
a linked worktree (`git rev-parse --git-dir` ≠ `--git-common-dir`), rule out a submodule
|
|
188
189
|
(`git rev-parse --show-superproject-working-tree` must be empty), `cd` to the main working tree, then
|
|
189
|
-
`git worktree remove` and `git worktree prune`. Never `-D` a branch to make the cleanup succeed
|
|
190
|
+
`git worktree remove` and `git worktree prune`. Never `-D` a branch to make the cleanup succeed;
|
|
191
|
+
only `tidy` deletes a branch with `-D`, and only one its content check proved squash-merged.
|
|
190
192
|
|
|
191
193
|
## Model tier — `light` (opt-in routing)
|
|
192
194
|
|
|
@@ -206,7 +208,7 @@ wish for brevity removes the check before risking someone's WIP.
|
|
|
206
208
|
|
|
207
209
|
| Rationalization | Reality / Fix |
|
|
208
210
|
| --- | --- |
|
|
209
|
-
| "I'll just implement on `main`, it's a small change" | Small changes become commits on the wrong branch.
|
|
211
|
+
| "I'll just implement on `main`, it's a small change" | Small changes become commits on the wrong branch. Where the default branch is closed, branch/worktree first — before the first edit. Where it is open, the project already decided. |
|
|
210
212
|
| "There's uncommitted WIP, I'll stash it and switch" | A worktree avoids the stash entirely and can't drop it. Use a worktree; if you must stash, confirm with the user and name the stash. |
|
|
211
213
|
| "I'll branch off local HEAD, fetching is slow" | Stale base = merge conflicts you pay for later. Branch off an up-to-date `origin/<default>` unless the user wants HEAD. |
|
|
212
214
|
| "The worktree's dirty but I'll `remove --force` to clean up" | Force-removing a dirty/unmerged worktree throws away work irreversibly. Resolve or confirm explicitly first; never silent-force. |
|
|
@@ -163,7 +163,7 @@ idea → predicted outlier multiple → why (the mechanism) → judge-by metric
|
|
|
163
163
|
|
|
164
164
|
```text
|
|
165
165
|
Bad: "This one should do well."
|
|
166
|
-
Good: "Predict
|
|
166
|
+
Good: "Predict 3x baseline. Bet: the contrarian title + we own first-hand proof no
|
|
167
167
|
outlier has. Judge by 28-day views vs trailing-10 average AND CTR vs channel
|
|
168
168
|
median. 2026-06-02."
|
|
169
169
|
```
|
package/targets/agents.js
CHANGED
|
@@ -17,15 +17,22 @@ import {
|
|
|
17
17
|
resolveStackAgentNames, validateAgentCatalog,
|
|
18
18
|
} from './agent-catalog.js';
|
|
19
19
|
|
|
20
|
-
// Concrete model per provider per tier
|
|
21
|
-
//
|
|
22
|
-
//
|
|
20
|
+
// Concrete model per provider per tier — EDIT to your account's models; the TIER is the
|
|
21
|
+
// contract, the id is yours to change. `light` is deliberately absent: the developer floor is
|
|
22
|
+
// `balanced`.
|
|
23
23
|
const TIER_MODEL = {
|
|
24
|
-
anthropic: { balanced: 'claude-sonnet-
|
|
24
|
+
anthropic: { balanced: 'claude-sonnet-5-5', heavy: 'claude-opus-5-5' },
|
|
25
25
|
google: { balanced: 'gemini-2.5-flash', heavy: 'gemini-2.5-pro' },
|
|
26
26
|
openai: { balanced: 'gpt-5.1-mini', heavy: 'gpt-5.1' },
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
+
// The Anthropic ids earlier releases wrote into agent files. Never rendered for a new file: they only
|
|
30
|
+
// let `knownRenderings` recognise a file rsc wrote before the ids moved, so an upgrade replaces it
|
|
31
|
+
// instead of keeping it as the user's.
|
|
32
|
+
const PREVIOUS_TIER_MODEL = {
|
|
33
|
+
anthropic: { balanced: 'claude-sonnet-4-6', heavy: 'claude-opus-4-8' }, // prompt-audit: allow retired-model — recognises agent files written by earlier rsc releases
|
|
34
|
+
};
|
|
35
|
+
|
|
29
36
|
// Per-target agent capability: where the file goes, its format, and how the model value
|
|
30
37
|
// is written for that tool. Targets absent here have no installable file-based agents
|
|
31
38
|
// (Amp/Zed/Windsurf/Cline/Roo/Continue/Aider/Jules/Antigravity) — there the developer
|
|
@@ -33,16 +40,16 @@ const TIER_MODEL = {
|
|
|
33
40
|
const AGENT_TARGETS = {
|
|
34
41
|
claude: { dir: '.claude/agents', ext: '.md', format: 'md', toolsFormat: 'claude', model: (t) => (t === 'heavy' ? 'opus' : 'sonnet') },
|
|
35
42
|
junie: { dir: '.junie/agents', ext: '.md', format: 'md', model: (t) => (t === 'heavy' ? 'opus' : 'sonnet') },
|
|
36
|
-
cursor: { dir: '.cursor/agents', ext: '.md', format: 'md', model: (t) => TIER_MODEL.anthropic[t] },
|
|
43
|
+
cursor: { dir: '.cursor/agents', ext: '.md', format: 'md', model: (t) => TIER_MODEL.anthropic[t], previousModel: (t) => PREVIOUS_TIER_MODEL.anthropic[t] },
|
|
37
44
|
// #298 — OpenCode is the one tool people point at a local model or another provider per session, so
|
|
38
45
|
// its agents INHERIT the session model by default (`model: null` → no `model:` line) and only carry
|
|
39
46
|
// one when the project pins it (`agentModels.opencode` in .rsc.json). And its `tools` map is
|
|
40
47
|
// restrict-only: rsc never grants a tool there, it can only take away what a role never declared,
|
|
41
48
|
// so a stricter project permission policy is never loosened by an rsc agent.
|
|
42
|
-
opencode: { dir: '.opencode/agents', ext: '.md', format: 'md', mode: 'subagent', toolsFormat: 'restrict', model: () => null, legacyModel: (t) => `anthropic/${
|
|
49
|
+
opencode: { dir: '.opencode/agents', ext: '.md', format: 'md', mode: 'subagent', toolsFormat: 'restrict', model: () => null, legacyModel: (t) => `anthropic/${PREVIOUS_TIER_MODEL.anthropic[t]}` },
|
|
43
50
|
gemini: { dir: '.gemini/agents', ext: '.md', format: 'md', model: (t) => TIER_MODEL.google[t] },
|
|
44
|
-
copilot: { dir: '.github/agents', ext: '.agent.md', format: 'md', model: (t) => TIER_MODEL.anthropic[t] },
|
|
45
|
-
kiro: { dir: '.kiro/agents', ext: '.json', format: 'json', model: (t) => (t === 'heavy' ? 'claude-opus-4' : 'claude-sonnet-4') },
|
|
51
|
+
copilot: { dir: '.github/agents', ext: '.agent.md', format: 'md', model: (t) => TIER_MODEL.anthropic[t], previousModel: (t) => PREVIOUS_TIER_MODEL.anthropic[t] },
|
|
52
|
+
kiro: { dir: '.kiro/agents', ext: '.json', format: 'json', model: (t) => (t === 'heavy' ? 'claude-opus-4' : 'claude-sonnet-4') }, // prompt-audit: allow retired-model — Kiro's own model names, not Anthropic API ids; change them when Kiro lists newer ones
|
|
46
53
|
codex: { dir: '.codex/agents', ext: '.toml', format: 'toml', model: (t) => TIER_MODEL.openai[t] },
|
|
47
54
|
};
|
|
48
55
|
|
|
@@ -53,12 +60,14 @@ export function targetHasAgents(target) { return Boolean(AGENT_TARGETS[target]);
|
|
|
53
60
|
// (decided in clarify 2026-08-18: a lens passed as a parameter reintroduces the
|
|
54
61
|
// does-anyone-remember dependency this whole spec exists to remove) — but P5 says length is a cost,
|
|
55
62
|
// so the contract they share is composed, not written three times.
|
|
56
|
-
|
|
57
|
-
1. The task contract — the original request **plus every scope change a human explicitly approved since**. Without the approved changes, a legitimate scope revision reads as a spec gap and you will report a confident false positive.
|
|
63
|
+
const REFUTER_INPUT_LIST = `1. The task contract — the original request **plus every scope change a human explicitly approved since**. Without the approved changes, a legitimate scope revision reads as a spec gap and you will report a confident false positive.
|
|
58
64
|
2. The approved spec.
|
|
59
65
|
3. The exact source state (commit SHA, or a tree hash when git is absent). A verdict attaches to the state you saw, not to the project.
|
|
60
66
|
4. The entry point — the one command that reruns the checks.`;
|
|
61
67
|
|
|
68
|
+
export const REFUTER_FOUR_INPUTS = `**You get exactly four inputs, and nothing else:**
|
|
69
|
+
${REFUTER_INPUT_LIST}`;
|
|
70
|
+
|
|
62
71
|
const REFUTER_CONTRACT = `Your mandate is to **refute readiness**, not confirm it. A reviewer looking for confirmation finds confirmation; the asymmetry is the point.
|
|
63
72
|
|
|
64
73
|
${REFUTER_FOUR_INPUTS}
|
|
@@ -106,7 +115,7 @@ Full discipline lives in the \`implement\` skill.`,
|
|
|
106
115
|
{
|
|
107
116
|
name: 'refuter-correctness',
|
|
108
117
|
desc: 'Adversarial reviewer, correctness lens: attacks a green diff for boundary and error-path defects, and demands that any home-grown gate prove it can both fail and pass. Fresh context, mandate to refute.',
|
|
109
|
-
body: `You are the **correctness** refuter for this project — one of three adversarial lenses ${'`review`'} dispatches at tier 2. What matters is not the number of lenses but their **diversity**:
|
|
118
|
+
body: `You are the **correctness** refuter for this project — one of three adversarial lenses ${'`review`'} dispatches at tier 2. What matters is not the number of lenses but their **diversity**: a lens often finds the defect that another lens was not looking for.
|
|
110
119
|
|
|
111
120
|
${REFUTER_CONTRACT}
|
|
112
121
|
|
|
@@ -115,18 +124,18 @@ ${REFUTER_CONTRACT}
|
|
|
115
124
|
**And the lens this panel was missing:** when the change adds or touches a **gate, checker or guard**, ask it in BOTH directions.
|
|
116
125
|
- Can it fail? Feed it a known-bad input and watch it fail. A gate nobody has seen fail is not a gate.
|
|
117
126
|
- **Can it pass?** Feed it a known-good input and watch it pass. Over-blocking is not the safe side — a gate that fires on correct work gets muted, worked around, or wedges the pipeline that depends on it, and it is *harder* to notice because it arrives dressed as diligence.
|
|
118
|
-
- Watch for a check that matches **text** where it should match **structure**: "the path appears in the string" is not "the write targets that location"
|
|
127
|
+
- Watch for a check that matches **text** where it should match **structure**: "the path appears in the string" is not "the write targets that location".`,
|
|
119
128
|
},
|
|
120
129
|
{
|
|
121
130
|
name: 'refuter-security',
|
|
122
131
|
desc: 'Adversarial reviewer, security and privacy lens: hunts untrusted input reaching a sink, authz gaps, leaked secrets and data escaping where it should not. Fresh context, mandate to refute.',
|
|
123
|
-
body: `You are the **security and privacy** refuter for this project — one of three adversarial lenses ${'`review`'} dispatches at tier 2. Your value is that you are not looking where the others look
|
|
132
|
+
body: `You are the **security and privacy** refuter for this project — one of three adversarial lenses ${'`review`'} dispatches at tier 2. Your value is that you are not looking where the others look.
|
|
124
133
|
|
|
125
134
|
${REFUTER_CONTRACT}
|
|
126
135
|
|
|
127
136
|
**Your lens:** untrusted input reaching a sink (injection, SSRF, path traversal), authorization gaps (authenticated is not authorized), secrets in the diff or in config, and **data leaving where it should not** — a log line, an error message, a file written outside its zone, a payload sent to a third party.
|
|
128
137
|
|
|
129
|
-
**Follow the trail rather than the checklist.** When something looks merely untidy — a file in an odd place, a path that repeats — ask who else cares about that location before dismissing it
|
|
138
|
+
**Follow the trail rather than the checklist.** When something looks merely untidy — a file in an odd place, a path that repeats — ask who else cares about that location before dismissing it.`,
|
|
130
139
|
},
|
|
131
140
|
{
|
|
132
141
|
name: 'refuter-tests',
|
|
@@ -150,9 +159,8 @@ ${REFUTER_CONTRACT}
|
|
|
150
159
|
desc: 'Adversarial verifier of review findings: takes ONE consolidated finding and tries to prove it false against the code. Default stance: the finding is false; only a reproduced or traced failure is CONFIRMED. Fresh context, edits nothing.',
|
|
151
160
|
body: `You are the **finding verifier** for this project. ${'`review`'} hands you **one** finding that survived ${'`rsc review consolidate`'} — a blocker or should-fix some refuter lens reported against a diff. Your job is to **prove it false**. Your starting position is that it is false; the finding has to beat you.
|
|
152
161
|
|
|
153
|
-
**
|
|
154
|
-
|
|
155
|
-
${REFUTER_FOUR_INPUTS}
|
|
162
|
+
**You get five inputs, and nothing else:** the finding (location, claim, failure scenario, evidence), plus the same four the lenses had:
|
|
163
|
+
${REFUTER_INPUT_LIST}
|
|
156
164
|
|
|
157
165
|
**You do NOT get** the refuter's reasoning or the builder's defence. Judge the claim against the code, not against either story.
|
|
158
166
|
|
|
@@ -317,6 +325,7 @@ function knownRenderings(target, cwd, agent) {
|
|
|
317
325
|
out.add(renderAgent(target, spec, resolveModel(target, cwd, tier), agent, 'list'));
|
|
318
326
|
out.add(renderAgent(target, spec, spec.model(tier), agent, 'list'));
|
|
319
327
|
}
|
|
328
|
+
if (spec.previousModel) out.add(renderAgent(target, spec, spec.previousModel(tier), agent));
|
|
320
329
|
if (spec.legacyModel) out.add(renderAgent(target, spec, spec.legacyModel(tier), agent, 'map'));
|
|
321
330
|
}
|
|
322
331
|
return out;
|