Przejdź do treści
Biblioteka skilli
AI i agenci · Przegląd i audyt

examples-are-not-rules

/examples-are-not-rules

Nie pozwala agentowi zamieniać przykładu użytkownika w regułę, co prowadzi do kodu zaszytego pod konkretne typy obiektów.

Licencja
MIT
Ostatnia zmiana repozytorium
10.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
3
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 10.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Nie pozwala agentowi zamieniać przykładu użytkownika w regułę, co prowadzi do kodu zaszytego pod konkretne typy obiektów.

Wyzwalacze z opisu

s example into a ruleclick a person and follow themdonnot just for X
Oryginalny opis (EN)

Stops an agent from turning the user's example into a rule's subject, which leads to code that hardcodes by kind (this is about special-casing, not secrets in source). Use when turning user requests into specs, acceptance criteria, or task contracts; when implementing a rule the user explained with an example ("click a person and follow them"); when handing implementation to another agent; and when reviewing code or diffs for kind/type/role/species/action-name checks that should be capability checks. Always use it when the user says "don't hardcode", "not just for X", "this should work for oth

Jak działa

  1. 1. Writing a rule: subject first
  2. 2. The second example
  3. 3. Two kinds of concreteness: where "don't over-engineer" fits
  4. 4. Code review: find branches on kind
  5. 5. Handing off to another agent
  6. Self-check
Sekcje z nagłówków SKILL.md, w oryginale · 126 linii, 2 360 słów
Podgląd SKILL.md
---
name: examples-are-not-rules
description: Stops an agent from turning the user's example into a rule's subject, which leads to code that hardcodes by kind (this is about special-casing, not secrets in source). Use when turning user requests into specs, acceptance criteria, or task contracts; when implementing a rule the user explained with an example ("click a person and follow them"); when handing implementation to another agent; and when reviewing code or diffs for kind/type/role/species/action-name checks that should be capability checks. Always use it when the user says "don't hardcode", "not just for X", "this should work for other things later", "simulate everything", "make it generic", or complains that a feature only works for the one case they mentioned.
---

# Examples are not rules

When the user says "click a person and my character should follow them", "person" is the rule's first example, not its subject. The subject is whatever has the properties the rule actually reads: anything that has a position, whose position can change, and that can be seen.

Once an example becomes the subject, every later step amplifies it faithfully. The spec says "person", the contract says "follow the person", the tests only cover people, and the code reads a person's body. Each step is reasonable on its own; together they produce a feature that only works for people. A line like "don't hardcode" doesn't prevent this, because nobody can check whether it was followed. This skill replaces it with things you can check: the rule's subject, a second example, the line between the two kinds of concreteness, and a review pass for kind-based branches.

## 1. Writing a rule: subject first

Write these lines for every rule before any details, and before any code. Put them in the spec or contract if you're writing one; otherwise put them in your reply to the user. They exist so the user can correct the subject while it is still one line. If the rule has no example noun in it (say, "log every playtest session"), one line, "Subject: no example", is enough.

```
Rule: <one sentence>
Subject: <a class of things>; decided by: <which capability or property it needs>
First example: <the one the user gave>
Second example: <a different kind with the same capabilities>
Doesn't apply to: <things lacking a capability, stated as the capability> (optional)
```

Finding the subject:
- The user's words often already contain the class, right before "for example" or "like". In "if I click something interactable, like another person", the subject is "something interactable". The class and the example may be in different messages, so read the whole conversation.
- If you proposed the design and the user just said "ok", the nouns in it are still yours. They are not a subject the user chose, so run this step on them too.
- If the user gave only an example, ask: which properties of the example does the rule actually read? Following reads "position" and "can be seen", so the subject is everything that has a position and can be seen. The properties the rule uses define the subject, not the example's kind.
- A class name can be too narrow as well. "Creature" means "has a body and a mind", but following only needs position and visibility. Whatever the name demands beyond what the rule reads is the range of things you'll wrongly exclude.
- When you turn an open-ended phrase from the user ("if something gets in the way") into a list, write the list items as capabilities ("out of reach", "can't see it", "no path"), not as states of one kind of thing ("target died" also excludes a corpse being dragged away).
- Check: swap the first example for the second in the rule's sentence. If it still reads true, the subject is right.
- If you're not sure the user wants the whole class, ask once: give your proposed subject and 2-3 candidate second examples to pick from (does "follow" include a dog? a car?), not an open question. Don't silently narrow it to the example, and don't silently widen it to "everything".
- If you can't ask (the user is away, or you're running unattended), take the subject the rule's properties support, carry on, and state the subject and second example in your report so the user can correct them.

A capability is a fact the rule reads directly (can hear, has a position, has export permission). A kind is a name (person, admin, Safari, `run`). Checking the kind assumes the name will always come bundled with those capabilities. Web developers learned this the hard way: browser sniffing by User-Agent breaks; feature detection doesn't.

## 2. The second example

- Who picks it: whoever writes the spec, never whoever implements it. An implementer that picks its own second example picks one it already passes. Propose it yourself and write it next to the subject; only bring the user in when the subject is a real design decision (section 1), not on every rule.
- When you are both, which is the usual case for one agent working alone, the order does the job the separation would. Fix the second example in writing before you read or write the implementation, and don't change it afterwards. If it turns out to be the wrong example, say so and say why; don't swap in one that passes.
- How to pick it: it has every capability the rule reads, but differs from the first example in kind, data shape, or where its data lives. The more shortcuts it breaks, the better. If the target is "a person", pick "an item carried by a person": it has no position of its own, its position comes from whoever is holding it, and a person-only implementation fails immediately.
- Acceptance: every rule has at least one test that exercises the behavior with the second example. An implementation that only passes with the first example is not done. Tests that regex-match the source code don't count.
- Same code path: the second example must go through the same code as the first. Adding a separate branch for it just hardcodes two examples instead of one.
- No second example exists in the system yet: use the cheapest stand-in available, such as a test fixture that carries only the capability fields the rule needs. Don't build the future feature just to have something to test.
- Optionally add a negative example: something missing a capability should be rejected, and the failure reason should name the capability ("can't hear"), not the kind ("not a person").

## 3. Two kinds of concreteness: where "don't over-engineer" fits

Hardcoding and over-engineering look like opposite failure modes, but they govern different things:

| | Rules the user stated | Places nobody mentioned |
|---|---|---|
| Subject | Implement for the class; accept with the second example | Write for today's need; concrete is fine |
| Mechanism | Least code possible | Least code possible; YAGNI |

- Implementing a stated rule for its whole class is the requirement, not scope creep. "Minimal change" constrains the mechanism, not the subject.
- Implementing for the class usually needs no new abstraction, just a different field to read: read the `senses` component instead of `species`; call `can(user, 'export')` instead of checking `role === 'admin'`. If going class-wide seems to require a registry, plugin system, or interface hierarchy, stop. Either the data is missing the fact the rule needs to read (add the data, not a framework), or this rule doesn't actually need to generalize (ask).
- The second example is also the upper bound on scope. Once two examples work through the same path, stop. Don't write code for an imagined third.
- World-level statements like "simulate everything" or "support multi-tenancy" tell you which direction rules generalize in. They don't license generalizing everything. They only take effect when they reach each rule's subject: one sentence of vision at the top of a doc loses to one concrete noun inside a rule.

## 4. Code review: find branches on kind

"Kind" here means more than entity type. It includes the names of actions, items, events, roles, and gaits.

**Step 1: trace the data, starting from the rule.** For each rule the user stated, find the code that implements it and list every fact it reads:
- Where is it read from? If it reads data only one kind of thing has, that's a finding. Example: visibility reads `body.heightCells`, when shape should be something any entity can have.
- Who writes it? A capability field that no production code writes, and only tests set, means everything runs on the default value. That's a finding, not a footnote.
- Is one capability decided by two different facts? Example: "can it be eaten" checks `category === 'food'`, while "how much does eating restore" reads `nutrition`. Anything with nutrition but a different category will fall through the gap between them.

Grep can't catch this class of problem, which is why this step comes first. If the spec itself lists kinds ("click a person, an item, or furniture"), code that follows it is being faithful. The problem is in the spec; go back to section 1.

**Step 2: grep for candidates.** On a diff small enough to read, reading is enough; these are for code too large to read. The same patterns work with `grep -rnE` if `rg` isn't available.

