Claude Skill

create-project-skills

Scans an existing codebase and generates project-specific skills that capture inferred conventions such as naming, file organization, framework usage, data access, error handling, and testing style. Writes into the project's chosen skill directory (e.g., `.claude/skills/`, `.agen

LLM Mart · 0 points · 17 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download tobihagemann-turbo-codex_skills_create-project-skills-b903a85.zip · 7 KB
Part of tobihagemann/turbo — 147 skills

Install

skills CLI npx skills add https://github.com/tobihagemann/turbo/tree/main/codex/skills/create-project-skills
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install tobihagemann-turbo@llmmart
Git git clone https://github.com/tobihagemann/turbo.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole tobihagemann/turbo collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

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 $create-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:
    • Check candidate paths .agents/skills/, .claude/skills/, and a top-level skills/ directory (match case-insensitively so Skills/ or similar non-standard casing is detected too). Resolve symlinks so co-linked paths are treated as one logical location.
    • Use request_user_input to confirm where generated skills should live. Offer up to 3 options: the most likely target directory first, the next-most-likely if there is one, and a free-form path option. Note any symlink alias in the option description. If no Codex skill directory is detected, default the first option to ~/.agents/skills. The user can specify a custom path such as a project-specific directory via the free-form option.
  5. 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:

  • Write the skills from what we know (Recommended) — build skills from what this session established, rather than from conventions read out of the repo
  • Generate nothing yet — leave skills until the repo has code to have conventions about
  • Extract anyway — generate skills from the documentation and configuration that are there

On the first option, run the $create-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).

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. 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:

  • Name its assigned category
  • Include the stack summary and directory map from Step 1
  • Include the list of conventions already documented in AGENTS.md so duplicates are skipped
  • Instruct the agent to read references/pattern-extractor.md as its role brief and return findings in the format defined at the end of that file

