OpenParable
Skip to content
← Back to skills

Clone Patterns

Research
clone-patterns

Clone Patterns is an Agent Skill for research published in the Houseofmvps/ultraship repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Learn From the Best — analyze patterns from any codebase and apply them to yours. Use when user wants to adopt best practices from another repo, compare code quality, or learn how top projects are structured.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/Houseofmvps/ultraship/blob/HEAD/skills/clone-patterns/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/clone-patterns, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Learn From the Best

Analyze any codebase's patterns and apply the best ones to your project.

Process

Phase 1: Analyze Source

Ask for the source project directory (must be cloned locally):

  • "Which repo do you want to learn from? Provide the local path."
node ${CLAUDE_PLUGIN_ROOT}/tools/pattern-analyzer.mjs <source-directory> --compare=<your-project-directory>

Parse the JSON output.

Phase 2: Pattern Report

Present the source project's patterns:

Project Structure:

  • How they organize code (feature-based, layer-based, hybrid)
  • Naming conventions
  • Key directories

Testing Strategy:

  • Framework and location
  • Test-to-source ratio
  • Integration vs unit separation

Code Quality:

  • Average file length
  • Export patterns
  • Linting and formatting setup

TypeScript Practices:

  • Strict mode usage
  • Type vs interface preference
  • any count

Error Handling:

  • Custom error classes
  • Middleware patterns
  • Global handlers

CI/CD:

  • Pipeline setup
  • Automated steps

Phase 3: Comparison

Show side-by-side comparison between the source project and yours:

For each area, show:

  • What they do vs what you do
  • Whether the difference matters
  • Specific recommendation

Phase 4: Adoption Plan

Create a prioritized adoption plan:

Priority 1 (High Impact, Low Effort):

  • Enable TypeScript strict mode
  • Add linting/formatting config
  • Adopt naming conventions

Priority 2 (High Impact, Medium Effort):

  • Add test framework and initial tests
  • Create custom error classes
  • Add CI pipeline

Priority 3 (Medium Impact, Higher Effort):

  • Restructure project directories
  • Add integration tests
  • Improve documentation

Phase 5: Apply Patterns

For each pattern the user wants to adopt, implement it:

  1. TypeScript strict mode — update tsconfig.json, fix resulting errors
  2. Test framework — install vitest/jest, create first test, add test script
  3. Error handling — create base error class, add error middleware
  4. CI pipeline — create .github/workflows/ci.yml with lint, test, build
  5. Linting — add eslint config matching source project's style

Only apply patterns the user explicitly approves.

Key Principle

Steal like an artist. The best codebases didn't invent their patterns — they borrowed from others and refined them. Learn what works, adapt it to your context, and make it your own.