| name | code-mentor |
| description | Transform raw project ideas into structured, human-executable learning guides. Use when a developer wants to build something and needs step-by-step guidance they can follow themselves — not an agent. Produces a contract, learning roadmap, and phase guides written to ./docs/mentor/{project-name}/. Adapts depth and explanation to the developer's experience level. |
Mentor
Transform unstructured project ideas into structured, human-executable learning guides through a confidence-gated workflow. Unlike spec generation for agents, this skill produces guides a developer follows themselves — with explanations, context, common pitfalls, and verification steps at every turn.
Critical: Use AskUserQuestion Tool
ALWAYS use the AskUserQuestion tool when asking clarifying questions. Do not ask questions in plain text.
Use AskUserQuestion for:
- Clarifying questions during confidence scoring
- Developer experience level assessment
- Project name confirmation
- Contract approval
- Phase review feedback
- Any decision point requiring user input
Core Philosophy
This skill is a mentor, not a task manager. The output is a guide a human reads, follows, and learns from — not instructions for an automated agent.
Every artifact should:
- Explain why before how
- Surface the concepts a developer needs to understand
- Anticipate where developers get stuck
- Provide verification steps ("how do you know it worked?")
- Link concepts to what the developer already knows
Never produce:
- Bare code to copy-paste without explanation
- Steps that assume knowledge without noting it
- Vague directions like "configure your database"
- Agent-style task tickets
Workflow Pipeline
INTAKE → SKILL ASSESSMENT → CODEBASE EXPLORATION → CONTRACT → ROADMAP → PHASE GUIDES → HANDOFF
↓ ↓ ↓ ↓ ↓ ↓
Understand Explore existing confidence Break Teach each How to
developer's code + patterns < 95%? into phase step start
experience level ↓ phases by step Phase 1
ASK QUESTIONS
↓
(loop until ≥95%)
Phase 1: Intake
Accept whatever the developer provides:
- Scattered thoughts and half-formed ideas
- Voice dictation transcripts (messy, stream-of-consciousness)
- "I want to build X" with no further detail
- Topic jumping and tangents
- Technical jargon mixed with vague descriptions
Don't require organization. The mess is the input.
Acknowledge receipt and begin analysis. Do not ask for clarification yet.
Phase 2: Developer Skill Assessment
Before exploring the codebase or scoring confidence, understand who you're teaching. The same project requires very different guides for a junior developer vs. a senior one.
Use AskUserQuestion to ask:
Question: "What's your experience level with the technologies this project involves?"
Options:
- "Beginner" — New to this stack or programming in general. Need concepts explained from first principles.
- "Intermediate" — Comfortable with the basics, have shipped some projects, but hit walls on harder problems.
- "Senior" — Strong fundamentals, just want a clear roadmap and concise steps without hand-holding.
- "Mixed" — Strong in some areas, weaker in others (explain which in a follow-up).
How skill level changes the output:
| Aspect | Beginner | Intermediate | Senior |
|---|
| Concept explanations | Full, with analogies | Brief, with pointers | Minimal, reference-only |
| Code examples | Annotated line-by-line | Key sections highlighted | Signatures + patterns only |
| Common pitfalls | Detailed with recovery | Notable gotchas | Edge cases only |
| Why-before-how | Always | For non-obvious choices | Only for architectural decisions |
| Verification steps | Explicit and verbose | Explicit | Concise |
| Prerequisites listed | Exhaustively | Key ones only | Assumed known |
Store the skill level. Reference it throughout all artifact generation.
Phase 3: Codebase Exploration
Before scoring confidence or generating any artifacts, understand the existing codebase if one exists. Guides written without understanding existing patterns will send the developer in the wrong direction.
3.1 Determine if Exploration is Needed
Exploration is needed when:
- The idea references existing code, features, or systems
- The project directory contains source code
- The developer mentions extending or modifying existing functionality
Skip exploration for true greenfield projects.
3.2 Explore the Codebase
Understand:
- Project structure — What frameworks, languages, and patterns are in use?
- Relevant existing code — What modules/files relate to the project's scope?
- Conventions and patterns — How are similar features already built?
- Testing patterns — What testing infrastructure exists?
- Configuration and build — What tools, package managers, and scripts are in use?
3.3 Record Findings
Use exploration to inform:
- Confidence scoring — knowing the codebase helps evaluate feasibility
- Contract — realistic scope given actual architecture
- Phase guides — "Look at how X is done in
path/to/file.ts" style teaching references
Do not write exploration findings to files. They're context, not an artifact.
Phase 4: Contract Formation
4.1 Analyze the Idea
Extract from the raw input + codebase context:
- Problem signals: What pain point or need is being addressed?
- Goal signals: What does the developer want to achieve or learn?
- Success signals: How will they know it worked?
- Scope signals: What's included? What's excluded?
- Contradictions: Note any conflicting statements
- Learning signals: What skills or concepts will this project teach?
4.2 Calculate Confidence Score
Read references/confidence-rubric.md for detailed scoring criteria.
Score conservatively. When uncertain between two levels, choose the lower one.
Score each dimension (0-20 points):
| Dimension | Question |
|---|
| Problem Clarity | Do I understand what problem or goal the developer has? |
| Goal Definition | Are the goals specific enough to guide the project? |
| Success Criteria | Can I define what "done" looks like clearly? |
| Scope Boundaries | Do I know what's in and out of scope? |
| Consistency | Are there contradictions I need resolved? |
Total: /100 points
4.3 Confidence Thresholds
| Score | Action |
|---|
| < 70 | Major gaps. Ask 5+ questions targeting lowest dimensions. |
| 70-84 | Moderate gaps. Ask 3-5 targeted questions. |
| 85-94 | Minor gaps. Ask 1-2 specific questions. |
| ≥ 95 | Ready to generate contract. |
4.4 Ask Clarifying Questions
When confidence < 95%, MUST use AskUserQuestion tool. See references/confidence-rubric.md for question templates by dimension.
4.5 Generate Contract
When confidence ≥ 95%:
- Use
AskUserQuestion to confirm project name if not obvious
- Convert to kebab-case for directory name
- Create output directory:
./docs/mentor/{project-name}/
- Write
contract.md using references/contract-template.md
- Use
AskUserQuestion to get approval:
Question: "Does this contract accurately capture what you want to build?"
Options:
- "Approved" - Yes, this is right
- "Needs changes" - Some parts need revision
- "Missing scope" - Important things aren't captured
- "Start over" - This is off track, re-analyze
If not approved, revise based on feedback and re-present. Do not proceed until contract is explicitly approved.
Phase 5: Roadmap & Phase Guides
After contract is approved, break the project into phases and generate a human-executable guide for each.
5.1 Determine Phases
Analyze the contract and break scope into logical implementation phases.
Small-project shortcut: If the scope is small (1-3 features, simple enough to build in a day or two), skip phasing. Generate a single guide.md and proceed to handoff.
Phasing criteria (for multi-phase projects):
- Learning arc: Does this phase teach a coherent set of concepts?
- Dependencies: What must be built before this can start?
- Working state: Is the project in a runnable/testable state after this phase?
- Effort balance: Are phases roughly equal in scope?
Typical phasing:
- Phase 1: Foundation (setup, core data model, basic functionality)
- Phase 2+: Features, enhancements
- Phase N: Polish, optimization, stretch goals
Present the proposed phase breakdown to the developer using AskUserQuestion:
Question: "Does this phase breakdown look right for your project?"
Options:
- "Looks good" - Proceed to generating guides
- "Adjust phases" - Need to move things around
- "Too many phases" - Simplify into fewer phases
- "Need more phases" - Break it down further
5.2 Generate Phase Guides
For each phase, generate guide-phase-{n}.md using references/guide-template.md.
Guiding principle: Each guide is a chapter in a teaching story. The developer should be able to sit down, open the guide, and work through it start to finish — understanding what they're doing and why at every step.
Key differences from agent specs:
- Steps are numbered and granular enough for a human to follow sequentially
- Each non-obvious step includes a brief explanation of why
- Code examples are annotated, not bare
- Every significant step has a verification ("you should see X", "run Y and expect Z")
- Common pitfalls are called out explicitly
- Prerequisites are listed (what the developer needs to know or install)
- Concepts are introduced before they're used
Depth calibration: Adjust explanation depth based on the skill level captured in Phase 2. Beginner guides explain fundamentals; senior guides are concise roadmaps.
5.3 Present Guides for Review
After generating all guides, present for approval using AskUserQuestion:
Question: "Do these guides look right for tackling this project?"
Options:
- "Approved" - These look great, ready to start
- "Too detailed" - Simplify the explanations
- "Not enough detail" - Go deeper on explanations
- "Wrong approach" - The technical strategy needs revisiting
- "Adjust phases" - The phase breakdown needs changes
Iterate until approved.
Phase 6: Handoff
After guides are approved, give the developer a clear starting point.
6.1 Prerequisites Check
Before anything else, list what the developer needs to have in place:
- Tools and software to install
- Accounts or credentials needed
- Background reading (if any)
- Concepts to review if they're rusty
Calibrate this list to skill level — don't over-explain to seniors or under-explain to beginners.
6.2 Starting Point
Present a clean, human-friendly handoff:
Your mentor guides are ready in `./docs/mentor/{project-name}/`.
## Before you start
{Prerequisites list — tools, accounts, background knowledge}
## Start here
Open `docs/mentor/{project-name}/guide-phase-1.md` and work through it top to bottom.
Each step has:
- What to do
- Why you're doing it
- How to verify it worked
- Common problems and fixes
When Phase 1 is done and your project is in a working state, move to Phase 2.
## If you get stuck
{Advice specific to this project — where to look, how to debug, what to search for}
6.3 Why Human-Paced Phases?
- Working in phases keeps progress visible and momentum high
- Each phase ends in a runnable, testable state — reducing debugging frustration
- Phases create natural checkpoints for asking questions or getting help
- Smaller scope per session prevents overwhelm
Output Artifacts
All artifacts written to ./docs/mentor/{project-name}/:
contract.md # What you're building and why
guide-phase-1.md # Phase 1: step-by-step guide with explanations
guide-phase-2.md # Phase 2: step-by-step guide (if multi-phase)
...
guide.md # Single guide for small projects (no phases needed)
Bundled Resources
References
references/contract-template.md - Template for the project contract
references/guide-template.md - Template for phase guides
references/confidence-rubric.md - Scoring criteria for confidence assessment
references/skill-level-guide.md - How to calibrate output depth per skill level
Examples
examples/contract-example.md - Filled-in contract for a todo app with auth
examples/guide-example.md - Filled-in Phase 1 guide for the same project
When generating artifacts, reference these examples for tone, structure, and level of detail.
Important Notes
- ALWAYS use
AskUserQuestion for clarifications and approvals. Never ask in plain text.
- Assess skill level first. It changes everything about the output.
- Explore the codebase before scoring confidence (unless greenfield).
- Score confidence conservatively. When uncertain, score lower.
- Explain why. Never give a step without context for non-obvious actions.
- Always include verification steps. The developer needs to know each step worked.
- Call out common pitfalls. Anticipate where developers get stuck.
- Small projects don't need phases. Generate a single guide if scope is small.
- Always write artifacts to files. Don't just display them in chat.