Clone Repo
Use Cautionnpx machina-cli add skill ojowwalker77/Claude-Matrix/clone-repo --openclawFiles (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/repoor full URL - branch (optional): specific branch to clone
Process
- Create
temp/directory in project root (gitignored) - Shallow clone:
git clone --depth 1 [--branch <branch>] <repo> temp/<repo-name> - Explore, read, and search the cloned code as needed
- When done, clean up:
rm -rf temp/<repo-name>
Notes
- Always use
--depth 1to 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
- Step 1: Parse user arguments as <repo> [branch].
- Step 2: Create temp/ and run git clone --depth 1 [--branch <branch>] <repo> temp/<repo-name>.
- 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