Back to Skills

github-readme

verified

Fetch the README content from a GitHub repository. Use when the user asks for a repository README, documentation, or wants to read the repo's main documentation file.

View on GitHub

Marketplace

mearman

Mearman/marketplace

Plugin

github-api

Repository

Mearman/marketplace
2stars

plugins/github-api/skills/github-readme/SKILL.md

Last Verified

January 23, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/Mearman/marketplace/blob/main/plugins/github-api/skills/github-readme/SKILL.md -a claude-code --skill github-readme

Installation paths:

Claude
.claude/skills/github-readme/
Powered by add-skill CLI

Instructions

# Get GitHub Repository README

Fetch and decode the README content from a GitHub repository.

## Usage

```bash
npx tsx scripts/readme.ts <repository> [options]
```

### Arguments

| Argument | Required | Description |
|----------|----------|-------------|
| `repository` | Yes | Repository in format `owner/repo` or full GitHub URL |

### Options

| Option | Description |
|--------|-------------|
| `--token=TOKEN` | GitHub Personal Access Token (optional, overrides GITHUB_TOKEN env var) |
| `--no-cache` | Bypass cache and fetch fresh data from API |

### Output

```
README.md from facebook/react
-----------------------------
Size: 12.3 KB
URL: https://github.com/facebook/react/blob/main/README.md

# README Contents

[decoded README content displayed here]
```

## Script Execution (Preferred)

```bash
npx tsx scripts/readme.ts <repository> [options]
```

Options:
- `--token=TOKEN` - GitHub Personal Access Token (optional, overrides GITHUB_TOKEN env var)
- `--no-cache` - Bypass cache and fetch fresh data from API

Run from the github-api plugin directory: `~/.claude/plugins/cache/github-api/`

## README API

```
GET https://api.github.com/repos/{owner}/{repo}/readme
```

### Parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| `owner` | Yes | Repository owner (user or organization) |
| `repo` | Yes | Repository name |

### Examples

Get README content:
```
https://api.github.com/repos/facebook/react/readme
```

## Response Format

The response contains README metadata and base64-encoded content:

- **`name`** - README filename (e.g., "README.md")
- **`path`** - Path to the README
- **`sha`** - Git SHA for the file
- **`size`** - File size in bytes
- **`url`** - API URL for the file
- **`html_url`** - GitHub URL to view the README
- **`content`** - Base64-encoded content
- **`encoding`** - Encoding type (always "base64")

## README Detection

GitHub automatically detects and prioritizes README files in this order:
1. `README.md`
2

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
4251 chars