docs(framework): write the hook contract in docs/ARCHITECTURE.md

Offen Anfängerfreundlich
#1,197 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
78/100
Issue-Typ
Dokumentation
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
typescript
Bereich
documentation

Rechercherichtung

Lies die Regeln 5 und 7 in docs/ARCHITECTURE.md und suche dann den Verweis auf 08-hook-generate sowie den früheren Hook-Vertrag in PR #1158. Füge den angeforderten Vertragsabschnitt hinzu und stimme diese Regeln darauf ab; die Kompatibilitätstabelle pro Tool liegt außerhalb des Umfangs. Die Aufgabe ist abgeschlossen, wenn alle drei Abnahmekriterien erfüllt sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Problem

Hooks the framework ships must behave the same on every supported tool. The contract lives in PR #1158 and in session notes, not in one place a hook author or the hook generator can follow. Two hooks written without it already disagree (#1190).

Scope

Add a short section to docs/ARCHITECTURE.md:

  • A hook is a script: deterministic, no model, no network, 5 s timeout, one purpose.
  • Two reactions: inform (additionalContext) or require (decision: "block" with a reason). Say nothing when there is nothing to report.
  • Shared moments: SessionStart, PostToolUse, Stop. Optional where the tool has them: PreToolUse, UserPromptSubmit, SubagentStop.
  • Rules: judge only what changed this turn (sha1 baseline of the relevant files, not a tool-name filter); report only new findings; require nothing that cannot be done yet; require at most once per turn, tracked in the script; neutral message that says what to do; git read-only; no state outside the script's own baseline file.
  • Scope statement: hooks a user generates for one tool with 08-hook-generate are not bound by this contract.

Per-tool facts go to COMPATIBILITY.md (#978), not here.

Acceptance criteria
  • The section exists in docs/ARCHITECTURE.md.
  • 08-hook-generate references it.
  • Rules 5 and 7 of ARCHITECTURE.md are consistent with it.
Prior art in this repo
  • #1158 (one hook contract), #1146 (git allowed read-only), #1190 (plan check false positives), #978 (verified compatibility).
Out of scope

The per-tool table (#978). Bridge fixes (#1191, #1193, #1194).

Vorherrschende Sprache
TypeScript
Sterne
481
Forks
45
Ø Merge
1 T. 13 Std.
Gemergte PRs (30 T.)
91

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus ai-driven-dev/framework

Alle Issues in ai-driven-dev/framework

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.