Step 3: Evaluate Patterns

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

  • Consistency: what share of eligible sites follow the pattern? Drop findings below 30%. Flag findings between 30–70% as "mixed" for Step 4 review.
  • Intentionality: does the pattern appear across multiple subsystems and recent commits, or is it isolated? Drop findings confined to a single legacy module unless docs or lint config explicitly mark them as the desired convention.
  • Modernity: does the pattern align with current best practices for the stack? Flag patterns that contradict current idioms (e.g., pre-hooks class components in a React codebase also using hooks elsewhere) as "legacy" for Step 4 review.

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:

  • A proposed name (kebab-case, narrow to the topic, e.g., swift-naming, react-state, api-clients)
  • A one-line description with trigger phrases (e.g., "Use when writing or reviewing
  • 3–8 concrete convention statements with evidence citations (file:line)
  • A Status tag based on disk comparison:
    • New: no skill with that name exists in the target directory.
    • Update: a skill with the same name exists in the target directory. Produce a unified diff against the current SKILL.md body.
    • Rename conflict: an existing skill in the target directory has a name, description, or first-section heading that covers the same topic under a different name. Flag for user decision.

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:

  • Status tag, proposed name, one-line description
  • The 3–8 convention statements with evidence
  • For Update status, the unified diff
  • For Rename conflict status, the existing skill name and the overlap summary

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 $create-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.

This gives $create-skill everything it needs to skip its Step 1 (usage patterns clearly understood) and Step 2 (project skills typically need no additional reusable resources). For Update candidates, $create-skill also skips its Step 3 (initialization) per its own "skill already exists, iteration needed" skip rule and iterates on the existing SKILL.md in Step 4 until it matches the target convention statements.

Run the $create-skill skill once with this batch in context. Its batch-aware review, evaluation, and apply cycle then runs across all touched skills.

After $create-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

  • Each generated skill stays narrow: one topic per skill. Splitting is preferred over bundling.
  • Do not duplicate conventions already documented in AGENTS.md. Reference them instead if needed.
  • Generated skills must be self-contained: no cross-skill routing, no references to pipelines that invoke them.
  • Descriptions must be third-person and include trigger phrases a future agent session would match when working on the topic (e.g., "Use when writing or reviewing
Files (turbo)
  • references
    • pattern-extractor.md 8.6 KB
      # Pattern Extractor Guidelines
      
      Scan the codebase for convention patterns in one assigned category. Return a single structured list of findings using the format at the end of this file. Do not write code, modify files, or propose implementation steps.
      
      ## Contents
      
      - Extraction Process
      - Pattern Categories
        - Naming conventions
        - File organization
        - Framework usage
        - Data access and persistence
        - Error handling and logging
        - Testing conventions
        - State management
        - API and service boundaries
        - Styling and UI
        - Domain modeling and types
        - Concurrency and async
        - Build, scripts, and dev tooling
      - Finding Format
      
      ## Extraction Process
      
      ### 1. Focus on the Assigned Category
      
      The parent prompt names one category from the taxonomy below. Work only on that category. Ignore patterns that belong to other categories even when they surface during the search.
      
      ### 2. Survey Systematically
      
      - Use shell glob expansion or `find` to locate candidate files by name pattern.
      - Use `rg` to find specific symbols, imports, or patterns across files.
      - Read files only after a glob or `rg` result indicates they are relevant.
      - Issue multiple tool calls in parallel when searching for different things simultaneously.
      - Look for repeated patterns across unrelated modules and recent commits. Isolated occurrences do not establish convention.
      
      ### 3. Skip Already-Documented Conventions
      
      The parent prompt lists conventions already documented in `AGENTS.md`. Do not report those as new findings.
      
      ### 4. Emit Findings
      
      Use the Finding Format section at the end of this file. One entry per distinct pattern. If the category yields no meaningful patterns, return a single "no patterns detected" line per the Finding Format.
      
      ## Pattern Categories
      
      ### Naming Conventions
      
      **What to look for:** file names, directory names, class and type names, protocol or interface names, function and method names, variable and property names, constants, enum cases, test names, acronym casing, prefix or suffix conventions for specific roles (e.g., `*ViewModel`, `*Repository`, `use*` hooks).
      
      **Evidence sources:** any source file. Look for repeated patterns across many files to distinguish convention from coincidence.
      
      **Quality signals:** a linter or formatter config encoding the pattern, the same shape used across multiple subsystems and authors, the pattern applied even in recent commits.
      
      ### File Organization
      
      **What to look for:** top-level directory layout, per-feature vs per-layer organization, where tests live relative to source, where generated or vendored code is placed, where configuration lives, how modules or packages are split.
      
      **Evidence sources:** directory tree, manifest files, import or module paths, workspace configuration.
      
      **Quality signals:** consistent placement across features, a documented structure in a README or architecture doc, build configuration that enforces the layout.
      
      ### Framework Usage
      
      **What to look for:** how the project uses its primary frameworks (React hooks patterns, Vue composables, SwiftUI view structure, Django views and middleware, Rails controllers and concerns, Spring annotations, etc.). Both idiomatic and project-specific deviations.
      
      **Evidence sources:** feature modules, component or view files, framework integration points.
      
      **Quality signals:** the same framework idiom used across unrelated features, a wrapper or base class that encodes the convention, custom lint rules.
      
      ### Data Access and Persistence
      
      **What to look for:** ORM or query builder usage, repository or data-access object patterns, transaction boundaries, caching layers, migration conventions, how queries are parameterized and composed, how related entities are loaded.
      
      **Evidence sources:** data layer directories, repository or model files, query helpers, migration files.
      
      **Quality signals:** a single way of writing queries across the codebase, shared base classes or helpers, documented transaction patterns.
      
      ### Error Handling and Logging
      
      **What to look for:** custom error or exception types, how errors propagate (thrown, returned as result types, wrapped), logging library and log levels, structured logging fields, how user-facing errors differ from internal errors, retry and backoff patterns.
      
      **Evidence sources:** shared error modules, logging utilities, service boundaries, API handlers.
      
      **Quality signals:** a small number of well-defined error types, consistent logging context fields, documented retry policies.
      
      ### Testing Conventions
      
      **What to look for:** test file naming and location, test framework choice and assertion style, fixture and factory patterns, mocking approach, test data builders, naming of test cases, how integration vs unit tests are separated, snapshot testing usage.
      
      **Evidence sources:** test directories, test utility files, CI configuration.
      
      **Quality signals:** consistent test structure across features, shared test helpers, tests written alongside recent code changes.
      
      ### State Management
      
      **What to look for:** state container choice (Redux, Zustand, Pinia, Combine, observable objects, etc.), how state is scoped (global, feature, local), side-effect handling (thunks, sagas, effects), selector and derived-state patterns, how state shape evolves with features.
      
      **Evidence sources:** store or state directories, feature state slices, action and reducer definitions.
      
      **Quality signals:** a uniform state shape pattern across features, documented slice or module boundaries.
      
      ### API and Service Boundaries
      
      **What to look for:** how HTTP clients are constructed and shared, request and response type definitions, authentication and header handling, pagination and error response shapes, internal service-to-service communication patterns, API versioning, rate limiting.
      
      **Evidence sources:** client or service directories, generated API types, middleware or interceptor code.
      
      **Quality signals:** a single client wrapper used everywhere, typed request and response schemas, consistent error-mapping layer.
      
      ### Styling and UI
      
      **What to look for:** styling approach (CSS modules, Tailwind, styled-components, design tokens), design system components, spacing and typography scales, theming, accessibility conventions, responsive breakpoints, icon handling.
      
      **Evidence sources:** component libraries, style or theme directories, design token files, Storybook or similar.
      
      **Quality signals:** components composed from a design system rather than bespoke styles, consistent token usage, documented design system.
      
      ### Domain Modeling and Types
      
      **What to look for:** core domain types and where they live, value vs entity distinction, identifier patterns (branded types, UUIDs, strongly-typed IDs), invariants enforced at the type level, serialization and deserialization boundaries, enum vs union type patterns.
      
      **Evidence sources:** domain or model directories, type definition files, schema files.
      
      **Quality signals:** types shared across layers (domain, API, storage), invariants enforced in constructors or smart constructors, consistent identifier strategy.
      
      ### Concurrency and Async
      
      **What to look for:** async primitive choice (async/await, futures, promises, actors, Combine, RxJS), concurrency boundaries, cancellation patterns, thread-safety conventions, background work scheduling, queue usage, race-condition prevention.
      
      **Evidence sources:** async utility files, background job modules, concurrency-heavy features.
      
      **Quality signals:** a uniform async idiom across features, documented cancellation strategy, actor or queue boundaries that match module structure.
      
      ### Build, Scripts, and Dev Tooling
      
      **What to look for:** package manager and lockfile, custom build scripts, code generation steps, pre-commit or pre-push hooks, CI pipeline structure, environment configuration, developer setup scripts.
      
      **Evidence sources:** root manifest files, scripts directories, `.github/workflows/` or equivalent, Makefiles or justfiles, pre-commit configs.
      
      **Quality signals:** scripts documented in the README, lint and test steps wired into CI, consistent environment variable handling.
      
      ## Finding Format
      
      Each finding follows the structure below. Use this exact format so the evaluation step can aggregate uniformly.
      
      ```markdown
      **Category:** <category name from the list above>
      **Pattern:** <one-line convention statement>
      **Evidence:** <file:line>, <file:line>, <file:line>
      **Frequency:** <occurrences> / <eligible sites>
      **Variants:** <competing variants observed, or "none">
      **Notes:** <anything that affects quality evaluation: recency, author spread, linter backing>
      ```
      
      If a category yields no meaningful patterns (e.g., state management in a backend-only service), return a single line: `**Category:** <name> — no patterns detected.`
      
  • SKILL.md 10.2 KB
    ---
    name: create-project-skills
    description: "Scans an existing codebase and generates project-specific skills that capture inferred conventions such as naming, file organization, framework usage, data access, error handling, and testing style. Writes into the project's chosen skill directory (e.g., `.claude/skills/`, `.agents/skills/`, or a custom path). Use when the user asks to \"extract skills from the codebase\", \"create project skills\", \"infer project conventions as skills\", \"codify patterns as skills\", or \"mine the repo for best practices\"."
    ---
    
    # 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 `$create-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:
       - Check candidate paths `.agents/skills/`, `.claude/skills/`, and a top-level `skills/` directory (match case-insensitively so `Skills/` or similar non-standard casing is detected too). Resolve symlinks so co-linked paths are treated as one logical location.
       - Use `request_user_input` to confirm where generated skills should live. Offer up to 3 options: the most likely target directory first, the next-most-likely if there is one, and a free-form path option. Note any symlink alias in the option description. If no Codex skill directory is detected, default the first option to `~/.agents/skills`. The user can specify a custom path such as a project-specific directory via the free-form option.
    5. 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:
    
    - **Write the skills from what we know (Recommended)** — build skills from what this session established, rather than from conventions read out of the repo
    - **Generate nothing yet** — leave skills until the repo has code to have conventions about
    - **Extract anyway** — generate skills from the documentation and configuration that are there
    
    On the first option, run the `$create-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](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).
    
    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. 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:
    
    - Name its assigned category
    - Include the stack summary and directory map from Step 1
    - Include the list of conventions already documented in `AGENTS.md` so duplicates are skipped
    - Instruct the agent to read [references/pattern-extractor.md](references/pattern-extractor.md) as its role brief and return findings in the format defined at the end of that file
    
    ## Step 3: Evaluate Patterns
    
    Aggregate findings from all agents. For each finding, score three axes:
    
    - **Consistency**: what share of eligible sites follow the pattern? Drop findings below 30%. Flag findings between 30–70% as "mixed" for Step 4 review.
    - **Intentionality**: does the pattern appear across multiple subsystems and recent commits, or is it isolated? Drop findings confined to a single legacy module unless docs or lint config explicitly mark them as the desired convention.
    - **Modernity**: does the pattern align with current best practices for the stack? Flag patterns that contradict current idioms (e.g., pre-hooks class components in a React codebase also using hooks elsewhere) as "legacy" for Step 4 review.
    
    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:
    
    - A proposed `name` (kebab-case, narrow to the topic, e.g., `swift-naming`, `react-state`, `api-clients`)
    - A one-line description with trigger phrases (e.g., "Use when writing or reviewing <topic>...")
    - 3–8 concrete convention statements with evidence citations (`file:line`)
    - A **Status** tag based on disk comparison:
      - **New**: no skill with that name exists in the target directory.
      - **Update**: a skill with the same name exists in the target directory. Produce a unified diff against the current SKILL.md body.
      - **Rename conflict**: an existing skill in the target directory has a name, description, or first-section heading that covers the same topic under a different name. Flag for user decision.
    
    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:
    
    - Status tag, proposed name, one-line description
    - The 3–8 convention statements with evidence
    - For Update status, the unified diff
    - For Rename conflict status, the existing skill name and the overlap summary
    
    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 `$create-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.
    
    This gives `$create-skill` everything it needs to skip its Step 1 (usage patterns clearly understood) and Step 2 (project skills typically need no additional reusable resources). For Update candidates, `$create-skill` also skips its Step 3 (initialization) per its own "skill already exists, iteration needed" skip rule and iterates on the existing SKILL.md in Step 4 until it matches the target convention statements.
    
    Run the `$create-skill` skill once with this batch in context. Its batch-aware review, evaluation, and apply cycle then runs across all touched skills.
    
    After `$create-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
    
    - Each generated skill stays narrow: one topic per skill. Splitting is preferred over bundling.
    - Do not duplicate conventions already documented in `AGENTS.md`. Reference them instead if needed.
    - Generated skills must be self-contained: no cross-skill routing, no references to pipelines that invoke them.
    - Descriptions must be third-person and include trigger phrases a future agent session would match when working on the topic (e.g., "Use when writing or reviewing <tech>...", "Use when editing <layer>...").
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related