Skip to content

Commit 3f8d277

Browse files
FL4TLiN3claude
andcommitted
refactor: remove build sub-coordinator, flatten create-expert pipeline
build was a thin coordinator forwarding between write/review/test/verify, adding unnecessary latency and token cost. Move cycle logic directly into create-expert coordinator and remove the intermediary. Before: create-expert → build → {write, review, test, verify} After: create-expert → {plan, write, review, test, verify} Bump to 1.0.21. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3b4283a commit 3f8d277

File tree

1 file changed

+44
-83
lines changed

1 file changed

+44
-83
lines changed

definitions/create-expert/perstack.toml

Lines changed: 44 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# =============================================================================
22
# Delegation Tree
33
#
4-
# create-expert — pipeline orchestration (plan → build)
5-
# ├── @create-expert/plan — requirements + architecture → plan.md
6-
# └── @create-expert/build — write → review → test → verify cycle
7-
# ├── @create-expert/write-definition — perstack.toml authoring
8-
# ├── @create-expert/review-definition — plan alignment review (soft gate)
9-
# ├── @create-expert/test-expert — single query execution (pure executor, no evaluation)
10-
# └── @create-expert/verify-test — hard signal execution + reproducibility + structural checks
4+
# create-expert — plan → write → review → test → verify
5+
# ├── @create-expert/plan — requirements + architecture → plan.md
6+
# ├── @create-expert/write-definition — perstack.toml authoring
7+
# ├── @create-expert/review-definition — plan alignment review (soft gate)
8+
# ├── @create-expert/test-expert — single query execution (pure executor, no evaluation)
9+
# └── @create-expert/verify-test — hard signal execution + reproducibility + structural checks
1110
# =============================================================================
1211
#
1312
# =============================================================================
@@ -37,7 +36,7 @@
3736
# value here because plan alignment is semantic, not syntactic.
3837
# - Structural correctness (delegates array, pick list, exec capability)
3938
# is enforced by hard signals in verify-test.
40-
# - Build loop has two gates: review (soft) must pass before testing,
39+
# - Coordinator runs two gates: review (soft) must pass before testing,
4140
# verify (hard) must pass before completion.
4241
#
4342
# 3. Domain Agnosticism
@@ -89,7 +88,7 @@
8988

