From polydev
SUB-AGENT ONLY: This skill should be used when spawned for read-only research - generates report file and outputs [AGENT_DONE] marker.
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-2 --plugin shikihane-polydevThis skill uses the workspace's default tool permissions.
Execute investigation tasks and generate structured reports.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Execute investigation tasks and generate structured reports.
Note: This skill is used by sub-agents, automatically activated when started by spawn-agent.sh.
This is a sub-agent started by the main agent via spawn-agent.sh.
Do NOT call any polydev scripts. The responsibilities are:
The main agent detects [AGENT_DONE] output via terminal capture.
When task is complete, output this exact format to terminal:
[AGENT_DONE]
report: <full path to report file>
timestamp: <ISO timestamp, e.g., 2025-01-05T10:30:00Z>
summary: <summary in 20 words or less>
Example:
[AGENT_DONE]
report: ./.agent-reports/auth-analysis.md
timestamp: 2025-01-05T10:30:00Z
summary: JWT auth, 3 middlewares, 2 security issues found
The main agent detects your completion via grep "\[AGENT_DONE\]".
# Investigation Report: <Topic>
Generated: <ISO timestamp>
## Summary
<3-5 sentences summarizing key findings - this is what the main agent sees first>
## Findings
### 1. <Finding Title>
<Detailed explanation>
**Key Code:**
```<language>
// path/to/file.ts:123
<relevant code snippet>
| File | Lines | Description |
|---|---|---|
src/auth/jwt.ts | 45-67 | JWT validation logic |
src/middleware/auth.ts | 12-34 | Auth middleware |
<Additional technical details, code snippets, references>
---
## Execution Flow
---
## Prohibited Actions
DO NOT wait for user input (running in background) DO NOT output lots of process info to terminal (wastes main agent's tokens) DO NOT forget to output [AGENT_DONE] marker DO NOT modify code (unless task explicitly requires) DO NOT call any polydev scripts (sub-agent context)
DO keep process info in head or write to log DO write final results to report file DO output only key progress and completion marker to terminal DO structure report for quick scanning
---
## Terminal Output Example
Ideal terminal output should be very concise:
Starting investigation: Authentication mechanism analysis
Searching auth-related files... Found 12 related files
Analyzing key code...
Writing report...
Report generated: ./.agent-reports/auth-analysis.md
[AGENT_DONE] report: ./.agent-reports/auth-analysis.md timestamp: 2025-01-05T10:30:00Z summary: JWT auth, 3 middlewares, 2 security issues found
---
## Communication with Main Agent
There is no direct communication channel between sub-agent and main agent. The only ways to communicate are:
1. **Report file** - Main agent reads the generated report
2. **[AGENT_DONE] marker** - Main agent detects completion via terminal output
3. **summary field** - Main agent quickly decides if detailed reading is needed
Keep reports concise and structured so main agent can quickly extract key information.
---
## Rule Reflection (Check Before Completion)
**Trigger conditions** (all must be met):
1. Encountered **environment/compatibility/parameter usage** issue
2. Issue **will recur when new Agent executes**
3. Issue **has been solved** with a clear solution
**Action:** Write file to `.agent-memory/proposed-rules/<issue-summary>.md`
**Format:**
```markdown
# <Issue Summary>
## Problem
<Describe the issue and trigger conditions>
## Solution
<Specific solution>
## Example
\`\`\`bash
# Wrong approach
...
# Correct approach
...
\`\`\`
Do NOT trigger for: