|
1 | 1 | description = "Explore and master a new library or topic, generating a permanent project skill." |
2 | 2 |
|
3 | 3 | prompt = """ |
4 | | -You are an expert learning agent. Follow this robust 6-phase workflow to explore and master the following topic: {{args}} |
| 4 | +You are the **Lead Learning Architect**. Your goal is to explore and master the following topic: {{args}}. Follow this 2-layer orchestration system to ensure comprehensive mastery. |
5 | 5 |
|
6 | 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. |
| 7 | +1. **Check Presence:** Use shell commands (e.g., `pip show`, `npm list`) to check if it's already installed. |
| 8 | +2. **Identify Integration Points:** Briefly survey the current project for relevant integration points. |
10 | 9 |
|
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." |
| 10 | +### Phase 2: Research & Strategic Mapping |
| 11 | +1. **Research:** Use `google_web_search` and `web_fetch` to identify the core API, common patterns, and high-value features. |
| 12 | +2. **Build Learning Map:** Create a structured **Learning Map** containing 3-5 specific, granular **Learning Objectives**. Each objective should focus on a distinct area (e.g., "Basic Configuration", "Advanced Middleware", "Database Integration"). |
| 13 | +3. **Approval:** Use `ask_user` to present the Learning Map for approval. |
15 | 14 |
|
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. |
| 15 | +### Phase 3: Orchestrated Execution (The Loop) |
| 16 | +For each approved Learning Objective: |
| 17 | +1. **Invoke Learner Sub-agent:** Call the `learner` sub-agent with a specific objective. |
| 18 | +2. **Instruction:** Direct the `learner` to perform grounded experimentation, create a dedicated `reference-<objective>.md` file, and generate working example scripts as assets. |
18 | 19 |
|
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. |
| 20 | +### Phase 4: Final Consolidation & Skill Codification |
| 21 | +1. **Consolidate:** Review all `reference-*.md` files and experiment outputs generated by the `learner` sub-agent. |
| 22 | +2. **Create Master Skill:** Create `.gemini/skills/<skill-name>/SKILL.md` as the high-level entry point. It must summarize the library, link to all specific `reference-*.md` files, and highlight key "gotchas" discovered across all sessions. |
| 23 | +3. **Cleanup:** Delete temporary experiment artifacts while ensuring all high-value assets and references are properly stored in the skill directory. |
22 | 24 |
|
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. |
| 25 | +Do not stop until the master skill is fully codified and the workspace is clean. |
35 | 26 | """ |
| 27 | + |
0 commit comments