@jiggai/recipes 0.2.25 → 0.3.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.
Files changed (37) hide show
  1. package/LICENSE +192 -0
  2. package/README.md +43 -6
  3. package/docs/AGENTS_AND_SKILLS.md +9 -13
  4. package/docs/ARCHITECTURE.md +109 -0
  5. package/docs/BUNDLED_RECIPES.md +3 -14
  6. package/docs/COMMANDS.md +92 -48
  7. package/docs/INSTALLATION.md +5 -5
  8. package/docs/RECIPE_FORMAT.md +2 -2
  9. package/docs/TEAM_WORKFLOW.md +4 -1
  10. package/docs/TUTORIAL_CREATE_RECIPE.md +7 -8
  11. package/docs/releasing.md +42 -0
  12. package/openclaw.plugin.json +1 -1
  13. package/package.json +2 -2
  14. package/recipes/default/business-team.md +20 -0
  15. package/recipes/default/clinic-team.md +20 -0
  16. package/recipes/default/construction-team.md +20 -0
  17. package/recipes/default/crypto-trader-team.md +20 -0
  18. package/recipes/default/customer-support-team.md +1 -1
  19. package/recipes/default/developer.md +0 -1
  20. package/recipes/default/development-team.md +79 -69
  21. package/recipes/default/editor.md +1 -1
  22. package/recipes/default/financial-planner-team.md +21 -0
  23. package/recipes/default/law-firm-team.md +22 -0
  24. package/recipes/default/marketing-team.md +22 -1
  25. package/recipes/default/product-team.md +1 -1
  26. package/recipes/default/research-team.md +1 -1
  27. package/recipes/default/researcher.md +1 -1
  28. package/recipes/default/stock-trader-team.md +1 -1
  29. package/recipes/default/writing-team.md +1 -1
  30. package/src/handlers/cron.ts +96 -20
  31. package/src/handlers/team.ts +32 -2
  32. package/src/lib/recipe-frontmatter.ts +7 -0
  33. package/src/lib/remove-team.ts +17 -4
  34. package/docs/CLEANUP_TODO.md +0 -31
  35. package/docs/CODE_SMELLS_TRACKER.md +0 -42
  36. package/docs/SMELLS_TODO.md +0 -23
  37. package/docs/TEST_COVERAGE_PROGRESS.md +0 -37
package/LICENSE ADDED
@@ -0,0 +1,192 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ Copyright [yyyy] [name of copyright owner]
181
+
182
+ Licensed under the Apache License, Version 2.0 (the "License");
183
+ you may not use this file except in compliance with the License.
184
+ You may obtain a copy of the License at
185
+
186
+ http://www.apache.org/licenses/LICENSE-2.0
187
+
188
+ Unless required by applicable law or agreed to in writing, software
189
+ distributed under the License is distributed on an "AS IS" BASIS,
190
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
191
+ See the License for the specific language governing permissions and
192
+ limitations under the License.
package/README.md CHANGED
@@ -11,7 +11,7 @@ If you like durable workflows: ClawRecipes is built around a **file-first team w
11
11
  ## Quickstart
12
12
  ### 1) Install
13
13
  #### Option A (preferred): install from npm
14
- Once published:
14
+ When published on npm:
15
15
 
16
16
  ```bash
17
17
  openclaw plugins install @jiggai/recipes
@@ -54,11 +54,22 @@ openclaw recipes dispatch \
54
54
  --owner lead
55
55
  ```
56
56
 
57
+ ## License
58
+
59
+ ClawRecipes is licensed under **Apache-2.0**.
60
+
61
+ Attribution requirement (practical): if you redistribute ClawRecipes (or a derivative work), you must retain the license and attribution notices (see `LICENSE` and `NOTICE`).
62
+
63
+ Branding note: the license does not grant permission to use JIGGAI trademarks except as required for reasonable and customary attribution. See `TRADEMARK.md`.
64
+
65
+ Contributions: we welcome PRs. By contributing, you agree that your contributions are licensed under the project’s Apache-2.0 license.
66
+
57
67
  ## Commands (high level)
