@codemation/agent-skills 0.1.4 → 0.1.6
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 +16 -0
- package/package.json +2 -1
- package/skills/codemation-cli/SKILL.md +2 -0
- package/skills/codemation-cli/references/command-map.md +2 -0
- 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 +9 -2
- package/skills/codemation-plugin-development/references/plugin-structure.md +5 -1
- package/skills/codemation-workflow-dsl/SKILL.md +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @codemation/agent-skills
|
|
2
2
|
|
|
3
|
+
## 0.1.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#57](https://github.com/MadeRelevant/codemation/pull/57) [`3e882de`](https://github.com/MadeRelevant/codemation/commit/3e882de13103b6001d278b430791c380ee6771e1) Thanks [@cblokland90](https://github.com/cblokland90)! - Align discovered plugin loading with packaged JavaScript entries and keep framework watch mode rebuilding workspace plugin dist outputs.
|
|
8
|
+
|
|
9
|
+
## 0.1.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#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.
|
|
14
|
+
|
|
15
|
+
Built-in nodes and workflow DSL (`split` / `filter` / `aggregate` on the fluent chain, Switch routing, execution normalization) align with the unified runnable model.
|
|
16
|
+
|
|
17
|
+
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.
|
|
18
|
+
|
|
3
19
|
## 0.1.4
|
|
4
20
|
|
|
5
21
|
### 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.6",
|
|
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
|
}
|
|
@@ -34,6 +34,8 @@ Do not use this skill for workflow graph design, custom node implementation, or
|
|
|
34
34
|
2. Mention `.codemation/output` only when build artifacts or runtime bootstrap details matter.
|
|
35
35
|
3. When the user is in the monorepo, distinguish framework-author mode from normal consumer mode explicitly.
|
|
36
36
|
4. When Redis-backed execution is involved, mention the shared PostgreSQL requirement instead of assuming local SQLite still fits.
|
|
37
|
+
5. In consumer mode, discovered plugins are loaded from the built JavaScript path declared in `package.json#codemation.plugin`, not from TypeScript source under `node_modules`.
|
|
38
|
+
6. In plugin mode, the CLI TypeScript-loads only the current plugin repo through the generated `.codemation/plugin-dev/codemation.config.ts`.
|
|
37
39
|
|
|
38
40
|
## Read next when needed
|
|
39
41
|
|
|
@@ -15,6 +15,7 @@ Use `codemation dev` for a standalone Codemation app.
|
|
|
15
15
|
- The CLI starts the packaged `@codemation/next-host` UI.
|
|
16
16
|
- The CLI owns a stable development gateway.
|
|
17
17
|
- The CLI hot-swaps the in-process API runtime when consumer files change.
|
|
18
|
+
- Discovered plugins are loaded from the built JavaScript entry declared in `package.json#codemation.plugin`.
|
|
18
19
|
|
|
19
20
|
### Framework-author mode
|
|
20
21
|
|
|
@@ -22,6 +23,7 @@ Use `codemation dev --watch-framework` when working inside the Codemation monore
|
|
|
22
23
|
|
|
23
24
|
- The CLI starts `next dev` for `@codemation/next-host`.
|
|
24
25
|
- The CLI still owns the stable gateway and runtime swapping.
|
|
26
|
+
- Workspace plugin packages keep their `dist/` plugin entry fresh so runtime behavior stays aligned with packaged installs.
|
|
25
27
|
- This mode is for framework package work, not normal consumer usage.
|
|
26
28
|
|
|
27
29
|
## Command responsibilities
|
|
@@ -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
|
|
@@ -25,15 +25,22 @@ Do not use this skill for ordinary consumer workflow-only changes unless the wor
|
|
|
25
25
|
2. Keep plugin registration separate from node and credential implementation modules.
|
|
26
26
|
3. Use the sandbox app to exercise the plugin right away.
|
|
27
27
|
4. Keep the package publishable like a normal npm package.
|
|
28
|
+
5. Treat `codemation.plugin.ts` as the plugin repo's source composition root; consumer projects should load the built JavaScript entry declared in `package.json#codemation.plugin`.
|
|
28
29
|
|
|
29
30
|
## Common plugin pieces
|
|
30
31
|
|
|
31
|
-
- `codemation.plugin.ts`: plugin registration and sandbox app
|
|
32
|
-
- `src/nodes/*`: custom node definitions (`defineNode` → **`
|
|
32
|
+
- `codemation.plugin.ts`: plugin registration and sandbox app source, compiled to the published plugin entry in `dist/`
|
|
33
|
+
- `src/nodes/*`: custom node definitions (`defineNode` → **`execute`**; `defineBatchNode` → batch **`run`**)
|
|
33
34
|
- `src/credentialTypes/*`: custom credential definitions
|
|
34
35
|
- `src/index.ts`: package exports
|
|
35
36
|
- `test/*.test.ts` (optional): Vitest + `WorkflowTestKit` from `@codemation/core/testing` for engine-backed unit tests without starting the full host (`pnpm test`)
|
|
36
37
|
|
|
38
|
+
## Packaging guardrail
|
|
39
|
+
|
|
40
|
+
- `package.json#codemation.plugin` should point at runnable JavaScript such as `./dist/codemation.plugin.js`.
|
|
41
|
+
- Do not rely on consumers TypeScript-loading plugin files from `node_modules`.
|
|
42
|
+
- Prefer publishing `dist/**` plus package metadata/docs rather than shipping source-only plugin entry files as runtime dependencies.
|
|
43
|
+
|
|
37
44
|
## Unit tests (`WorkflowTestKit`)
|
|
38
45
|
|
|
39
46
|
Import **`WorkflowTestKit`** from **`@codemation/core/testing`**. Use **`registerDefinedNodes([...])`** for `defineNode` packages, then **`runNode({ node: yourNode.create(...), items })`** or **`run({ workflow, items })`** for fuller graphs. Prefer this for fast node tests; use **`codemation dev:plugin`** when you need the UI and persistence.
|
|
@@ -19,9 +19,11 @@ Use `codemation.plugin.ts` as the single place that:
|
|
|
19
19
|
- registers the plugin's nodes
|
|
20
20
|
- defines a small sandbox app through `defineCodemationApp(...)`
|
|
21
21
|
|
|
22
|
+
That file is the plugin repository's source composition root. Consumers should discover the plugin through `package.json#codemation.plugin`, pointing at built JavaScript in `dist/`.
|
|
23
|
+
|
|
22
24
|
## Node guidance
|
|
23
25
|
|
|
24
|
-
- start with `defineNode(...)` and **`
|
|
26
|
+
- start with `defineNode(...)` and **`execute(...)`** for simple reusable nodes (per-item pipeline; optional **`inputSchema`** and **`itemValue`** on config fields)
|
|
25
27
|
- use `defineBatchNode(...)` only when the node must process the **whole activation batch** in one **`run(items, ...)`**
|
|
26
28
|
- keep runtime logic close to the node definition
|
|
27
29
|
- move to class-based node APIs when you need constructor-injected collaborators or deeper runtime metadata
|
|
@@ -35,5 +37,7 @@ Use `codemation.plugin.ts` as the single place that:
|
|
|
35
37
|
## Publishability
|
|
36
38
|
|
|
37
39
|
- keep the package build output and plugin entry explicit
|
|
40
|
+
- point `package.json#codemation.plugin` at built JavaScript such as `./dist/codemation.plugin.js`
|
|
41
|
+
- do not rely on consumer runtimes TypeScript-loading plugin files from `node_modules`
|
|
38
42
|
- treat the plugin as a normal npm package
|
|
39
43
|
- installing the package in a Codemation app should be enough for the common auto-discovery flow
|
|
@@ -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
|
|