@codemation/agent-skills 0.1.4 → 0.1.5
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/CHANGELOG.md +10 -0
- package/package.json +2 -1
- package/skills/codemation-custom-node-development/SKILL.md +3 -3
- package/skills/codemation-custom-node-development/references/node-patterns.md +4 -4
- package/skills/codemation-plugin-development/SKILL.md +1 -1
- package/skills/codemation-plugin-development/references/plugin-structure.md +1 -1
- package/skills/codemation-workflow-dsl/SKILL.md +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @codemation/agent-skills
|
|
2
2
|
|
|
3
|
+
## 0.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#54](https://github.com/MadeRelevant/codemation/pull/54) [`35b78bb`](https://github.com/MadeRelevant/codemation/commit/35b78bb4d8c7ee2998a8b8e51e5ffc3fd901e4c7) Thanks [@cblokland90](https://github.com/cblokland90)! - **Breaking change:** `defineNode(...)` now follows the per-item pipeline: implement **`execute(args, context)`** (optional **`inputSchema`**, **`mapInput`**, and **`TWireJson`** on the generated runnable config). Add **`defineBatchNode(...)`** with **`run(items, context)`** for plugin nodes that still require batch **`run`** semantics.
|
|
8
|
+
|
|
9
|
+
Built-in nodes and workflow DSL (`split` / `filter` / `aggregate` on the fluent chain, Switch routing, execution normalization) align with the unified runnable model.
|
|
10
|
+
|
|
11
|
+
Align documentation (site guides, repo **`AGENTS.md`**, **`strict-oop-di`** skill, **`packages/core/docs/item-node-execution.md`**) and the **plugin** starter **`AGENTS.md`** with **config** for static wiring (credentials, retry, presentation) vs **inputs** / wire JSON for per-item behavior.
|
|
12
|
+
|
|
3
13
|
## 0.1.4
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codemation/agent-skills",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Reusable agent skills for Codemation projects and plugin development.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"skills"
|
|
38
38
|
],
|
|
39
39
|
"scripts": {
|
|
40
|
+
"changeset:verify": "pnpm --workspace-root run changeset:verify",
|
|
40
41
|
"test": "vitest run"
|
|
41
42
|
}
|
|
42
43
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: codemation-custom-node-development
|
|
3
|
-
description: Guides Codemation custom node development with `defineNode(...)` (`
|
|
3
|
+
description: Guides Codemation custom node development with `defineNode(...)` (`execute` per item), `defineBatchNode(...)` (batch `run`), reusable node modules, credential-aware nodes, and the class-based node fallback for advanced cases. Use when creating or updating custom nodes for apps or plugin packages.
|
|
4
4
|
compatibility: Designed for Codemation apps and plugin packages that define reusable nodes.
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@ Do not use this skill for pure workflow chaining questions unless the node imple
|
|
|
15
15
|
## Default approach
|
|
16
16
|
|
|
17
17
|
1. Start with `defineNode(...)`.
|
|
18
|
-
2. Implement **`
|
|
18
|
+
2. Implement **`execute(args, context)`** — one mapped **input** in, one output payload per item (activations are still batch-shaped; the engine iterates items for you).
|
|
19
19
|
3. Give the node a stable key and a clear title.
|
|
20
20
|
4. Optionally set **`icon`** on the `defineNode` definition so the workflow canvas shows a proper glyph (same string contract as `NodeConfigBase.icon`).
|
|
21
21
|
5. Use **`defineBatchNode(...)`** with **`run(items, context)`** only when the node must process the **entire batch** at once (legacy batch semantics).
|
|
@@ -26,7 +26,7 @@ Do not use this skill for pure workflow chaining questions unless the node imple
|
|
|
26
26
|
1. Prefer helper-based nodes first.
|
|
27
27
|
2. Keep nodes deterministic and focused.
|
|
28
28
|
3. Request credentials through named slots instead of hard-coded secrets.
|
|
29
|
-
4. Put **static** options (credentials, retry policy, labels) on **config**; put **per-item** behavior in **inputs** / wire JSON and optional **`
|
|
29
|
+
4. Put **static** options (credentials, retry policy, labels) on **config**; put **per-item** behavior in **inputs** / wire JSON and optional **`itemValue`** on config fields (consistent with built-in nodes).
|
|
30
30
|
5. Drop to class-based node APIs only when you need constructor-injected collaborators, decorators, or deeper runtime metadata.
|
|
31
31
|
|
|
32
32
|
## Testing with `WorkflowTestKit`
|
|
@@ -8,7 +8,7 @@ Use `defineNode(...)` when:
|
|
|
8
8
|
- the node belongs to one app or plugin package
|
|
9
9
|
- helper-based credential slots are enough
|
|
10
10
|
|
|
11
|
-
## Standard helper shape (`
|
|
11
|
+
## Standard helper shape (`execute`)
|
|
12
12
|
|
|
13
13
|
```ts
|
|
14
14
|
export const uppercaseNode = defineNode({
|
|
@@ -18,7 +18,7 @@ export const uppercaseNode = defineNode({
|
|
|
18
18
|
input: {
|
|
19
19
|
field: "string",
|
|
20
20
|
},
|
|
21
|
-
|
|
21
|
+
execute({ input }, { config }) {
|
|
22
22
|
return {
|
|
23
23
|
...input,
|
|
24
24
|
[config.field]: String(input[config.field as keyof typeof input] ?? "").toUpperCase(),
|
|
@@ -31,7 +31,7 @@ Optional **`icon`** is forwarded to the generated node config for the canvas (Lu
|
|
|
31
31
|
|
|
32
32
|
## Batch helper shape (`defineBatchNode`)
|
|
33
33
|
|
|
34
|
-
When the node must see **all items in one call**, use **`defineBatchNode`** and **`run(items, { config, credentials, execution })`** returning
|
|
34
|
+
When the node must see **all items in one call**, use **`defineBatchNode`** and **`run(items, { config, credentials, execution })`** returning outputs for the batch (same contract as other batch-shaped nodes such as **Aggregate**).
|
|
35
35
|
|
|
36
36
|
## When a custom node pays off
|
|
37
37
|
|
|
@@ -52,6 +52,6 @@ Reach for class-based node APIs when:
|
|
|
52
52
|
|
|
53
53
|
## Runtime reminder
|
|
54
54
|
|
|
55
|
-
- **`defineNode`** runs **`
|
|
55
|
+
- **`defineNode`** runs **`execute` once per item** (with optional **`inputSchema`** and **`itemValue`** on config fields before **`execute`**)
|
|
56
56
|
- **`defineBatchNode`** runs **`run`** once per activation batch
|
|
57
57
|
- keep nodes deterministic and testable; prefer real code paths or in-memory collaborators over heavy mocking
|
|
@@ -29,7 +29,7 @@ Do not use this skill for ordinary consumer workflow-only changes unless the wor
|
|
|
29
29
|
## Common plugin pieces
|
|
30
30
|
|
|
31
31
|
- `codemation.plugin.ts`: plugin registration and sandbox app
|
|
32
|
-
- `src/nodes/*`: custom node definitions (`defineNode` → **`
|
|
32
|
+
- `src/nodes/*`: custom node definitions (`defineNode` → **`execute`**; `defineBatchNode` → batch **`run`**)
|
|
33
33
|
- `src/credentialTypes/*`: custom credential definitions
|
|
34
34
|
- `src/index.ts`: package exports
|
|
35
35
|
- `test/*.test.ts` (optional): Vitest + `WorkflowTestKit` from `@codemation/core/testing` for engine-backed unit tests without starting the full host (`pnpm test`)
|
|
@@ -21,7 +21,7 @@ Use `codemation.plugin.ts` as the single place that:
|
|
|
21
21
|
|
|
22
22
|
## Node guidance
|
|
23
23
|
|
|
24
|
-
- start with `defineNode(...)` and **`
|
|
24
|
+
- start with `defineNode(...)` and **`execute(...)`** for simple reusable nodes (per-item pipeline; optional **`inputSchema`** and **`itemValue`** on config fields)
|
|
25
25
|
- use `defineBatchNode(...)` only when the node must process the **whole activation batch** in one **`run(items, ...)`**
|
|
26
26
|
- keep runtime logic close to the node definition
|
|
27
27
|
- move to class-based node APIs when you need constructor-injected collaborators or deeper runtime metadata
|
|
@@ -17,14 +17,14 @@ Do not use this skill for CLI-only troubleshooting or deep host architecture que
|
|
|
17
17
|
1. A workflow definition describes how items move from a trigger through downstream steps.
|
|
18
18
|
2. The fluent authoring chain is the normal starting point for Codemation apps.
|
|
19
19
|
3. Finish fluent workflow definitions with `.build()`.
|
|
20
|
-
4. Activations are **batch-shaped** (`Items`); many steps use **per-item** execution (`
|
|
20
|
+
4. Activations are **batch-shaped** (`Items`); many steps use **per-item** execution (`execute`, including helper **`defineNode`**) with optional **`inputSchema`** and **`itemValue`** on config fields. Batch reshape steps (split/filter/aggregate, **`defineBatchNode`**) work on the whole batch.
|
|
21
21
|
|
|
22
22
|
## Authoring rules
|
|
23
23
|
|
|
24
24
|
1. Prefer the fluent `workflow(...)` chain for app-local workflow files.
|
|
25
25
|
2. Keep workflow files focused on orchestration and named steps.
|
|
26
26
|
3. Use custom nodes when a callback grows into reusable product logic.
|
|
27
|
-
4. Distinguish **batch activations** from **per-item node bodies**: custom nodes from **`defineNode`** implement **`
|
|
27
|
+
4. Distinguish **batch activations** from **per-item node bodies**: custom nodes from **`defineNode`** implement **`execute`** per item unless you chose **`defineBatchNode`** for batch **`run`**.
|
|
28
28
|
|
|
29
29
|
## Typical flow
|
|
30
30
|
|