```bash
# Comparing against a name: a string literal or an enum member
rg -n "(===|!==|==|!=)\s*(['\"]|[A-Z]\w*\.[A-Z])" <dirs>
rg -n "instanceof |isinstance\(|case\s+(['\"]|[A-Z]\w*\.)" <dirs>
# Lists of names, and membership tests against them
rg -n "[\[(]\s*['\"]\w+['\"]\s*,\s*['\"]|\.includes\(|\bin\s+[\[(]" <dirs>
# Kind decided by string prefix
rg -n "starts[Ww]ith\(['\"]|split\(['\"]:['\"]\)" <dirs>
# The spec's example nouns, as literals or inside function, parameter, or field names
rg -n -i "<example1>|<example2>" <dirs>
```

If the first pattern returns too much, narrow it to the fields that hold kinds in this codebase (`kind`, `type`, `role`, `plan`, and so on). If an example noun is also a language keyword (`export`, `type`), search for it quoted or as part of an identifier.

**Step 3: ask one question of every candidate: is this branching on what it is, or on what it can do?**

- Branching on what it can do: fine.
- Dispatch by kind at the definition site: fine. Each kind's own behavior lives in a table or switch keyed by kind, such as message handlers, a closed protocol enum, or a species table that yields capabilities. Display names and sprites also count. The right shape is: kind → data table → capability → rule.
- An exception the user stated by name: fine wherever it sits. If the spec says "an email blast must never be retried", a check for `email_blast` at the retry site is the rule as written. If the user also gave a reason and the reason reads like a capability ("a retry could send it twice"), say in your report that other kinds may share it, and leave the widening to the user.
- Kind check at a query site: this is the bug. Logic somewhere else holds a list of names and asks "is it one of these?" to decide a shared property: can it be resumed, does it count as work, is it moving, should it run. When a new kind shows up, nobody remembers to update that list. The property belongs in the kind's own data, such as `resumable: true` in the action table or a speed in the gait table. Generating options by capability and then, at execution time, only handling one of the names also falls in this bucket.
- Telling definition sites from query sites: the definition site is the kind's own definition, meaning its data row and its handler. A list of names outside the kind's definition is a query site, even if it's a named constant (`WORK_ACTIONS`). If the same list appears twice with different contents, someone has already forgotten to update one.
- Names the data format requires every member to have (say, every body must have `walk`) are safe to rely on. Names only some members have (`run`) must not be assumed present.

Report each real problem like this:

```
Location: file:line
Rule: which rule (quote the spec)
Second example: what would fail here, and how
Should read: which capability field or query, and which layer owns it
Confidence: confirmed / needs checking (say what evidence is missing)
```

When the spec names no second example, supply one for that line yourself. A reviewer is not the implementer, so the objection in section 2 doesn't apply.

Check the tests too: if a rule's tests only use the first example, the missing second-example test is itself a finding.

## 5. Handing off to another agent

The receiving agent only sees the contract, and each handoff loses a little more of the "why" from the layer above. Every rule in the contract needs the items below, even if the contract links to a design doc, because the receiver will build from the contract:

- The subject and what decides it;
- The first example, the second example, and the test for the second example. The second example is fixed: the receiver may not swap it or pick its own;
- A failure condition: "An implementation that only works for <first example> is rejected";
- Names that follow the subject, not the example (`perceivedEntity`, not `perceivedPerson`);
- A requirement that the report back lists every kind-based branch in the new code and why each one is fine.

The items most often missed are the failure condition and the test list. The subject gets written correctly, but the failure condition says "when following a person, walks to the old tile" and the browser test says "follow a walking person", and the receiver still builds a person-only feature.

If you're the receiver and a rule in the contract has an example but no subject: point it out before writing code, or fill it in using this section and state in your report which subject you added. If it has no second example, send it back and ask for one before writing code. Don't invent one: you'd pick one you already pass. (Contract says "only admins can delete" with no second example? Ask whether an editor should; don't decide that `role === 'admin'` is the rule.)

## Self-check

- Does every rule have a subject, what decides it, and a second example that was fixed before the implementation was written?
- Does the second example have a test, and does it run through the same code as the first?
- Is there any new abstraction that wasn't needed to make the second example pass? If so, delete it.
- Has every kind branch in the new code been asked "what it is, or what it can do?"
Pliki w paczce (3)
  • LICENSE 1 KB
  • README.md 2 KB
  • SKILL.md 14 KB

Wersje

W bazie nie ma innych skilli o nazwie examples-are-not-rules.

Migawka bazy z 13.11.2026 · wersja paczki d6d67a0b8a3c (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 95example-playbook
    Prowadzi budowniczego AgentWorks przy tworzeniu wielokrotnego użytku przykładu zdolności albo naprawie jego workflow.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.