Set up slop-farmer for a GitHub repository end-to-end. Use this whenever the user mentions slop-farmer setup, creating a repo config, choosing scrape limits, checking GitHub rate limits, cleaning PR template boilerplate, inspecting issue/PR title patterns with gh, installing or authenticating the Hugging Face hf CLI, publishing datasets, reproducing dashboards, or deploying the static dashboard to a Hugging Face Space. Be proactive even if the user only asks for one piece of the setup, because config, auth, dataset publishing, and dashboard deployment are tightly coupled here.
npx skills add https://github.com/huggingface/swarm-sweeper --skill farmer-setup
Help the user go from “I want to run slop-farmer on repo X” to a reproducible setup with:
Use the bundled resources:
references/config-template.yaml when drafting a config.scripts/repo_setup_audit.py <owner/name> when gh is available and the user wants repo-specific sizing or cleanup advice.scripts/suggest_setup_config.py <owner/name> when you want a stronger automated pass over repeated PR/issue body patterns, heuristic cleanup candidates, and an optional fast-agent synthesis branch.Be accurate about the current codebase:
GITHUB_TOKEN.GH_TOKEN and GRAPHQL_TOKEN are also accepted in code paths.gh auth token.HF_TOKEN, otherwise an existing hf auth login.--config.pull-requests.template_cleanup.deploy-dashboard publishes a static dashboard to a Hugging Face Space. That is different from running the whole pipeline continuously inside a Space.gh api rate_limit is valid because gh api can call arbitrary GitHub REST endpoints, including /rate_limit.Unless the user asks for something narrower, structure your answer like this:
Always include a copy-pasteable YAML config and exact shell commands when possible.
Quickly determine:
owner/name)gh, hf, uv, and npm are availableIf the user already named a repo, move directly into inspection instead of asking generic questions.
Prefer short, concrete checks.
Recommended checks:
uv --version
gh --version
hf version
npm --version
If hf is missing or old, recommend:
python -m pip install -U huggingface_hub
hf version
If the user prefers uv-managed tools, it is also reasonable to suggest:
uv tool install --upgrade huggingface_hub
Then confirm auth with one of:
hf auth whoami
printenv HF_TOKEN
If neither works, recommend:
hf auth login
For headless environments, prefer HF_TOKEN over interactive login.
If the user says “GITHUB_ACCESS_TOKEN” or similar, clarify that the main supported variable here is:
export GITHUB_TOKEN=...
Useful verification commands:
printenv GITHUB_TOKEN
gh auth status
gh auth token >/dev/null && echo "gh token available"
gh api rate_limit
When advising on token creation:
If gh is available, audit the repo before finalizing config.
Preferred method:
uv run skills/farmer-setup/scripts/repo_setup_audit.py owner/name
For a richer automation pass that also inspects recent PR/issue bodies and can optionally prepare or run a fast-agent synthesis prompt:
uv run skills/farmer-setup/scripts/suggest_setup_config.py owner/name --prepare-fast-agent
If you do not use the script, gather equivalent information manually:
gh api rate_limit
gh api repos/OWNER/REPO
gh pr list -R OWNER/REPO --state all --limit 100 --json number,title,createdAt,url
gh issue list -R OWNER/REPO --state all --limit 100 --json number,title,createdAt,url
gh api repos/OWNER/REPO/contents/.github
For template discovery, also inspect the standard GitHub template locations on the default branch:
gh api repos/OWNER/REPO/contents/.github/PULL_REQUEST_TEMPLATE.md
gh api repos/OWNER/REPO/contents/.github/pull_request_template.md
gh api repos/OWNER/REPO/contents/PULL_REQUEST_TEMPLATE.md
gh api repos/OWNER/REPO/contents/docs/PULL_REQUEST_TEMPLATE.md
gh api repos/OWNER/REPO/contents/.github/PULL_REQUEST_TEMPLATE
gh api repos/OWNER/REPO/contents/.github/ISSUE_TEMPLATE
gh api repos/OWNER/REPO/contents/.github/ISSUE_TEMPLATE/config.yml
Also remember GitHub may inherit community health files from the owner-level .github repo. If repo-local templates are absent, check:
gh api repos/OWNER/.github/contents/.github/PULL_REQUEST_TEMPLATE.md
gh api repos/OWNER/.github/contents/.github/ISSUE_TEMPLATE
gh api repos/OWNER/.github/contents/.github/ISSUE_TEMPLATE/config.yml
Look for:
[foo], release, docs, bump version, post-releaseDo not jump straight to an unbounded historical scrape unless the user explicitly wants it and has plenty of rate-limit headroom.
Use a staged recommendation:
Use this when auth is unverified, the repo is high-volume, or the user wants a quick first pass.
Typical recommendation:
uv run slop-farmer scrape \
--repo OWNER/REPO \
--output-dir runs/REPO/data \
--max-issues 200 \
--max-prs 50 \
--fetch-timeline
Use this for high-volume repos after the smoke test succeeds.
Typical recommendation:
fetch-timeline: trueissue-max-age-days: 30 to 60pr-max-age-days: 14 to 30max-issues and max-prs for the first real runOnce the user has a healthy snapshot directory, recommend resuming from the watermark and dropping most manual caps unless the repo is extremely busy.
Start from references/config-template.yaml.
Good defaults to lean toward:
workspace: runs/<repo-slug>scrape.fetch-timeline: truedashboard.window_days: 60dashboard.contributor_window_days: 60dashboard.contributor_max_authors: 0analysis.max_clusters: 10For analysis backend:
deterministic if the user has not configured a fast-agent/provider model key yet.hybrid only if the surrounding model setup is already in place or the user explicitly wants it.When you generate config, explain each non-obvious field in one line.
Separate three different things clearly:
pull-requests.template_cleanuppull-requests.cluster_suppression_rulesFor PR cleanup:
section_patterns or line_patternsSummary by default just because it is common. In some repos, including OpenClaw, the summary section carries the most PR-specific signal and stripping it can worsen PR-text over-clustering.mode: merge_defaults unless the repo needs a total replacementstrip_html_comments: truetrim_closing_reference_prefix: trueFor suppression rules:
For issues:
.yml) or config.yml exist, summarize them because they help identify the effective issue intake flowIf fast-agent is installed and the relevant model secret is present, you can upgrade the heuristic pass into a model-assisted synthesis pass.
Recommended flow:
uv run skills/farmer-setup/scripts/suggest_setup_config.py owner/name --prepare-fast-agent
HF_TOKEN and it is present, run:uv run skills/farmer-setup/scripts/suggest_setup_config.py owner/name --use-fast-agent --fast-agent-model kimi25
Notes:
fast-agent check models --for-model <model> --json to discover required secret env var names.fast-agent go --no-env --model kimi25 --prompt-file ... --json-schema ... --quiet.--shell is optional and usually unnecessary here because the script has already collected the evidence.For local interactive usage:
python -m pip install -U huggingface_hub
hf auth login
hf auth whoami
For CI/headless/Space-style usage:
export HF_TOKEN=...
hf auth whoami
If the user wants both dataset publishing and dashboard deployment, remind them they need:
USER/repo-prUSER/repo-dashboardAfter you draft repo-specific PR cleanup rules, do a tuning pass before treating the config as production-ready.
Recommended loop:
soft_similarity, check whether it is:pr-scope code clusterpull-requests.template_cleanup and rerun deterministic analysis before switching back to hybrid for publishing.Useful commands:
uv run slop-farmer --config configs/REPO.yaml scrape
uv run slop-farmer --config configs/REPO.yaml analyze --ranking-backend deterministic
uv run slop-farmer --config configs/REPO.yaml pr-scope
Heuristic for likely PR-template over-clustering:
evidence_types dominated by soft_similaritypr-scope clusterIf that happens:
Summary blindlyVerified useful HF Space commands:
hf repos create USER/my-space --type space --space-sdk static --exist-ok
hf repos create USER/my-space --type space --space-sdk docker --secrets HF_TOKEN --secrets GITHUB_TOKEN
hf repos create USER/my-space --type space --space-sdk docker --secrets-file .space.secrets --env-file .space.env
hf spaces info USER/my-space --format json
hf upload USER/my-space ./dist . --repo-type space
Useful API-Space volume/bootstrap commands:
python - <<'PY'
from huggingface_hub import HfApi
api = HfApi()
api.create_bucket("USER/my-api-space-data", exist_ok=True)
PY
hf spaces volumes set USER/my-api-space -v hf://buckets/USER/my-api-space-data:/data
hf spaces volumes ls USER/my-api-space
Important notes:
hf repo create; use HfApi.create_bucket(...).hf://buckets/USER/bucket-name:/mount/path.Recommend this as the default robust setup:
refresh-dataset plus publish-analysis-artifactsdeploy-dashboard/dataExplain why this is better than “run everything inside a Space”:
If the user specifically insists on running the pipeline inside a Space, be honest:
--secrets, --secrets-file, --env, and --env-file when creating a Spaceuv run slop-farmer --config configs/my-repo.yaml refresh-dataset
uv run slop-farmer --config configs/my-repo.yaml analyze
uv run slop-farmer --config configs/my-repo.yaml publish-analysis-artifacts \
--analysis-id hybrid-gpt54mini-v3 \
--canonical
uv run slop-farmer --config configs/my-repo.yaml pr-scope
uv run slop-farmer --config configs/my-repo.yaml new-contributor-report
uv run slop-farmer --config configs/my-repo.yaml deploy-dashboard --refresh-contributors
Dashboard default note:
--analysis-input is omitted, dashboard export now prefers published analysis/current/When producing a setup answer, include:
GITHUB_TOKEN and HF_TOKEN.github community health files may be the effective source.Take huggingface/farmer-setup from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference pip.
Without those the skill loads but fails at the first command.