58
68
  - `openclaw recipes list|show|status`
59
69
  - `openclaw recipes scaffold` (agent → `workspace-<agentId>` + writes workspace recipe `~/.openclaw/workspace/recipes/<agentId>.md` by default)
60
70
  - `openclaw recipes scaffold-team` (team → `workspace-<teamId>` + `roles/<role>/` + writes workspace recipe `~/.openclaw/workspace/recipes/<teamId>.md` by default)
61
- - `openclaw recipes install <idOrSlug> [--yes] [--global|--agent-id <id>|--team-id <id>]` (skills: global or scoped)
71
+ - `openclaw recipes install-skill <idOrSlug> [--yes] [--global|--agent-id <id>|--team-id <id>]` (skills: global or scoped)
72
+ - `openclaw recipes install <slug>` (marketplace recipe)
62
73
  - `openclaw recipes bind|unbind|bindings` (multi-agent routing)
63
74
  - `openclaw recipes dispatch ...` (request → inbox + ticket + assignment)
64
75
  - `openclaw recipes tickets|move-ticket|assign|take|handoff|complete` (file-first ticket workflow)
@@ -79,15 +90,26 @@ The plugin supports these config keys (with defaults):
79
90
  Config schema is defined in `openclaw.plugin.json`.
80
91
 
81
92
  ## Documentation
82
- Start here:
83
- - Installation: `docs/INSTALLATION.md`
84
- - Agents + skills: `docs/AGENTS_AND_SKILLS.md`
85
- - Tutorial (create a recipe): `docs/TUTORIAL_CREATE_RECIPE.md`
93
+ **For users:**
94
+ - [Installation](docs/INSTALLATION.md) — install the plugin
95
+ - [Agents & skills](docs/AGENTS_AND_SKILLS.md) — mental model, tool policies
96
+ - [Tutorial](docs/TUTORIAL_CREATE_RECIPE.md) — create your first recipe
97
+ - [Commands](docs/COMMANDS.md) — full command reference
98
+ - [Team workflow](docs/TEAM_WORKFLOW.md) — file-first workflow
99
+
100
+ **For contributors:**
101
+ - [Architecture](docs/ARCHITECTURE.md) — codebase structure
102
+ - [Contributing](CONTRIBUTING.md) — setup, tests, PR workflow
86
103
 
87
104
  ## Development
88
105
  ### Unit tests (vitest)
89
106
  Run:
90
107
  - `npm test`
108
+ - `npm run test:coverage` — coverage with CI thresholds (see `vitest.config.ts`)
109
+ - `npm run smell-check` — quality checks (ESLint, jscpd, pattern grep)
110
+
111
+ ### Pre-commit hooks
112
+ Husky runs on commit. Run `npm ci` first to install hooks.
91
113
 
92
114
  ### Scaffold smoke test (regression)
93
115
  A lightweight smoke check validates scaffold-team output contains the required testing workflow docs (ticket 0004).
@@ -98,6 +120,11 @@ Run:
98
120
  Notes:
99
121
  - Creates a temporary `workspace-smoke-<timestamp>-team` under `~/.openclaw/` and then deletes it.
100
122
  - Exits non-zero on mismatch.
123
+ - Requires OpenClaw and workspace config.
124
+
125
+ ### For contributors
126
+ - [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) — codebase structure
127
+ - [CONTRIBUTING.md](CONTRIBUTING.md) — setup, commands, pre-commit, CI
101
128
 
102
129
  Reference:
103
130
  - Commands: `docs/COMMANDS.md`
