@ericrisco/rsc 1.0.10 → 1.0.12

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.
Files changed (40) hide show
  1. package/README.md +15 -13
  2. package/manifest.json +133 -2
  3. package/package.json +3 -3
  4. package/scripts/consult.js +75 -42
  5. package/scripts/lib/default-skill-floor.js +11 -0
  6. package/scripts/lib/domains.js +3 -3
  7. package/scripts/lib/recommend.js +1 -0
  8. package/scripts/lib/text-rank.js +112 -0
  9. package/scripts/lib/ui.js +3 -3
  10. package/scripts/routing-audit.js +163 -0
  11. package/scripts/rsc.js +11 -10
  12. package/skills/author-skill/references/rsc-conventions.md +1 -1
  13. package/skills/bro/SKILL.md +68 -0
  14. package/skills/bro/evals/README.md +22 -0
  15. package/skills/bro/evals/cases.yaml +58 -0
  16. package/skills/decision-challenge/SKILL.md +113 -0
  17. package/skills/decision-challenge/evals/README.md +3 -0
  18. package/skills/decision-challenge/evals/cases.yaml +42 -0
  19. package/skills/deprecation/SKILL.md +123 -0
  20. package/skills/deprecation/evals/README.md +3 -0
  21. package/skills/deprecation/evals/cases.yaml +42 -0
  22. package/skills/idea-refinement/SKILL.md +121 -0
  23. package/skills/idea-refinement/evals/README.md +3 -0
  24. package/skills/idea-refinement/evals/cases.yaml +42 -0
  25. package/skills/observability/SKILL.md +6 -0
  26. package/skills/observability/evals/cases.yaml +2 -0
  27. package/skills/performance/SKILL.md +13 -0
  28. package/skills/performance/evals/cases.yaml +2 -0
  29. package/skills/simplify-code/SKILL.md +101 -0
  30. package/skills/simplify-code/evals/README.md +3 -0
  31. package/skills/simplify-code/evals/cases.yaml +42 -0
  32. package/skills/source-grounded-development/SKILL.md +108 -0
  33. package/skills/source-grounded-development/evals/README.md +3 -0
  34. package/skills/source-grounded-development/evals/cases.yaml +42 -0
  35. package/skills/specify/SKILL.md +31 -0
  36. package/skills/suggest/evals/cases.yaml +1 -1
  37. package/skills/testing-go/SKILL.md +17 -0
  38. package/skills/testing-py/SKILL.md +18 -0
  39. package/skills/testing-web/SKILL.md +20 -0
  40. package/skills/verify/SKILL.md +37 -0
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: deprecation
3
+ description: "Use when retiring a public API, feature, integration, service or legacy path without abandoning consumers. Inventories usage, classifies advisory vs compulsory migration, ships compatibility/tooling, assigns owners and gates removal on evidence. NOT live schema expand-contract (`db-migrations`), NOT replacement API design (`api-design`)."
4
+ tags: [deprecation, migration, compatibility, consumer-migration, removal]
5
+ recommends: [api-design, db-migrations, deployment, git-workflow, monitoring]
6
+ profiles: [core, full]
7
+ origin: risco
8
+ ---
9
+
10
+ # deprecation — removal is a consumer migration
11
+
12
+ Deprecation is not a date in a changelog. It is the controlled transfer of real consumers from an old contract to a supported replacement, followed by evidence that removal no longer breaks anyone important.
13
+
14
+ This skill owns the cross-consumer program. It delegates the replacement interface to `../api-design/SKILL.md`, live schema mechanics to `../db-migrations/SKILL.md`, release/version mechanics to `../git-workflow/SKILL.md`, and rollout/rollback execution to `../deployment/SKILL.md`.
15
+
16
+ ## The retirement sequence
17
+
18
+ ```text
19
+ INVENTORY → CLASSIFY → ENABLE → NOTIFY → MIGRATE → OBSERVE → REMOVE
20
+ ```
21
+
22
+ ### 1. INVENTORY the contract and consumers
23
+
24
+ Identify:
25
+
26
+ - exact endpoints, events, schemas, flags, SDK methods, jobs, services and docs being retired;
27
+ - internal and external consumers, owners and contractual notice periods;
28
+ - traffic/usage by consumer, version and operation;
29
+ - data written only by the old path and compatibility obligations;
30
+ - support, reseller or offline consumers invisible to runtime telemetry;
31
+ - current fallback and restoration options.
32
+
33
+ “No known users” is not an inventory. Query telemetry, code search, dependency graphs, access keys, support records and account owners. Record where visibility is incomplete.
34
+
35
+ ### 2. CLASSIFY the migration
36
+
37
+ - **Advisory:** the old path remains supported; migration is encouraged for benefit or future-proofing.
38
+ - **Compulsory:** support will end or continued use creates unacceptable security, reliability, legal or operating risk.
39
+
40
+ Only compulsory migrations justify a removal deadline. State the forcing reason and who has authority to accept exceptions. A deadline should respect contracts, effort and evidence; do not import a universal 30/60/90-day calendar.
41
+
42
+ ### 3. ENABLE migration before announcing removal
43
+
44
+ The replacement must be usable first:
45
+
46
+ - compatible contract or adapter where feasible;
47
+ - migration guide with old → new mappings and changed semantics;
48
+ - tooling, codemod, SDK or dual-write/read path for repetitive work;
49
+ - test/sandbox path and representative examples;
50
+ - rollback or temporary compatibility mode;
51
+ - ownership for data backfill and reconciliation.
52
+
53
+ For database changes, use expand → backfill → switch reads/writes → contract through `../db-migrations/SKILL.md`. Do not promise a generic `down` migration for irreversible data transformations; prove the actual restoration/reconciliation path instead.
54
+
55
+ ### 4. NOTIFY through machine and human channels
56
+
57
+ Use the channels the consumer will actually see: response headers, compiler/runtime warnings, API dashboards, release notes, direct account contact, support and status communications. A warning must name the replacement, action, consequence, evidence link and earliest removal condition.
58
+
59
+ Versioned public APIs should follow their compatibility policy and SemVer where it applies. Machine warnings without a migration guide create noise; an email without runtime identification misses the real owner. Use both when the surface permits.
60
+
61
+ ### 5. MIGRATE with explicit ownership
62
+
63
+ The team introducing the deprecation owns the common migration path: inventory, docs, automation, default internal consumers and escalation. Consumer teams own domain-specific acceptance and scheduling, not rediscovering the replacement.
64
+
65
+ Track each consumer as: uncontacted, acknowledged, testing, migrated, exempted with expiry, unreachable, or blocked. Give blockers an owner and next action. Reseller-managed or unknown consumers need a separate reachability plan; do not silently exclude them from the denominator.
66
+
67
+ ### 6. OBSERVE real cutover
68
+
69
+ Instrument old-path usage by consumer and operation, plus errors on the replacement. Where risk warrants it, shadow or dual-run and compare results before switching authority. Dashboards must distinguish legitimate residual traffic, retries and synthetic probes from active dependency.
70
+
71
+ Define the removal gate up front, for example:
72
+
73
+ - no non-exempt production use for a representative window;
74
+ - every contractually covered consumer notified and migrated or explicitly exempted;
75
+ - replacement error/SLO health acceptable;
76
+ - rollback/compatibility response tested;
77
+ - support, docs and on-call ready for late discoveries.
78
+
79
+ The representative window depends on consumer cadence. A monthly batch needs more than a quiet week.
80
+
81
+ ### 7. REMOVE in a reversible order
82
+
83
+ Disable entry first, observe, then delete implementation, flags, compatibility code, credentials, dashboards and documentation that exist only for the old path. Preserve audit/history records. Update dependency and ownership maps so the retired system does not remain a zombie operational obligation.
84
+
85
+ If unexpected material traffic appears, re-enable the bounded compatibility path and return to migration. Do not restore an undocumented permanent fork.
86
+
87
+ ## Deprecation record
88
+
89
+ ```markdown
90
+ # Deprecation — <old> → <replacement>
91
+
92
+ ## Classification and reason
93
+ Advisory/compulsory · forcing reason · authority · notice constraints.
94
+
95
+ ## Inventory
96
+ Contracts · consumers · owners · baseline usage · visibility gaps.
97
+
98
+ ## Migration path
99
+ Compatibility · guide/tooling · data plan · rollback/reconciliation.
100
+
101
+ ## Consumer ledger
102
+ Consumer · state · owner · last old-path use · blocker/exception expiry.
103
+
104
+ ## Removal gate and evidence
105
+ Window · zero-use evidence · replacement health · support/rollback readiness.
106
+
107
+ ## Removal log
108
+ Disabled · observed · deleted · residual artifacts.
109
+ ```
110
+
111
+ ## Anti-patterns
112
+
113
+ | Smell | Correction |
114
+ |---|---|
115
+ | The calendar arrives while material traffic remains | Hold removal; the gate is evidence, not date alone. |
116
+ | Every consumer writes the same adapter | The deprecating team owns common tooling and default migrations. |
117
+ | Internal code search proves external zero-use | Combine runtime identity, contracts, support and account ownership. |
118
+ | Temporary compatibility has no owner or expiry | Track an explicit exception with accountable owner and end condition. |
119
+ | Deprecation silently grants deploy authority | Keep live rollout/rollback explicit through `deployment`. |
120
+
121
+ ## Orientación (siempre)
122
+
123
+ Cierra cada turno con el **bloque-brújula** (📍 dónde estás · ✅ qué hiciste · 🧭 por qué · ➡️ siguiente, terminando en pregunta), calibrado al dial de `02-DOCS/wiki/harness/user-profile.md`. **Nunca termines en seco.** Protocolo completo: skill `orient` → `skills/orient/references/orientation-contract.md`. (Defiere a `suggest` el “¿instalo la skill que falta?”.)
@@ -0,0 +1,3 @@
1
+ # Evals — deprecation
2
+
3
+ Routing separates the consumer-migration program from schema mechanics, replacement API design, Git versioning, deployment and ADR authoring. The capability case requires consumer completeness, contractual timing, migration enablement, multichannel notice, measured cutover and a reversible removal sequence.
@@ -0,0 +1,42 @@
1
+ skill: deprecation
2
+
3
+ should_trigger:
4
+ - prompt: "We need to retire the v1 public API without stranding 200 external consumers."
5
+ why: "Public contract retirement with consumer migration is the core workflow."
6
+ - prompt: "Planifica la retirada del login legado: inventario, avisos, migración, telemetría y puerta de borrado."
7
+ why: "Spanish request names the complete deprecation program."
8
+ - prompt: "This SDK method is deprecated; ship a codemod and prove no supported clients still call it before removal."
9
+ why: "Migration tooling plus measured zero-use gate."
10
+ - prompt: "Hem de retirar una integració antiga, però alguns clients només executen un batch mensual."
11
+ why: "Catalan case where the observation window must match consumer cadence."
12
+ - prompt: "Classify this migration as advisory or compulsory and define who can grant expiring exceptions."
13
+ why: "The forcing model and exception authority are deprecation decisions."
14
+ - prompt: "Track every consumer from uncontacted to migrated and gate deletion on replacement health and tested rollback."
15
+ why: "Consumer ledger and evidence-based removal gate."
16
+
17
+ should_not_trigger:
18
+ - prompt: "Add a nullable column, backfill ten million rows in batches, then enforce NOT NULL without downtime."
19
+ route_to: db-migrations
20
+ why: "Concrete live schema expand-contract mechanics."
21
+ - prompt: "Design the v2 API resources, error envelope, pagination and OpenAPI contract."
22
+ route_to: api-design
23
+ why: "Replacement interface design precedes the migration program."
24
+ - prompt: "Choose the SemVer tag and write the Conventional Commit for this breaking release."
25
+ route_to: git-workflow
26
+ why: "Version and Git release conventions."
27
+ - prompt: "Deploy the compatibility adapter to production with a healthcheck and rollback command."
28
+ route_to: deployment
29
+ why: "Authorized live rollout execution."
30
+ - prompt: "Write an ADR explaining why the team chose v2 over extending v1."
31
+ route_to: decision-records
32
+ why: "Durable decision rationale, not consumer migration execution."
33
+
34
+ capability:
35
+ - scenario: "Deprecate a v1 REST API used by 200 organizations; v2 is live, current telemetry sees 173 active keys, twelve accounts are reseller-managed, and the largest contract requires 90 days' notice."
36
+ must_include:
37
+ - "Inventories exact v1 surfaces, all consumer classes, owners, contractual notice, baseline usage, data obligations, and telemetry/reachability gaps."
38
+ - "Classifies advisory versus compulsory with a forcing reason, authority, and expiring exception policy rather than an arbitrary universal timeline."
39
+ - "Makes v2 usable first through compatibility, guide, tooling/SDK, test path, data reconciliation, and a real restoration strategy."
40
+ - "Uses both machine-visible warnings and direct human channels, including a plan for reseller-managed and unreachable consumers."
41
+ - "Maintains a per-consumer migration ledger and assigns common migration work to the deprecating team rather than every consumer."
42
+ - "Defines a representative zero-use and replacement-health removal gate, then disables, observes, and deletes in reversible order."
@@ -0,0 +1,121 @@
1
+ ---
2
+ name: idea-refinement
3
+ description: "Use when a rough product, service, workflow or feature idea needs divergent options and assumption pressure-testing before it becomes a spec. Produces a decision brief with alternatives, evidence gaps, Not Now and a cheap experiment. NOT requirements or acceptance criteria (`specify`), NOT market sizing (`market-research`)."
4
+ tags: [ideation, idea-refinement, product-discovery, assumptions, decision-brief]
5
+ recommends: [specify, market-research, competitor-watch, ab-testing]
6
+ profiles: [core, full]
7
+ origin: risco
8
+ ---
9
+
10
+ # idea-refinement — make the idea earn its direction
11
+
12
+ Use this before `specify`, while the question is still “which version of this idea is worth pursuing?” The output is not a backlog or a polished pitch. It is a short decision brief that widens the option space, exposes what is merely assumed, and recommends the cheapest sensible direction to test.
13
+
14
+ Inspect any brief, notes, product or repository already supplied before asking questions. Ask one question at a time only when the answer would change the option space. The user may delegate a choice; “use your judgment” is valid authority when the decision is reversible and the assumptions are made visible.
15
+
16
+ ## The refinement loop
17
+
18
+ ```text
19
+ FRAME → DIVERGE → CHALLENGE → CONVERGE → TEST
20
+ ```
21
+
22
+ ### 1. FRAME the real opportunity
23
+
24
+ Write five lines, no solution language yet:
25
+
26
+ - **Actor:** who is struggling, in what situation?
27
+ - **Current workaround:** what do they do now, including “do nothing”?
28
+ - **Desired progress:** what observable change would make this useful?
29
+ - **Constraints:** time, money, channel, trust, regulation, existing product.
30
+ - **Known / assumed:** separate evidence already seen from hypotheses that only sound plausible.
31
+
32
+ If the idea is phrased as a feature (“an AI dashboard”), reframe it as a problem and outcome (“operators need to spot failed jobs before customers report them”). Keep the original idea as one candidate, not as the conclusion.
33
+
34
+ ### 2. DIVERGE deliberately
35
+
36
+ Produce **five to eight meaningfully different directions**. Variants that only change colors, names, pricing tiers or implementation technology count as one direction.
37
+
38
+ Choose two lenses that attack the largest uncertainty:
39
+
40
+ - **Remove / replace / combine / reverse:** change the mechanism, not the wording.
41
+ - **Job and workaround:** improve, automate or eliminate the thing people already do.
42
+ - **Constraint inversion:** assume the budget, time, data or integration is unavailable.
43
+ - **Trust ladder:** begin with advice, then approval, then automation; do not jump to full autonomy.
44
+ - **Pre-mortem:** imagine the idea failed in six months and design away the most likely cause.
45
+ - **Narrow wedge:** find the smallest audience and moment where the pain is strongest.
46
+
47
+ For each direction give: target actor, promised progress, mechanism, largest assumption, and what makes it distinct. Do not advocate yet.
48
+
49
+ ### 3. CHALLENGE the attractive options
50
+
51
+ Take the three strongest directions and try to disprove them. Check:
52
+
53
+ - Does the pain happen often and cost enough to change behaviour?
54
+ - Does the user control the data, budget and permissions the idea requires?
55
+ - Is the proposal replacing a habit or tool with a worse switching cost?
56
+ - What dependency, incentive or trust failure could make the value impossible?
57
+ - Which claim could be tested this week without building the product?
58
+
59
+ State the strongest objection fairly. If an option survives only because a critical fact is unknown, label it **unverified**, not “promising.” Route market-size and demand evidence to `../market-research/SKILL.md`; route a named-rival comparison to `../competitor-watch/SKILL.md`.
60
+
61
+ ### 4. CONVERGE with explicit criteria
62
+
63
+ Choose three to five criteria that fit the situation, then compare the finalists on the same scale. Typical criteria are user value, evidence strength, time to learning, reversibility, distribution access and operational risk. Weight only when one criterion genuinely dominates; decorative arithmetic is not evidence.
64
+
65
+ Make one recommendation with:
66
+
67
+ - the direction and the dominant reason;
68
+ - confidence: high / medium / low;
69
+ - assumptions it depends on;
70
+ - what was rejected and why;
71
+ - the fact that would most likely reverse the choice.
72
+
73
+ If two options remain genuinely tied, recommend the experiment that distinguishes them. Do not ask the user to choose between indistinguishable summaries.
74
+
75
+ ### 5. TEST before specifying
76
+
77
+ Name the cheapest next test that can change the decision: five problem interviews, a concierge workflow, a fake-door measure with consent, a manual prototype, a pricing conversation, or a data audit. Define the signal that would support the direction and the signal that would kill it.
78
+
79
+ Only after a direction survives does it hand off to `../specify/SKILL.md` for goals, scope, behaviour and acceptance criteria.
80
+
81
+ ## Decision brief
82
+
83
+ ```markdown
84
+ # Idea decision — <working title>
85
+
86
+ ## Opportunity
87
+ Actor · workaround · desired progress · constraints
88
+
89
+ ## Evidence and assumptions
90
+ - Seen: ...
91
+ - Assumed: ...
92
+
93
+ ## Directions considered
94
+ 1. ...
95
+
96
+ ## Comparison
97
+ Same criteria across the three finalists.
98
+
99
+ ## Recommendation
100
+ Direction · confidence · deciding reason · reversal fact.
101
+
102
+ ## Not Now
103
+ Ideas deliberately excluded from the first test.
104
+
105
+ ## Next experiment
106
+ Method · audience · support signal · kill signal · timebox.
107
+ ```
108
+
109
+ ## Anti-patterns
110
+
111
+ | Smell | Correction |
112
+ |---|---|
113
+ | Brainstorming becomes an implementation plan | Stop at direction + falsifier; `plan` comes after an approved spec. |
114
+ | A long questionnaire precedes any thinking | Inspect first; ask one decision-changing question at a time. |
115
+ | A score hides missing evidence | Put the evidence gap beside the score and lower confidence. |
116
+ | The starting idea returns as cosmetic variants | Change mechanism, trust, audience, workflow or constraint. |
117
+ | Ideation continues after direction and falsifier are clear | Stop and run the cheapest distinguishing experiment. |
118
+
119
+ ## Orientación (siempre)
120
+
121
+ Cierra cada turno con el **bloque-brújula** (📍 dónde estás · ✅ qué hiciste · 🧭 por qué · ➡️ siguiente, terminando en pregunta), calibrado al dial de `02-DOCS/wiki/harness/user-profile.md`. **Nunca termines en seco.** Protocolo completo: skill `orient` → `skills/orient/references/orientation-contract.md`. (Defiere a `suggest` el “¿instalo la skill que falta?”.)
@@ -0,0 +1,3 @@
1
+ # Evals — idea-refinement
2
+
3
+ Routing must distinguish exploration before commitment from `specify`, market evidence, competitor monitoring, task breakdown and experiment statistics. The capability case passes only when the answer widens the idea space, attacks assumptions, converges transparently and ends with a falsifiable cheap experiment rather than a polished feature spec.
@@ -0,0 +1,42 @@
1
+ skill: idea-refinement
2
+
3
+ should_trigger:
4
+ - prompt: "I have a vague idea for helping remote teams share what they know; explore several versions before we spec it."
5
+ why: "A rough product idea needs divergent directions and a choice before requirements."
6
+ - prompt: "No quiero que me des la razón: abre opciones y destroza los supuestos de esta idea de onboarding."
7
+ why: "Spanish request for option generation and assumption pressure-testing."
8
+ - prompt: "Tenemos una idea de automatizar soporte, pero aún no sabemos si debería aconsejar, pedir aprobación o actuar sola."
9
+ why: "The trust ladder is the key unresolved product direction."
10
+ - prompt: "Fes un pre-mortem de la idea i proposa cinc enfocaments realment diferents abans de triar-ne un."
11
+ why: "Catalan request for pre-mortem plus meaningful divergence."
12
+ - prompt: "Turn this feature-shaped idea into a problem, alternatives, Not Now list, and the cheapest experiment."
13
+ why: "Names the complete refinement artifact and test handoff."
14
+ - prompt: "We keep circling three product concepts; compare them on evidence, reversibility, and time to learning."
15
+ why: "Convergence across explicit criteria is owned here."
16
+
17
+ should_not_trigger:
18
+ - prompt: "Write the approved feature spec with user stories and acceptance criteria."
19
+ route_to: specify
20
+ why: "The direction is chosen and now needs the WHAT/WHY contract."
21
+ - prompt: "Size the European payroll market with TAM, SAM, SOM and dated sources."
22
+ route_to: market-research
23
+ why: "Defensible market sizing and demand evidence, not ideation."
24
+ - prompt: "Track what Notion and Slite shipped this quarter and compare their moves."
25
+ route_to: competitor-watch
26
+ why: "Standing named-competitor intelligence."
27
+ - prompt: "Break the notifications spec into dependency-ordered implementation tasks."
28
+ route_to: tasks
29
+ why: "Execution decomposition occurs after spec and plan."
30
+ - prompt: "Design the sample size and guardrail metrics for our landing-page experiment."
31
+ route_to: ab-testing
32
+ why: "The direction is already an experiment needing statistical design."
33
+
34
+ capability:
35
+ - scenario: "Refine a rough idea for an AI assistant that helps small agencies capture project knowledge without creating more admin work."
36
+ must_include:
37
+ - "Reframes the feature idea as actor, current workaround, desired progress, constraints, and separate evidence versus assumptions."
38
+ - "Produces five to eight materially different directions, including different trust or workflow mechanisms rather than cosmetic variants."
39
+ - "Pressure-tests the strongest directions for adoption, data, permission, switching-cost, dependency, and failure assumptions."
40
+ - "Compares finalists against the same explicit criteria and recommends one with confidence and a fact that could reverse the decision."
41
+ - "Includes a Not Now list so discarded scope does not leak into the first experiment."
42
+ - "Defines one cheap next experiment with both a support signal and a kill signal, then hands the survivor to specify."
@@ -14,6 +14,10 @@ You are wiring the *inside* view of a service: when something breaks at 3am, an
14
14
 
