Skip to content

Commit 7b4db58

Browse files
mattthomps1claude
andcommitted
fix: restructure research workflow routing to prevent phase selection leak
The model was running Phase Selection (artifact status checks) even when inline transcript content was provided. Replaced soft "jump to Phase 2" instruction with numbered rules (Rule 1-4) with explicit "follow FIRST match and STOP" semantics. Inline content handling now happens at the routing point itself rather than deferring to a distant section. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 50ef776 commit 7b4db58

1 file changed

Lines changed: 26 additions & 9 deletions

File tree

  • plugins/compound-engineering/commands/workflows

plugins/compound-engineering/commands/workflows/research.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,38 @@ mkdir -p docs/research/plans docs/research/transcripts docs/research/interviews
3131

3232
Run this silently before any phase.
3333

34-
## Research Phase
34+
## Routing
3535

3636
<research_phase> #$ARGUMENTS </research_phase>
3737

38-
**If argument matches a phase name** (`plan`, `process`, or `personas`), jump directly to that phase below.
38+
Read the content inside `<research_phase>`. Follow the FIRST matching rule below and STOP — do not continue to later rules.
3939

40-
**If argument is unrecognized**, show the phase selection menu with a note: "Valid arguments: `plan`, `process`, `personas`."
40+
### Rule 1: Inline transcript content
4141

42-
**If argument is empty**, run phase selection:
42+
If the argument contains multi-line content (a transcript, meeting notes, interview text — anything beyond a single keyword or short phrase):
43+
44+
This IS inline transcript content. Do NOT check artifact status. Do NOT show phase selection. Handle it immediately:
45+
46+
1. Extract the meeting title and date from the content to generate a filename: `YYYY-MM-DD_<meeting-title-slug>_transcript.md`. If no date is found, use today's date.
47+
2. Save the full content to `docs/research/transcripts/[filename]`
48+
3. Jump to **Process Selected Transcript** in Phase 2 below with this file path
49+
50+
### Rule 2: Phase name keyword
51+
52+
If the argument is exactly `plan`, `process`, or `personas`, jump to that phase below.
53+
54+
### Rule 3: Unrecognized argument
55+
56+
If the argument is a short unrecognized string, show the phase selection menu with a note: "Valid arguments: `plan`, `process`, `personas`."
57+
58+
### Rule 4: Empty argument
59+
60+
If the argument is empty, run phase selection:
4361

4462
### Phase Selection
4563

64+
**SKIP this section if Rule 1 matched above (inline content).** Only run this when the argument was empty.
65+
4666
Show a brief artifact status (2-3 lines max):
4767

4868
```
@@ -83,12 +103,9 @@ After the skill completes, proceed to **Handoff**.
83103

84104
### Check for Inline Content
85105

86-
If the research phase argument contains more than just the word "process" (i.e., transcript content was provided inline):
106+
If arriving here from **Rule 1** in Routing, the transcript has already been saved. Skip directly to **Process Selected Transcript** below.
87107

88-
1. Extract the transcript content from the argument (everything after "process")
89-
2. Look for a meeting title or date in the content to generate a filename. Use the format: `YYYY-MM-DD_<meeting-title-slug>_transcript.md`. If no title or date is found, use today's date with a generic slug (e.g., `2026-02-13_interview_transcript.md`)
90-
3. Save the content to `docs/research/transcripts/[filename]`
91-
4. Skip the transcript selection step below — proceed directly to **Process Selected Transcript** with this file path
108+
If the argument starts with "process" followed by substantial content, strip the "process" prefix, save the content as a transcript file (using the same naming logic from Rule 1), and skip to **Process Selected Transcript**.
92109

93110
### Check for Transcripts
94111

0 commit comments

Comments
 (0)