Przejdź do treści
Biblioteka skilli
Prawo i compliance · Pisanie

caac

/caac

Pisze i przegląda kontrakty w stylu Contract as a Code: klauzule z identyfikatorami, definicje pojęć, krótkie zdania normatywne i przypadki akceptacji.

Licencja
MIT
Ostatnia zmiana repozytorium
13.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
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 13.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

Pisze i przegląda kontrakty w stylu Contract as a Code: klauzule z identyfikatorami, definicje pojęć, krótkie zdania normatywne i przypadki akceptacji.

Oryginalny opis (EN)

Use when writing or reviewing a contract in the Contract as a Code style: clauses with IDs, defined terms, short normative sentences, acceptance cases, and evidence-based completion. Triggers: contract, clause, CAAC, contract-as-code, contract completion, contract review, write contract, review contract.

Jak działa

  1. When to use
  2. Writing procedure
  3. Tools
  4. References
Sekcje z nagłówków SKILL.md, w oryginale · 142 linii, 697 słów
Podgląd SKILL.md
---
name: "caac"
description: "Use when writing or reviewing a contract in the Contract as a Code style: clauses with IDs, defined terms, short normative sentences, acceptance cases, and evidence-based completion. Triggers: contract, clause, CAAC, contract-as-code, contract completion, contract review, write contract, review contract."
---

# Contract as a Code (CAAC)

CAAC treats a contract as a program. The contract sits above the implementation
harness. A controller repeats contract work until the declared completion gate
passes.

## When to use

- You need to define permitted behavior before implementation starts.
- You need machine-checkable clauses with IDs and acceptance cases.
- You need evidence-based completion, not an LLM assertion.

## Writing procedure

Follow these steps in order. Do not skip steps.

### Step 0: Size the contract

Before writing, estimate the contract scope using T-shirt sizing:

| Size | Scope | Example |
| --- | --- | --- |
| XS | Single function or expression | One validation rule |
| S | One module or class | One data structure with operations |
| M | One service or component | A queue with send/receive/ack |
| L | One application or subsystem | A full agent adapter |
| XL | One system or platform | Multi-agent coordination |

Size determines the minimum contract unit. A size-XS contract needs 3-5 clauses.
A size-XL contract needs 30+ clauses and multiple files. Do not write a
size-XL contract in one file. Split by module.

### Step 1: Define scope and actors

Write a "Scope and exclusions" section. List what is in scope and what is out.
Name the actor (e.g., `Queue`, `BatchProcessor`). State what it does and does not do.

### Step 2: Define terms and inputs

Define every domain term before its first normative use. Each term gets one
meaning. List inputs, outputs, and error types.

Use short sentences (≤20 words for normative clauses). Define "nonblank" and
other predicates explicitly.

### Step 3: Define operation signatures

List each operation with its inputs and outputs:

```
send(envelope) -> SendResult
receive(recipient, lease) -> Delivery or null
```

### Step 4: Write clauses

Each clause occupies one physical line: `ID | sentence`.

Format: `ID | Actor must/must not/may ...`

Rules:
- ID: uppercase letter groups + 3 digits (e.g., `COO-001`, `BATCH-003`).
- One actor, one obligation per clause.
- ≤20 words per sentence.
- No semicolons.
- Use `@ID` to reference another clause.

Example:
```
COO-001 | Queue must commit an ordinary message before returning success.
COO-002 | Queue must assign id and created_at_ms after accepting an envelope.
```

### Step 5: Define state transitions (if applicable)

List states and transitions. Each transition gets a clause ID.

### Step 6: Write acceptance cases

Create a table: Case | Input | Expected result | Clauses.

Each case must reference at least one clause. Cover branches, boundaries, and
failures.

### Step 7: Run syntax check

```sh
caac check <contract-file>
```

Fix all findings. Repeat until `PASS` (syntax only, semantic review pending).

### Step 8: Resolve open decisions

Find `OPEN:` lines. For each, either:
- Replace with a `DECISION:` line recording the answer.
- Or use `caac interview <file>` to prompt for answers.

```sh
caac interview <contract-file>
```

### Step 9: Review

Review the contract without inferring meaning from implementation code. Record
findings. Fix them. Repeat.

Use `caac watch <file>` to re-check on every save.

### Step 10: Completion gate

A contract is complete only when:
- All clauses have acceptance cases.
- All cases have recorded results.
- No open decisions block a required clause.
- An independent reviewer accepted the exact revision.
- Owner acceptance is recorded (when required).

An LLM statement alone does not establish completion.

## Tools

- `caac check <files>`: declared syntax checks. Reports duplicate IDs, unknown
  references, malformed clauses, word-count violations, open decisions, and files
  without clauses. Exit 0 on success, 1 on findings, 2 on input errors.
- `caac scratch <dir> --title "..."`: create a draft contract scaffold.
- `caac plugin <dir> --title "..." --source <file>`: create a plugin contract
  from source observations.
- `caac migration <dir> --title "..." --source <file>`: create a migration
  contract from source.
- `caac interview <file>`: walk through open decisions, prompt for answers.
- `caac resume <file>`: continue a previous interview.
- `caac watch <files>`: re-run checks on file changes.

## References

- [CONTRACT.md](../../../CONTRACT.md): method rules (CAAC-001 through CAAC-039).
- [contracts/tooling.md](../../../contracts/tooling.md): CLI and checker rules.
- [examples/batch-division.md](../../../examples/batch-division.md): complete example.
- [docs/quickstart.md](../../../docs/quickstart.md): five-minute guide.

Wersje

W bazie nie ma innych skilli o nazwie caac.

Migawka bazy z 13.11.2026 · wersja paczki c9621b295609 (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

  • 100law-contract
    Analizuje podstawy umów: wymogi zawarcia (oferta, przyjęcie, świadczenie wzajemne), kluczowe klauzule i typowe obszary ryzyka, przy przeglądzie umowy i szukaniu ryzykownych zapisów.
  • 90brief-review
    Recenzuje umowę i nanosi poprawki, wskazując ryzyka, brakujące klauzule i jednostronne warunki.
  • 100contract-review
    Przegląda umowę punkt po punkcie, sprawdza podstawowe elementy, oznacza ryzykowne lub brakujące zapisy i przygotowuje pytania dla prawnika.
  • 96review-contract
    Przegląda umowę zapisaną w GitLaw, znajduje kluczowe i ryzykowne klauzule i dodaje komentarze tam, gdzie trzeba.
  • 100contract-review
    Przegląda umowę klauzula po klauzuli z perspektywy jednej strony (kupującego, sprzedawcy, dostawcy lub licencjobiorcy) i ocenia, czy dany zapis stanowi problem.
  • 100ops-contract-review
    Przegląda umowy biznesowe pod kątem ryzyka: klauzule odpowiedzialności, własność IP, warunki rozwiązania i płatności, przy umowach z dostawcami, partnerskich i o usługi.

Uwagi i zgłoszenia

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