15
15
  **Every signal carries the same correlation identity: `trace_id`, `service.name`, `deployment.environment`.** A log line you cannot pivot to its trace, or a spiking metric you cannot pivot to an exemplar span, doubles your mean-time-to-resolution — you are back to grepping. Three signals that don't share keys are three disconnected tools; three that do are one queryable system. Set the resource once at SDK init, inject `trace_id`/`span_id` into every log, and never emit a metric you can't tie back to a service and environment.
16
16
 
17
+ ## Start from the operator's questions
18
+
19
+ Before choosing signals, write **two to four questions on-call must answer during the likely incident**. For example: “Are payment retries recovering?”, “Which dependency and failure class drives exhaustion?”, “Can one payment be charged twice?”, “Which customer-visible operations need intervention now?” Then assign the cheapest signal: metrics say **that/how much**, traces show **where/causal path**, logs explain **why for this event**. If a proposed event or label answers none of the questions, do not emit it.
20
+
17
21
  ## The three pillars — when each earns its place
18
22
 
19
23
  Don't emit all three of everything. Each signal answers a different question at a different cost.
@@ -227,3 +231,5 @@ The instrumentation above makes these *possible* — defining them is your job;
227
231
  ## Verify
228
232
 
229
233
  Run `scripts/verify.sh` against the directory holding your Collector config + SDK init. It checks the config is valid, that every defined exporter is actually wired into a pipeline (the classic "defined but unused" footgun), that `service.name` is set, and warns on high-cardinality metric labels. It is read-only and exits 0 when there's nothing to check.
