Skip to content

Commit e598c54

Browse files
author
catlog22
committed
refactor: standardize Codex skill API calls to functions.request_user_input and add functions.update_plan
- Replace bare request_user_input() with functions.request_user_input() across 94 skill files - Replace AskUserQuestion with request_user_input in 3 team-config.json tool arrays - Add functions.update_plan progress tracking to 9 multi-phase skills (investigate, ship, security-audit, team-designer, review-cycle, issue-discover, parallel-dev-cycle, spec-generator, workflow-test-fix-cycle)
1 parent f93d646 commit e598c54

64 files changed

Lines changed: 1082 additions & 531 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codex/skills/analyze-with-file/SKILL.md

Lines changed: 383 additions & 134 deletions
Large diffs are not rendered by default.

.codex/skills/brainstorm-with-file/SKILL.md

Lines changed: 208 additions & 88 deletions
Large diffs are not rendered by default.

.codex/skills/brainstorm/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ const topic = isRole
228228

229229
```javascript
230230
if (executionMode === null) {
231-
const modeAnswer = request_user_input({
231+
const modeAnswer = functions.request_user_input({
232232
questions: [{
233233
question: "Choose brainstorming mode:",
234234
header: "Mode",
@@ -324,7 +324,7 @@ TOPIC: ${topic}" --tool gemini --mode analysis --rule planning-breakdown-task-st
324324
features.forEach(f => console.log(` - [${f.id}] ${f.title}`))
325325
}
326326

327-
const answer = request_user_input({
327+
const answer = functions.request_user_input({
328328
questions: [{
329329
question: "Approve brainstorm framework?",
330330
header: "Validate",
@@ -339,7 +339,7 @@ TOPIC: ${topic}" --tool gemini --mode analysis --rule planning-breakdown-task-st
339339
if (answer.Validate === "Cancel") return
340340
if (answer.Validate === "Modify Roles") {
341341
// Allow user to adjust via request_user_input
342-
const roleAnswer = request_user_input({
342+
const roleAnswer = functions.request_user_input({
343343
questions: [{
344344
question: "Select roles for analysis:",
345345
header: "Roles",

.codex/skills/clean/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ Manifest: ${sessionFolder}/cleanup-manifest.json
252252
}
253253

254254
// User confirmation
255-
const selection = request_user_input({
255+
const selection = functions.request_user_input({
256256
questions: [
257257
{
258258
header: "清理类别",

.codex/skills/csv-wave-pipeline/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ REQUIREMENT: ${requirement}" --tool gemini --mode analysis --rule planning-break
437437
waveTasks.forEach(t => console.log(` - [${t.id}] ${t.title}`))
438438
}
439439

440-
const answer = request_user_input({
440+
const answer = functions.request_user_input({
441441
questions: [{
442442
header: "验证",
443443
id: "validation",
@@ -820,7 +820,7 @@ ${[...new Set(tasks.flatMap(t => (t.files_modified || '').split(';')).filter(Boo
820820
821821
```javascript
822822
if (!AUTO_YES && failed.length > 0) {
823-
const answer = request_user_input({
823+
const answer = functions.request_user_input({
824824
questions: [{
825825
header: "下一步",
826826
id: "next_step",

.codex/skills/investigate/orchestrator.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,20 @@ Utility subagents callable by the investigator agent during analysis phases:
8181

8282
## Phase Execution
8383

84+
### Progress Tracking Initialization
85+
86+
Before spawning any agent, initialize progress tracking for all phases:
87+
88+
```
89+
functions.update_plan([
90+
{ id: "phase-1", title: "Phase 1: Root Cause Investigation", status: "in_progress" },
91+
{ id: "phase-2", title: "Phase 2: Pattern Analysis", status: "pending" },
92+
{ id: "phase-3", title: "Phase 3: Hypothesis Testing", status: "pending" },
93+
{ id: "phase-4", title: "Phase 4: Implementation", status: "pending" },
94+
{ id: "phase-5", title: "Phase 5: Verification & Report", status: "pending" }
95+
])
96+
```
97+
8498
### Phase 1: Root Cause Investigation
8599

86100
**Objective**: Spawn the investigator agent and assign the Phase 1 investigation task. Agent reproduces the bug, collects evidence, and runs initial diagnosis.
@@ -127,6 +141,8 @@ const p1Result = wait_agent({ targets: ["investigator"], timeout_ms: 300000 })
127141
|----------|-------------|
128142
| p1Result | Phase 1 completion summary with evidence, reproduction, initial diagnosis |
129143

144+
**Progress**: `functions.update_plan([{id: "phase-1", status: "completed"}, {id: "phase-2", status: "in_progress"}])`
145+
130146
---
131147

132148
### Phase 2: Pattern Analysis
@@ -169,6 +185,8 @@ const p2Result = wait_agent({ targets: ["investigator"], timeout_ms: 300000 })
169185
|----------|-------------|
170186
| p2Result | Pattern analysis section: scope classification, similar occurrences, scope justification |
171187

188+
**Progress**: `functions.update_plan([{id: "phase-2", status: "completed"}, {id: "phase-3", status: "in_progress"}])`
189+
172190
---
173191

174192
### Phase 3: Hypothesis Testing
@@ -218,6 +236,8 @@ const p3Result = wait_agent({ targets: ["investigator"], timeout_ms: 480000 })
218236

219237
If BLOCKED: close investigator and surface the diagnostic dump to the user. Do not proceed to Phase 4.
220238

239+
**Progress (on success)**: `functions.update_plan([{id: "phase-3", status: "completed"}, {id: "phase-4", status: "in_progress"}])`
240+
221241
---
222242

223243
### Phase 4: Implementation
@@ -261,6 +281,8 @@ const p4Result = wait_agent({ targets: ["investigator"], timeout_ms: 480000 })
261281
|----------|-------------|
262282
| p4Result | fix_applied section: files changed, regression test details, reproduction verified |
263283

284+
**Progress**: `functions.update_plan([{id: "phase-4", status: "completed"}, {id: "phase-5", status: "in_progress"}])`
285+
264286
---
265287

266288
### Phase 5: Verification & Report
@@ -303,6 +325,8 @@ const p5Result = wait_agent({ targets: ["investigator"], timeout_ms: 300000 })
303325
|----------|-------------|
304326
| p5Result | Completion status, test suite results, path to debug report file |
305327

328+
**Progress**: `functions.update_plan([{id: "phase-5", status: "completed"}])`
329+
306330
---
307331

308332
## Lifecycle Management

.codex/skills/issue-discover/SKILL.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ Action Selection:
102102
│ ├─ Short text (< 80 chars) → Create New (Phase 1)
103103
│ └─ Long descriptive text (≥ 80 chars) → Discover by Prompt (Phase 3)
104104
└─ Otherwise → request_user_input to select action
105+
└─ Initialize progress tracking: functions.update_plan([...phases])
105106
106107
Phase Execution (load one phase):
107108
├─ Phase 1: Create New → phases/01-issue-new.md
@@ -172,7 +173,7 @@ function detectAction(input, flags) {
172173

173174
```javascript
174175
// When action cannot be auto-detected
175-
const answer = request_user_input({
176+
const answer = functions.request_user_input({
176177
questions: [{
177178
header: "Action",
178179
id: "action",
@@ -201,6 +202,13 @@ const actionMap = {
201202
"Discover Issues": "discover",
202203
"Discover by Prompt": "discover-by-prompt"
203204
};
205+
206+
// Initialize progress tracking (MANDATORY)
207+
functions.update_plan([
208+
{ id: "action-select", title: "Action Selection", status: "completed" },
209+
{ id: "phase-exec", title: `Phase: ${selectedAction}`, status: "in_progress" },
210+
{ id: "post-phase", title: "Post-Phase: Next Steps", status: "pending" }
211+
])
204212
```
205213

206214
## Data Flow
@@ -317,11 +325,13 @@ close_agent({ id: agentId })
317325

318326
## Post-Phase Next Steps
319327

328+
**Progress**: `functions.update_plan([{id: "phase-exec", status: "completed"}, {id: "post-phase", status: "in_progress"}])`
329+
320330
After successful phase execution, recommend next action:
321331

322332
```javascript
323333
// After Create New (issue created)
324-
request_user_input({
334+
functions.request_user_input({
325335
questions: [{
326336
header: "Next Step",
327337
id: "next_after_create",
@@ -336,7 +346,7 @@ request_user_input({
336346
// answer.answers.next_after_create.answers[0] → selected label
337347

338348
// After Discover / Discover by Prompt (discoveries generated)
339-
request_user_input({
349+
functions.request_user_input({
340350
questions: [{
341351
header: "Next Step",
342352
id: "next_after_discover",
@@ -350,6 +360,9 @@ request_user_input({
350360
}); // BLOCKS (wait for user response)
351361
// answer.answers.next_after_discover.answers[0] → selected label
352362
// If "Quick Plan & Execute (Recommended)" → Read phases/04-quick-execute.md, execute
363+
364+
// Mark workflow complete
365+
functions.update_plan([{ id: "post-phase", status: "completed" }])
353366
```
354367

355368
## Related Skills & Commands

.codex/skills/issue-discover/phases/01-issue-new.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ if (clarityScore >= 1 && clarityScore <= 2 && !issueData.affected_components?.le
145145
```javascript
146146
// ONLY ask questions if clarity is low
147147
if (clarityScore < 2 && (!issueData.context || issueData.context.length < 20)) {
148-
const answer = request_user_input({
148+
const answer = functions.request_user_input({
149149
questions: [{
150150
header: "Clarify",
151151
id: "clarify",

.codex/skills/issue-discover/phases/02-discover.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ if (args.perspectives) {
8787
selectedPerspectives = args.perspectives.split(',').map(p => p.trim());
8888
} else {
8989
// Interactive selection via request_user_input
90-
const response = request_user_input({
90+
const response = functions.request_user_input({
9191
questions: [{
9292
header: "Focus",
9393
id: "focus",
@@ -273,7 +273,7 @@ await updateDiscoveryState(outputDir, {
273273
```javascript
274274
const hasHighPriority = issues.some(i => i.priority === 'critical' || i.priority === 'high');
275275

276-
await request_user_input({
276+
await functions.request_user_input({
277277
questions: [{
278278
header: "Next Step",
279279
id: "next_step",

.codex/skills/issue-discover/phases/03-discover-by-prompt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ await updateDiscoveryState(outputDir, {
390390
});
391391

392392
// Prompt user for next action
393-
await request_user_input({
393+
await functions.request_user_input({
394394
questions: [{
395395
header: "Next Step",
396396
id: "next_step",

0 commit comments

Comments
 (0)