@eventmodelers/cli 0.0.1
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/README.md +175 -0
- package/cli.js +676 -0
- package/package.json +35 -0
- package/shared/build-kit/code-export.mjs +560 -0
- package/shared/build-kit/lib/ollama-agent.js +147 -0
- package/shared/build-kit/package.json +11 -0
- package/shared/build-kit/ralph-ollama.js +39 -0
- package/shared/build-kit/realtime-agent.js +18 -0
- package/stacks/axon/templates/.claude/skills/build-automation/SKILL.md +407 -0
- package/stacks/axon/templates/.claude/skills/build-automation/references/feature-flag-patterns.md +114 -0
- package/stacks/axon/templates/.claude/skills/build-automation-workflow/SKILL.md +496 -0
- package/stacks/axon/templates/.claude/skills/build-automation-workflow/references/axon-workflow-api.md +279 -0
- package/stacks/axon/templates/.claude/skills/build-automation-workflow/references/feature-flag-patterns.md +114 -0
- package/stacks/axon/templates/.claude/skills/build-state-change/SKILL.md +396 -0
- package/stacks/axon/templates/.claude/skills/build-state-change/references/axon-test-fixture-patterns.md +162 -0
- package/stacks/axon/templates/.claude/skills/build-state-change/references/feature-flag-patterns.md +56 -0
- package/stacks/axon/templates/.claude/skills/build-state-change/references/rest-api-patterns.md +115 -0
- package/stacks/axon/templates/.claude/skills/build-state-view/SKILL.md +282 -0
- package/stacks/axon/templates/.claude/skills/connect/SKILL.md +178 -0
- package/stacks/axon/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +611 -0
- package/stacks/axon/templates/.claude/skills/load-slice/SKILL.md +141 -0
- package/stacks/axon/templates/.claude/skills/update-slice-status/SKILL.md +105 -0
- package/stacks/axon/templates/build-kit/lib/AGENT.md +47 -0
- package/stacks/axon/templates/build-kit/lib/agent.sh +20 -0
- package/stacks/axon/templates/build-kit/lib/backend-prompt.md +158 -0
- package/stacks/axon/templates/build-kit/lib/prompt.md +126 -0
- package/stacks/axon/templates/build-kit/lib/ralph.js +369 -0
- package/stacks/axon/templates/build-kit/ralph-claude.js +44 -0
- package/stacks/axon/templates/build-kit/ralph.sh +98 -0
- package/stacks/axon/templates/root/.env.example +5 -0
- package/stacks/axon/templates/root/CLAUDE.md +60 -0
- package/stacks/axon/templates/root/README.md +44 -0
- package/stacks/axon/templates/root/docker-compose.yml +64 -0
- package/stacks/axon/templates/root/mvnw +259 -0
- package/stacks/axon/templates/root/mvnw.cmd +149 -0
- package/stacks/axon/templates/root/pom.xml +125 -0
- package/stacks/axon/templates/root/src/main/java/io/axoniq/quickstart/QuickstartApplication.java +128 -0
- package/stacks/axon/templates/root/src/main/java/io/axoniq/quickstart/config/WebConfig.java +155 -0
- package/stacks/axon/templates/root/src/main/resources/application.properties +2 -0
- package/stacks/axon/templates/root/src/main/resources/static/bg-body.png +0 -0
- package/stacks/axon/templates/root/src/main/resources/static/bg-header.png +0 -0
- package/stacks/axon/templates/root/src/main/resources/static/index.html +596 -0
- package/stacks/cratis-csharp/templates/.claude/skills/_shared/cratis-conventions.md +251 -0
- package/stacks/cratis-csharp/templates/.claude/skills/build-automation/SKILL.md +99 -0
- package/stacks/cratis-csharp/templates/.claude/skills/build-automation/references/patterns.md +115 -0
- package/stacks/cratis-csharp/templates/.claude/skills/build-state-change/SKILL.md +163 -0
- package/stacks/cratis-csharp/templates/.claude/skills/build-state-change/references/patterns.md +234 -0
- package/stacks/cratis-csharp/templates/.claude/skills/build-state-view/SKILL.md +120 -0
- package/stacks/cratis-csharp/templates/.claude/skills/build-state-view/references/patterns.md +166 -0
- package/stacks/cratis-csharp/templates/.claude/skills/connect/SKILL.md +169 -0
- package/stacks/cratis-csharp/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +609 -0
- package/stacks/cratis-csharp/templates/.claude/skills/load-slice/SKILL.md +141 -0
- package/stacks/cratis-csharp/templates/.claude/skills/update-slice-status/SKILL.md +105 -0
- package/stacks/cratis-csharp/templates/build-kit/lib/AGENT.md +58 -0
- package/stacks/cratis-csharp/templates/build-kit/lib/agent.sh +20 -0
- package/stacks/cratis-csharp/templates/build-kit/lib/backend-prompt.md +129 -0
- package/stacks/cratis-csharp/templates/build-kit/lib/prompt.md +124 -0
- package/stacks/cratis-csharp/templates/build-kit/lib/ralph.js +302 -0
- package/stacks/cratis-csharp/templates/build-kit/ralph-claude.js +37 -0
- package/stacks/cratis-csharp/templates/build-kit/ralph.sh +98 -0
- package/stacks/cratis-csharp/templates/root/.frontend/index.css +29 -0
- package/stacks/cratis-csharp/templates/root/.frontend/index.html +17 -0
- package/stacks/cratis-csharp/templates/root/.frontend/main.tsx +18 -0
- package/stacks/cratis-csharp/templates/root/.frontend/tsconfig.json +42 -0
- package/stacks/cratis-csharp/templates/root/.frontend/tsconfig.node.json +11 -0
- package/stacks/cratis-csharp/templates/root/.frontend/vite.config.ts +56 -0
- package/stacks/cratis-csharp/templates/root/App.tsx +23 -0
- package/stacks/cratis-csharp/templates/root/CLAUDE.md +62 -0
- package/stacks/cratis-csharp/templates/root/CratisApp.csproj +25 -0
- package/stacks/cratis-csharp/templates/root/CratisApp.sln +18 -0
- package/stacks/cratis-csharp/templates/root/GlobalUsings.cs +3 -0
- package/stacks/cratis-csharp/templates/root/Home.tsx +102 -0
- package/stacks/cratis-csharp/templates/root/Program.cs +26 -0
- package/stacks/cratis-csharp/templates/root/README.md +192 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Listing/AllListings.ts +47 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Listing/Listing.cs +11 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Listing/Listing.ts +12 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Listing/ListingDataTable.tsx +17 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Listing/index.ts +1 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Registration/Register.ts +51 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Registration/RegisterDialog.tsx +18 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Registration/Registration.cs +27 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Registration/index.ts +1 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/SomeFeature.tsx +22 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/SomeName.cs +3 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/index.ts +1 -0
- package/stacks/cratis-csharp/templates/root/appsettings.Development.json +9 -0
- package/stacks/cratis-csharp/templates/root/appsettings.json +26 -0
- package/stacks/cratis-csharp/templates/root/docker-compose.yml +23 -0
- package/stacks/cratis-csharp/templates/root/package.json +33 -0
- package/stacks/cratis-csharp/templates/root/tsconfig.json +3 -0
- package/stacks/modeling-kit/templates/.claude/settings.local.json +13 -0
- package/stacks/modeling-kit/templates/.claude/skills/analyze-existing-model/SKILL.md +215 -0
- package/stacks/modeling-kit/templates/.claude/skills/attributes/SKILL.md +176 -0
- package/stacks/modeling-kit/templates/.claude/skills/connect/SKILL.md +182 -0
- package/stacks/modeling-kit/templates/.claude/skills/discover-storyboard/SKILL.md +383 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-applying-conways-law/SKILL.md +465 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-brainstorming-events/SKILL.md +587 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-brainstorming-events/references/facilitating-event-modeling-workshops.md +626 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-checking-completeness/SKILL.md +542 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-designing-event-models/SKILL.md +497 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-elaborating-scenarios/SKILL.md +783 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-identifying-inputs/SKILL.md +604 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-identifying-outputs/SKILL.md +699 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-integrating-legacy-systems/SKILL.md +674 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-optimizing-stream-design/SKILL.md +231 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-optimizing-stream-design/references/domain-patterns.md +150 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-optimizing-stream-design/references/patterns.md +329 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-optimizing-stream-design/references/snapshotting.md +204 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-orchestrating-event-modeling/SKILL.md +352 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-orchestrating-event-modeling/references/project-planning-with-event-modeling.md +341 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-plotting-events/SKILL.md +153 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-slicing-event-models/SKILL.md +136 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-slicing-event-models/references/examples.md +78 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-slicing-event-models/references/patterns.md +85 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-storyboarding-events/SKILL.md +655 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-translating-external-events/SKILL.md +479 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-validating-event-models/SKILL.md +234 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-validating-event-models-checklist/SKILL.md +353 -0
- package/stacks/modeling-kit/templates/.claude/skills/examples/SKILL.md +200 -0
- package/stacks/modeling-kit/templates/.claude/skills/handle-comment/SKILL.md +94 -0
- package/stacks/modeling-kit/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +441 -0
- package/stacks/modeling-kit/templates/.claude/skills/place-element/SKILL.md +290 -0
- package/stacks/modeling-kit/templates/.claude/skills/storyboard/SKILL.md +212 -0
- package/stacks/modeling-kit/templates/.claude/skills/storyboard-screen/SKILL.md +123 -0
- package/stacks/modeling-kit/templates/.claude/skills/timeline/SKILL.md +353 -0
- package/stacks/modeling-kit/templates/.claude/skills/update-slice-status/SKILL.md +110 -0
- package/stacks/modeling-kit/templates/.claude/skills/wdyt/SKILL.md +134 -0
- package/stacks/modeling-kit/templates/kit/lib/agent.sh +20 -0
- package/stacks/modeling-kit/templates/kit/lib/ollama-agent.js +147 -0
- package/stacks/modeling-kit/templates/kit/lib/ralph.js +286 -0
- package/stacks/modeling-kit/templates/kit/package.json +12 -0
- package/stacks/modeling-kit/templates/kit/ralph-claude.js +50 -0
- package/stacks/modeling-kit/templates/kit/ralph-ollama.js +38 -0
- package/stacks/modeling-kit/templates/kit/ralph.sh +61 -0
- package/stacks/modeling-kit/templates/kit/realtime-agent.js +18 -0
- package/stacks/modeling-kit/templates/root/CLAUDE.md +56 -0
- package/stacks/node/templates/.claude/skills/build-automation/SKILL.md +266 -0
- package/stacks/node/templates/.claude/skills/build-state-change/SKILL.md +344 -0
- package/stacks/node/templates/.claude/skills/build-state-view/SKILL.md +412 -0
- package/stacks/node/templates/.claude/skills/connect/SKILL.md +178 -0
- package/stacks/node/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +628 -0
- package/stacks/node/templates/.claude/skills/load-slice/SKILL.md +143 -0
- package/stacks/node/templates/.claude/skills/update-slice-status/SKILL.md +110 -0
- package/stacks/node/templates/build-kit/README.md +86 -0
- package/stacks/node/templates/build-kit/lib/AGENT.md +47 -0
- package/stacks/node/templates/build-kit/lib/agent.sh +20 -0
- package/stacks/node/templates/build-kit/lib/backend-prompt.md +152 -0
- package/stacks/node/templates/build-kit/lib/prompt.md +122 -0
- package/stacks/node/templates/build-kit/lib/ralph.js +369 -0
- package/stacks/node/templates/build-kit/ralph-claude.js +44 -0
- package/stacks/node/templates/build-kit/ralph.sh +98 -0
- package/stacks/node/templates/root/.env.example +15 -0
- package/stacks/node/templates/root/CLAUDE.md +60 -0
- package/stacks/node/templates/root/docker-compose.yml +15 -0
- package/stacks/node/templates/root/flyway.conf +17 -0
- package/stacks/node/templates/root/migrations/V1__schema.sql.example +12 -0
- package/stacks/node/templates/root/package.json +50 -0
- package/stacks/node/templates/root/server.ts +130 -0
- package/stacks/node/templates/root/setup-env.sh +53 -0
- package/stacks/node/templates/root/src/common/assertions.ts +6 -0
- package/stacks/node/templates/root/src/common/db.ts +32 -0
- package/stacks/node/templates/root/src/common/loadPostgresEventstore.ts +23 -0
- package/stacks/node/templates/root/src/common/parseEndpoint.ts +51 -0
- package/stacks/node/templates/root/src/common/processorDlq.ts +28 -0
- package/stacks/node/templates/root/src/common/realtimeBroadcast.ts +12 -0
- package/stacks/node/templates/root/src/common/replay.ts +16 -0
- package/stacks/node/templates/root/src/common/routes.ts +19 -0
- package/stacks/node/templates/root/src/common/testHelpers.ts +44 -0
- package/stacks/node/templates/root/src/swagger.ts +34 -0
- package/stacks/node/templates/root/src/util/assertions.ts +6 -0
- package/stacks/node/templates/root/src/util/hash.ts +9 -0
- package/stacks/node/templates/root/src/util/sanitize.ts +23 -0
- package/stacks/node/templates/root/tsconfig.json +32 -0
- package/stacks/node/templates/root/vercel.json +8 -0
- package/stacks/supabase/templates/.claude/skills/build-automation/SKILL.md +266 -0
- package/stacks/supabase/templates/.claude/skills/build-state-change/SKILL.md +344 -0
- package/stacks/supabase/templates/.claude/skills/build-state-view/SKILL.md +390 -0
- package/stacks/supabase/templates/.claude/skills/build-webhook/SKILL.md +303 -0
- package/stacks/supabase/templates/.claude/skills/connect/SKILL.md +178 -0
- package/stacks/supabase/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +628 -0
- package/stacks/supabase/templates/.claude/skills/load-slice/SKILL.md +143 -0
- package/stacks/supabase/templates/.claude/skills/update-slice-status/SKILL.md +110 -0
- package/stacks/supabase/templates/build-kit/README.md +86 -0
- package/stacks/supabase/templates/build-kit/lib/AGENT.md +47 -0
- package/stacks/supabase/templates/build-kit/lib/agent.sh +20 -0
- package/stacks/supabase/templates/build-kit/lib/backend-prompt.md +152 -0
- package/stacks/supabase/templates/build-kit/lib/prompt.md +123 -0
- package/stacks/supabase/templates/build-kit/lib/ralph.js +369 -0
- package/stacks/supabase/templates/build-kit/ralph-claude.js +44 -0
- package/stacks/supabase/templates/build-kit/ralph.sh +98 -0
- package/stacks/supabase/templates/root/.env.example +22 -0
- package/stacks/supabase/templates/root/CLAUDE.md +61 -0
- package/stacks/supabase/templates/root/flyway.conf +17 -0
- package/stacks/supabase/templates/root/package.json +52 -0
- package/stacks/supabase/templates/root/server.ts +177 -0
- package/stacks/supabase/templates/root/setup-env.sh +53 -0
- package/stacks/supabase/templates/root/src/common/assertions.ts +6 -0
- package/stacks/supabase/templates/root/src/common/db.ts +32 -0
- package/stacks/supabase/templates/root/src/common/loadPostgresEventstore.ts +23 -0
- package/stacks/supabase/templates/root/src/common/parseEndpoint.ts +51 -0
- package/stacks/supabase/templates/root/src/common/processorDlq.ts +28 -0
- package/stacks/supabase/templates/root/src/common/realtimeBroadcast.ts +19 -0
- package/stacks/supabase/templates/root/src/common/replay.ts +16 -0
- package/stacks/supabase/templates/root/src/common/routes.ts +23 -0
- package/stacks/supabase/templates/root/src/common/testHelpers.ts +54 -0
- package/stacks/supabase/templates/root/src/supabase/README.md +141 -0
- package/stacks/supabase/templates/root/src/supabase/api.ts +56 -0
- package/stacks/supabase/templates/root/src/supabase/requireOrgaAdmin.ts +32 -0
- package/stacks/supabase/templates/root/src/supabase/requireSysUser.ts +40 -0
- package/stacks/supabase/templates/root/src/supabase/requireUser.ts +72 -0
- package/stacks/supabase/templates/root/src/swagger.ts +34 -0
- package/stacks/supabase/templates/root/src/util/assertions.ts +6 -0
- package/stacks/supabase/templates/root/src/util/hash.ts +9 -0
- package/stacks/supabase/templates/root/src/util/sanitize.ts +23 -0
- package/stacks/supabase/templates/root/supabase/config.toml +295 -0
- package/stacks/supabase/templates/root/supabase/migrations/V1__schema.sql.example +12 -0
- package/stacks/supabase/templates/root/supabase/seed.sql +1 -0
- package/stacks/supabase/templates/root/tsconfig.json +32 -0
- package/stacks/supabase/templates/root/vercel.json +8 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: examples
|
|
3
|
+
description: Find an element on an eventmodelers board by ID, name, or cell name and add or improve example data on its fields, using linked elements for context and consistency
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Examples
|
|
7
|
+
|
|
8
|
+
> **Before doing anything else**, invoke the `connect` skill to resolve `TOKEN`, `BOARD_ID`, and `BASE_URL`. Do not proceed until the connect skill has completed.
|
|
9
|
+
|
|
10
|
+
You are adding or improving example data on an eventmodelers element. You find the element, read all linked elements for context, then generate realistic and consistent example values for every field that is missing one or has a weak example.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Step 1 — Parse arguments
|
|
15
|
+
|
|
16
|
+
From `$ARGUMENTS`, extract:
|
|
17
|
+
|
|
18
|
+
| Field | How to find it | Default |
|
|
19
|
+
|-------|---------------|---------|
|
|
20
|
+
| `target` | node UUID, element name (e.g. "Order Placed"), or cell name (e.g. "B3") | **required** |
|
|
21
|
+
| `boardId` | a board UUID | from `connect` skill (`BOARD_ID`) |
|
|
22
|
+
| `baseUrl` | explicit URL override | from `connect` skill (`BASE_URL`) |
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Step 2 — Resolve the element
|
|
27
|
+
|
|
28
|
+
Try the resolution strategies in order until one succeeds.
|
|
29
|
+
|
|
30
|
+
### 2a — UUID
|
|
31
|
+
If `target` looks like a UUID (pattern `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`), fetch it directly:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
curl -s "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes/$target" \
|
|
35
|
+
-H "x-user-id: examples-skill"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 2b — Name search
|
|
39
|
+
If `target` is not a UUID, search by name:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
curl -s "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/events/search?name=$(python3 -c 'import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))' "$target")" \
|
|
43
|
+
-H "x-user-id: examples-skill"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Pick the best match (exact title match preferred; case-insensitive). If multiple matches exist, list them and ask the user to pick one.
|
|
47
|
+
|
|
48
|
+
### 2c — Cell name (spreadsheet-style, e.g. "B3")
|
|
49
|
+
If `target` matches the pattern `[A-Z]+[0-9]+`:
|
|
50
|
+
|
|
51
|
+
1. Fetch all chapters on the board to find the relevant timeline:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
curl -s "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes?type=CHAPTER" \
|
|
55
|
+
-H "x-user-id: examples-skill"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
If multiple chapters exist, ask the user which one to use.
|
|
59
|
+
|
|
60
|
+
2. Fetch the chapter **fresh** to decode the grid — never use cached chapter data, as cells are updated frequently:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
curl -s "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes/$CHAPTER_ID" \
|
|
64
|
+
-H "x-user-id: examples-skill"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
From `meta.timelineData`, decode the cell name into a `cellId`:
|
|
68
|
+
- Column letter(s) → 0-based column index (A=0, B=1, … Z=25, AA=26, …)
|
|
69
|
+
- Row digit → 0-based row index (1→0, 2→1, …)
|
|
70
|
+
- Find the matching column in `columns` and the matching row in `rows`.
|
|
71
|
+
- Compute: **`CELL_ID = row.id + "-" + column.id`** (cell IDs are always `<rowId>-<columnId>`).
|
|
72
|
+
|
|
73
|
+
3. **Always fetch the cell live** to get the current node list — do not rely on the `nodeId` in the chapter's cell data, as it may be stale:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
curl -s "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes?cellId=$CELL_ID" \
|
|
77
|
+
-H "x-user-id: examples-skill"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Use the first non-CHAPTER result (filter out CHAPTER type).
|
|
81
|
+
|
|
82
|
+
If no element is found after all strategies, stop and tell the user what was tried.
|
|
83
|
+
|
|
84
|
+
Save the resolved node as `TARGET_NODE` (full JSON including `id`, `meta`, `edges`).
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Step 3 — Load linked elements for context
|
|
89
|
+
|
|
90
|
+
Collect nearby elements to understand the domain context and generate consistent examples. **Never fetch all board nodes.** Only fetch specific nodes you already have IDs for.
|
|
91
|
+
|
|
92
|
+
### 3a — Nodes from edges
|
|
93
|
+
If `TARGET_NODE.edges` is non-empty, fetch each connected node individually by its ID:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
curl -s "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes/<EDGE_NODE_ID>" \
|
|
97
|
+
-H "x-user-id: examples-skill"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Fetch all edge-connected nodes in parallel (one request per node ID).
|
|
101
|
+
|
|
102
|
+
### 3b — Nodes from the same column (cell-based resolution only)
|
|
103
|
+
If you resolved `TARGET_NODE` via a cell name (Step 2c), you already have the full chapter `cells` array in memory. Use it — **no extra API call needed**:
|
|
104
|
+
|
|
105
|
+
- Find all cells that share the same `colId` as `TARGET_NODE`'s cell.
|
|
106
|
+
- Collect their `nodeId` values (skip the target itself and any cell without a `nodeId`).
|
|
107
|
+
- Fetch each of those nodes individually by ID (in parallel):
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
curl -s "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes/<NODE_ID>" \
|
|
111
|
+
-H "x-user-id: examples-skill"
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### 3c — Read neighbour fields
|
|
115
|
+
For each neighbour element collected above (COMMAND, EVENT, READMODEL), extract its `meta.fields` and their existing `example` values. This gives you a pool of consistent values to reuse — e.g. if a COMMAND already has `email: "jane@example.com"`, use the same email in the linked EVENT.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Step 4 — Generate improved examples
|
|
120
|
+
|
|
121
|
+
For each field in `TARGET_NODE.meta.fields`:
|
|
122
|
+
|
|
123
|
+
1. **Skip** if `example` has any non-empty value — never overwrite existing examples, regardless of quality.
|
|
124
|
+
2. **Fill** only if `example` is absent, null, or whitespace-only.
|
|
125
|
+
|
|
126
|
+
Rules for generating examples:
|
|
127
|
+
- **Reuse values from linked elements** when the field name matches — keep examples consistent across the slice.
|
|
128
|
+
- **Infer type from the field name and `type`** property:
|
|
129
|
+
- `email` → realistic email like `"jane.smith@example.com"`
|
|
130
|
+
- `name`, `firstName`, `lastName` → real-sounding name
|
|
131
|
+
- `id`, `*Id` → realistic UUID or short ID like `"ORD-2024-0042"`
|
|
132
|
+
- `amount`, `price`, `total` → realistic decimal like `"149.99"`
|
|
133
|
+
- `date`, `*At`, `*Date` → ISO 8601 string like `"2024-03-15T10:30:00Z"`
|
|
134
|
+
- `status` → a plausible status value derived from the element title
|
|
135
|
+
- `boolean`, `*Enabled`, `*Active` → `"true"` or `"false"`
|
|
136
|
+
- `count`, `quantity` → small realistic integer like `"3"`
|
|
137
|
+
- Arrays / `cardinality: "List"` → JSON array with 1–2 representative items
|
|
138
|
+
- Unknown string fields → a short, realistic sentence or value matching the field name
|
|
139
|
+
- Make examples **domain-specific**: if the element is called "Order Placed", use order-domain values; if it's "User Registered", use registration-domain values.
|
|
140
|
+
- Keep examples **short** — one value per field, no paragraphs.
|
|
141
|
+
|
|
142
|
+
Build the updated `fields` array: same structure as the original, only the `example` property changed where needed. Set `edited: true` on any field you modify.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Step 5 — Write the update
|
|
147
|
+
|
|
148
|
+
Build the payload with Python to avoid shell JSON-escaping issues, then POST it:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
python3 - <<EOF > /tmp/examples_payload.json
|
|
152
|
+
import json, time, uuid
|
|
153
|
+
payload = [{
|
|
154
|
+
"id": str(uuid.uuid4()),
|
|
155
|
+
"eventType": "node:changed",
|
|
156
|
+
"nodeId": "<TARGET_NODE.id>",
|
|
157
|
+
"boardId": "<BOARD_ID>",
|
|
158
|
+
"timestamp": int(time.time() * 1000),
|
|
159
|
+
"changedAttributes": ["meta.fields"],
|
|
160
|
+
"meta": {
|
|
161
|
+
"fields": <updated-fields-array as Python list>
|
|
162
|
+
}
|
|
163
|
+
}]
|
|
164
|
+
print(json.dumps(payload))
|
|
165
|
+
EOF
|
|
166
|
+
|
|
167
|
+
curl -s -w "\n%{http_code}" -X POST "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes/events" \
|
|
168
|
+
-H "Content-Type: application/json" \
|
|
169
|
+
-H "x-token: $TOKEN" \
|
|
170
|
+
-H "x-board-id: $BOARD_ID" \
|
|
171
|
+
-H "x-user-id: examples-skill" \
|
|
172
|
+
--data-binary @/tmp/examples_payload.json
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Verify the response is HTTP 200. If it fails, report the error and stop.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Step 6 — Report back
|
|
180
|
+
|
|
181
|
+
Tell the user:
|
|
182
|
+
|
|
183
|
+
- **Element updated**: title and type
|
|
184
|
+
- **Fields improved**: list each field name and the example value that was set (skip unchanged fields)
|
|
185
|
+
- **Fields skipped**: briefly note any fields that already had good examples
|
|
186
|
+
- **Consistency notes**: if you reused values from linked elements, mention which ones
|
|
187
|
+
|
|
188
|
+
Example output:
|
|
189
|
+
```
|
|
190
|
+
Updated: EVENT "Order Placed"
|
|
191
|
+
|
|
192
|
+
Examples set:
|
|
193
|
+
orderId → "ORD-2024-0042"
|
|
194
|
+
customerId → "CUST-8819" (reused from linked COMMAND "Place Order")
|
|
195
|
+
amount → "149.99"
|
|
196
|
+
placedAt → "2024-03-15T10:30:00Z"
|
|
197
|
+
|
|
198
|
+
Skipped (already good):
|
|
199
|
+
email → "jane@example.com"
|
|
200
|
+
```
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: handle-comment
|
|
3
|
+
description: Place, resolve, or delete a comment on an eventmodelers board node. Action is determined by the first argument: place (default), resolve, or delete.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Handle Comment
|
|
7
|
+
|
|
8
|
+
> **Before doing anything else**, invoke the `connect` skill to resolve `TOKEN`, `BOARD_ID`, and `BASE_URL`. Do not proceed until the connect skill has completed.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Step 1 — Parse arguments
|
|
13
|
+
|
|
14
|
+
From `$ARGUMENTS` or the calling skill's context, extract:
|
|
15
|
+
|
|
16
|
+
| Field | How to find it | Default |
|
|
17
|
+
|-------|---------------|---------|
|
|
18
|
+
| `action` | First word: `place`, `resolve`, or `delete` | `place` |
|
|
19
|
+
| `nodeId` | UUID of the target node | **required** |
|
|
20
|
+
| `text` | Comment text (place) or substring to match (resolve/delete) | required for `place`; used to look up comment when `commentId` is absent |
|
|
21
|
+
| `commentId` | UUID of the comment to resolve/delete | preferred over `text` for resolve/delete |
|
|
22
|
+
| `type` | `COMMENT`, `TASK`, or `QUESTION` | `QUESTION` (place only) |
|
|
23
|
+
| `author` | Author identifier string | `agent` (place only) |
|
|
24
|
+
| `boardId` | Board UUID | from `connect` skill (`BOARD_ID`) |
|
|
25
|
+
|
|
26
|
+
Route to the matching section below based on `action`.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Action: place
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
curl -s -X POST "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes/$NODE_ID/comments" \
|
|
34
|
+
-H "Authorization: Bearer $TOKEN" \
|
|
35
|
+
-H "Content-Type: application/json" \
|
|
36
|
+
-d '{"text":"<text>","type":"<type>","author":"<author>"}'
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Response: `201 {"id":"<commentId>"}`
|
|
40
|
+
|
|
41
|
+
**Batching (when called in bulk, e.g. from `wdyt`):** send one request per comment — there is no batch endpoint for comments. Fire them sequentially, not in a single payload.
|
|
42
|
+
|
|
43
|
+
**Report:**
|
|
44
|
+
```
|
|
45
|
+
Comment posted on node <nodeId>
|
|
46
|
+
Type: <type> | Author: <author>
|
|
47
|
+
"<text>"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Action: resolve
|
|
53
|
+
|
|
54
|
+
**Step A — Resolve comment ID** (skip if `commentId` was provided directly):
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
curl -s "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes/$NODE_ID/comments" \
|
|
58
|
+
-H "Authorization: Bearer $TOKEN"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Find the comment whose `text` contains the `text` argument (case-insensitive). If multiple match, list them and ask the user to confirm. If none match, stop: "No comment found matching '<text>' on node `<nodeId>`."
|
|
62
|
+
|
|
63
|
+
**Step B — Resolve:**
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
curl -s -X POST "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes/$NODE_ID/comments/$COMMENT_ID/resolve" \
|
|
67
|
+
-H "Authorization: Bearer $TOKEN"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Report:** `Resolved comment <commentId> on node <nodeId>`
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Action: delete
|
|
75
|
+
|
|
76
|
+
**Step A — Resolve comment ID** (same lookup as resolve; skip if `commentId` was provided directly).
|
|
77
|
+
|
|
78
|
+
**Step B — Confirm before deleting:**
|
|
79
|
+
```
|
|
80
|
+
About to delete comment on node <nodeId>:
|
|
81
|
+
"<comment text>"
|
|
82
|
+
|
|
83
|
+
Confirm? (yes / no)
|
|
84
|
+
```
|
|
85
|
+
Wait for an explicit "yes". On any other response, stop: "Deletion cancelled."
|
|
86
|
+
|
|
87
|
+
**Step C — Delete:**
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
curl -s -X DELETE "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes/$NODE_ID/comments/$COMMENT_ID" \
|
|
91
|
+
-H "Authorization: Bearer $TOKEN"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Report:** `Deleted comment <commentId> from node <nodeId>`
|