create-expert 0.0.38 → 0.0.39

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.
@@ -68,23 +68,62 @@ pick = ["readTextFile", "writeTextFile", "listDirectory", "think", "attemptCompl
68
68
  3. Based on the user's request, draft the expert definition
69
69
  4. Create the expert in memory using `createExpert` to validate the definition
70
70
  5. Add it as a delegate using `addDelegate` so you can test it
71
- 6. Test the expert by calling the delegate tool with a simple, realistic query
72
- 7. Review the result: check that the expert behaves as expected
73
- 8. If the test shows errors or unexpected behavior:
71
+ 6. **Practical test**: Call the delegate with a realistic query that matches what the user would actually ask (see Testing Guide below)
72
+ 7. **Verify outputs**: After the delegate returns, verify the actual artifacts and process (see Testing Guide below)
73
+ 8. If the test shows errors, missing artifacts, or quality issues:
74
74
  - Use `removeDelegate` to remove the current delegate
75
75
  - Modify the definition and call `createExpert` again with the same key
76
76
  - Add it as a delegate again with `addDelegate` and re-test
77
- 9. Once the expert works correctly, write the final `perstack.toml` using `writeTextFile`
77
+ 9. Once the expert produces correct, complete outputs, write the final `perstack.toml` using `writeTextFile`
78
78
  10. Use `attemptCompletion` when the expert is created and verified
79
79
 
80
- ## Testing with createExpert + addDelegate
80
+ ## Testing Guide
81
81
 
82
- After drafting an expert definition, always test it in memory before writing perstack.toml:
83
- - Use `createExpert` with the expert key, instruction, description, skills, and other fields
84
- - Use `addDelegate` with the expert key to make it callable
85
- - Call the delegate tool with a simple query that exercises the expert's core functionality
86
- - Review the result to verify correctness
87
- - If issues arise, iterate: `removeDelegate` -> fix -> `createExpert` -> `addDelegate` -> re-test
82
+ You MUST perform practical, end-to-end testing before writing perstack.toml. The test must simulate the user's actual use case, not just check that the expert "runs without errors".
83
+
84
+ ### Step 1: Design a realistic test query
85
+
86
+ Before calling the delegate, think about what the user will actually ask this expert to do. The test query should be a concrete, representative task — not a trivial or abstract one.
87
+
88
+ - If the expert generates code: ask it to generate a small but complete, realistic piece (e.g., "Create a responsive landing page with a hero section, feature cards, and a contact form")
89
+ - If the expert writes documentation: ask it to document a specific scenario (e.g., "Write API documentation for a user authentication endpoint with examples")
90
+ - If the expert performs analysis: give it real-looking data to analyze
91
+ - If the expert manages a workflow with sub-experts: give it a task that exercises delegation to at least one sub-expert
92
+
93
+ ### Step 2: Verify the artifacts after delegation
94
+
95
+ After the delegate returns its text result, you must verify what was actually produced. Do NOT just read the delegate's response text and assume success.
96
+
97
+ **For experts that create files:**
98
+ 1. Use `listDirectory` to confirm all expected files were created
99
+ 2. Use `readTextFile` to read each generated file
100
+ 3. Check that file contents are correct, complete, and well-structured
101
+ 4. Verify no placeholder content (e.g., "TODO", "Lorem ipsum" where real content is expected)
102
+
103
+ **For experts that modify existing files:**
104
+ 1. Use `readTextFile` to read the modified files
105
+ 2. Verify the changes are correct and the file is still valid
106
+ 3. Check that unrelated parts of the file were not damaged
107
+
108
+ **For experts that perform tasks (build, test, deploy, etc.):**
109
+ 1. Use `exec` to run `perstack logs --last` to inspect the execution process
110
+ 2. Verify the task steps were performed in the correct order
111
+ 3. Check that the final state matches expectations (files created, commands run, etc.)
112
+
113
+ **For experts with delegates (coordinator/lead experts):**
114
+ 1. Use `exec` to run `perstack logs --last` to verify delegation occurred
115
+ 2. Confirm that each sub-expert was called with appropriate queries
116
+ 3. Verify the coordinator properly synthesized results from sub-experts
117
+
118
+ ### Step 3: Evaluate quality, not just correctness
119
+
120
+ Ask yourself: "If I were the user, would I be satisfied with this output?"
121
+ - Is the output complete, or are parts missing?
122
+ - Is the quality appropriate for the task?
123
+ - Does the expert follow its instruction faithfully?
124
+ - Would the user need to manually fix or redo anything?
125
+
126
+ If the answer to any of these is unsatisfactory, iterate: fix the instruction, recreate, and re-test.
88
127
 
89
128
  ## Important Rules
90
129
 
@@ -108,6 +147,7 @@ pick = [
108
147
  "writeTextFile",
109
148
  "listDirectory",
110
149
  "getFileInfo",
150
+ "exec",
111
151
  "think",
112
152
  "attemptCompletion",
113
153
  "createExpert",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-expert",
3
- "version": "0.0.38",
3
+ "version": "0.0.39",
4
4
  "description": "Create and modify Perstack expert definitions",
5
5
  "author": "Wintermute Technologies, Inc.",
6
6
  "license": "Apache-2.0",
@@ -22,10 +22,10 @@
22
22
  "@types/node": "^25.2.3",
23
23
  "tsdown": "^0.20.3",
24
24
  "typescript": "^5.9.3",
25
- "@perstack/core": "0.0.50",
26
25
  "@perstack/perstack-toml": "0.0.6",
27
- "@perstack/runtime": "0.0.108",
28
- "@perstack/tui": "0.0.9"
26
+ "@perstack/core": "0.0.50",
27
+ "@perstack/runtime": "0.0.110",
28
+ "@perstack/tui": "0.0.10"
29
29
  },
30
30
  "engines": {
31
31
  "node": ">=22.0.0"