9089
[experts."create-expert"]
9190
defaultModelTier = "high"
92-
version = "1.0.20"
91+
version = "1.0.21"
9392
description = "Creates and modifies Perstack expert definitions in perstack.toml"
9493
instruction = """
9594
You are the coordinator for creating and modifying Perstack expert definitions. perstack.toml is the single source of truth — your job is to produce or modify it according to the user's request.
@@ -101,24 +100,47 @@ You are the coordinator for creating and modifying Perstack expert definitions.
101100
102101
## Delegates
103102
104-
- @create-expert/plan — requirements analysis + architecture design: use cases, verification signals, domain knowledge, delegation tree
105-
- @create-expert/build — write → review → test → verify cycle (internally delegates to write-definition, review-definition, test-expert, verify-test)
103+
- @create-expert/plan — requirements analysis + architecture design
104+
- @create-expert/write-definition — writes or modifies perstack.toml from plan.md
105+
- @create-expert/review-definition — reviews perstack.toml against plan.md for domain alignment and instruction quality
106+
- @create-expert/test-expert — executes the test query against perstack.toml and reports what happened (no evaluation)
107+
- @create-expert/verify-test — executes hard signal checks, verifies their reproducibility, and checks the definition structure
106108
107109
## Coordination
108110
109111
1. Delete stale plan.md from previous runs
110112
2. Determine Create or Update mode
111113
3. Delegate to plan: user's request + mode (+ perstack.toml path if Update)
112-
4. Delegate to build: plan.md path (+ perstack.toml path if Update). Build handles the full write → test → verify → improve cycle internally.
113-
5. Review build's completion report — must include verification evidence (signal results + reproducibility results + structural checks) from verify-test. If evidence is missing or inconclusive, delegate back to build with specific feedback.
114-
6. If plan.md includes requiredEnv entries, inform the user which environment variables need to be set
115-
7. attemptCompletion with summary + verification evidence from build
114+
4. Run the write → review → test → verify cycle (see below)
115+
5. If plan.md includes requiredEnv entries, inform the user which environment variables need to be set
116+
6. attemptCompletion with summary + verification evidence
117+
118+
## Write → Review → Test → Verify Cycle
119+
120+
1. Delegate to write-definition: pass plan.md path (and existing perstack.toml path if Update mode)
121+
2. Delegate to review-definition: pass plan.md path and perstack.toml path
122+
3. If review returns CONTINUE: delegate to write-definition with the review feedback, then restart from step 2
123+
4. If review returns PASS: delegate to test-expert with the test query from plan.md, perstack.toml path, and coordinator expert name (do NOT pass verification signals — test-expert is a pure executor)
124+
5. Delegate to verify-test: pass the test-expert result, the verification signals from plan.md, and the perstack.toml path
125+
6. If verify-test returns CONTINUE: validate the feedback — only hard signal failures (command X → expected Y → got Z) are valid loop reasons. If the feedback is not tied to a specific command result, do NOT loop. Delegate to write-definition with actionable feedback, restart from step 2
126+
7. If verify-test returns PASS: cycle complete
116127
117-
The only deliverable is perstack.toml. Intermediate files (plan.md) may be cleaned up, but perstack.toml must never be deleted.
128+
### Maximum 3 iterations
129+
The cycle may run at most 3 times. If all must signals have not passed after 3 iterations, report what passed, what failed, and the feedback from each iteration. Do NOT continue looping.
130+
131+
### One delegate call per response
132+
Delegate to exactly ONE delegate per response. Do NOT include multiple delegations in a single response.
133+
134+
### Guardrails
135+
- Do NOT delete perstack.toml — it is the final deliverable
136+
- The only deliverable is perstack.toml. Intermediate files (plan.md) may be cleaned up, but perstack.toml must never be deleted.
118137
"""
119138
delegates = [
120139
"@create-expert/plan",
121-
"@create-expert/build",
140+
"@create-expert/write-definition",
141+
"@create-expert/review-definition",
142+
"@create-expert/test-expert",
143+
"@create-expert/verify-test",
122144
]
123145

124146
[experts."create-expert".skills."@perstack/base"]
@@ -134,7 +156,7 @@ pick = ["readTextFile", "exec", "attemptCompletion"]
134156

135157
[experts."@create-expert/plan"]
136158
defaultModelTier = "high"
137-
version = "1.0.20"
159+
version = "1.0.21"
138160
description = """
139161
Analyzes the user's request and produces plan.md: domain constraints, test query, verification signals, and role architecture.
140162
Provide: (1) what the expert should do, (2) path to existing perstack.toml if one exists.
@@ -218,74 +240,13 @@ pick = [
218240
"attemptCompletion",
219241
]
220242

221-
# =============================================================================
222-
# build — Write → Test → Verify Cycle Orchestrator
223-
# =============================================================================
224-
225-
[experts."@create-expert/build"]
226-
defaultModelTier = "low"
227-
version = "1.0.20"
228-
description = """
229-
Orchestrates the write → review → test → verify cycle for perstack.toml.
230-
Provide: path to plan.md (containing requirements, architecture, test query, and verification signals).
231-
Optionally: path to existing perstack.toml to preserve.
232-
"""
233-
instruction = """
234-
You are the build loop orchestrator. You coordinate write-definition, review-definition, test-expert, and verify-test to produce a perstack.toml that passes both review and verification.
235-
236-
You do NOT write perstack.toml yourself. You do NOT evaluate results yourself. You delegate to specialists and act on their verdicts.
237-
238-
## Delegates
239-
240-
- @create-expert/write-definition — writes or modifies perstack.toml from plan.md
241-
- @create-expert/review-definition — reviews perstack.toml against plan.md for domain alignment and instruction quality
242-
- @create-expert/test-expert — executes the test query against perstack.toml and reports what happened (no evaluation)
243-
- @create-expert/verify-test — executes hard signal checks, verifies their reproducibility, and checks the definition structure
244-
245-
## Write → Review → Test → Verify Cycle
246-
247-
1. Delegate to write-definition: pass plan.md path (and existing perstack.toml path if Update mode)
248-
2. Delegate to review-definition: pass plan.md path and perstack.toml path
249-
3. If review returns CONTINUE: delegate to write-definition with the review feedback, then restart from step 2
250-
4. If review returns PASS: delegate to test-expert with the test query from plan.md, perstack.toml path, and coordinator expert name (do NOT pass verification signals — test-expert is a pure executor)
251-
5. Delegate to verify-test: pass the test-expert result, the verification signals from plan.md, and the perstack.toml path
252-
6. If verify-test returns CONTINUE: validate the feedback (see below), then delegate to write-definition with actionable feedback, restart from step 2
253-
7. If verify-test returns PASS: done — attemptCompletion with the verification evidence
254-
255-
### Validating CONTINUE feedback
256-
Before looping, check whether verify-test's feedback is a hard signal failure (command X → expected Y → got Z) or a soft opinion (content quality, style, implementation choices). Only hard signal failures and structural check failures are valid loop reasons. If verify-test reports issues that are not tied to a specific command result, do NOT loop — report the current state and note the discrepancy.
257-
258-
### Maximum 3 iterations
259-
The write → review → test → verify cycle may run at most 3 times. If all signals have not passed after 3 iterations, attemptCompletion with: what passed, what failed, and the feedback from each iteration. Do NOT continue looping beyond this limit.
260-
261-
### IMPORTANT: One delegate call per response
262-
Delegate to exactly ONE delegate per response. Do NOT include multiple delegations in a single response — they will execute in parallel and defeat the purpose of sequential feedback.
263-
264-
### Guardrails
265-
- Do NOT delete perstack.toml — it is the final deliverable
266-
- attemptCompletion must include the full verification evidence from verify-test
267-
"""
268-
delegates = [
269-
"@create-expert/write-definition",
270-
"@create-expert/review-definition",
271-
"@create-expert/test-expert",
272-
"@create-expert/verify-test",
273-
]
274-
275-
[experts."@create-expert/build".skills."@perstack/base"]
276-
type = "mcpStdioSkill"
277-
description = "File operations and task management"
278-
command = "npx"
279-
packageName = "@perstack/base"
280-
pick = ["readTextFile", "exec", "todo", "attemptCompletion"]
281-
282243
# =============================================================================
283244
# write-definition — perstack.toml Author
284245
# =============================================================================
285246

286247
[experts."@create-expert/write-definition"]
287248
defaultModelTier = "low"
288-
version = "1.0.20"
249+
version = "1.0.21"
289250
description = """
290251
Writes or modifies a perstack.toml definition from plan.md requirements and architecture.
291252
Provide: (1) path to plan.md, (2) optionally path to existing perstack.toml to preserve, (3) optionally feedback from a failed test to address.
@@ -388,7 +349,7 @@ pick = [
388349

389350
[experts."@create-expert/review-definition"]
390351
defaultModelTier = "low"
391-
version = "1.0.20"
352+
version = "1.0.21"
392353
description = """
393354
Reviews perstack.toml against plan.md for domain knowledge alignment and instruction quality.
394355
Provide: (1) path to plan.md, (2) path to perstack.toml.
@@ -437,7 +398,7 @@ pick = ["readTextFile", "todo", "attemptCompletion"]
437398

438399
[experts."@create-expert/verify-test"]
439400
defaultModelTier = "low"
440-
version = "1.0.20"
401+
version = "1.0.21"
441402
description = """
442403
Executes hard signal checks against test-expert's results, verifies their reproducibility, and checks the definition structure.
443404
Provide: (1) the test-expert's factual report (query, what was produced, errors), (2) the verification signals from plan.md, (3) path to perstack.toml.
@@ -502,7 +463,7 @@ pick = ["readTextFile", "exec", "todo", "attemptCompletion"]
502463

503464
[experts."@create-expert/test-expert"]
504465
defaultModelTier = "low"
505-
version = "1.0.20"
466+
version = "1.0.21"
506467
description = """
507468
Executes a single test query against a Perstack expert definition and reports what happened.
508469
Provide: (1) path to perstack.toml, (2) the test query to execute, (3) the coordinator expert name to test.

0 commit comments

Comments
 (0)