Skip to content

Commit 6ba141d

Browse files
committed
refactor: restructure instruction-builder-agent first-use.md
1 parent 32bb3a9 commit 6ba141d

3 files changed

Lines changed: 343 additions & 235 deletions

File tree

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"status" : "open"
2+
"status" : "closed",
3+
"target_branch" : "v2.1"
34
}

.cat/issues/v2/v2.1/refactor-instruction-builder-agent/plan.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,93 @@ prompts by ~40%.
1818
- [ ] All tests passing: `mvn -f client/pom.xml test` exits 0
1919
- [ ] Code quality improved: step numbering is sequential (no decimal sub-steps), curiosity gate is read once, verification checklist is grouped by phase
2020
- [ ] E2E verification: invoke instruction-builder on a simple test skill and confirm it completes the design subagent phase successfully
21+
22+
## Jobs
23+
24+
### Job 1
25+
26+
Refactor `plugin/skills/instruction-builder-agent/first-use.md` with the following structural changes. The file is
27+
the only file modified in this issue.
28+
29+
**Step 1: Add Prerequisites section after "Invocation Restriction" and before "Document Structure"**
30+
31+
Insert a new `## Prerequisites` section containing:
32+
- **Required inputs:** `GOAL` and `EXISTING_INSTRUCTION_PATH` (or `"N/A"`)
33+
- **Curiosity level:** Single read of `curiosity` from effective config (`get-config-output effective`), stored as
34+
`CURIOSITY`. Document that this value gates Steps 5-11 (when `CURIOSITY = low`, skip test evaluation, adversarial
35+
hardening, compression, and organic tests)
36+
37+
This replaces the 4 scattered `effort`/`curiosity` gate checks currently in Steps 4, 5, 6, and 7.
38+
39+
**Step 2: Extract Subagent Command Allowlist to shared section**
40+
41+
Move the "## Subagent Command Allowlist" section (currently embedded within Step 4) to a top-level section placed
42+
after Prerequisites and before Procedure. Keep all three categories (test-run, grader/analyzer, all subagents) and
43+
the full allowlist content. Add a single "instruction-based isolation limitation" note here instead of the two
44+
separate "Note on instruction-based isolation" paragraphs currently in the test-run and grader sub-sections.
45+
46+
**Step 3: Flatten step numbering**
47+
48+
Renumber all steps to be sequential 1-based integers. The current structure maps to:
49+
50+
| Current | New | Content |
51+
|---------|-----|---------|
52+
| Step 1 | Step 1 | Collect Existing Instruction Content |
53+
| Step 2 | Step 2 | Delegate Design Phase to Task Subagent |
54+
| Step 3 | Step 3 | Compact-Output Pass |
55+
| Step 4 (intro) | Step 4 | Write Draft and Prepare Test Infrastructure (compute TEST_DIR, TEST_MODEL, sanity check) |
56+
| Step 4.1 | Step 5 | Auto-Generate Test Cases |
57+
| Step 4.2 | Step 6 (subsection) | Incremental Test Case Selection (make a subsection header within Step 6, not a top-level step) |
58+
| Step 4.3 | Step 6 | SPRT Test Execution (includes pipeline, grading, result inspection) |
59+
| Step 4.4 | Step 7 | SPRT Failure Investigation |
60+
| Step 4.5 | Step 8 | Analyze and Iterate |
61+
| Step 5 | Step 9 | Adversarial TDD Loop |
62+
| Step 6 | Step 10 | In-Place Hardening Mode (Optional) |
63+
| Step 7 | Step 11 | Compression Phase |
64+
| Step 8 | (omit) | Create Organic Test Cases (omit — not present in source first-use.md) |
65+
66+
Within each new step, use descriptive subsection headers (####) instead of decimal sub-steps for internal structure
67+
(e.g., "#### Incremental Test Case Selection", "#### SPRT Parameters", "#### Pipeline Control Flow").
68+
69+
**Step 4: Reduce verification checklist**
70+
71+
Replace the current ~80-item checklist with ~30 items grouped by phase:
72+
73+
- **Design phase** (~3 items): design subagent returned complete draft, compact-output applied, correctness priority
74+
- **Test generation** (~7 items): per-unit extraction, action-based assertions, production-sequence prompts, negative
75+
scenarios, YAML frontmatter, user approval, no system_reminders
76+
- **SPRT execution** (~8 items): parameters correct, fresh subagents, TEST_MODEL from extract-model, grader subagents,
77+
temp files only, literal strings passed, result inspection checklist, token summary
78+
- **Failure investigation** (~4 items): auto-runs on reject, checks performed, conclusion routing correct
79+
- **Adversarial hardening** (~5 items): follows protocol, target_type correct, no inline embedding, prior test check,
80+
batch findings paths
81+
- **Compression** (~5 items): never interleaved with hardening, semantic pre-check, retries capped, acceptance
82+
criteria identical, subagent file restrictions
83+
84+
Remove items that merely duplicate procedure text (e.g., "Step 2 design subagent tool prohibition explicitly lists
85+
NotebookEdit alongside other prohibited tools" — this is already in the Step 2 procedure text).
86+
87+
**Step 5: Condense subagent prohibition prompts**
88+
89+
For each subagent prompt section (test-run, grader, compression, analyzer):
90+
- Remove duplicate "Note on instruction-based isolation" paragraphs (now in shared section)
91+
- Consolidate repeated file-access restrictions into a reference to the shared allowlist
92+
- Remove verbose re-listings of prohibited tools when they duplicate the shared allowlist
93+
- Keep all actual constraints — only remove redundant text that restates the same constraint
94+
95+
**Step 6: Replace curiosity gate checks**
96+
97+
In each step that currently has an inline curiosity/effort gate check (reading config and checking value), replace
98+
with a reference to the `CURIOSITY` variable set in Prerequisites:
99+
100+
- Old pattern: `Read effort from config... If effort = low, skip...`
101+
- New pattern: `If CURIOSITY = low, skip this step.`
102+
103+
**Step 7: Update index.json to closed status**
104+
105+
After all changes are made and verified:
106+
```bash
107+
cd ${WORKTREE_PATH} && sed -i 's/"open"/"closed"/' .cat/issues/v2/v2.1/refactor-instruction-builder-agent/index.json
108+
```
109+
110+
Commit all changes together: `refactor: restructure instruction-builder-agent first-use.md`

0 commit comments

Comments
 (0)