Skip to content

Commit 986eb31

Browse files
author
catlog22
committed
refactor: enhance context-search-agent execution mode and session information structure
1 parent 4f0edb2 commit 986eb31

File tree

1 file changed

+47
-25
lines changed

1 file changed

+47
-25
lines changed

.claude/commands/workflow/brainstorm/artifacts.md

Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -166,33 +166,55 @@ Task(
166166
prompt=`
167167
You are executing as context-search-agent (.claude/agents/context-search-agent.md).
168168
169-
## Session Info
170-
- Session ID: {session-id}
171-
- Topic: {topic}
172-
- Output: .workflow/WFS-{session-id}/.process/context-package.json
169+
## Execution Mode
170+
**BRAINSTORM MODE** (Lightweight) - Phase 1-2 only (skip deep analysis)
171+
172+
## Session Information
173+
- **Session ID**: ${session_id}
174+
- **Task Description**: ${task_description}
175+
- **Output Path**: .workflow/${session_id}/.process/context-package.json
173176
174177
## Mission
175-
Gather lightweight project context for brainstorming questions:
176-
- Project structure (get_modules_by_depth.sh)
177-
- Tech stack (package.json/requirements.txt)
178-
- Architecture patterns (CLAUDE.md)
179-
- Existing related modules (keywords: {topic_keywords})
180-
181-
## Scope (for brainstorm)
182-
**LIGHTWEIGHT** - Focus on high-level context, NOT detailed implementation
183-
- Skip: Detailed dependency graphs, deep code analysis
184-
- Include: Architecture overview, tech stack, existing module names
185-
- Conflict risk: Basic detection only (file count, module overlap)
186-
187-
## Output Fields Required
188-
- metadata: {task_description, keywords, tech_stack, session_id}
189-
- project_context: {architecture_patterns, coding_conventions, tech_stack}
190-
- assets: {documentation[], source_code[] with high-level paths only}
191-
- conflict_detection: {risk_level, existing_files[], affected_modules[]}
192-
- brainstorm_artifacts: {empty initially, will be populated by synthesis}
193-
194-
Execute Phase 0-2 only (Foundation, Task Analysis, Basic Discovery).
195-
Skip deep dependency analysis and web research.
178+
Execute complete context-search-agent workflow for implementation planning:
179+
180+
### Phase 1: Initialization & Pre-Analysis
181+
1. **Detection**: Check for existing context-package (early exit if valid)
182+
2. **Foundation**: Initialize code-index, get project structure, load docs
183+
3. **Analysis**: Extract keywords, determine scope, classify complexity
184+
185+
### Phase 2: Multi-Source Context Discovery
186+
Execute all 3 discovery tracks:
187+
- **Track 1**: Reference documentation (CLAUDE.md, architecture docs)
188+
- **Track 2**: Web examples (use Exa MCP for unfamiliar tech/APIs)
189+
- **Track 3**: Codebase analysis (5-layer discovery: files, content, patterns, deps, config/tests)
190+
191+
### Phase 3: Synthesis, Assessment & Packaging
192+
1. Apply relevance scoring and build dependency graph
193+
2. Synthesize 3-source data (docs > code > web)
194+
3. Integrate brainstorm artifacts (if .brainstorming/ exists, read content)
195+
4. Perform conflict detection with risk assessment
196+
5. Generate and validate context-package.json
197+
198+
## Output Requirements
199+
Complete context-package.json with:
200+
- **metadata**: task_description, keywords, complexity, tech_stack, session_id
201+
- **project_context**: architecture_patterns, coding_conventions, tech_stack
202+
- **assets**: {documentation[], source_code[], config[], tests[]} with relevance scores
203+
- **dependencies**: {internal[], external[]} with dependency graph
204+
- **brainstorm_artifacts**: {guidance_specification, role_analyses[], synthesis_output} with content
205+
- **conflict_detection**: {risk_level, risk_factors, affected_modules[], mitigation_strategy}
206+
207+
## Quality Validation
208+
Before completion verify:
209+
- [ ] Valid JSON format with all required fields
210+
- [ ] File relevance accuracy >80%
211+
- [ ] Dependency graph complete (max 2 transitive levels)
212+
- [ ] Conflict risk level calculated correctly
213+
- [ ] No sensitive data exposed
214+
- [ ] Total files ≤50 (prioritize high-relevance)
215+
216+
Execute autonomously following agent documentation.
217+
Report completion with statistics.
196218
`
197219
)
198220
```

0 commit comments

Comments
 (0)