@@ -139,8 +166,10 @@ Notes:
139
166
  - [Recipe format](https://github.com/JIGGAI/ClawRecipes/blob/main/docs/RECIPE_FORMAT.md): `docs/RECIPE_FORMAT.md`
140
167
  - [Team workflow](https://github.com/JIGGAI/ClawRecipes/blob/main/docs/TEAM_WORKFLOW.md): `docs/TEAM_WORKFLOW.md`
141
168
  - [Agents & Skills](https://github.com/JIGGAI/ClawRecipes/blob/main/docs/AGENTS_AND_SKILLS.md): `docs/AGENTS_AND_SKILLS.md`
169
+ - [Architecture](https://github.com/JIGGAI/ClawRecipes/blob/main/docs/ARCHITECTURE.md): `docs/ARCHITECTURE.md`
142
170
  - [Bundled](https://github.com/JIGGAI/ClawRecipes/blob/main/docs/BUNDLED_RECIPES.md): `docs/BUNDLED_RECIPES.md`
143
171
  - [Create Recipe Tutorial](https://github.com/JIGGAI/ClawRecipes/blob/main/docs/TUTORIAL_CREATE_RECIPE.md): `docs/TUTORIAL_CREATE_RECIPE.md`
172
+ - [Contributing](https://github.com/JIGGAI/ClawRecipes/blob/main/CONTRIBUTING.md): `CONTRIBUTING.md`
144
173
 
145
174
  ## Note
146
175
  ClawRecipes is meant to be *installed* and then used to build **agents + teams**.
@@ -149,3 +178,11 @@ Most users should focus on:
149
178
  - authoring recipes in their OpenClaw workspace (`<workspace>/recipes/*.md`)
150
179
  - scaffolding teams (`openclaw recipes scaffold-team ...`)
151
180
  - running the file-first workflow (dispatch → backlog → in-progress → testing → done)
181
+
182
+ ## Goals
183
+ - Release Clawmarket, https://github.com/JIGGAI/ClawMarket, public url https://clawkitchen.ai
184
+ - Release ClawKitchen, https://github.com/JIGGAI/ClawKitchen
185
+ - Merge at least 1 community pull request
186
+ - Daily shipping/pull requests of ClawRecipes features
187
+ - Improve recipes with more detailed agent files
188
+ - Add ability to install skills for agents through ClawKitchen
@@ -95,30 +95,26 @@ openclaw gateway restart
95
95
 
96
96
  > Tip: if you later re-run scaffold with `--apply-config`, the recipe’s tool policy may overwrite your manual edits. If you want a change to stick, encode it in the recipe.
97
97
 
98
- ## Installing skills (workspace-local)
99
- ClawRecipes favors **workspace-local** installs so each OpenClaw workspace is self-contained.
98
+ ## Installing skills
99
+ ClawRecipes favors **workspace-local** installs so each agent/team workspace is self-contained.
100
100
 
101
101
  ### Install a skill slug
102
102
  ```bash
103
- openclaw recipes install <skill-slug>
103
+ openclaw recipes install-skill <skill-slug>
104
104
  # or non-interactive:
105
- openclaw recipes install <skill-slug> --yes
105
+ openclaw recipes install-skill <skill-slug> --yes
106
106
  ```
107
107
 
108
- This runs ClawHub under the hood and installs into the **current OpenClaw workspace** skills dir:
109
- - `<workspace>/skills/<skill-slug>`
110
-
111
- Examples:
112
- - standalone agent workspace: `~/.openclaw/workspace-<agentId>/skills/<skill-slug>`
113
- - team workspace: `~/.openclaw/workspace-<teamId>/skills/<skill-slug>`
114
-
115
- > Note: in the new workspace policy, standalone agents live in `~/.openclaw/workspace-<agentId>` and teams live in `~/.openclaw/workspace-<teamId>`. Skill install targeting is still being refined during the experimental phase.
108
+ By default, installs **globally** into `~/.openclaw/skills/`. Use flags to target a specific workspace:
109
+ - `--global` — shared across all agents (default)
110
+ - `--agent-id <id>` — `~/.openclaw/workspace-<agentId>/skills/<skill-slug>`
111
+ - `--team-id <id>` — `~/.openclaw/workspace-<teamId>/skills/<skill-slug>`
116
112
 
117
113
  ### Install the skills required by a recipe
118
114
  If a recipe declares skills in `requiredSkills` or `optionalSkills`:
119
115
 
120
116
  ```bash
121
- openclaw recipes install <recipe-id>
117
+ openclaw recipes install-skill <recipe-id>
122
118
  ```
123
119
 
124
120
  That installs the recipe’s declared skills.
@@ -0,0 +1,109 @@
1
+ # Architecture
2
+
3
+ Overview of the ClawRecipes codebase for maintainers.
4
+
5
+ ## Overview
6
+
7
+ `index.ts` acts as thin CLI wiring: it registers commands via `api.registerCli` and delegates to handlers. Business logic lives in `src/handlers/` and `src/lib/`. The plugin exports `__internal` for test-only access to handlers and lib functions.
8
+
9
+ ## File structure
10
+
11
+ ```
12
+ ClawRecipes/
13
+ ├── index.ts # Entry point: CLI wiring, delegates to handlers
14
+ ├── src/
15
+ │ ├── handlers/ # One file per command group
16
+ │ │ ├── cron.ts # Cron reconciliation (used during scaffold)
17
+ │ │ ├── install.ts # install-skill, install (marketplace recipe)
18
+ │ │ ├── recipes.ts # list, show, status, bind, unbind, bindings
19
+ │ │ ├── scaffold.ts # scaffold (single agent)
20
+ │ │ ├── team.ts # scaffold-team, migrate-team, remove-team
21
+ │ │ └── tickets.ts # tickets, move-ticket, assign, take, handoff, dispatch, complete
22
+ │ └── lib/ # Shared logic
23
+ │ ├── recipes-config.ts # OpenClaw config load/write, bindings, agent snippets
24
+ │ ├── recipes.ts # Recipe listing, loading, workspace paths
25
+ │ ├── recipe-id.ts # Pick recipe id (auto-increment)
26
+ │ ├── scaffold-utils.ts # Shared scaffold logic
27
+ │ ├── ticket-workflow.ts # Ticket stages, move, assign, handoff
28
+ │ ├── ticket-finder.ts # Ticket lookup by id/number
29
+ │ ├── lanes.ts # Workflow stages (backlog, in-progress, testing, done)
30
+ │ ├── cleanup-workspaces.ts
31
+ │ ├── remove-team.ts # Team uninstall logic
32
+ │ └── ... # prompt, template, skill-install, fs-utils, etc.
33
+ ├── recipes/ # Bundled recipe markdown files
34
+ ├── scripts/ # Smell-check, scaffold smoke, etc.
35
+ └── tests/ # Vitest unit tests
36
+ ```
37
+
38
+ ## Handler-to-command map
39
+
40
+ | Handler | Commands |
41
+ |-----------|----------|
42
+ | recipes | list, show, status, bind, unbind, bindings |
43
+ | scaffold | scaffold |
44
+ | team | scaffold-team, migrate-team, remove-team |
45
+ | tickets | tickets, move-ticket, assign, take, handoff, dispatch, complete |
46
+ | install | install-skill (ClawHub skills), install (marketplace recipe), install-recipe (alias) |
47
+ | cron | Reconciled during scaffold (no standalone command) |
48
+
49
+ ## Shared scaffold flow
50
+
51
+ Both `scaffold` and `scaffold-team` use:
52
+
53
+ - `scaffoldAgentFromRecipe` — creates workspace, writes recipe-managed files, applies agent config
54
+ - `reconcileRecipeCronJobs` — when a recipe declares `cronJobs`, installs/updates cron jobs per `cronInstallation` config
55
+
56
+ Cron behavior applies to both commands when the recipe has `cronJobs` in frontmatter.
57
+
58
+ ## Data flow
59
+
60
+ ```mermaid
61
+ flowchart LR
62
+ subgraph cli [CLI]
63
+ Cmd[recipes list/show/status/...]
64
+ end
65
+ subgraph idx [index.ts]
66
+ IndexTS[registerCli]
67
+ end
68
+ subgraph handlers [Handlers]
69
+ HRecipes[recipes.ts]
70
+ HScaffold[scaffold.ts]
71
+ HTeam[team.ts]
72
+ HTickets[tickets.ts]
73
+ HInstall[install.ts]
74
+ end
75
+ subgraph lib [Lib]
76
+ LibRecipes[recipes-config]
77
+ LibScaffold[scaffold-utils]
78
+ LibTickets[ticket-workflow]
79
+ end
80
+ Cmd --> IndexTS
81
+ IndexTS --> HRecipes
82
+ IndexTS --> HScaffold
83
+ IndexTS --> HTeam
84
+ IndexTS --> HTickets
85
+ IndexTS --> HInstall
86
+ HRecipes --> LibRecipes
87
+ HScaffold --> LibScaffold
88
+ HTeam --> LibScaffold
89
+ HTickets --> LibTickets
90
+ ```
91
+
92
+ ## Key decisions
93
+
94
+ - **Tool policy preservation**: When a recipe omits `tools`, the scaffold preserves the existing agent's tool policy (rather than resetting it). See scaffold logic and tests.
95
+ - **`__internal` export**: Unit tests import handlers and lib helpers via `__internal`; these are not part of the public plugin API.
96
+
97
+ ## Quality automation
98
+
99
+ - **smell-check**: `npm run smell-check` runs:
100
+ - **ESLint**: `no-explicit-any`, `complexity`, `max-lines-per-function`, `max-params` (src/; index.ts exempt from complexity/lines)
101
+ - **jscpd**: Duplicate code detection (≥8 lines, ≥50 tokens)
102
+ - **Pattern grep**: `as any` in src/ (max 10), TODO/FIXME/XXX (max 20)
103
+ - **lint**: `npm run lint` / `npm run lint:fix`
104
+ - **tests**: `npm test` (vitest), `npm run test:coverage`
105
+ - **CI**: `.github/workflows/ci.yml` runs test:coverage, smell-check, npm audit
106
+
107
+ ---
108
+
109
+ If this doc is outdated, please submit a PR to update it.
@@ -19,8 +19,8 @@ openclaw recipes scaffold project-manager --agent-id pm --name "Project Manager"
19
19
  ```
20
20
 
21
21
  What it writes:
22
- - `agents/pm/SOUL.md`
23
- - `agents/pm/AGENTS.md`
22
+ - `workspace-pm/SOUL.md`
23
+ - `workspace-pm/AGENTS.md`
24
24
 
25
25
  Default tool policy (recipe-defined):
26
26
  - allows: `group:fs`, `group:web`, plus `cron` and `message`
@@ -272,18 +272,7 @@ openclaw recipes scaffold-team financial-planner-team --team-id financial-planne
272
272
  Roles:
273
273
  - lead, advisor, analyst, tax, insurance, ops
274
274
 
275
- ## 17) `stock-trader-team` (team)
276
- **Use when:** you want a trading workflow: research/signals/risk/journaling.
277
-
278
- Scaffold:
279
- ```bash
280
- openclaw recipes scaffold-team stock-trader-team --team-id stock-trader-team-team --apply-config
281
- ```
282
-
283
- Roles:
284
- - lead, researcher, signals, risk, journal, ops
285
-
286
- ## 18) `crypto-trader-team` (team)
275
+ ## 17) `crypto-trader-team` (team)
287
276
  **Use when:** you want a crypto trading workflow with onchain research.
288
277
 
289
278
  Scaffold: