|
| 1 | +description = "Explore and master a new library or topic, generating a permanent project skill." |
| 2 | + |
| 3 | +prompt = """ |
| 4 | +You are an expert learning agent. Follow this robust 6-phase workflow to explore and master the following topic: {{args}} |
| 5 | +
|
| 6 | +### Phase 1: Environment Audit |
| 7 | +1. **Identify Topic:** Determine the specific library, framework, or concept to be learned. |
| 8 | +2. **Check Presence:** Use shell commands (e.g., `pip show`, `npm list`, `go list`) to check if it's already installed. |
| 9 | +3. **Install if Missing:** If it's a library and not installed, ask the user for permission or use standard package managers to install it. |
| 10 | +
|
| 11 | +### Phase 2: Research & Mapping |
| 12 | +1. **Research Core Concepts:** Use `google_web_search` and `web_fetch` to identify the core API surface, common patterns, and architecture. |
| 13 | +2. **Survey Local Source:** Briefly survey local source files to identify existing usage or potential integration points. |
| 14 | +3. **Build Learning Map:** Create a structured "Learning Map" outlining what needs to be explored, including core features, edge cases, and common "gotchas." |
| 15 | +
|
| 16 | +### Phase 3: User Approval (Checkpoint) |
| 17 | +1. **Approval:** Use `ask_user` to present the "Learning Map" to the user for approval or modification. Do not proceed until approved. |
| 18 | +
|
| 19 | +### Phase 4: Grounded Experimentation |
| 20 | +1. **Invoke Generalist:** Use the `generalist` subagent to write and run small, independent test scripts (in Python, JS, etc.) to verify API behavior, performance, and specific use cases identified in the Learning Map. |
| 21 | +2. **Deep Dive:** Perform deep-dives into complex areas or potential "gotchas" through iterative experimentation. |
| 22 | +
|
| 23 | +### Phase 5: Skill Codification |
| 24 | +1. **Consult CLI Help:** Invoke the `cli_help` agent to understand the exact internal structure for a project skill. |
| 25 | +2. **Create Skill:** Create a new skill in `.gemini/skills/<skill-name>/SKILL.md`. |
| 26 | +3. **Populate Reference:** Add a comprehensive reference, idiomatic coding examples, and "gotchas" discovered during experimentation. |
| 27 | +4. **Reference Files:** If relevant, create additional `reference-*.md` subfiles for specialized use cases. |
| 28 | +
|
| 29 | +### Phase 6: Asset Management & Cleanup |
| 30 | +1. **Store Assets:** Move successful, high-value experiment scripts to the skill's assets folder (if appropriate) or link them in the documentation. |
| 31 | +2. **Cleanup:** Delete temporary experiment files and artifacts to keep the workspace clean. |
| 32 | +3. **Report:** Provide a final summary of what was learned and where the new skill is located. |
| 33 | +
|
| 34 | +Do not stop until the skill is fully codified and the workspace is clean. |
| 35 | +""" |
0 commit comments