nicolas-codemate

mentor-workflow

Coaching workflow orchestrator. Guides the developer through implementation without writing code.

nicolas-codemate 0 Updated 3mo ago

Resources

2
GitHub

Install

npx skillscat add nicolas-codemate/claudecodeconfig/mentor-workflow

Install via the SkillsCat registry.

SKILL.md

Mentor - Coaching Workflow Orchestrator

This skill orchestrates the developer coaching workflow. It reuses steps 00-05 from resolve-workflow for ticket fetching, analysis, and planning, then runs its own steps 06-08 for interactive coaching, review, and retrospective.

The mentor NEVER writes or modifies code files. It reads, analyzes, questions, and guides.

Input

Arguments passed from command: $ARGUMENTS

Step 1: Parse Arguments

Extract from arguments: - `ticket_id`: Optional (see resolve-workflow SKILL.md Step 1.5 for resolution) - `free_description`: Text after `--free` flag (enables free mode) - Flags: `--init`, `--continue`, `--refine-plan`, `--plan-only`, `--free` - Options: `--source`

CRITICAL: This workflow does NOT support --auto, --pr, --draft, --skip-simplify, --skip-review.
Mentoring is interactive by nature. The dev manages their own commits and PRs.

Step 2: Determine Mode

| Flag | Mode | Starting Step | |------|------|---------------| | `--free "..."` | FREE | 03-exploration (with description as context) | | `--init` | INIT | 00-initialization (config only) | | `--continue` | CONTINUE | 06-coach | | `--refine-plan` | REFINE | 05-plan-validation | | `--plan-only` | PLAN-ONLY | 00-initialization → ... → 05-plan-validation → STOP | | (default) | INTERACTIVE | 00-initialization | </mode_detection>

Step 3: Handle Free Mode Setup

If `--free` flag is present:

1. Create Feature Directory

Generate a slug from the description (e.g., "ajouter un endpoint API" → free-endpoint-api):

mkdir -p .claude/feature/{slug}

2. Initialize Status

Create .claude/feature/{slug}/status.json:

{
  "ticket_id": "{slug}",
  "mode": "INTERACTIVE",
  "workflow_type": "mentor",
  "free_mode": true,
  "free_description": "{user's description}",
  "state": "initialized",
  "started_at": "{ISO timestamp}",
  "phases": {
    "initialization": "completed",
    "fetch": "skipped",
    "analysis": "skipped"
  },
  "options": {
    "base_branch": "{auto-detected or ask user}"
  }
}

3. Create Ticket Equivalent

Save .claude/feature/{slug}/ticket.md:

# Free Mode: {description}

## Description

{user's full description}

## Source

Free mode - no ticket

4. Detect Base Branch

Same logic as step 00-initialization (detect from git or ask user).

5. Skip to Step 03 (Exploration)

Jump directly to exploration with the free description as context.
</free_mode>

Step 4: Load Current Step

1. Check mode to determine starting point 2. If CONTINUE: - Read status from `.claude/feature/{ticket-id}/status.json` - Verify status.json exists and has `workflow_type: "mentor"` - Load coaching context from status.json 3. For steps 00-04: Read from `~/.claude/skills/resolve-workflow/steps/{step}.md` 4. For steps 05-08: Read from `~/.claude/skills/mentor-workflow/steps/{step}.md` 5. Execute step instructions 6. Read step frontmatter for `next` directive 7. Continue to next step or STOP **IMPORTANT - Feature directory structure:** All workflow files are stored in `.claude/feature/{ticket-id}/`: - `status.json` - Workflow state (MUST include `workflow_type: "mentor"`) - `ticket.md` - Ticket content (or free mode description) - `plan.md` - Implementation plan - `final-review.md` - Pedagogical review - `retrospective.md` - Learning summary

NEVER use docs/ for workflow files. Always use .claude/feature/{ticket-id}/.
</critical_paths>

**ABSOLUTE RULE - READ-ONLY:**

The mentor workflow MUST NOT create or modify any code files. Allowed file operations:

  • READ: Any file (code, config, tests, etc.)
  • WRITE: Only files inside .claude/feature/{ticket-id}/ (status, plan, review, retro)
  • BASH: Only for git diff, git status, running tests/lint (read operations)

FORBIDDEN: Write, Edit tools on any file outside .claude/feature/
</read_only_rule>

**CRITICAL - Base Branch Usage:**

All git diff operations MUST use the base branch from status.json.
See resolve-workflow SKILL.md for full base_branch_rule documentation.
</base_branch_rule>

Step Execution Flow

### Ticket Mode (INTERACTIVE) ``` 00-initialization → 01-fetch-ticket → 02-analyze-complexity → 03-exploration → 04-create-plan → 05-plan-validation → STOP or /compact → 06-coach → 07-final-review → 08-retrospective | ^ +-- /mentor --continue + ```

Free Mode

(free setup) → 03-exploration → 04-create-plan → 05-plan-validation
→ STOP or /compact → 06-coach → 07-final-review → 08-retrospective

CONTINUE Flow

(verify status, load context) → 06-coach → 07-final-review → 08-retrospective

REFINE Flow

(load context) → 05-plan-validation → STOP or /compact → 06-coach → ...

INIT Flow

00-initialization → STOP

PLAN-ONLY Flow

00-initialization → ... → 05-plan-validation → STOP
</step_flow>

Status Extension

When initializing or updating status.json, add mentor-specific fields:

{
  "workflow_type": "mentor",
  "coaching": {
    "objective": null,
    "current_phase": 0,
    "current_task": 0,
    "hint_levels": {},
    "completed_tasks": [],
    "skipped_tasks": []
  }
}

Step Files

Step Location Description
00 resolve-workflow/steps/ Setup, config, feature directory
01 resolve-workflow/steps/ Retrieve ticket, Figma URLs
02 resolve-workflow/steps/ Score complexity
03 resolve-workflow/steps/ Explore codebase
04 resolve-workflow/steps/ Generate implementation plan
05 mentor-workflow/steps/ Ask objective + validate/refine plan
06 mentor-workflow/steps/ Coaching loop (CORE)
07 mentor-workflow/steps/ Final pedagogical review
08 mentor-workflow/steps/ Retrospective and learning summary

Mentor Agent

Load the mentor persona from ~/.claude/agents/mentor-agent.md before step 06.
This defines the coaching tone, principles, and adaptation rules.

Error Handling

- If step file not found: ERROR with clear message - If status.json invalid for CONTINUE: ERROR "Pas de session de coaching trouvee" - If CONTINUE but workflow_type != "mentor": ERROR "Ce ticket utilise /resolve, pas /mentor" - If ticket not found: ERROR with troubleshooting hints - Always update status.json after each step completion

Language

All user communication in French.
Technical output (git, code, files) in English.

NOW

1. Parse the arguments provided 2. Determine the execution mode 3. If free mode: run free mode setup 4. Load and execute the appropriate starting step 5. Follow the step's `next` directive until STOP or completion

Begin workflow for: $ARGUMENTS