Create project skills

From tobihagemann/turbo · View interactive version

Create project skills is an AI agent skill from the GitHub repository tobihagemann/turbo. Scan a codebase and generate project skills capturing its inferred conventions. Use when the user asks to \"create project skills\", \"extract skills from the codebase\", or \"codify patterns as skills\".

How to use this skill

Skill file

Create Project Skills

Generates one skill per detected convention area in the project's skill directory so future Claude or Codex sessions auto-load them when working in the repo.

Task Tracking

At the start, use update_plan to track each phase, restating any remaining steps of a parent workflow alongside them:

  1. Survey codebase
  2. Extract patterns in parallel
  3. Evaluate patterns
  4. Propose skill list
  5. Run $write-skill skill

Step 1: Survey Codebase

If $ARGUMENTS specifies paths, scope the scan to those paths; otherwise scan the whole repository.

Build the extraction context:

  1. Detect primary languages and frameworks from manifest files (package.json, Cargo.toml, pyproject.toml, go.mod, Package.swift, pom.xml, Gemfile, and others appropriate to the stack).
  2. Map the top-level source directory structure and note test directory conventions.
  3. Read the project's instruction files (at each level AGENTS.override.md when one is present, otherwise AGENTS.md, including nested ones) and any .cursor/rules or .cursorrules. Note the conventions already documented there. The generated skills must not duplicate them.
  4. Determine the target skill directory:
  1. In the chosen target directory, list existing skills. For each, record the skill name, the description from SKILL.md frontmatter, and the first ## section heading from the body. These signals feed rename-conflict detection in Step 3.

Output a short text summary of detected stack, top-level layout, chosen target directory, and existing skills before moving on.

When that summary shows no source code to extract conventions from, stop here rather than dispatching Step 2. Executable code in any language qualifies, including scripts no manifest declares, so judge from the directory map rather than the detected stack. Documentation, instruction files, and configuration alone do not: extraction run over prose returns that prose's assertions as observed conventions, and Step 3 scores them with no code sites to test them against.

State that as text first — what the survey found, and that conventions extracted from it would have nothing to verify against. Then use request_user_input to offer:

On the first option, run the $write-skill skill directly on that knowledge and skip the remaining steps. On either of the first two, call update_plan with the extraction phases removed so they no longer read as pending work.

Step 2: Extract Patterns in Parallel

Read references/pattern-extractor.md to see the full taxonomy of pattern categories. Decide which categories apply to the detected stack (e.g., drop "Styling and UI" for a backend service, drop "State management" for a static-analysis tool).

Resolve the absolute path of this skill's directory, the directory of the SKILL.md loaded for this run, and use it as <this skill's directory> below.

Issue one extraction spawn_agent call per applicable category, all in one batch, then collect their results with wait_agent. Do not issue one and await its result before issuing the rest. Each sub-agent inherits the parent model. State the total count explicitly before emitting the batch. Every sub-agent's prompt must direct it to treat the shared working tree and its git index as read-only and to extract by reading and reasoning. Every sub-agent's prompt must also direct it to search the repository with a tool that skips gitignored files, such as git grep --untracked, and to open or search a gitignored path only when its prompt or a file its prompt directs it to read names it, or when a dependency's installed source is needed to verify a claim, never one holding local configuration or credentials. HEAD stays where it is: read other refs with git show <ref>:<path> rather than git checkout or git switch. Each agent's prompt must:

Step 3: Evaluate Patterns

Aggregate findings from all agents. For each finding, score three axes:

Group the surviving findings by topic into candidate skills. Each candidate typically covers one category, but related categories may merge if the patterns are tightly coupled. Split a candidate into two skills if its patterns cover clearly distinct sub-topics.

For each candidate skill, produce:

If rename-conflict detection is ambiguous from the Step 1 signals alone, read the existing skill's SKILL.md body and compare convention statements before finalizing the Status tag.

Step 4: Propose Skill List

Output the full proposal as text first, not inside request_user_input. For each candidate skill, show:

After all candidates are listed, use request_user_input to confirm the proposal with these options: "Approve all", "Make edits", "Cancel". If the user selects "Make edits", continue in conversation so the user can specify which candidates to drop, merge, or rename before returning here.

For each Rename conflict candidate, use a separate request_user_input asking whether to update the existing skill, create the new one alongside it, or skip. Since creating alongside always establishes a second skill covering the same conventions, present a Get a second opinion option in place of skip, keeping the question at three options. It runs the $consult-claude skill for which resolution leaves the skill set coherent. Then resolve the conflict with that answer in hand, re-asking when the choice stays the user's. A freeform answer that declines the candidate skips it.

Step 5: Run `$write-skill` Skill

Build the batch from approved candidates only. Do not include anything not explicitly approved in Step 4.

Output all approved candidates (both New and Update status) as text in a single batch. For each candidate, list the Status tag, proposed name, description, target path <target-skill-directory>/<name>/SKILL.md, and the 3–8 convention statements organized under ## <Section> headings with inline evidence citations (file_path:line). These convention statements define the target state the final SKILL.md should match, regardless of whether the skill is being created or updated.

Run the $write-skill skill once with this batch in context.

After $write-skill completes, output a summary of created and updated skills, grouped by status. If any candidates were dropped or skipped in Step 4, list them so the user knows what was left out.

Rules

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.