234
+
235
+ Then prove the wire with one safe induced failure in a test/staging path. Confirm the expected error-rate metric changes, the trace records the failing operation and error status, and the structured log carries the same `trace_id` without PII. Query the backend/Collector output; “the instrumentation code ran” is not evidence that usable telemetry arrived. Live paging and escalation proof remains `../monitoring/SKILL.md`.
@@ -47,3 +47,5 @@ capability:
47
47
  - a multi-window SLO burn-rate alert defined from the emitted metrics
48
48
  - respects the cardinality rule (no user_id/request_id/email as a metric label) and logs no PII (opaque ids, redaction in the Collector)
49
49
  - exports through a Collector via OTLP, not straight to a vendor
50
+ - starts from two to four concrete on-call questions and maps metrics to that/how much, traces to where, and logs to why
51
+ - induces one safe failure and proves the correlated metric, error trace, and structured log actually arrive without PII
@@ -41,6 +41,16 @@ You have two kinds of measurement and they answer different questions. Use both,
41
41
 
42
42
  The output of Step 0 is **one sentence naming the bottleneck**: "LCP is 3.8 s and 2.1 s of it is resource load delay because the hero image is lazy-loaded." Do not proceed without that sentence. Tool runbooks (Lighthouse CI flags, reading a flame chart, the Profiler workflow, wiring `web-vitals` for RUM) live in `references/profiling-playbook.md`.
43
43
 
44
+ **Measurement honesty:** static source can identify a *plausible* bottleneck, never a measured LCP/INP/CLS, latency win or byte saving. If runtime/field data is unavailable, label the finding `POTENTIAL`, name the exact trace/benchmark needed, and make no numeric improvement claim. Do not turn code inspection into fictional telemetry.
45
+
46
+ Keep one experiment card per change:
47
+
48
+ ```text
49
+ metric + conditions | baseline distribution | one hypothesis/change | after distribution | keep/revert | next
50
+ ```
51
+
52
+ Use the same device, data volume, cache state, build mode and sampling method before and after. Repeat enough runs to see ordinary variance; a one-off result inside that noise is neutral. Keep a change only when it moves the target beyond the noise without violating another budget. Revert a neutral or worse experiment with a targeted edit and preserve the card — failed attempts prevent the next person from paying for the same guess.
53
+
44
54
  ## CWV "good" thresholds (field p75)
45
55
 
46
56
  | Metric | Good | Needs improvement | Poor |
@@ -210,6 +220,9 @@ Use **streaming SSR with `<Suspense>`** to flush the static shell immediately an
210
220
  | Images/embeds with no reserved space | content reflows on load → CLS | explicit width/height or `aspect-ratio` |
211
221
  | Micro-optimizing a non-bottleneck phase | effort moves a number off the critical path | fix only the phase the trace points at |
