agentleFS
viknesh20-20viknesh20-20/claude-code-tool-kit/.claude/skills/create-component/SKILL.md

create-component

Skill7 starsChanged 6 months agoMITView on GitHub

Scaffolds a new component, module, or package following the project's existing structure, naming conventions, and patterns. Auto-detects framework and generates all necessary files including tests.

12 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Test file suffix (.test.ts, _test.go, test_.py, _spec.rb, etc.)

    line 33
  2. Distinctive:

    Use the patterns found in Step 1

    line 84
  3. Distinctive:

    Add standard boilerplate (constructor, basic methods)

    line 86
  4. Distinctive:

    Follow the project's export pattern

    line 87
  5. Distinctive:

    Add to barrel exports if the project uses them

    line 91
  6. Distinctive:

    Add to module system if applicable (Angular modules, Python packages, etc.)

    line 93

“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Create Component / Module

Detect Project Structure

!ls -d src/ app/ lib/ pkg/ cmd/ internal/ components/ pages/ modules/ features/ 2>/dev/null !ls package.json go.mod Cargo.toml pyproject.toml *.csproj Gemfile mix.exs 2>/dev/null

Existing Components (for pattern matching)

!find . -type d -maxdepth 4 \( -path "*/components/*" -o -path "*/modules/*" -o -path "*/features/*" -o -path "*/pkg/*" -o -path "*/internal/*" \) -not -path "*/node_modules/*" -not -path "*/.git/*" 2>/dev/null | head -20


Scaffolding Process

Step 1: Analyze Existing Patterns

  1. Find the most similar existing component/module
  2. Note its file structure:
    • Main implementation file
    • Test file
    • Types/interfaces file
    • Index/barrel file
    • Styles file (if frontend)
    • Storybook/docs file (if applicable)
  3. Note naming conventions:
    • PascalCase, camelCase, kebab-case, or snake_case?
    • File extensions (.tsx, .ts, .py, .go, etc.)
    • Test file suffix (.test.ts, test.go, test.py, _spec.rb, etc.)

Step 2: Determine What to Generate

Based on the detected framework:

React/Next.js/Vue:

ComponentName/
├── ComponentName.tsx       # Main component
├── ComponentName.test.tsx  # Tests
├── ComponentName.types.ts  # TypeScript interfaces
├── ComponentName.module.css # Styles (if CSS modules used)
└── index.ts               # Barrel export

Python:

module_name/
├── __init__.py            # Public exports
├── module_name.py         # Main implementation
├── models.py              # Data models (if applicable)
└── test_module_name.py    # Tests

Go:

packagename/
├── packagename.go         # Main implementation
├── packagename_test.go    # Tests
└── types.go               # Type definitions (if needed)

Rust:

module_name/
├── mod.rs                 # Module entry point
├── types.rs               # Types and structs
└── tests.rs               # Tests

C#/.NET:

ModuleName/
├── ModuleName.cs          # Main class
├── IModuleName.cs         # Interface
└── ModuleNameTests.cs     # Tests

Step 3: Generate Files

For each file:

  1. Use the patterns found in Step 1
  2. Include proper imports/using statements
  3. Add standard boilerplate (constructor, basic methods)
  4. Follow the project's export pattern
  5. Include a skeleton test file with at least one test

Step 4: Register the Component

  • Add to barrel exports if the project uses them
  • Register routes if it's a page/endpoint
  • Add to module system if applicable (Angular modules, Python packages, etc.)

Rules

  • Mirror existing patterns exactly — don't introduce new conventions
  • Minimal boilerplate — generate just enough to be useful, not bloated
  • Include tests — always create the test file
  • Don't guess — if you can't determine the convention, ask the user

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.