基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/heldernoid/agentic-build-templates --skill github-api命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Edit the visual grid layout of a garden bed, assigning crops to cells on a canvas editor. Use when asked to arrange crops in a bed, draw a planting layout, move crops around, visualize companion planting placement, or check for enemy crop adjacency in a specific bed. Triggers include "layout editor", "bed grid", "draw the bed", "assign crops to cells", "companion warning in layout", or similar visual planning tasks.
Plan crop rotations, planting schedules, and companion planting for garden beds and fields. Use when asked to manage a farm, garden, or plot layout; schedule what to plant and when; check companion planting relationships; track rotation history; or generate a printable planting schedule. Triggers include "crop rotation", "planting schedule", "companion planting", "garden bed", "what to plant", "frost dates", or any task involving seasonal crop planning.
Log crop harvests with yield quantity, quality grade, field, and storage destination. Use when asked to record a harvest, check total yield for a crop or field, filter harvest history by date or grade, view analytics charts, or export harvest data. Triggers include "log harvest", "record yield", "harvest entry", "crop yield", "grade breakdown", "field yield", "harvest history", or any task involving tracking what was picked and where it went.
| name | github-api |
| description | Fetch open pull requests and repository metadata from the GitHub REST API using Octokit |
Use this skill when the user needs to:
@octokit/rest npm packageread:repopnpm add @octokit/rest
import { Octokit } from '@octokit/rest';
const octokit = new Octokit({ auth: process.env.GBDASH_GITHUB_TOKEN });
const { data } = await octokit.rest.pulls.list({
owner: 'my-org',
repo: 'my-repo',
state: 'open',
per_page: 100,
});
The pulls.list endpoint returns up to 100 PRs per page. For repositories with more than 100 open PRs, paginate using octokit.paginate:
const prs = await octokit.paginate(octokit.rest.pulls.list, {
owner,
repo,
state: 'open',
per_page: 100,
});
The head.ref field on each PR contains the source branch name. Match it against branches.name in the local database:
for (const pr of prs) {
const branch = branchMap.get(pr.head.ref);
if (branch) {
branch.pr_id = pr.id.toString();
}
}
The GitHub REST API allows 5000 requests per hour for authenticated requests. Check the x-ratelimit-remaining response header:
const { data, headers } = await octokit.rest.pulls.list({ owner, repo, state: 'open' });
const remaining = parseInt(headers['x-ratelimit-remaining'] ?? '5000', 10);
if (remaining < 100) {
// log a warning
}
Octokit automatically retries 429 responses with the retry plugin.
Point Octokit at an Enterprise base URL:
const octokit = new Octokit({
auth: token,
baseUrl: 'https://github.mycompany.com/api/v3',
});
Never log the token or include it in API responses. Store it in:
~/.git-branch-dashboard/config.json with file permissions 0600GBDASH_GITHUB_TOKENThe config loader sets permissions on write:
import { chmod, writeFile } from 'node:fs/promises';
await writeFile(configPath, JSON.stringify(config, null, 2), 'utf8');
await chmod(configPath, 0o600);
listOpenPRs(owner: string, repo: string): Promise<PRRecord[]>Fetches all open pull requests for the given repository and returns them as PRRecord objects.
Fields returned per PR:
pr_number - GitHub PR numberpr_title - PR titlepr_url - URL to the PR on github.compr_state - always "open" for this callpr_author - login of the PR authorbranch_name - head.ref value (source branch name)pr_created_at - ISO 8601 creation timestampFields NOT returned (security):
pr_number| Scope | Purpose |
|---|---|
read:repo (public repos) | List PRs on public repositories |
repo (private repos) | List PRs on private repositories |
read:org | Required if the repo belongs to a GitHub org with SSO |
For most use cases, create a fine-grained personal access token with Pull requests: Read-only permission scoped to the specific repositories.
| Auth type | Requests per hour |
|---|---|
| Authenticated (PAT) | 5000 |
| Unauthenticated | 60 |
| GitHub App | 15000 |
git-branch-dashboard uses authenticated requests only.
401 Unauthorized - The token is invalid or expired. Generate a new token at https://github.com/settings/tokens and update it with git-branch-dash config set github-token ghp_....
403 Forbidden - The token does not have the required scope. Verify it has at minimum read:repo for public repos or repo for private repos.
404 Not Found - The owner or repo slug is incorrect. Check the repository settings in the dashboard under Repositories.
PRs not appearing on branches - Verify the branch_name in PRRecord matches the branch name exactly (case-sensitive). Check that a scan has run after the PR was opened.
Secondary rate limit (429) - This happens when making too many requests in a short window. Add a delay between repo scans or reduce the scan interval.