cerber-core 1.1.1 → 1.1.2

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.
@@ -1,347 +1,347 @@
1
- # Cerber TEAM Integration Example
2
-
3
- This example shows how to integrate Cerber TEAM with Guardian, Cerber 2.1, and SOLO for complete workflow automation.
4
-
5
- ## Overview
6
-
7
- **Cerber TEAM** adds module system and focus mode to the proven Guardian + Cerber 2.1 + SOLO foundation.
8
-
9
- ```
10
- Guardian 1.0 (Pre-commit) + Cerber 2.1 (Runtime) + SOLO (Automation) + TEAM (Modules)
11
- ```
12
-
13
- ## Installation
14
-
15
- ```bash
16
- npm install cerber-core --save-dev
17
- ```
18
-
19
- ## Directory Structure
20
-
21
- ```
22
- your-project/
23
- ├── .cerber/ # TEAM structure
24
- │ ├── BIBLE.md # Master project map
25
- │ ├── CERBER_LAW.md # Team rules (optional)
26
- │ ├── modules/ # Module definitions
27
- │ │ ├── pricing-engine/
28
- │ │ │ ├── MODULE.md
29
- │ │ │ ├── contract.json
30
- │ │ │ └── dependencies.json
31
- │ │ └── booking-calendar/
32
- │ │ ├── MODULE.md
33
- │ │ ├── contract.json
34
- │ │ └── dependencies.json
35
- │ └── connections/
36
- │ └── contracts/ # Connection contracts
37
- │ └── pricing-to-booking.json
38
-
39
- ├── src/ # Actual source code
40
- │ └── modules/
41
- │ ├── pricing-engine/
42
- │ │ └── index.ts
43
- │ └── booking-calendar/
44
- │ └── index.ts
45
-
46
- ├── package.json # Scripts (see below)
47
- └── README.md
48
- ```
49
-
50
- ## Setup
51
-
52
- ### 1. Initialize TEAM
53
-
54
- ```bash
55
- # Create structure
56
- mkdir -p .cerber/modules
57
- mkdir -p .cerber/connections/contracts
58
-
59
- # Copy BIBLE template
60
- cp node_modules/cerber-core/team/templates/BIBLE_TEMPLATE.md .cerber/BIBLE.md
61
-
62
- # Edit BIBLE.md to describe your project
63
- ```
64
-
65
- ### 2. Add Scripts to package.json
66
-
67
- See the included `package.json` for complete script setup.
68
-
69
- ```json
70
- {
71
- "scripts": {
72
- "cerber:morning": "bash node_modules/cerber-core/team/scripts/cerber-team-morning.sh",
73
- "cerber:add-module": "bash node_modules/cerber-core/team/scripts/cerber-add-module.sh",
74
- "cerber:focus": "bash node_modules/cerber-core/team/scripts/cerber-focus.sh",
75
- "cerber:check-module": "bash node_modules/cerber-core/team/scripts/cerber-module-check.sh",
76
- "cerber:check-connections": "bash node_modules/cerber-core/team/scripts/cerber-connections-check.sh"
77
- }
78
- }
79
- ```
80
-
81
- ### 3. Create First Module
82
-
83
- ```bash
84
- npm run cerber:add-module my-first-module
85
- ```
86
-
87
- ## Daily Workflow
88
-
89
- ### Morning Routine
90
-
91
- ```bash
92
- # Start day with dashboard
93
- npm run cerber:morning
94
-
95
- # Shows:
96
- # - All modules and health
97
- # - Connection contracts status
98
- # - Recent activity
99
- # - Today's focus
100
- ```
101
-
102
- ### Working on Module
103
-
104
- ```bash
105
- # 1. Enter focus mode
106
- npm run cerber:focus my-module
107
-
108
- # 2. View focus context (500 LOC vs 10,000 LOC)
109
- cat .cerber/FOCUS_CONTEXT.md
110
-
111
- # 3. Share FOCUS_CONTEXT.md with AI
112
- # "Here's the context for my-module. Please implement..."
113
- # AI processes 10x faster with focused context
114
-
115
- # 4. Make changes
116
- # [code changes]
117
-
118
- # 5. Validate module
119
- npm run cerber:check-module my-module
120
-
121
- # 6. Validate connections
122
- npm run cerber:check-connections
123
-
124
- # 7. Commit (Guardian validates)
125
- git commit -m "feat(my-module): add feature"
126
- ```
127
-
128
- ### Creating New Module
129
-
130
- ```bash
131
- # 1. Create module
132
- npm run cerber:add-module payment-gateway
133
-
134
- # 2. Edit documentation
135
- nano .cerber/modules/payment-gateway/MODULE.md
136
- nano .cerber/modules/payment-gateway/contract.json
137
- nano .cerber/modules/payment-gateway/dependencies.json
138
-
139
- # 3. Enter focus mode
140
- npm run cerber:focus payment-gateway
141
-
142
- # 4. Implement module
143
- # [code in src/modules/payment-gateway/]
144
-
145
- # 5. Validate
146
- npm run cerber:check-module payment-gateway
147
- npm run cerber:check-connections
148
- ```
149
-
150
- ### Creating Connection Contract
151
-
152
- ```bash
153
- # 1. Copy template
154
- cp node_modules/cerber-core/team/templates/CONNECTION_TEMPLATE.json \
155
- .cerber/connections/contracts/module-a-to-module-b.json
156
-
157
- # 2. Edit contract
158
- nano .cerber/connections/contracts/module-a-to-module-b.json
159
-
160
- # 3. Validate
161
- npm run cerber:check-connections
162
- ```
163
-
164
- ## Full Integration
165
-
166
- ### With Guardian (Pre-commit)
167
-
168
- ```bash
169
- # .husky/pre-commit
170
- #!/bin/sh
171
-
172
- # Guardian validates architecture
173
- node scripts/validate-schema.mjs
174
-
175
- # TEAM validates modules (optional)
176
- bash node_modules/cerber-core/team/scripts/cerber-connections-check.sh
177
- ```
178
-
179
- ### With Cerber 2.1 (Runtime)
180
-
181
- ```typescript
182
- // server.ts
183
- import { createHealthEndpoint } from 'cerber-core';
184
-
185
- const healthChecks = {
186
- 'pricing-engine': async () => {
187
- // Check module health
188
- return [];
189
- },
190
- 'booking-calendar': async () => {
191
- // Check module health
192
- return [];
193
- }
194
- };
195
-
196
- app.get('/api/health', createHealthEndpoint(healthChecks));
197
- ```
198
-
199
- ### With SOLO (Automation)
200
-
201
- ```json
202
- {
203
- "scripts": {
204
- "cerber:morning": "bash team/scripts/cerber-team-morning.sh && node solo/scripts/cerber-dashboard.js",
205
- "cerber:pre-push": "npm run cerber:check-connections && npm run cerber:deps && npm run cerber:docs"
206
- }
207
- }
208
- ```
209
-
210
- ## Complete Workflow Example
211
-
212
- ```bash
213
- # Morning (5 min)
214
- npm run cerber:morning # TEAM + SOLO dashboard
215
-
216
- # Create feature in new module (10 min)
217
- npm run cerber:add-module notifications
218
- nano .cerber/modules/notifications/MODULE.md
219
- nano .cerber/modules/notifications/contract.json
220
-
221
- # Work on module (focused!)
222
- npm run cerber:focus notifications
223
- cat .cerber/FOCUS_CONTEXT.md # Share with AI
224
- # [AI implements 10x faster with 500 LOC context]
225
-
226
- # Validate (5 sec)
227
- npm run cerber:check-module notifications
228
- npm run cerber:check-connections
229
-
230
- # Commit (Guardian validates)
231
- git commit -m "feat(notifications): add email notifications"
232
-
233
- # Pre-push checks
234
- npm run cerber:pre-push # SOLO automation
235
-
236
- # Deploy
237
- git push
238
- # CI/CD pipeline runs
239
- # Deployment succeeds
240
-
241
- # Validate production
242
- curl https://api.example.com/api/health # Cerber 2.1 checks
243
- ```
244
-
245
- ## Benefits
246
-
247
- **Before TEAM:**
248
- - AI needs entire 10,000 LOC codebase → 60 second responses
249
- - Unclear module boundaries
250
- - Hidden dependencies between components
251
- - Documentation drifts from code
252
-
253
- **After TEAM:**
254
- - AI gets focused 500 LOC context → 6 second responses (10x faster ⚡)
255
- - Clear module boundaries with validation
256
- - Explicit connection contracts
257
- - Living documentation that can't drift
258
-
259
- ## Scripts Breakdown
260
-
261
- ### Morning Dashboard
262
- ```bash
263
- npm run cerber:morning
264
- ```
265
- Shows module health, connections status, recent activity
266
-
267
- ### Focus Mode (⭐ Most Important)
268
- ```bash
269
- npm run cerber:focus <module-name>
270
- ```
271
- Generates 500 LOC context file for 10x faster AI
272
-
273
- ### Module Validation
274
- ```bash
275
- npm run cerber:check-module <module-name>
276
- ```
277
- Validates MODULE.md, contract.json, dependencies.json
278
-
279
- ### Connection Validation
280
- ```bash
281
- npm run cerber:check-connections
282
- ```
283
- Validates all connection contracts
284
-
285
- ### Add Module
286
- ```bash
287
- npm run cerber:add-module <module-name>
288
- ```
289
- Creates new module from template
290
-
291
- ## Tips
292
-
293
- 1. **Always use focus mode** before working on a module
294
- 2. **Share FOCUS_CONTEXT.md with AI** instead of entire codebase
295
- 3. **Validate before committing** to catch issues early
296
- 4. **Start day with morning dashboard** to see what needs attention
297
- 5. **Update BIBLE.md** when adding major modules
298
- 6. **Version connection contracts** to track breaking changes
299
-
300
- ## Troubleshooting
301
-
302
- ### Module validation fails
303
-
304
- Check that MODULE.md has required sections:
305
- - Purpose
306
- - Responsibilities
307
- - Public Interface
308
- - Dependencies
309
-
310
- Validate JSON files:
311
- ```bash
312
- python3 -m json.tool .cerber/modules/my-module/contract.json
313
- ```
314
-
315
- ### Focus mode fails
316
-
317
- Ensure module exists:
318
- ```bash
319
- ls .cerber/modules/
320
- ```
321
-
322
- Create module if missing:
323
- ```bash
324
- npm run cerber:add-module my-module
325
- ```
326
-
327
- ### Connection check fails
328
-
329
- Validate JSON syntax:
330
- ```bash
331
- python3 -m json.tool .cerber/connections/contracts/my-contract.json
332
- ```
333
-
334
- Ensure referenced modules exist:
335
- ```bash
336
- ls .cerber/modules/
337
- ```
338
-
339
- ## Documentation
340
-
341
- - **Full TEAM docs:** `node_modules/cerber-core/docs/TEAM.md`
342
- - **Quick start:** `node_modules/cerber-core/team/README.md`
343
- - **Example project:** `node_modules/cerber-core/.cerber-example/`
344
-
345
- ## License
346
-
347
- MIT © 2026 Stefan Pitek
1
+ # Cerber TEAM Integration Example
2
+
3
+ This example shows how to integrate Cerber TEAM with Guardian, Cerber 2.1, and SOLO for complete workflow automation.
4
+
5
+ ## Overview
6
+
7
+ **Cerber TEAM** adds module system and focus mode to the proven Guardian + Cerber 2.1 + SOLO foundation.
8
+
9
+ ```
10
+ Guardian 1.0 (Pre-commit) + Cerber 2.1 (Runtime) + SOLO (Automation) + TEAM (Modules)
11
+ ```
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ npm install cerber-core --save-dev
17
+ ```
18
+
19
+ ## Directory Structure
20
+
21
+ ```
22
+ your-project/
23
+ ├── .cerber/ # TEAM structure
24
+ │ ├── CERBER.md # Master project map
25
+ │ ├── CERBER_LAW.md # Team rules (optional)
26
+ │ ├── modules/ # Module definitions
27
+ │ │ ├── pricing-engine/
28
+ │ │ │ ├── MODULE.md
29
+ │ │ │ ├── contract.json
30
+ │ │ │ └── dependencies.json
31
+ │ │ └── booking-calendar/
32
+ │ │ ├── MODULE.md
33
+ │ │ ├── contract.json
34
+ │ │ └── dependencies.json
35
+ │ └── connections/
36
+ │ └── contracts/ # Connection contracts
37
+ │ └── pricing-to-booking.json
38
+
39
+ ├── src/ # Actual source code
40
+ │ └── modules/
41
+ │ ├── pricing-engine/
42
+ │ │ └── index.ts
43
+ │ └── booking-calendar/
44
+ │ └── index.ts
45
+
46
+ ├── package.json # Scripts (see below)
47
+ └── README.md
48
+ ```
49
+
50
+ ## Setup
51
+
52
+ ### 1. Initialize TEAM
53
+
54
+ ```bash
55
+ # Create structure
56
+ mkdir -p .cerber/modules
57
+ mkdir -p .cerber/connections/contracts
58
+
59
+ # Copy CERBER template
60
+ cp node_modules/cerber-core/team/templates/CERBER_TEMPLATE.md .cerber/CERBER.md
61
+
62
+ # Edit CERBER.md to describe your project
63
+ ```
64
+
65
+ ### 2. Add Scripts to package.json
66
+
67
+ See the included `package.json` for complete script setup.
68
+
69
+ ```json
70
+ {
71
+ "scripts": {
72
+ "cerber:morning": "bash node_modules/cerber-core/team/scripts/cerber-team-morning.sh",
73
+ "cerber:add-module": "bash node_modules/cerber-core/team/scripts/cerber-add-module.sh",
74
+ "cerber:focus": "bash node_modules/cerber-core/team/scripts/cerber-focus.sh",
75
+ "cerber:check-module": "bash node_modules/cerber-core/team/scripts/cerber-module-check.sh",
76
+ "cerber:check-connections": "bash node_modules/cerber-core/team/scripts/cerber-connections-check.sh"
77
+ }
78
+ }
79
+ ```
80
+
81
+ ### 3. Create First Module
82
+
83
+ ```bash
84
+ npm run cerber:add-module my-first-module
85
+ ```
86
+
87
+ ## Daily Workflow
88
+
89
+ ### Morning Routine
90
+
91
+ ```bash
92
+ # Start day with dashboard
93
+ npm run cerber:morning
94
+
95
+ # Shows:
96
+ # - All modules and health
97
+ # - Connection contracts status
98
+ # - Recent activity
99
+ # - Today's focus
100
+ ```
101
+
102
+ ### Working on Module
103
+
104
+ ```bash
105
+ # 1. Enter focus mode
106
+ npm run cerber:focus my-module
107
+
108
+ # 2. View focus context (500 LOC vs 10,000 LOC)
109
+ cat .cerber/FOCUS_CONTEXT.md
110
+
111
+ # 3. Share FOCUS_CONTEXT.md with AI
112
+ # "Here's the context for my-module. Please implement..."
113
+ # AI processes 10x faster with focused context
114
+
115
+ # 4. Make changes
116
+ # [code changes]
117
+
118
+ # 5. Validate module
119
+ npm run cerber:check-module my-module
120
+
121
+ # 6. Validate connections
122
+ npm run cerber:check-connections
123
+
124
+ # 7. Commit (Guardian validates)
125
+ git commit -m "feat(my-module): add feature"
126
+ ```
127
+
128
+ ### Creating New Module
129
+
130
+ ```bash
131
+ # 1. Create module
132
+ npm run cerber:add-module payment-gateway
133
+
134
+ # 2. Edit documentation
135
+ nano .cerber/modules/payment-gateway/MODULE.md
136
+ nano .cerber/modules/payment-gateway/contract.json
137
+ nano .cerber/modules/payment-gateway/dependencies.json
138
+
139
+ # 3. Enter focus mode
140
+ npm run cerber:focus payment-gateway
141
+
142
+ # 4. Implement module
143
+ # [code in src/modules/payment-gateway/]
144
+
145
+ # 5. Validate
146
+ npm run cerber:check-module payment-gateway
147
+ npm run cerber:check-connections
148
+ ```
149
+
150
+ ### Creating Connection Contract
151
+
152
+ ```bash
153
+ # 1. Copy template
154
+ cp node_modules/cerber-core/team/templates/CONNECTION_TEMPLATE.json \
155
+ .cerber/connections/contracts/module-a-to-module-b.json
156
+
157
+ # 2. Edit contract
158
+ nano .cerber/connections/contracts/module-a-to-module-b.json
159
+
160
+ # 3. Validate
161
+ npm run cerber:check-connections
162
+ ```
163
+
164
+ ## Full Integration
165
+
166
+ ### With Guardian (Pre-commit)
167
+
168
+ ```bash
169
+ # .husky/pre-commit
170
+ #!/bin/sh
171
+
172
+ # Guardian validates architecture
173
+ node scripts/validate-schema.mjs
174
+
175
+ # TEAM validates modules (optional)
176
+ bash node_modules/cerber-core/team/scripts/cerber-connections-check.sh
177
+ ```
178
+
179
+ ### With Cerber 2.1 (Runtime)
180
+
181
+ ```typescript
182
+ // server.ts
183
+ import { createHealthEndpoint } from 'cerber-core';
184
+
185
+ const healthChecks = {
186
+ 'pricing-engine': async () => {
187
+ // Check module health
188
+ return [];
189
+ },
190
+ 'booking-calendar': async () => {
191
+ // Check module health
192
+ return [];
193
+ }
194
+ };
195
+
196
+ app.get('/api/health', createHealthEndpoint(healthChecks));
197
+ ```
198
+
199
+ ### With SOLO (Automation)
200
+
201
+ ```json
202
+ {
203
+ "scripts": {
204
+ "cerber:morning": "bash team/scripts/cerber-team-morning.sh && node solo/scripts/cerber-dashboard.js",
205
+ "cerber:pre-push": "npm run cerber:check-connections && npm run cerber:deps && npm run cerber:docs"
206
+ }
207
+ }
208
+ ```
209
+
210
+ ## Complete Workflow Example
211
+
212
+ ```bash
213
+ # Morning (5 min)
214
+ npm run cerber:morning # TEAM + SOLO dashboard
215
+
216
+ # Create feature in new module (10 min)
217
+ npm run cerber:add-module notifications
218
+ nano .cerber/modules/notifications/MODULE.md
219
+ nano .cerber/modules/notifications/contract.json
220
+
221
+ # Work on module (focused!)
222
+ npm run cerber:focus notifications
223
+ cat .cerber/FOCUS_CONTEXT.md # Share with AI
224
+ # [AI implements 10x faster with 500 LOC context]
225
+
226
+ # Validate (5 sec)
227
+ npm run cerber:check-module notifications
228
+ npm run cerber:check-connections
229
+
230
+ # Commit (Guardian validates)
231
+ git commit -m "feat(notifications): add email notifications"
232
+
233
+ # Pre-push checks
234
+ npm run cerber:pre-push # SOLO automation
235
+
236
+ # Deploy
237
+ git push
238
+ # CI/CD pipeline runs
239
+ # Deployment succeeds
240
+
241
+ # Validate production
242
+ curl https://api.example.com/api/health # Cerber 2.1 checks
243
+ ```
244
+
245
+ ## Benefits
246
+
247
+ **Before TEAM:**
248
+ - AI needs entire 10,000 LOC codebase → 60 second responses
249
+ - Unclear module boundaries
250
+ - Hidden dependencies between components
251
+ - Documentation drifts from code
252
+
253
+ **After TEAM:**
254
+ - AI gets focused 500 LOC context → 6 second responses (10x faster ⚡)
255
+ - Clear module boundaries with validation
256
+ - Explicit connection contracts
257
+ - Living documentation that can't drift
258
+
259
+ ## Scripts Breakdown
260
+
261
+ ### Morning Dashboard
262
+ ```bash
263
+ npm run cerber:morning
264
+ ```
265
+ Shows module health, connections status, recent activity
266
+
267
+ ### Focus Mode (⭐ Most Important)
268
+ ```bash
269
+ npm run cerber:focus <module-name>
270
+ ```
271
+ Generates 500 LOC context file for 10x faster AI
272
+
273
+ ### Module Validation
274
+ ```bash
275
+ npm run cerber:check-module <module-name>
276
+ ```
277
+ Validates MODULE.md, contract.json, dependencies.json
278
+
279
+ ### Connection Validation
280
+ ```bash
281
+ npm run cerber:check-connections
282
+ ```
283
+ Validates all connection contracts
284
+
285
+ ### Add Module
286
+ ```bash
287
+ npm run cerber:add-module <module-name>
288
+ ```
289
+ Creates new module from template
290
+
291
+ ## Tips
292
+
293
+ 1. **Always use focus mode** before working on a module
294
+ 2. **Share FOCUS_CONTEXT.md with AI** instead of entire codebase
295
+ 3. **Validate before committing** to catch issues early
296
+ 4. **Start day with morning dashboard** to see what needs attention
297
+ 5. **Update CERBER.md** when adding major modules
298
+ 6. **Version connection contracts** to track breaking changes
299
+
300
+ ## Troubleshooting
301
+
302
+ ### Module validation fails
303
+
304
+ Check that MODULE.md has required sections:
305
+ - Purpose
306
+ - Responsibilities
307
+ - Public Interface
308
+ - Dependencies
309
+
310
+ Validate JSON files:
311
+ ```bash
312
+ python3 -m json.tool .cerber/modules/my-module/contract.json
313
+ ```
314
+
315
+ ### Focus mode fails
316
+
317
+ Ensure module exists:
318
+ ```bash
319
+ ls .cerber/modules/
320
+ ```
321
+
322
+ Create module if missing:
323
+ ```bash
324
+ npm run cerber:add-module my-module
325
+ ```
326
+
327
+ ### Connection check fails
328
+
329
+ Validate JSON syntax:
330
+ ```bash
331
+ python3 -m json.tool .cerber/connections/contracts/my-contract.json
332
+ ```
333
+
334
+ Ensure referenced modules exist:
335
+ ```bash
336
+ ls .cerber/modules/
337
+ ```
338
+
339
+ ## Documentation
340
+
341
+ - **Full TEAM docs:** `node_modules/cerber-core/docs/TEAM.md`
342
+ - **Quick start:** `node_modules/cerber-core/team/README.md`
343
+ - **Example project:** `node_modules/cerber-core/.cerber-example/`
344
+
345
+ ## License
346
+
347
+ MIT © 2026 Stefan Pitek