Get the FREE Ultimate OpenClaw Setup Guide β†’

Clone Repo

Use Caution
npx machina-cli add skill ojowwalker77/Claude-Matrix/clone-repo --openclaw
Files (1)
SKILL.md
973 B

Clone Repo

Clone an external repository for exploration and code reference.

Usage

Parse user arguments: <repo> [branch]

  • repo: GitHub owner/repo or full URL
  • branch (optional): specific branch to clone

Process

  1. Create temp/ directory in project root (gitignored)
  2. Shallow clone: git clone --depth 1 [--branch <branch>] <repo> temp/<repo-name>
  3. Explore, read, and search the cloned code as needed
  4. When done, clean up: rm -rf temp/<repo-name>

Notes

  • Always use --depth 1 to minimize download size
  • Clean up when finished β€” don't leave cloned repos around
  • If temp/ doesn't exist in .gitignore, add it

Source

git clone https://github.com/ojowwalker77/Claude-Matrix/blob/main/skills/clone-repo/SKILL.mdView on GitHub

Overview

Clone Repo lets you fetch an external GitHub repo or URL for exploration and reference. It uses a shallow clone into a temp directory, limiting history with --depth 1, and cleans up after you're done.

How This Skill Works

It parses arguments as <repo> [branch], creates a temp/ directory, runs git clone --depth 1 [--branch <branch>] <repo> temp/<repo-name>, then you can read and search the cloned code. When finished, it removes the temporary clone to keep the project clean.

When to Use It

  • You need to inspect code from an external repository to reference patterns.
  • You want to quickly grab code examples from GitHub without pulling full history.
  • You are evaluating a library's implementation before integration.
  • You are documenting usage or providing examples that rely on external code.
  • You want to study a repository's structure in a sandboxed temp area before reuse.

Quick Start

  1. Step 1: Parse user arguments as <repo> [branch].
  2. Step 2: Create temp/ and run git clone --depth 1 [--branch <branch>] <repo> temp/<repo-name>.
  3. Step 3: Explore the code, then clean up: rm -rf temp/<repo-name>.

Best Practices

  • Always use --depth 1 to minimize download size when exploring external repos.
  • Clone into a temp/<repo-name> path and clean up with rm -rf temp/<repo-name> after use.
  • If temp/ isn’t already in .gitignore, add it to prevent committing temp clones.
  • Specify a branch with --branch when you need a specific version of the code.
  • Verify the repository URL/owner to avoid pulling from untrusted sources and respect licenses.

Example Use Cases

  • Clone TensorFlow examples for reference on modeling patterns.
  • Inspect a small OSS project to copy code snippets for a prototype.
  • Clone a library to study its initialization and API usage.
  • Fetch code samples from a GitHub repo to enhance documentation.
  • Clone a classroom assignment repo to study tasks and solutions.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers β†—