Do upskill

From thermiteau/maverick · View interactive version

Do upskill is an AI agent skill from the GitHub repository thermiteau/maverick. Generate project-specific implementation skills at docs/maverick/skills/<topic>/SKILL.md by scanning the codebase. Pass a topic name to generate one topic; omit arguments to process every topic.

How to use this skill

Skill file

Generate Project Skills

Scan the current project's codebase for a given topic and produce a project-specific skill file at docs/maverick/skills/<topic>/SKILL.md.

Primary audience: LLMs. The generated skill is project implementation and usage guidance — what technology is used, how it's configured, and where the code lives. It is NOT best practices (the maverick best-practice skill handles that). Keep it dense, factual, and under 100 lines.

Preflight (mandatory)

Run this first. If it exits non-zero, halt and report the stderr output to the user verbatim. Do not proceed.

uv run maverick preflight do-upskill

The check verifies the project is initialised and uv is on PATH.

Invocation

Topics live in ${CLAUDE_PLUGIN_ROOT}/skills/do-upskill/topics.json

(resolve the env var once via Bash — the runtime cwd is the target

project, not the plugin).

that one topic and stop. This is the mode other skills and mid-task

lookups use — never expand a single-topic request into a full scan.

prompting the user. Do not present a list of choices.

For each topic entry being processed:

  1. Read the topic, prompt, bestPracticeSkill, and scanHints fields
  2. If the best-practice skill file exists, read it for reference
  3. Detect repository type (once, cached across all topics — see step 0 below)
  4. Single-repo: scan the entire repo, write to docs/maverick/skills/<topic>/SKILL.md
  5. Mono-repo: for each package, scope scanning to that package directory and write to <package>/docs/maverick/skills/<topic>/SKILL.md. Also scan the repo root for cross-cutting implementations and write those to docs/maverick/skills/<topic>/SKILL.md. Cross-cutting topics (see below) always write to root only.

Use subagents or parallel agents to process multiple topics concurrently when possible.

Input

Each topic entry in topics.json provides:

file — resolve against ${CLAUDE_PLUGIN_ROOT} before reading

(the same corpus is rendered below for reference)

Process

digraph generate {
    "Receive topic + scan hints" [shape=box];
    "Detect repository type" [shape=diamond];
    "Enumerate packages" [shape=box];
    "Check dependency files" [shape=box];
    "Grep for code patterns" [shape=box];
    "Glob for relevant files" [shape=box];
    "Read discovered files" [shape=box];
    "Technology found?" [shape=diamond];
    "Write full project skill" [shape=box];
    "Write recommended skill from best practice" [shape=box];

    "Receive topic + scan hints" -> "Detect repository type";
    "Detect repository type" -> "Check dependency files" [label="single-repo"];
    "Detect repository type" -> "Enumerate packages" [label="mono-repo"];
    "Enumerate packages" -> "Check dependency files" [label="for each package"];
    "Check dependency files" -> "Grep for code patterns";
    "Grep for code patterns" -> "Glob for relevant files";
    "Glob for relevant files" -> "Read discovered files";
    "Read discovered files" -> "Technology found?";
    "Technology found?" -> "Write full project skill" [label="yes"];
    "Technology found?" -> "Write recommended skill from best practice" [label="no"];
}

0. Detect Repository Type

Determine whether the project is a mono-repo or single-repo. A project is a mono-repo if any of the following are present:

If none of these indicators are found, treat the project as a single-repo.

Cache this result for the entire invocation — do not re-detect for each topic.

Package enumeration: Once a mono-repo is detected, enumerate all packages by reading the workspace configuration:

1. Check Dependency Files

Search for topic-related packages in:

Mono-repo: Check dependency files within each package directory (e.g. <package>/package.json, <package>/pyproject.toml), not just at the root. Root-level dependency files are still checked for cross-cutting concerns shared across packages.

2. Grep for Code Patterns

Use the scan hints grep patterns to find relevant code. If no scan hints provided, use the defaults for the topic.

3. Glob for Relevant Files

Use the scan hints file patterns to find relevant files by name.

4. Read Discovered Files

Read the files found in steps 2-3 to understand:

5. Write the Project Skill

Single-repo: Write SKILL.md to docs/maverick/skills/<topic>/SKILL.md using the Write tool (which creates parent directories automatically). Do NOT use mkdir via Bash.