212
222
  | "Done" without re-measuring | the fix may not have moved the metric | re-measure against the threshold, then stop |
223
+ | Reporting source-only review as a measured win | no trace/field/benchmark ran, so the number is invented | label POTENTIAL and name the measurement |
224
+ | Changing three levers in one experiment | you cannot attribute the result or reuse the learning | one hypothesis/change per card, then re-measure |
225
+ | Keeping a neutral optimization | complexity rose but the target did not beat normal variance | targeted revert; retain the failed-experiment record |
213
226
 
214
227
  ## Stop rule
215
228
 
@@ -45,3 +45,5 @@ capability:
45
45
  - "Proposes a concrete bundle cut — replace/remove a heavy dep, dynamic import() for non-critical UI, or fix a whole-library import — in payoff order."
46
46
  - "Does NOT blanket-memoize React components (notes React 19 compiler auto-memoizes) and does not guess fixes without the profile."
47
47
  - "Re-measures against the numeric targets (LCP ≤ 2.5s field p75 and a bundle budget) and stops at 'good' rather than gold-plating."
48
+ - "Never reports source inspection as a measured result; without runtime/field data it labels findings POTENTIAL and names the exact trace or benchmark required."
49
+ - "Records baseline conditions and variance, changes one lever, re-measures under the same conditions, and targeted-reverts neutral or worse experiments while preserving the failed-attempt record."
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: simplify-code
3
+ description: "Use when correct working code is unnecessarily hard to read, change or verify and needs behaviour-preserving simplification in a bounded scope. Characterizes the observable contract, removes accidental complexity one concept at a time and proves equivalence. NOT fixing a failure (`debug`), NOT read-only diff judgment (`review`/`code-review`)."
4
+ tags: [code-simplification, refactoring, readability, complexity, behavior-preservation]
5
+ recommends: [code-review, review, verify, debug, performance]
6
+ profiles: [core, full]
7
+ origin: risco
8
+ ---
9
+
10
+ # simplify-code — fewer moving parts, same contract
11
+
12
+ Use this when the code already works and the desired change is easier reasoning, not new behaviour. The output is a smaller or clearer implementation plus proof that callers cannot tell the difference.
13
+
14
+ Default scope is the files or symbols the user named, or the recently changed slice. Expanding into adjacent cleanup requires a concrete dependency and must be stated. Never “clean the whole repository” as a side effect.
15
+
16
+ ## The equivalence loop
17
+
18
+ ```text
19
+ BOUND → CHARACTERIZE → BASELINE → REDUCE → VERIFY → EXPLAIN
20
+ ```
21
+
22
+ ### 1. BOUND the work
23
+
24
+ Record:
25
+
26
+ - target files/symbols and why they are difficult;
27
+ - callers and public interfaces that must remain stable;
28
+ - generated/vendor code and project-marked protected regions to leave alone;
29
+ - performance, ordering, compatibility or serialization constraints;
30
+ - unrelated dirty-worktree changes that belong to someone else.
31
+
32
+ Respect protected regions through repository instructions and explicit comments. Do not hide them by rewriting files on disk, swapping placeholders in and out, or relying on a cleanup hook to restore them later.
33
+
34
+ ### 2. CHARACTERIZE the observable contract
35
+
36
+ Tests are necessary but may be incomplete. Write down what must remain the same:
37
+
38
+ - return values and data shapes;
39
+ - thrown/rejected error types, messages when contractual, and timing;
40
+ - ordering, deduplication and mutation behaviour;
41
+ - I/O, logs, analytics and other side effects;
42
+ - async/concurrency semantics;
43
+ - hot-path allocations or latency when performance is part of the contract.
44
+
45
+ If the behaviour cannot be stated or observed, add characterization tests before refactoring. When the current behaviour is a bug, stop and route to `../debug/SKILL.md`; simplification must not smuggle in a fix.
46
+
47
+ ### 3. BASELINE current evidence
48
+
49
+ Run the narrow tests first and preserve their output. Then run type/lint/build checks appropriate to the slice. For a performance-sensitive path, capture a representative benchmark under named conditions. A baseline proves what “same” means and prevents a cleaner-looking regression.
50
+
51
+ ### 4. REDUCE one source of accidental complexity
52
+
53
+ Prefer changes with a visible reasoning payoff:
54
+
55
+ - remove dead branches, duplicate calculations or needless state;
56
+ - replace nested control flow with guard clauses when ordering stays identical;
57
+ - extract a name for a real concept, not every three lines;
58
+ - collapse pass-through wrappers that enforce no policy;
59
+ - replace clever compact expressions with direct ones;
60
+ - make data flow single-directional and ownership explicit;
61
+ - reuse an existing local abstraction when it is simpler than both copies.
62
+
63
+ Change one concept at a time and inspect the diff. Complexity moved into a new helper, generic abstraction or dependency is not removed. Lines of code are supporting evidence, never the target.
64
+
65
+ Do not redesign a public API, rename unrelated symbols, update formatting across untouched files, add features, change error policy, or create a speculative framework “for future reuse.”
66
+
67
+ ### 5. VERIFY after every coherent step
68
+
69
+ Run the focused characterization tests, then the relevant repository gate. Compare benchmark conditions when applicable; keep a performance claim only when the difference exceeds normal run-to-run noise. Review the diff specifically for contract drift and accidental scope growth.
70
+
71
+ If a step is neutral or worse for understandability, revert **that step only** using a targeted edit. Never use `git reset --hard`, overwrite the working tree, or discard unrelated user changes. Do not commit automatically.
72
+
73
+ ### 6. EXPLAIN the gain
74
+
75
+ Report:
76
+
77
+ - scope simplified;
78
+ - complexity removed, not merely relocated;
79
+ - observable contract preserved;
80
+ - tests/checks/benchmark run and results;
81
+ - anything intentionally left complex and the invariant that justifies it.
82
+
83
+ “Cleaner” is too vague. Prefer: “removed three mutable states and one duplicate parse; preserved error type/message, insertion order and one-read I/O semantics; 18 focused tests plus full typecheck pass.”
84
+
85
+ ## Stop rule
86
+
87
+ Stop when another edit would trade one defensible style for another without lowering the number of states, branches, concepts or proof obligations. Readability has diminishing returns. A bounded, verified improvement is done even if neighbouring legacy code remains ugly.
88
+
89
+ ## Anti-patterns
90
+
91
+ | Smell | Correction |
92
+ |---|---|
93
+ | A failing behaviour is “cleaned up” | Diagnose with `debug`; simplification must not smuggle in a fix. |
94
+ | A read-only review starts editing | Keep verdict work in `review`/`code-review`. |
95
+ | A speed hunch justifies a refactor | `performance` measures first; preserve a benchmark when speed is contractual. |
96
+ | An odd public behaviour is silently normalized | Preserve it until a behaviour change is explicitly authorized. |
97
+ | Cleanup commits, pushes, resets or deploys on its own | These are separate authorized operations; use targeted edits only. |
98
+
99
+ ## Orientación (siempre)
100
+
101
+ Cierra cada turno con el **bloque-brújula** (📍 dónde estás · ✅ qué hiciste · 🧭 por qué · ➡️ siguiente, terminando en pregunta), calibrado al dial de `02-DOCS/wiki/harness/user-profile.md`. **Nunca termines en seco.** Protocolo completo: skill `orient` → `skills/orient/references/orientation-contract.md`. (Defiere a `suggest` el “¿instalo la skill que falta?”.)
@@ -0,0 +1,3 @@
1
+ # Evals — simplify-code
2
+
3
+ The cases distinguish correct-but-complex code from debugging, review, verification, performance and API redesign. The capability case requires an explicit behavioural contract, characterization baseline, one-concept reductions, full evidence and safe worktree handling.
@@ -0,0 +1,42 @@
1
+ skill: simplify-code
2
+
3
+ should_trigger:
4
+ - prompt: "This parser works and its tests are green, but the nested branches are impossible to follow; simplify it without changing behavior."
5
+ why: "Correct code needs bounded behaviour-preserving simplification."
6
+ - prompt: "Simplifica esta función, pero conserva exactamente errores, orden y efectos laterales."
7
+ why: "Spanish request explicitly names observable contract preservation."
8
+ - prompt: "The feature is done; now remove the accidental complexity from only the files we changed."
9
+ why: "Post-feature bounded cleanup is the default scope."
10
+ - prompt: "Fes el codi menys enginyós i més directe, amb tests de caracterització abans de tocar-lo."
11
+ why: "Catalan request for characterization-led simplification."
12
+ - prompt: "Collapse these pass-through wrappers and duplicate state if callers cannot observe a difference."
13
+ why: "Specific removable complexity with an equivalence condition."
14
+ - prompt: "Refactor this hot path for clarity, but keep the benchmark and allocation profile within noise."
15
+ why: "Performance is part of the observable simplification contract."
16
+
17
+ should_not_trigger:
18
+ - prompt: "The parser throws on valid quoted values; reproduce the bug and fix it."
19
+ route_to: debug
20
+ why: "Behaviour is incorrect, so diagnosis precedes any cleanup."
21
+ - prompt: "Review this pull request and list correctness issues, but do not edit it."
22
+ route_to: code-review
23
+ why: "Read-only spec-less diff judgment."
24
+ - prompt: "Verify the finished SDD implementation against every acceptance criterion."
25
+ route_to: verify
26
+ why: "Evidence gate rather than code editing."
27
+ - prompt: "The page is slow; profile Core Web Vitals and fix the measured bottleneck."
28
+ route_to: performance
29
+ why: "Measured speed work owns the task."
30
+ - prompt: "Redesign the public API and migrate all callers to the new contract."
31
+ route_to: api-design
32
+ why: "The requested behaviour/interface change is not simplification."
33
+
34
+ capability:
35
+ - scenario: "Simplify an 80-line configuration parser whose current tests cover the happy path but whose callers depend on comment handling, quoting, numeric conversion, insertion order and ignored malformed lines."
36
+ must_include:
37
+ - "Bounds the target and inspects callers, dirty-worktree state, generated code, and explicit protected regions without mutating files to hide content."
38
+ - "States the observable contract including return shape, ignored input, type conversion, order, errors and side effects."
39
+ - "Adds characterization cases for uncovered contract edges and records a green baseline before refactoring."
40
+ - "Removes one source of complexity at a time without adding features, redesigning public APIs, or relocating complexity into speculative abstractions."
41
+ - "Runs focused tests plus relevant lint/type/build gates after coherent steps and compares a benchmark when performance is contractual."
42
+ - "Uses targeted edits for a bad step and never resets, auto-commits, pushes, deploys, or discards unrelated changes."