@ericrisco/rsc 4.1.11 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/manifest.json +6 -6
- package/package.json +2 -1
- package/scripts/lib/prompt-audit.js +110 -0
- package/scripts/prompt-audit.js +48 -0
- 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/gdpr-privacy/references/dpa-and-transfers.md +1 -1
- package/skills/git-workflow/SKILL.md +3 -3
- package/skills/go/SKILL.md +3 -3
- 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/hiring/SKILL.md +3 -3
- package/skills/htmx/SKILL.md +4 -4
- package/skills/htmx/references/server-contract.md +2 -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/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 +1 -1
- package/skills/linkedin-api/references/api-reference.md +1 -1
- 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 +4 -4
- 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 +5 -4
- package/skills/typescript/references/build-and-monorepo.md +2 -2
- 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/commands.js +7 -7
package/manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.
|
|
2
|
+
"version": "4.2.0",
|
|
3
3
|
"counts": {
|
|
4
4
|
"skills": 273,
|
|
5
5
|
"agents": 34,
|
|
@@ -2705,7 +2705,7 @@
|
|
|
2705
2705
|
},
|
|
2706
2706
|
{
|
|
2707
2707
|
"id": "laravel",
|
|
2708
|
-
"description": "Use when building or extending a Laravel 11
|
|
2708
|
+
"description": "Use when building or extending a Laravel 11+ app — Eloquent models, migrations and relationships, routing with controllers and Form Requests, queues and background jobs, framework-native security (validation, mass-assignment, policies, signed URLs, rate limiting), and Pest/PHPUnit feature tests. NOT pure PHP language or toolchain work (that is `php`).",
|
|
2709
2709
|
"tags": [
|
|
2710
2710
|
"laravel",
|
|
2711
2711
|
"php",
|
|
@@ -4454,7 +4454,7 @@
|
|
|
4454
4454
|
},
|
|
4455
4455
|
{
|
|
4456
4456
|
"id": "shopify",
|
|
4457
|
-
"description": "Use when building or customizing a Shopify store across its three code surfaces — themes (Liquid, Online Store 2.0 sections, blocks and JSON templates), apps (
|
|
4457
|
+
"description": "Use when building or customizing a Shopify store across its three code surfaces — themes (Liquid, Online Store 2.0 sections, blocks and JSON templates), apps (the React Router template with the versioned GraphQL Admin API and its query-cost model), and checkout (UI extensions, Functions, Web Pixels), plus the CLI flow and checkout-extensibility migration. NOT WooCommerce or PHP stores (that is `wordpress`), NOT the React layer of a headless storefront (that is `nextjs`), NOT non-Shopify payment integrations (that is `stripe`).",
|
|
4458
4458
|
"tags": [
|
|
4459
4459
|
"shopify",
|
|
4460
4460
|
"liquid",
|
|
@@ -6340,7 +6340,7 @@
|
|
|
6340
6340
|
"id": "learn",
|
|
6341
6341
|
"description": "Propose one local lesson; saving still requires individual explicit approval.",
|
|
6342
6342
|
"kind": "memory",
|
|
6343
|
-
"backing": "memory
|
|
6343
|
+
"backing": "rsc memory learn"
|
|
6344
6344
|
},
|
|
6345
6345
|
{
|
|
6346
6346
|
"id": "machine-learning-build",
|
|
@@ -6418,7 +6418,7 @@
|
|
|
6418
6418
|
"id": "resume-session",
|
|
6419
6419
|
"description": "Read the bounded local continuation record for this branch and worktree.",
|
|
6420
6420
|
"kind": "memory",
|
|
6421
|
-
"backing": "memory
|
|
6421
|
+
"backing": "rsc memory resume"
|
|
6422
6422
|
},
|
|
6423
6423
|
{
|
|
6424
6424
|
"id": "review",
|
|
@@ -6442,7 +6442,7 @@
|
|
|
6442
6442
|
"id": "save-session",
|
|
6443
6443
|
"description": "Force a local deterministic session checkpoint.",
|
|
6444
6444
|
"kind": "memory",
|
|
6445
|
-
"backing": "memory
|
|
6445
|
+
"backing": "rsc memory save"
|
|
6446
6446
|
},
|
|
6447
6447
|
{
|
|
6448
6448
|
"id": "security-audit",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ericrisco/rsc",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "A guided harness builder that turns your goal into a minimal, verified AI-agent setup using strict best practices.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"knowledge:doctor": "node scripts/knowledge-doctor.js",
|
|
20
20
|
"spec:gate": "node scripts/spec-gate.js",
|
|
21
21
|
"routing:audit": "node scripts/routing-audit.js",
|
|
22
|
+
"prompt:audit": "node scripts/prompt-audit.js",
|
|
22
23
|
"design:upstream": "node scripts/design-upstream.js",
|
|
23
24
|
"originality:check": "node scripts/originality-check.js",
|
|
24
25
|
"test": "node --test",
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// The deterministic half of a prompt audit, as a gate.
|
|
2
|
+
//
|
|
3
|
+
// The catalog is prompt text: every skill, reference, generated agent and hook string is read by a
|
|
4
|
+
// model in every project that installs rsc. Most prompt cruft needs judgment to spot (a script for a
|
|
5
|
+
// judgment task, pressure without a reason) and stays with the human sweep. Four classes do not, and
|
|
6
|
+
// those are what this checks — each with a fixture that fails and one that passes
|
|
7
|
+
// (tests/prompt-audit.test.js), because a gate that cannot be seen failing checks nothing.
|
|
8
|
+
//
|
|
9
|
+
// retired-model a Claude model id older than the current generation, offered as if current
|
|
10
|
+
// generator-id an internal generator id presented as something to invoke ("Invoke memory:learn")
|
|
11
|
+
// history-phrase a short list of phrases that narrate the text's own past instead of the rule
|
|
12
|
+
// dead-skill-link `../<id>/SKILL.md` naming a skill that is not in the catalog
|
|
13
|
+
//
|
|
14
|
+
// A line can opt out with a reason, on the same line or the line above:
|
|
15
|
+
// prompt-audit: allow <rule> — <reason>
|
|
16
|
+
// An allow without a reason is itself a finding: the reason is what lets the next reader judge it.
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The current Claude generation per family. The one volatile fact in this file: when a new generation
|
|
20
|
+
* ships, change it here and the gate lists every id the catalog still has to move.
|
|
21
|
+
*/
|
|
22
|
+
export const CURRENT_CLAUDE = { opus: [5, 5], sonnet: [5, 5], haiku: [5, 5] };
|
|
23
|
+
|
|
24
|
+
// The minor version is one or two digits; an 8-digit group is a date suffix, never a version.
|
|
25
|
+
const FAMILY_ID = /\bclaude-(opus|sonnet|haiku)-(\d+)(?:[-.](\d{1,2})(?!\d))?(?:-\d{8})?\b/g;
|
|
26
|
+
const LEGACY_ID = /\bclaude-(?:[23](?:[-.]\d+)*-(?:opus|sonnet|haiku)|instant|2(?:\.\d)?)\b[-\w.]*/g;
|
|
27
|
+
|
|
28
|
+
const GENERATOR_ID = /\bInvoke\s+(?:memory|sello):[a-z-]+\b|\bthe\s+sello\s+backing\b/i;
|
|
29
|
+
|
|
30
|
+
// Narrow on purpose: a phrase belongs here only when it cannot be a statement about the world
|
|
31
|
+
// ("X no longer supports Y" is a fact about a framework; "this used to be an instruction" is the
|
|
32
|
+
// prompt talking about itself).
|
|
33
|
+
export const HISTORY_PHRASES = [
|
|
34
|
+
/\bthis used to be an instruction\b/i,
|
|
35
|
+
/\byou no longer (?:run|need to|have to)\b/i,
|
|
36
|
+
/\bused to end with a request\b/i,
|
|
37
|
+
/\bthis (?:panel|lens|gate|skill) ever found\b/i,
|
|
38
|
+
/\bshipped twice in one day\b/i,
|
|
39
|
+
/\bthat is how this lens found\b/i,
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
const ALLOW = /prompt-audit:\s*allow\s+([a-z-]+)(?:\s*[—–-]+\s*(.*))?/i;
|
|
43
|
+
|
|
44
|
+
export const RULES = {
|
|
45
|
+
'retired-model': 'use the current generation (claude-opus-5-5, claude-sonnet-5-5, claude-haiku-5-5) or resolve the id from config',
|
|
46
|
+
'generator-id': 'name the command or skill the agent should actually run; generator ids are internal to targets/',
|
|
47
|
+
'history-phrase': 'state the rule as it is now; the history behind it belongs in decisions.md or the commit',
|
|
48
|
+
'dead-skill-link': 'point at a skill that exists under skills/, or remove the link',
|
|
49
|
+
'allow-without-reason': 'write why the exception holds after the dash: `prompt-audit: allow <rule> — <reason>`',
|
|
50
|
+
'allow-unknown-rule': 'name one of the rules this gate checks, or remove the allow',
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const older = ([a, b], [c, d]) => a < c || (a === c && b < d);
|
|
54
|
+
|
|
55
|
+
/** Claude model ids on one line that are older than the current generation. */
|
|
56
|
+
export function retiredModels(line) {
|
|
57
|
+
const out = [];
|
|
58
|
+
for (const m of line.matchAll(FAMILY_ID)) {
|
|
59
|
+
const version = [Number(m[2]), m[3] === undefined ? 0 : Number(m[3])];
|
|
60
|
+
if (older(version, CURRENT_CLAUDE[m[1]])) out.push(m[0]);
|
|
61
|
+
}
|
|
62
|
+
for (const m of line.matchAll(LEGACY_ID)) out.push(m[0]);
|
|
63
|
+
return out;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function allowed(lines, i) {
|
|
67
|
+
const found = [];
|
|
68
|
+
[lines[i], i > 0 ? lines[i - 1] : ''].forEach((l, k) => {
|
|
69
|
+
// Close an HTML comment first: otherwise the `--` of `-->` reads as the dash and `>` as a reason.
|
|
70
|
+
const m = ALLOW.exec((l || '').replace(/\s*-->\s*$/, ''));
|
|
71
|
+
if (m) found.push({ rule: m[1].toLowerCase(), reason: (m[2] || '').trim(), own: k === 0 });
|
|
72
|
+
});
|
|
73
|
+
return found;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Audit one file's text. Pure: the caller supplies the catalog's skill ids.
|
|
78
|
+
* @param {string} text
|
|
79
|
+
* @param {{ skillIds?: Set<string> }} [ctx]
|
|
80
|
+
* @returns {Array<{line: number, rule: string, match: string, fix: string}>}
|
|
81
|
+
*/
|
|
82
|
+
export function auditText(text, { skillIds } = {}) {
|
|
83
|
+
const lines = String(text).split('\n');
|
|
84
|
+
const findings = [];
|
|
85
|
+
lines.forEach((line, i) => {
|
|
86
|
+
const hits = [];
|
|
87
|
+
for (const id of retiredModels(line)) hits.push(['retired-model', id]);
|
|
88
|
+
const gen = GENERATOR_ID.exec(line);
|
|
89
|
+
if (gen) hits.push(['generator-id', gen[0]]);
|
|
90
|
+
for (const re of HISTORY_PHRASES) {
|
|
91
|
+
const m = re.exec(line);
|
|
92
|
+
if (m) hits.push(['history-phrase', m[0]]);
|
|
93
|
+
}
|
|
94
|
+
if (skillIds) {
|
|
95
|
+
for (const m of line.matchAll(/(?:\.\.\/)+([a-z0-9-]+)\/SKILL\.md/g)) {
|
|
96
|
+
if (!skillIds.has(m[1])) hits.push(['dead-skill-link', m[0]]);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const allows = allowed(lines, i);
|
|
100
|
+
for (const a of allows) {
|
|
101
|
+
if (a.own && !a.reason) findings.push({ line: i + 1, rule: 'allow-without-reason', match: `allow ${a.rule}`, fix: RULES['allow-without-reason'] });
|
|
102
|
+
if (a.own && !(a.rule in RULES)) findings.push({ line: i + 1, rule: 'allow-unknown-rule', match: `allow ${a.rule}`, fix: RULES['allow-unknown-rule'] });
|
|
103
|
+
}
|
|
104
|
+
for (const [rule, match] of hits) {
|
|
105
|
+
if (allows.some((a) => a.rule === rule && a.reason)) continue;
|
|
106
|
+
findings.push({ line: i + 1, rule, match, fix: RULES[rule] });
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
return findings;
|
|
110
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// `npm run prompt:audit` — the deterministic prompt-cruft gate over the published catalog.
|
|
3
|
+
// Scope: skills/** (minus verbatim upstream/ copies and evals/) and the generators and hook texts in
|
|
4
|
+
// targets/. Rules and their rationale: scripts/lib/prompt-audit.js. Exit 1 on any finding.
|
|
5
|
+
import { readFileSync, readdirSync, realpathSync, statSync } from 'node:fs';
|
|
6
|
+
import { dirname, join, relative } from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { auditText } from './lib/prompt-audit.js';
|
|
9
|
+
|
|
10
|
+
const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
11
|
+
const TEXT = /\.(md|mjs|js|py|sh|ya?ml|toml|json)$/;
|
|
12
|
+
const SKIP_DIRS = new Set(['upstream', 'evals', 'node_modules']);
|
|
13
|
+
|
|
14
|
+
function walk(dir) {
|
|
15
|
+
const out = [];
|
|
16
|
+
for (const name of readdirSync(dir)) {
|
|
17
|
+
const p = join(dir, name);
|
|
18
|
+
if (statSync(p).isDirectory()) { if (!SKIP_DIRS.has(name)) out.push(...walk(p)); }
|
|
19
|
+
else if (TEXT.test(name)) out.push(p);
|
|
20
|
+
}
|
|
21
|
+
return out;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function auditCatalog(root = ROOT) {
|
|
25
|
+
const skillsDir = join(root, 'skills');
|
|
26
|
+
const skillIds = new Set(readdirSync(skillsDir).filter((n) => statSync(join(skillsDir, n)).isDirectory()));
|
|
27
|
+
const files = [...walk(skillsDir), ...walk(join(root, 'targets'))];
|
|
28
|
+
const findings = [];
|
|
29
|
+
for (const f of files) {
|
|
30
|
+
for (const x of auditText(readFileSync(f, 'utf8'), { skillIds })) findings.push({ file: relative(root, f), ...x });
|
|
31
|
+
}
|
|
32
|
+
return { files: files.length, findings };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// realpath on both sides: reached through a symlink, a plain string compare skips the gate and exits 0.
|
|
36
|
+
const invokedDirectly = () => {
|
|
37
|
+
try { return realpathSync(fileURLToPath(import.meta.url)) === realpathSync(process.argv[1]); } catch { return false; }
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
if (process.argv[1] && invokedDirectly()) {
|
|
41
|
+
const { files, findings } = auditCatalog(process.argv[2] || ROOT);
|
|
42
|
+
for (const f of findings) console.log(`${f.file}:${f.line} [${f.rule}] ${f.match}\n fix: ${f.fix}`);
|
|
43
|
+
if (findings.length) {
|
|
44
|
+
console.log(`\nprompt:audit FAIL — ${findings.length} finding(s) in ${files} files. Fix each, or keep it with a reason on that line or the one above: \`prompt-audit: allow <rule> — <reason>\`.`);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
console.log(`prompt:audit OK (${files} files, 0 findings)`);
|
|
48
|
+
}
|
package/skills/ads/SKILL.md
CHANGED
|
@@ -9,8 +9,8 @@ origin: risco
|
|
|
9
9
|
# ads
|
|
10
10
|
|
|
11
11
|
You are the paid-acquisition operator. You run money through Google and Meta to buy
|
|
12
|
-
customers, and you answer four questions in this order: **
|
|
13
|
-
|
|
12
|
+
customers, and you answer four questions in this order: **ROAS → structure →
|
|
13
|
+
creative → budget**. Your subject is the live account and its economics — the campaign
|
|
14
14
|
shape, the asset sets, the bid/budget config, and the math that says *keep scaling*
|
|
15
15
|
or *kill it*.
|
|
16
16
|
|
|
@@ -113,14 +113,14 @@ Low/Good/Best rotation playbook in `references/platform-specs.md`):
|
|
|
113
113
|
|
|
114
114
|
## Budget & scaling
|
|
115
115
|
|
|
116
|
-
- **Meta Advantage+ floor ≈ 50× target CPA**, with a practical minimum around
|
|
116
|
+
- **Meta Advantage+ floor ≈ 50× target CPA per week**, with a practical minimum around
|
|
117
117
|
**$100/day**; below ~$50/day the algorithm can't exit learning. *Why:* it needs
|
|
118
118
|
~50 conversions/week to optimize.
|
|
119
119
|
- **Scale ≤ 20% per week.** Bigger jumps reset the learning phase and you start over
|
|
120
120
|
at a worse CPA. *Why:* the algorithm re-explores after a large budget shock.
|
|
121
121
|
|
|
122
122
|
```text
|
|
123
|
-
target CPA $40 → Advantage+ floor ≈ 50 × $40 = $2,000/day
|
|
123
|
+
target CPA $40 → Advantage+ floor ≈ 50 × $40 = $2,000/week (≈ $290/day)
|
|
124
124
|
(or ramp in ≤20%/week steps to get there)
|
|
125
125
|
```
|
|
126
126
|
|
|
@@ -134,8 +134,8 @@ this gate before judging any campaign:
|
|
|
134
134
|
modeled conversions.
|
|
135
135
|
- [ ] **Meta CAPI** — the server-side equivalent; most stores need both it and
|
|
136
136
|
Enhanced Conversions.
|
|
137
|
-
- [ ] Account
|
|
138
|
-
|
|
137
|
+
- [ ] Account uses the unified `ad_storage` parameter — un-updated accounts risk
|
|
138
|
+
attribution gaps and bidding degradation.
|
|
139
139
|
|
|
140
140
|
Hand the reporting/dashboards to the `analytics` / `dashboard` skills — you set up
|
|
141
141
|
the signal; they build the read-out.
|
|
@@ -156,7 +156,7 @@ its derivatives). In Claude Code a Stop hook runs the same check on your final a
|
|
|
156
156
|
| Scaling on platform ROAS | Over-reports 30–100% via double-counting | Validate with geo-holdout / blended MER first |
|
|
157
157
|
| Fragmenting budget across many tiny campaigns | None gets enough data to exit learning | Consolidate above the conversion-data floor |
|
|
158
158
|
| No existing-customer cap on Advantage+ | Meta drifts to cheap retargeting; acquisition stops | Cap existing customers at 20–30% |
|
|
159
|
-
| Launching with 3–5 creatives | Algorithm can't test; it's a manual campaign in disguise | Feed 15–20+ variations
|
|
159
|
+
| Launching with 3–5 creatives | Algorithm can't test; it's a manual campaign in disguise | Feed 15–20+ variations; replace losers on the 4–6-week cadence |
|
|
160
160
|
| Tweaking budget/bids/assets every few days | Each >20% change resets the learning phase | Hold structure ≥4 weeks, then act on data |
|
|
161
161
|
| Target ROAS set below break-even | Every conversion loses money | Set target ≥ 1÷margin; profit-mode 3.5x–8x |
|
|
162
162
|
| Ignoring Consent Mode v2 / CAPI | Conversions go unattributed; Smart Bidding degrades | Advanced consent + Enhanced Conversions + CAPI |
|
|
@@ -131,7 +131,7 @@ short-lived token so the approved action cannot be swapped after the click.
|
|
|
131
131
|
| Send email/payment to external party, post live | no | external | **approve (HITL)** |
|
|
132
132
|
| Delete backups, rotate prod creds, mass-delete | no | catastrophic | **block** (or step-up auth) |
|
|
133
133
|
|
|
134
|
-
- **Step up for the
|
|
134
|
+
- **Step up for the bottom rows** — high-value irreversible actions deserve fresh auth, not the
|
|
135
135
|
ambient session. Why: a hijacked session should not also hold the keys to the worst action.
|
|
136
136
|
|
|
137
137
|
## Memory hygiene
|
package/skills/asdd/SKILL.md
CHANGED
|
@@ -11,7 +11,7 @@ origin: risco
|
|
|
11
11
|
|
|
12
12
|
*The front door for letting an agent build for hours without coming back with a Frankenstein: intent in, shipped-and-verified software out, every decision recorded in `02-DOCS/wiki/sdd/`.*
|
|
13
13
|
|
|
14
|
-
**Why it exists.** Classic SDD reviewed at the end. On paper it checked the spec; in a long autonomous run, the only thing that bit for hours was the test — and tests prove the code works, not that it does what was asked
|
|
14
|
+
**Why it exists.** Classic SDD reviewed at the end. On paper it checked the spec; in a long autonomous run, the only thing that bit for hours was the test — and tests prove the code works, not that it does what was asked. ASDD keeps the phases and changes two things: **the spec must prove itself**, and **the review moves inside every task**, scaled by risk. The human stops reviewing everything and only takes the decisions the agent must not take alone.
|
|
15
15
|
|
|
16
16
|
This skill does **not** do a phase. It names the method, reads the register, places the request on the map and hands off. Each phase skill points at the next one.
|
|
17
17
|
|
|
@@ -55,7 +55,7 @@ Every spec answers four questions, and `spec:gate` refuses one dated 2026-11-03
|
|
|
55
55
|
|
|
56
56
|
### The loop converges
|
|
57
57
|
|
|
58
|
-
`npx @ericrisco/rsc review ledger` holds it to
|
|
58
|
+
`npx @ericrisco/rsc review ledger` holds it to rules that make review converge instead of looping: `round <slug>/<task>` refuses a 4th round (rethink the approach or park the task), `record` marks a finding already raised as a `repeat` that is never raised again, `outcome` closes each finding as `fixed|false|intentional|irrelevant`, `stats` measures the noise. Flag the bug class, not the line; from round 2 re-review only the new diff.
|
|
59
59
|
|
|
60
60
|
### Park, don't block
|
|
61
61
|
|
|
@@ -38,9 +38,9 @@ models:
|
|
|
38
38
|
enabled: false # opt-in master switch; false = honor the session model, announce nothing
|
|
39
39
|
provider: anthropic # which provider the tiers below resolve to
|
|
40
40
|
tiers:
|
|
41
|
-
heavy: claude-opus-
|
|
42
|
-
balanced: claude-sonnet-
|
|
43
|
-
light: claude-haiku-
|
|
41
|
+
heavy: claude-opus-5-5
|
|
42
|
+
balanced: claude-sonnet-5-5
|
|
43
|
+
light: claude-haiku-5-5
|
|
44
44
|
phases:
|
|
45
45
|
constitution: heavy
|
|
46
46
|
specify: balanced
|
|
@@ -140,7 +140,7 @@ To target another provider, change `models.provider` and set `models.tiers` to t
|
|
|
140
140
|
|
|
141
141
|
| provider | heavy | balanced | light |
|
|
142
142
|
| --- | --- | --- | --- |
|
|
143
|
-
| `anthropic` | `claude-opus-
|
|
143
|
+
| `anthropic` | `claude-opus-5-5` | `claude-sonnet-5-5` | `claude-haiku-5-5` |
|
|
144
144
|
| `openai` | `gpt-5.1` (or current flagship) | `gpt-5.1-mini` | `gpt-5.1-nano` |
|
|
145
145
|
| `google` | `gemini-2.5-pro` | `gemini-2.5-flash` | `gemini-2.5-flash-lite` |
|
|
146
146
|
| `openrouter` | a strong model slug | a mid model slug | a cheap/free model slug |
|
|
@@ -173,7 +173,7 @@ Every phase's result envelope carries the model it ran on, so the chain is audit
|
|
|
173
173
|
```json
|
|
174
174
|
{
|
|
175
175
|
"status": "complete",
|
|
176
|
-
"model": { "tier": "heavy", "resolved": "claude-opus-
|
|
176
|
+
"model": { "tier": "heavy", "resolved": "claude-opus-5-5", "routing": "on|off" },
|
|
177
177
|
"...": "rest of the standard envelope"
|
|
178
178
|
}
|
|
179
179
|
```
|
package/skills/astro/SKILL.md
CHANGED
|
@@ -243,7 +243,7 @@ npx @astrojs/upgrade
|
|
|
243
243
|
`bash scripts/verify.sh` from the Astro project root — grep-based, needs no install. It **FAILS** if
|
|
244
244
|
a v6 project still has `src/content/config.ts` instead of `src/content.config.ts`, **WARNS** on
|
|
245
245
|
over-hydration smells (many `client:load`, or `client:only` with no framework string), **CHECKS**
|
|
246
|
-
that content
|
|
246
|
+
that the content config imports `defineCollection` from `astro:content`, and — only if the `astro` binary resolves —
|
|
247
247
|
optionally runs `npx astro check`. On an empty or clean tree it prints OK and exits 0; warnings are
|
|
248
248
|
advisory and never fail the run.
|
|
249
249
|
|
|
@@ -76,7 +76,7 @@ else
|
|
|
76
76
|
fi
|
|
77
77
|
|
|
78
78
|
# --- 2. content schema imports ---------------------------------------------
|
|
79
|
-
# A content config should import defineCollection
|
|
79
|
+
# A content config should import defineCollection from astro:content (z comes from astro/zod).
|
|
80
80
|
if [ -f src/content.config.ts ]; then
|
|
81
81
|
if grep -q 'astro:content' src/content.config.ts; then
|
|
82
82
|
ok "content schema imports from astro:content"
|
|
@@ -146,11 +146,11 @@ A skill ships only when every box is checked or a miss is consciously justified.
|
|
|
146
146
|
- [ ] **Orient voice honored** — reads `technical_level` from the profile and picks the register; short sentences, every answer understandable on its own.
|
|
147
147
|
- [ ] **Artifacts under `02-DOCS/wiki/`** and indexed in `02-DOCS/wiki/index.md` (the Knowledge map; root `CLAUDE.md` keeps only a short pointer), if the skill produces any.
|
|
148
148
|
- [ ] **Concrete tooling delegated** to the stack skills rather than reinvented.
|
|
149
|
-
- [ ] **evals present** — `cases.yaml` (≥5 `should_trigger` incl. non-obvious, ≥4 `should_not_trigger` each with a real-sibling `route_to`, ≥1 `capability` with a `must_include` rubric) + an honest `README.md`. `scripts/eval-lint.sh` passes —
|
|
149
|
+
- [ ] **evals present** — `cases.yaml` (≥5 `should_trigger` incl. non-obvious, ≥4 `should_not_trigger` each with a real-sibling `route_to`, ≥1 `capability` with a `must_include` rubric) + an honest `README.md`. `scripts/eval-lint.sh` passes — it checks presence, the counts (≥5/≥4/≥1), that those keys are lists, and that every `route_to` present resolves to a real catalog skill, `none` or `external:<name>`; that each `should_not_trigger` carries a `route_to`, non-obvious phrasings, and `must_include` quality are yours to verify here, not the linter's.
|
|
150
150
|
- [ ] **verify.sh** present iff the skill has a checkable artifact; process skills rely on evals.
|
|
151
|
-
- [ ] **Every `must_include` item discriminates** — answerable by the scenario's task, plausibly caused by the skill and plausibly missed without it. An item *both* arms fail measures nothing and lowers the absolute
|
|
152
|
-
- [ ] **Sibling links resolve** — every `../x/SKILL.md` points to a skill that exists.
|
|
153
|
-
- [ ] **Wired** — `tags` + `recommends` set, `npm run manifest` re-run, and `npm run validate` / `npm run manifest:check` pass (manifest current, no dangling recommends).
|
|
151
|
+
- [ ] **Every `must_include` item discriminates** — answerable by the scenario's task, plausibly caused by the skill and plausibly missed without it. An item *both* arms fail measures nothing and lowers the absolute. → `references/eval-authoring.md`.
|
|
152
|
+
- [ ] **Sibling links resolve** — every `../x/SKILL.md` points to a skill that exists. <!-- prompt-audit: allow dead-skill-link — placeholder in an example -->
|
|
153
|
+
- [ ] **Wired** — `tags` + `recommends` set, `npm run manifest` re-run, and `npm run validate` / `npm run manifest:check` / `npm run prompt:audit` pass (manifest current, no dangling recommends, no retired model ids or history phrases).
|
|
154
154
|
|
|
155
155
|
Full rubric rationale and the rsc plumbing steps → `references/rsc-conventions.md`.
|
|
156
156
|
|
|
@@ -186,7 +186,7 @@ only when **both** are green:
|
|
|
186
186
|
| A `references/` folder added to look thorough, or a reference nothing links to | An unlinked reference is never loaded — dead weight in the package. Link it at point of use or delete it. |
|
|
187
187
|
| Evals skipped: "I'll just test it by hand once" | Unverifiable = does not ship. Write `cases.yaml`, near-misses with `route_to` included. |
|
|
188
188
|
| `verify.sh` added to a process skill for rigor | A process skill has no artifact to grep. Its rigor is the capability eval. |
|
|
189
|
-
| `../foo/SKILL.md` linked to something not in this repo | A dead link is a defect. Verify the directory exists under `skills/`. |
|
|
189
|
+
| `../foo/SKILL.md` linked to something not in this repo | A dead link is a defect. Verify the directory exists under `skills/`. | <!-- prompt-audit: allow dead-skill-link — placeholder in an example -->
|
|
190
190
|
| Another catalog mirrored wholesale ("it's basically superpowers' writing-skills") | Mine the idea, write it in the rsc voice. Copied artifacts or phrasing are a defect. |
|
|
191
191
|
|
|
192
192
|
## Project grounding (02-DOCS + CLAUDE.md)
|
|
@@ -17,7 +17,7 @@ Everything lives in `evals/cases.yaml` (the cases) and `evals/README.md` (how to
|
|
|
17
17
|
|
|
18
18
|
`scripts/eval-lint.sh` parses every `cases.yaml` and fails the build only on the **structural minimums**: that `evals/cases.yaml` exists, that `should_trigger`, `should_not_trigger`, and `capability` are present as lists, and that their item counts meet **≥ 5 / ≥ 4 / ≥ 1**. (Without python3+PyYAML it degrades to a presence-only key check.) Run it before shipping to catch a missing or undersized section.
|
|
19
19
|
|
|
20
|
-
It also resolves every `route_to`: each value must be a real catalog skill id, `none`, or `external:<name>` for a skill that deliberately lives outside this catalog — a stale route
|
|
20
|
+
It also resolves every `route_to`: each value must be a real catalog skill id, `none`, or `external:<name>` for a skill that deliberately lives outside this catalog — a stale route fails the build. What it still does **not** read: whether each `should_not_trigger` actually carries a `route_to`, whether your `should_trigger` set includes a genuinely non-obvious or non-English phrasing, and whether each `capability` scenario has a real `must_include` rubric of gradeable points. Those are **author and review responsibilities**: verify them by hand (and in the self-audit / code-review pass) before shipping. A green eval-lint means the shape is right, not that the cases are good.
|
|
21
21
|
|
|
22
22
|
## cases.yaml structure
|
|
23
23
|
|
|
@@ -65,12 +65,11 @@ For a process skill (no `verify.sh`), the capability scenario is the *primary* r
|
|
|
65
65
|
|
|
66
66
|
## A `must_include` item must discriminate, or it subtracts
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
behaviour (
|
|
72
|
-
|
|
73
|
-
lift +2.2) to FAIL (7.5, lift +1.7)**. The rule they encoded was fine; the item was not.
|
|
68
|
+
An item that comes back **unsatisfied in both arms** — treatment and baseline alike — adds nothing
|
|
69
|
+
to lift and still counts against the coverage term, so it lowers the score and can flip a PASS to a
|
|
70
|
+
FAIL. The typical case: an item that demands the answer *name* a tool (`mutmut`, Stryker) when
|
|
71
|
+
both arms do the behaviour (plant a bug, check the suite catches it) without naming one. The rule
|
|
72
|
+
it encodes can be fine while the item is not.
|
|
74
73
|
|
|
75
74
|
Two tests before an item earns its place:
|
|
76
75
|
|
|
@@ -22,7 +22,7 @@ The single most expensive mistake is choosing on familiarity instead of cost mod
|
|
|
22
22
|
| Constraint | Zapier | Make | n8n |
|
|
23
23
|
| --- | --- | --- | --- |
|
|
24
24
|
| **Billing unit** (why it dominates cost) | per **task** — every action counts | per **credit** — each module action = 1 credit (was "operations" until 2025-08-27; converted 1:1) | per **execution** — whole run = 1, any step count |
|
|
25
|
-
| **Free tier** | 100 tasks/mo | 1,000
|
|
25
|
+
| **Free tier** | 100 tasks/mo | ≈ 1,000 credits/mo | self-host free, unlimited execs |
|
|
26
26
|
| **Entry paid** | Pro ≈ $19.99/mo (billed annually), 750 tasks | Core ≈ $9/mo, 10k credits (billing unit became **credits** on 2025-08-27) | cloud Starter ≈ €20/mo (billed annually), 2,500 execs; self-host = $0 |
|
|
27
27
|
| **App breadth** (obscure-app signal) | ≈ 8,000+ integrations — widest | ≈ 1,500, often deeper per app | ≈ 1,000 nodes + generic HTTP node + code |
|
|
28
28
|
| **Self-host / data residency** | no | no | yes — your infra, your data |
|
|
@@ -27,7 +27,7 @@ A thin provider adapter, a disciplined agent loop, schema-validated tools, provi
|
|
|
27
27
|
|
|
28
28
|
## The provider adapter (the heart of the skill)
|
|
29
29
|
|
|
30
|
-
The one payload to internalize. Python 3.12+, Pydantic v2, **async** so it composes directly with the bounded loop (and orchestrator-worker fan-out) in [`references/agent-loops-and-harness.md`](references/agent-loops-and-harness.md). Structured output is the quirk that differs most per vendor: strict JSON Schema (OpenAI),
|
|
30
|
+
The one payload to internalize. Python 3.12+, Pydantic v2, **async** so it composes directly with the bounded loop (and orchestrator-worker fan-out) in [`references/agent-loops-and-harness.md`](references/agent-loops-and-harness.md). Structured output is the quirk that differs most per vendor: strict JSON Schema (OpenAI), `output_config.format` (Anthropic), `response_json_schema` (Gemini). Streaming, the Gemini and OSS/litellm adapters, tool-result plumbing, and a `route()` registry live in [`references/provider-abstraction.md`](references/provider-abstraction.md) — this excerpt is the load-bearing core, not the whole interface.
|
|
31
31
|
|
|
32
32
|
```python
|
|
33
33
|
from __future__ import annotations
|
|
@@ -56,12 +56,12 @@ class Usage(BaseModel):
|
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
class CompletionRequest(BaseModel):
|
|
59
|
-
model: str # resolved from config, e.g. "claude-sonnet-
|
|
59
|
+
model: str # resolved from config, e.g. "claude-sonnet-5-5" — never literal in logic
|
|
60
60
|
messages: list[Message]
|
|
61
61
|
tools: list[ToolSpec] = Field(default_factory=list)
|
|
62
62
|
response_schema: dict | None = None # JSON Schema -> structured output
|
|
63
|
-
temperature: float =
|
|
64
|
-
max_tokens: int =
|
|
63
|
+
temperature: float | None = None # None = provider default; current Claude models reject sampling params
|
|
64
|
+
max_tokens: int = 8192 # thinking is on by default on current Claude models and shares this budget
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
class CompletionResponse(BaseModel):
|
|
@@ -88,7 +88,9 @@ class OpenAIAdapter:
|
|
|
88
88
|
# Chat Completions shape (universal, still current); references/provider-abstraction.md
|
|
89
89
|
# gives the preferred Responses-API adapter. system stays a `system` role message here.
|
|
90
90
|
kwargs: dict = {"model": self.model, "messages": [m.model_dump() for m in req.messages],
|
|
91
|
-
"
|
|
91
|
+
"max_tokens": req.max_tokens}
|
|
92
|
+
if req.temperature is not None:
|
|
93
|
+
kwargs["temperature"] = req.temperature
|
|
92
94
|
if req.tools:
|
|
93
95
|
kwargs["tools"] = [{"type": "function", "function": {"name": t.name, "description": t.description, "parameters": t.parameters}} for t in req.tools]
|
|
94
96
|
if req.response_schema:
|
|
@@ -108,14 +110,17 @@ class AnthropicAdapter:
|
|
|
108
110
|
|
|
109
111
|
async def complete(self, req: CompletionRequest) -> CompletionResponse:
|
|
110
112
|
# QUIRKS: system is a top-level param (not a message); tools use input_schema (not function).
|
|
111
|
-
|
|
113
|
+
# Current Claude models reject sampling params (temperature/top_p) and forced tool_choice,
|
|
114
|
+
# so req.temperature is not sent and structured output uses output_config.format.
|
|
115
|
+
system = "\n".join(m.content for m in req.messages if m.role == "system")
|
|
112
116
|
turns = [{"role": m.role, "content": m.content} for m in req.messages if m.role != "system"]
|
|
113
|
-
kwargs: dict = {"model": self.model, "
|
|
117
|
+
kwargs: dict = {"model": self.model, "messages": turns, "max_tokens": req.max_tokens}
|
|
118
|
+
if system:
|
|
119
|
+
kwargs["system"] = system
|
|
114
120
|
if req.tools:
|
|
115
121
|
kwargs["tools"] = [{"name": t.name, "description": t.description, "input_schema": t.parameters} for t in req.tools]
|
|
116
|
-
if req.response_schema: # structured output
|
|
117
|
-
kwargs["
|
|
118
|
-
kwargs["tool_choice"] = {"type": "tool", "name": "out"}
|
|
122
|
+
if req.response_schema: # structured output: the first text block is valid JSON
|
|
123
|
+
kwargs["output_config"] = {"format": {"type": "json_schema", "schema": req.response_schema}}
|
|
119
124
|
r = await self.client.messages.create(**kwargs)
|
|
120
125
|
text = "".join(b.text for b in r.content if b.type == "text")
|
|
121
126
|
calls = [{"id": b.id, "name": b.name, "arguments": b.input} for b in r.content if b.type == "tool_use"]
|
|
@@ -137,7 +142,7 @@ def get_provider(spec: str | None = None) -> LLMProvider:
|
|
|
137
142
|
|
|
138
143
|
## Good vs Bad
|
|
139
144
|
|
|
140
|
-
Call-sites use the adapter and never name a model: `provider = get_provider(settings.llm)` (e.g. `"anthropic:claude-sonnet-
|
|
145
|
+
Call-sites use the adapter and never name a model: `provider = get_provider(settings.llm)` (e.g. `"anthropic:claude-sonnet-5-5"`), then `await provider.complete(req)`. The two failures that survive that discipline:
|
|
141
146
|
|
|
142
147
|
```python
|
|
143
148
|
# BAD — parse-and-pray; wrong shape fails silently at 3am.
|
|
@@ -367,7 +372,7 @@ if __name__ == "__main__":
|
|
|
367
372
|
| "Default everything to the flagship model, it's smartest" | 5–20× cost for no measured gain. Route to the cheapest model that passes the eval. |
|
|
368
373
|
| "Stuff the whole doc in the prompt instead of RAG" | Blows context + cost and still hallucinates. Retrieve + cite + refuse. |
|
|
369
374
|
| "Retry on every exception" | Retrying a 400/401 wastes budget. Retry only transient (429/5xx/timeout) with backoff+jitter. |
|
|
370
|
-
| "Hardcode the model name, it's fine" | Names rot
|
|
375
|
+
| "Hardcode the model name, it's fine" | Names rot within weeks. Resolve from config/registry. |
|
|
371
376
|
| "MCP for everything" | In-process native tools are simpler and faster when reuse isn't needed. MCP only for cross-client reuse. |
|
|
372
377
|
| "Tool results just return the raw API blob" | Give the model `status/summary/next_actions`; raw blobs waste context and stall recovery. |
|
|
373
378
|
| "Prompt caching is Anthropic-only so skip caching" | Each provider has its own caching/dedup; abstract it behind the adapter, don't skip it. |
|
|
@@ -205,8 +205,9 @@ def call_signature(name: str, args: dict) -> str:
|
|
|
205
205
|
return hashlib.sha256(payload.encode()).hexdigest()[:16]
|
|
206
206
|
```
|
|
207
207
|
|
|
208
|
-
- For evals, pin `temperature=0.0` and
|
|
209
|
-
reproducible.
|
|
208
|
+
- For evals, pin `temperature=0.0` and a fixed seed where the model accepts them, so transcripts
|
|
209
|
+
are reproducible. Current Claude models reject sampling params: there, fix the prompt, the tool
|
|
210
|
+
results and the model id, and compare runs by grade rather than by exact text.
|
|
210
211
|
- For side-effecting tools, pass an **idempotency key** (`call.id` or `call_signature`)
|
|
211
212
|
so a retried step does not double-charge or double-insert (see `tools-and-rag.md`).
|
|
212
213
|
- Persist the full message transcript; a replayable transcript is the cheapest debugger
|
|
@@ -279,7 +279,8 @@ async def traced_complete(p: LLMProvider, system: str, req: CompletionRequest) -
|
|
|
279
279
|
with tracer.start_as_current_span("chat") as span:
|
|
280
280
|
span.set_attribute("gen_ai.system", system) # "openai" | "anthropic" | ...
|
|
281
281
|
span.set_attribute("gen_ai.request.model", req.model)
|
|
282
|
-
|
|
282
|
+
if req.temperature is not None: # unset on current Claude models
|
|
283
|
+
span.set_attribute("gen_ai.request.temperature", req.temperature)
|
|
283
284
|
resp = await p.complete(req)
|
|
284
285
|
span.set_attribute("gen_ai.usage.input_tokens", resp.usage.input_tokens)
|
|
285
286
|
span.set_attribute("gen_ai.usage.output_tokens", resp.usage.output_tokens)
|
|
@@ -392,16 +393,17 @@ Compute `cost_usd` from the dated pricing table — never hardcode a price in bu
|
|
|
392
393
|
|
|
393
394
|
| Model (provider:id) | $/MTok in | $/MTok out | Notes |
|
|
394
395
|
|---|---|---|---|
|
|
395
|
-
| anthropic:claude-haiku-
|
|
396
|
-
| anthropic:claude-sonnet-
|
|
397
|
-
| anthropic:claude-opus-
|
|
396
|
+
| anthropic:claude-haiku-5-5 | 0.10 | 0.50 | cheap/fast; prompts >100K tokens bill 0.50 / 2.50 |
|
|
397
|
+
| anthropic:claude-sonnet-5-5 | 2.00 | 10.00 | default; cache reads 0.10; 1M context |
|
|
398
|
+
| anthropic:claude-opus-5-5 | 4.00 | 20.00 | flagship Opus; cache reads 0.20; 1M context |
|
|
398
399
|
| openai:gpt-5.5 | 5.00 | 30.00 | flagship; >272K prompt billed 2× in / 1.5× out |
|
|
399
400
|
| openai:gpt-5.4 | 2.50 | 15.00 | cached input −90% |
|
|
400
401
|
| openai:gpt-5.2-codex | 1.75 | 14.00 | code-tuned |
|
|
401
402
|
| gemini:gemini-3.5-flash | 1.50 | 9.00 | cached 0.15; 1M context |
|
|
402
403
|
| gemini:gemini-3.1-pro | — | — | paid-only since 2026-04-01 |
|
|
403
404
|
|
|
404
|
-
|
|
405
|
+
Anthropic rows checked against the official price table in 2026-11; the others are **as of
|
|
406
|
+
2026-06**. Verify before quoting. Load them from config and refresh
|
|
405
407
|
the table before trusting any number.
|
|
406
408
|
|
|
407
409
|
## Anti-patterns
|