Use this skill when the user wants to explore or search across the codebase. Delegates search to GLM-4.7 via background subagent for non-blocking execution. Appropriate for: finding implementations,...
Delegate codebase searches to GLM-5 via background subagent. You remain free to do other work and receive automatic notification when complete.
Use the Task tool with these parameters:
Task(
description="GLM quick search: {brief description}",
subagent_type="general-purpose",
run_in_background=true,
max_turns=30, # GLM call + verification reads + summarization
prompt="""
Call the delegate_to_glm MCP tool with:
task: "{search_instructions}"
working_dir: "{project_root}"
Search instructions should include:
- Use rg (ripgrep) for fast searching
- Specific patterns or keywords to find
- File types or directories to focus on
- Output format: file:line with brief context
IMPORTANT: After GLM returns results, you MUST verify them and add Reviewer's Note:
1. For each reported file:line, use Read tool to check the actual content
2. Confirm the code/pattern GLM described actually exists at that location
3. DO NOT exclude incorrect findings - flag them in Reviewer's Note instead
Report format:
[GLM's findings with file:line references]
file.go:42 - Confirmed: AuthMiddleware exists herehandler.go:15 - Confirmed: Login handler implementationservice.go:88 - GLM reported AuthService but actual is UserServiceutils.go:20 - File exists but function is at line 45, not line 20
Main agent will discuss discrepancies with user and decide on follow-up.
"""
)
Task(
description="GLM search: authentication",
subagent_type="general-purpose",
run_in_background=true,
max_turns=30,
prompt="""
Call delegate_to_glm MCP tool:
task: "Find where user authentication is implemented in this Go project.
Use rg to search for:
- rg -n 'func.*Auth|func.*Login|func.*Verify' --type go
- rg -n 'middleware.*auth' --type go -i
Return file:line for each match."
working_dir: {project_root}
After GLM returns, verify the top 3-5 results and add Reviewer's Note:
- Read each file at the reported line
- Confirm the authentication logic exists there
- Flag any discrepancies in Reviewer's Note (don't exclude them)
Include Reviewer's Note section with Verified/Issues Found/Not Verified.
"""
)
Task(
description="GLM search: architecture violations",
subagent_type="general-purpose",
run_in_background=true,
max_turns=30,
prompt="""
Call delegate_to_glm MCP tool:
task: "Check for Clean Architecture violations.
Use rg to find domain layer importing infrastructure:
- rg -n 'import.*infrastructure|protocol|data' internal/feature/*/domain/ --type go
Report any violations as file:line, or 'No violations found'."
working_dir: {project_root}
If GLM reports violations, verify each one and add Reviewer's Note:
- Read the import block of each reported file
- Confirm it actually imports from infrastructure/protocol/data
- Flag false positives (comments, string literals) in Issues Found section
- Don't exclude anything - let main agent decide with user
"""
)
Task(
description="GLM search: TODOs",
subagent_type="general-purpose",
run_in_background=true,
max_turns=30,
prompt="""
Call delegate_to_glm MCP tool:
task: "Find all TODO and FIXME comments in the codebase.
Use: rg -n 'TODO|FIXME' --type go --type proto
Return file:line for each match."
working_dir: {project_root}
Verify a sample of results (at least 3-5) and add Reviewer's Note:
- Read the actual lines to confirm they are real TODO/FIXME comments
- Flag any false positives in Issues Found section
- Include Not Verified section for items not checked
"""
)
rg (ripgrep) instead of grep for speed--type to limit search scope-n flag to include line numbers| Parameter | Recommended | Description |
|---|---|---|
| max_turns (Task) | 30 | Subagent turns for GLM call + verification |
| max_iterations (GLM) | 100 | GLM tool calls within delegate_to_glm |
| working_dir | project root | Base directory for searches |