Native-session pointer: after writing each root-level project skill,

also write a thin pointer at .claude/rules/maverick-<topic>.md so

sessions that don't know Maverick's lookup convention still load the

facts:

This project's <topic> conventions are documented in
`docs/maverick/skills/<topic>/SKILL.md` (generated by Maverick).
Read and follow it when working on <topic>-related code.

Keep the pointer to those three lines — the project skill stays the

single source of content.

Mono-repo: Output path depends on whether the topic is cross-cutting or package-scoped:

Cross-Cutting vs Package-Scoped Topics

Mandatory Output Structure

Every generated project skill MUST use this exact structure:

---
name: <topic-name>
title: <Topic> — Project Implementation
topic: <topic-name>
package: <package-name>          # only for package-level skills in mono-repos
last-verified: <YYYY-MM-DD>
---

## Stack

<What technology/library/service is used. Be specific: name, version if detectable.>

## Configuration

<How it's configured: env vars, config files, initialisation patterns. Describe in prose, no code.>

## Patterns

<Established conventions in this codebase. How the team uses this technology.>

## File Locations

<Specific file paths where the relevant code lives.>

The package field is only included for package-level skills generated in mono-repos. Omit it for root-level and single-repo skills.

Rules

Recording the Milestone

After every topic has been processed and at least one project skill file has been written, record that upskill has run on this project:

uv run maverick integration set upskill true

The flag is committed in .maverick/config.json so other Maverick skills (and maverick integration get) can see this milestone has been completed.

When Nothing Is Found

If scanning finds no existing implementation for the topic, generate a recommended implementation skill based on the best-practice skill for that topic and the project's codebase.

digraph not_found {
    "No implementation found" [shape=box];
    "Best-practice skill exists?" [shape=diamond];
    "Analyse codebase context" [shape=box];
    "Write recommended skill" [shape=box];
    "Write minimal stub" [shape=box];

    "No implementation found" -> "Best-practice skill exists?";
    "Best-practice skill exists?" -> "Analyse codebase context" [label="yes"];
    "Best-practice skill exists?" -> "Write minimal stub" [label="no"];
    "Analyse codebase context" -> "Write recommended skill";
}

With a Best-Practice Skill Available

  1. Read the best-practice skill for the topic (${CLAUDE_PLUGIN_ROOT}/<bestPracticeSkill>, e.g. ${CLAUDE_PLUGIN_ROOT}/skills/mav-bp-operability/SKILL.md)
  2. Analyse the codebase context — identify the language, framework, deployment target (e.g. Node.js + Fastify on AWS Lambda), existing dependencies, and project structure
  3. Generate a recommended implementation — apply the best-practice guidance to the specific codebase, choosing concrete technologies and patterns that fit the project's stack

Use the same mandatory output structure but with recommended content:

---
name: <topic-name>
title: <Topic> — Project Implementation
topic: <topic-name>
package: <package-name>          # only for package-level skills in mono-repos
last-verified: <YYYY-MM-DD>
status: recommended
---

## Stack

<Recommended technology/library based on the project's stack and best-practice guidance. Be specific: name the library and explain why it fits this project.>

## Configuration

<Recommended configuration approach based on the project's patterns — env vars, config files, initialisation. Reference the best-practice standards.>

## Patterns

<Recommended usage patterns tailored to this codebase's framework and structure. Describe how the team should use this technology.>

## File Locations

<Recommended file locations following the project's existing directory conventions.>

The status: recommended frontmatter field distinguishes generated recommendations from skills based on detected implementations. Users can review and edit the generated skill, then remove the status field once they've adopted it.

Without a Best-Practice Skill

If no best-practice skill exists for the topic, write a minimal stub:

---
name: <topic-name>
title: <Topic> — Project Implementation
topic: <topic-name>
last-verified: <YYYY-MM-DD>
status: stub
---

## Stack

No <topic> implementation detected. No best-practice skill available to generate recommendations.

## Configuration

N/A

## Patterns

N/A

## File Locations

N/A

Default Scan Hints

Generated from the topic registry (TOPICS in this skill's config) — the

single source of truth shared with topics.json:

logging

alerting

unit-testing

integration-testing

linting

cicd

application-security

dependency-management

observability

api-design

database

error-handling

infrastructure-as-code

accessibility

environment-management

<!-- maverick-plugin-version: 5.3.1 -->

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.