You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,3 +52,7 @@ When creating or updating a pull request, you **must** follow the PR template in
52
52
- Do not leave HTML comments from the template in the final description — replace them with actual content.
53
53
- PR descriptions must be accurate and valuable to reviewers. Generic or boilerplate descriptions waste reviewer time.
54
54
- Review all commits on the branch (not just the latest) when writing the summary.
55
+
56
+
## KiloClaw Billing
57
+
58
+
Before making **any** changes related to KiloClaw billing — including bug fixes, new features, refactors, or reviews — you **must** first read the billing spec at `.specs/kiloclaw-billing.md`. This applies to all code paths that touch billing logic, pricing, invoicing, usage metering, or payment flows.
Copy file name to clipboardExpand all lines: cloudflare-gastown/AGENTS.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,37 @@
8
8
## Durable Objects
9
9
10
10
- Each DO module must export a `get{ClassName}Stub` helper function (e.g. `getRigDOStub`) that centralizes how that DO namespace creates instances. Callers should use this helper instead of accessing the namespace binding directly.
11
+
-**Sub-modules for large DOs**: When a Durable Object grows beyond a few hundred lines, extract domain logic into sub-modules under a `<do-name>/` directory alongside the DO file. For example, `Town.do.ts` delegates to modules in `town/`:
12
+
13
+
```
14
+
dos/
15
+
Town.do.ts # Class definition, RPC methods, alarm loop
16
+
town/
17
+
agents.ts # Agent CRUD, hook management
18
+
beads.ts # Bead CRUD, convoy progress
19
+
scheduling.ts # Agent dispatch, pending work scheduling
Each sub-module exports plain functions (not classes) that accept `SqlStorage` and any other required context as arguments. The DO imports them with the `import * as X` pattern:
This keeps the DO class thin (RPC surface + orchestration) while sub-modules own the business logic. The `import * as X` pattern makes call sites self-documenting — you can always tell which domain a function belongs to.
0 commit comments