interaqt 0.7.3 → 0.7.4

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.
package/agent/CLAUDE.md CHANGED
@@ -9,33 +9,72 @@ You are a honest software expert with the following capabilities:
9
9
 
10
10
  This guide provides a comprehensive step-by-step process for generating backend projects based on the interaqt framework.
11
11
 
12
- ## CRITICAL: Progress Tracking with STATUS.json
13
- **Before starting ANY work, create `docs/STATUS.json` to track your progress:**
12
+ ## CRITICAL: Module Selection and Progress Tracking
13
+
14
+ **🔴 STEP 0: Determine Current Working Module**
15
+
16
+ Before starting any work, you MUST determine which module you're working on:
17
+
18
+ 1. **Check if user specified module in their prompt:**
19
+ - If YES: Write the module name to `.currentmodule` file (create if doesn't exist, overwrite entire content if exists)
20
+ - If NO: Continue to step 2
21
+
22
+ 2. **Check if `.currentmodule` file exists:**
23
+ - If YES: Read the module name from `.currentmodule`
24
+ - If NO: **STOP and ask user which module to work on**, then write the module name to `.currentmodule`
25
+
26
+ 3. **Set the module name for this session:** Use this module name for all subsequent operations
27
+
28
+ **🔴 IMPORTANT: Module-Based Progress Tracking**
29
+
30
+ Each module has its own progress tracking file:
31
+ - **File location**: `docs/{module}.status.json` (where `{module}` is the current module name from `.currentmodule`)
32
+ - **Before starting ANY work, read or create the module's status file:**
14
33
 
15
34
  ```json
16
35
  {
36
+ "module": "moduleName",
17
37
  "currentTask": "Task 1",
18
38
  "completed": false,
19
39
  "completedItems": []
20
40
  }
21
41
  ```
22
42
 
23
- ** IMPORTANT: All tasks in this guide use a global unique numbering system (Task x.x.x.x). You can always find your current position by checking `docs/STATUS.json`, which tracks the exact Task number you were working on.**
43
+ ** IMPORTANT: All tasks in this guide use a global unique numbering system (Task x.x.x.x). You can always find your current position by checking `docs/{module}.status.json`, which tracks the exact Task number you were working on for that module.**
44
+
45
+ ** IMPORTANT: Module-Based Generation - All generated artifacts should be organized by module name read from `.currentmodule` file.**
24
46
 
25
47
  ## Task-Based Workflow System
26
48
 
27
49
  **📖 STEP 1: Check Current Progress**
28
- 1. Read `docs/STATUS.json` to find your current task number (e.g., "Task 1", "Task 2", "Task 3")
29
- 2. If the file doesn't exist, you should start with Task 1
50
+ 1. Read current module name from `.currentmodule` file
51
+ 2. Read `docs/{module}.status.json` to find your current task number (e.g., "Task 1", "Task 2", "Task 3")
52
+ 3. If the status file doesn't exist, you should start with Task 1
30
53
 
31
54
  **📖 STEP 2: Execute Corresponding Task**
32
- Based on the current task in `docs/STATUS.json`, use the appropriate sub-agent:
55
+ Based on the current task in `docs/{module}.status.json`, use the appropriate sub-agent:
33
56
 
34
57
  - **Task 1** → Use sub-agent `requirements-analysis-handler`
35
58
  - **Task 2** → Use sub-agent `implement-design-handler`
36
59
  - **Task 3** → Use sub-agent `code-generation-handler` (default for Task 3)
37
60
  - **Exception: Task 3.1.4.3 - Computation Implementation Loop** → Use sub-agent `computation-generation-handler` during the implementation loop
38
61
  - **Exception: Task 3.2.2 - Permission and Business Rule Implementation Loop** → Use sub-agent `permission-generation-handler` during the implementation loop
62
+ - **Error Checking** → Use sub-agent `error-check-handler` when user requests error checking or quality assurance
63
+
64
+ **📋 STEP 3: Error Checking (Optional)**
65
+
66
+ At any point in the workflow, you can use the `error-check-handler` sub-agent to perform comprehensive error checking:
67
+ - Creates a detailed error report in `docs/{module}.error-check-report.md`
68
+ - Checks all phases systematically (Module Setup, Requirements, Design, Code Generation, Frontend, Integration)
69
+ - Identifies CRITICAL, HIGH PRIORITY, and MEDIUM PRIORITY errors
70
+ - Provides specific file paths, line numbers, and suggested fixes
71
+ - Does NOT fix errors - only finds and reports them
72
+
73
+ **When to use error-check-handler:**
74
+ - User explicitly requests error checking or quality assurance
75
+ - Before marking any major phase complete (Task 1, Task 2, Task 3)
76
+ - After completing implementation but before moving to production
77
+ - When debugging issues or trying to understand problems
39
78
 
40
79
  **🔴 CRITICAL - AUTORUN EXECUTION CONTROL:**
41
80
 
@@ -46,7 +85,7 @@ Based on the current task in `docs/STATUS.json`, use the appropriate sub-agent:
46
85
 
47
86
  **For Loop Tasks Within Sub-Tasks:**
48
87
  - **Check `SCHEDULE.json`**: When `"autorun": true`, automatically complete the loop task cycles continuously. When `autorun` doesn't exist or is `false`, execute only one iteration of the loop task then stop and wait for user's manual instruction to proceed with the next iteration
49
- - **Loop Termination Condition**: Continue looping until the `completionCriteria` in `docs/STATUS.json` is fully satisfied
88
+ - **Loop Termination Condition**: Continue looping until the `completionCriteria` in `docs/{module}.status.json` is fully satisfied
50
89
  - **Example**: For Task 3.1.4.3, if autorun is true, keep implementing computations one by one until all items in `docs/computation-implementation-plan.json` have `completed: true`
51
90
  - **Example**: For Task 3.2.2, if autorun is true, keep implementing permissions/rules one by one until all items in `docs/business-rules-and-permission-control-implementation-plan.json` have `completed: true`
52
91
  - **IMPORTANT**: Only after the completion criteria is met can you proceed to the next task
@@ -2,14 +2,20 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- This guide helps you select the appropriate computation type for each entity, property, relation, and dictionary based on the structured information in `data-design.json` and `interaction-design.md`.
5
+ This guide helps you select the appropriate computation type for each entity, property, relation, and dictionary based on the structured information in `requirements/{module}.data-design.json` and `requirements/{module}.interaction-design.md`.
6
+
7
+ **IMPORTANT**: First read the current module name from `.currentmodule` file in project root, and use it to construct the file paths. For example, if `.currentmodule` contains `user-management`, then the paths would be:
8
+ - `requirements/user-management.data-design.json`
9
+ - `requirements/user-management.interaction-design.md`
6
10
 
7
11
 
8
12
  ## Input Files
9
13
 
10
14
  You will receive two input files:
11
- 1. **data-design.json**: Contains structured data dependencies and lifecycle information
12
- 2. **interaction-design.md**: Describes all interactions and their effects
15
+ 1. **requirements/{module}.data-design.json**: Contains structured data dependencies and lifecycle information
16
+ 2. **requirements/{module}.interaction-design.md**: Describes all interactions and their effects
17
+
18
+ Note: Replace `{module}` with the value from `.currentmodule` file.
13
19
 
14
20
  ## Direct Mapping Rules
15
21
 
@@ -33,6 +39,7 @@ Look at the entity's `lifecycle.creation` and `lifecycle.deletion`:
33
39
 
34
40
  | Creation Type | Deletion | Computation Decision |
35
41
  |---------------|----------|---------------------|
42
+ | `"integration-event"` | Always `canBeDeleted: false` | `None` - Entity is externally controlled by webhook/callback from external systems |
36
43
  | `"created-with-parent"` | Any | `_parent:[lifecycle.creation.parent]` (created by parent's computation) |
37
44
  | `"interaction-created"` | `canBeDeleted: false` | `Transform` with `InteractionEventEntity` |
38
45
  | `"interaction-created"` | `canBeDeleted: true` with `hard-delete` | `Transform` + `HardDeletionProperty` with `StateMachine` |
@@ -123,32 +130,37 @@ Based on `computationMethod` description:
123
130
  ## Automated Decision Process
124
131
 
125
132
  ### Step 1: Parse Input Files
126
- Read `data-design.json` and extract:
133
+ First, read the module name from `.currentmodule` file in project root to get the current module name.
134
+
135
+ Then read `requirements/{module}.data-design.json` and extract:
127
136
  - Entity definitions with their properties and lifecycle (creation and deletion)
128
137
  - Relation definitions with their lifecycle
129
138
  - Dictionary definitions
130
139
 
131
140
  ### Step 2: Apply Mapping Rules
132
141
  For each element:
133
- 1. Check lifecycle.creation.type and lifecycle.deletion for entities and relations
134
- 2. For properties, check controlType first:
142
+ 1. **For entities**: Check in this priority order:
143
+ - First check if `isIntegrationEvent: true` → set computation to "None" (externally controlled)
144
+ - Then check lifecycle.creation.type and lifecycle.deletion
145
+ - For entities that can be hard-deleted, use Transform + HardDeletionProperty with StateMachine
146
+ 2. **For relations**: Check lifecycle.creation.type and lifecycle.deletion
147
+ - For relations that can be hard-deleted, use Transform + HardDeletionProperty with StateMachine
148
+ 3. **For properties**: Check controlType first:
135
149
  - If `creation-only` or `derived-with-parent` → use `_owner`
136
150
  - If `independent` → apply standard dependency analysis rules
137
- 3. Apply the appropriate rules based on creation type
138
- 4. For entities/relations that can be hard-deleted, use Transform + HardDeletionProperty with StateMachine
139
151
 
140
152
  ### Step 3: Generate Output Document
141
153
 
142
- Create `docs/computation-analysis.json` with this structure:
154
+ Create `requirements/{module}.computation-analysis.json` (using the module name from `.currentmodule`) with this structure:
143
155
 
144
156
  ```json
145
157
  {
146
158
  "entities": [
147
159
  {
148
- "name": "<from data-design.json>",
160
+ "name": "<from requirements/{module}.data-design.json>",
149
161
  "entityAnalysis": {
150
- "purpose": "<from data-design.json>",
151
- "lifecycle": "<directly copy from lifecycle field in data-design.json>",
162
+ "purpose": "<from requirements/{module}.data-design.json>",
163
+ "lifecycle": "<directly copy from lifecycle field in requirements/{module}.data-design.json>",
152
164
  "computationDecision": "<Transform/_parent:[ParentName]/None based on rules>",
153
165
  "reasoning": "<automated based on lifecycle and deletion capability>",
154
166
  "calculationMethod": "<from computationMethod>"
@@ -156,14 +168,14 @@ Create `docs/computation-analysis.json` with this structure:
156
168
  "propertyAnalysis": [
157
169
  {
158
170
  "propertyName": "<property name>",
159
- "type": "<from data-design.json>",
160
- "purpose": "<from data-design.json>",
161
- "controlType": "<from data-design.json: creation-only/derived-with-parent/independent>",
171
+ "type": "<from requirements/{module}.data-design.json>",
172
+ "purpose": "<from requirements/{module}.data-design.json>",
173
+ "controlType": "<from requirements/{module}.data-design.json: creation-only/derived-with-parent/independent>",
162
174
  "dataSource": "<from computationMethod>",
163
175
  "computationDecision": "<_owner/StateMachine/Count/etc. based on controlType and rules>",
164
176
  "reasoning": "<automated based on controlType and rules>",
165
177
  "dependencies": <convert dataDependencies to proper format>,
166
- "interactionDependencies": <from data-design.json>,
178
+ "interactionDependencies": <from requirements/{module}.data-design.json>,
167
179
  "calculationMethod": "<from computationMethod>"
168
180
  }
169
181
  ]
@@ -171,10 +183,10 @@ Create `docs/computation-analysis.json` with this structure:
171
183
  ],
172
184
  "relations": [
173
185
  {
174
- "name": "<from data-design.json>",
186
+ "name": "<from requirements/{module}.data-design.json>",
175
187
  "relationAnalysis": {
176
- "purpose": "<from data-design.json>",
177
- "lifecycle": "<directly copy from lifecycle field in data-design.json>",
188
+ "purpose": "<from requirements/{module}.data-design.json>",
189
+ "lifecycle": "<directly copy from lifecycle field in requirements/{module}.data-design.json>",
178
190
  "computationDecision": "<Transform/_parent:[ParentName] based on rules>",
179
191
  "reasoning": "<automated based on lifecycle>",
180
192
  "calculationMethod": "<from computationMethod>"
@@ -183,15 +195,15 @@ Create `docs/computation-analysis.json` with this structure:
183
195
  ],
184
196
  "dictionaries": [
185
197
  {
186
- "name": "<from data-design.json>",
198
+ "name": "<from requirements/{module}.data-design.json>",
187
199
  "dictionaryAnalysis": {
188
- "purpose": "<from data-design.json>",
189
- "type": "<from data-design.json>",
200
+ "purpose": "<from requirements/{module}.data-design.json>",
201
+ "type": "<from requirements/{module}.data-design.json>",
190
202
  "collection": "<determine from type>",
191
203
  "computationDecision": "<apply dictionary rules>",
192
204
  "reasoning": "<automated based on computationMethod>",
193
205
  "dependencies": <format properly>,
194
- "interactionDependencies": <from data-design.json>,
206
+ "interactionDependencies": <from requirements/{module}.data-design.json>,
195
207
  "calculationMethod": "<from computationMethod>"
196
208
  }
197
209
  }
@@ -218,6 +230,7 @@ Examples:
218
230
 
219
231
  ```
220
232
  1. Entity Lifecycle?
233
+ ├─ lifecycle.creation.type: "integration-event"? → None (externally controlled)
221
234
  ├─ lifecycle.creation.type: "created-with-parent"? → _parent:[parent]
222
235
  ├─ lifecycle.creation.type: "interaction-created" + canBeDeleted: true (hard)? → Transform + HardDeletionProperty with StateMachine
223
236
  ├─ lifecycle.creation.type: "interaction-created" + canBeDeleted: true (soft)? → Transform + status StateMachine
@@ -278,23 +291,26 @@ Examples:
278
291
  ## Validation
279
292
 
280
293
  Before finalizing, verify:
281
- 1. Every entity with `interactionDependencies` has appropriate computation:
294
+ 1. Every entity with `lifecycle.creation.type: "integration-event"` has `computationDecision: "None"` or no computation
295
+ 2. Every entity with `interactionDependencies` has appropriate computation:
282
296
  - If `canBeDeleted: true` with `hard-delete` → Must use Transform + HardDeletionProperty with StateMachine
283
- - If `canBeDeleted: false` → Can use Transform (unless `created-with-parent`)
284
- 2. Entities/relations with `lifecycle.creation.type: "created-with-parent/entity"` use `_parent:[ParentName]`
285
- 3. Properties with `controlType: "creation-only"` or `"derived-with-parent"` have computation `_owner`
286
- 4. Properties with `controlType: "independent"` are analyzed for appropriate computation
287
- 5. Properties with modifying `interactionDependencies` use StateMachine (if `controlType: "independent"`)
288
- 6. Properties with only `dataDependencies` use data-based computation (if `controlType: "independent"`)
289
- 7. All entities or relations with `canBeDeleted:true` and `hard-delete` use Transform + HardDeletionProperty
290
- 8. All dependencies are properly formatted with specific properties
291
- 9. `InteractionEventEntity` is included when interactions are dependencies
292
- 10. The parent name in `_parent:[ParentName]` matches `lifecycle.creation.parent`
297
+ - If `canBeDeleted: false` → Can use Transform (unless `created-with-parent` or `integration-event`)
298
+ 3. Entities/relations with `lifecycle.creation.type: "created-with-parent/entity"` use `_parent:[ParentName]`
299
+ 4. Properties with `controlType: "creation-only"` or `"derived-with-parent"` have computation `_owner`
300
+ 5. Properties with `controlType: "independent"` are analyzed for appropriate computation
301
+ 6. Properties with modifying `interactionDependencies` use StateMachine (if `controlType: "independent"`)
302
+ 7. Properties with only `dataDependencies` use data-based computation (if `controlType: "independent"`)
303
+ 8. All entities or relations with `canBeDeleted:true` and `hard-delete` use Transform + HardDeletionProperty
304
+ 9. All dependencies are properly formatted with specific properties
305
+ 10. `InteractionEventEntity` is included when interactions are dependencies
306
+ 11. The parent name in `_parent:[ParentName]` matches `lifecycle.creation.parent`
293
307
 
294
308
 
295
309
  ## Implementation Checklist
296
310
 
297
- - [ ] Parse `data-design.json` completely
311
+ - [ ] Read module name from `.currentmodule` file in project root
312
+ - [ ] Parse `requirements/{module}.data-design.json` completely
313
+ - [ ] Check for entities with `isIntegrationEvent: true` and set computation to "None"
298
314
  - [ ] Apply mapping rules for every entity (check deletion capability)
299
315
  - [ ] Check `controlType` for every property first
300
316
  - [ ] Apply mapping rules for properties based on `controlType`
@@ -304,6 +320,7 @@ Before finalizing, verify:
304
320
  - [ ] Separate `dependencies` and `interactionDependencies`
305
321
  - [ ] Add `InteractionEventEntity` when needed
306
322
  - [ ] Verify properties with `controlType: "creation-only"` or `"derived-with-parent"` use `_owner`
323
+ - [ ] Verify entities with `lifecycle.creation.type: "integration-event"` have no computation
307
324
  - [ ] Verify Transform + HardDeletionProperty is used for deletable entities (hard-delete)
308
325
  - [ ] Verify Transform + HardDeletionProperty is used for deletable relations (hard-delete)
309
- - [ ] Generate complete `computation-analysis.json`
326
+ - [ ] Generate complete `requirements/{module}.computation-analysis.json`