agentic-actions-audito…
Audit GitHub Actions that run AI agents for prompt injection, unsafe interpolation, sandbox gaps, and permissive actor rules. Use…
Train object-detection, image-classification, or SAM segmentation models on Hugging Face Jobs. Use for vision fine-tuning and evaluation; use huggingface-llm-trainer for language models.
Claude Code
$ npx -y skills add waybarrios/opencode-power-pack --skill huggingface-vision-trainer --agent claude-code
Codex
$ npx skills add waybarrios/opencode-power-pack --skill huggingface-vision-trainer -a codex -y
Cursor
$ npx skills add waybarrios/opencode-power-pack --skill huggingface-vision-trainer -a cursor -y
Gemini CLI
$ npx skills add waybarrios/opencode-power-pack --skill huggingface-vision-trainer -a gemini-cli -y
GitHub Copilot
$ npx skills add waybarrios/opencode-power-pack --skill huggingface-vision-trainer -a github-copilot -y
OpenCode
$ npx skills add waybarrios/opencode-power-pack --skill huggingface-vision-trainer -a opencode -y
Windsurf
$ npx skills add waybarrios/opencode-power-pack --skill huggingface-vision-trainer -a windsurf -y
name: huggingface-vision-trainer description: "Train object-detection, image-classification, or SAM segmentation models on Hugging Face Jobs. Use for vision fine-tuning and evaluation; use huggingface-llm-trainer for language models." license: Apache-2.0 (modified; see UPSTREAMS.json)
Train object detection, image classification, and SAM/SAM2 segmentation models on managed cloud GPUs. No local GPU setup required — results are automatically saved to the Hugging Face Hub. For text/language model fine-tuning (SFT/DPO/GRPO via TRL), use this pack's `huggingface-llm-trainer` skill instead.
Fine-tuning object detection models (D-FINE, RT-DETR v2, DETR, YOLOS), image classification models (any `timm/` model or Transformers classifier), or SAM/SAM2 segmentation models (bbox or point prompts) on custom datasets — locally or on Hugging Face Jobs.
Helper scripts use PEP 723 inline dependencies:
uv run scripts/dataset_inspector.py --dataset username/dataset-name --split train uv run scripts/estimate_cost.py --help
Validate BEFORE launching GPU training — the #1 cause of training failures is format mismatches. Skip only for well-known defaults (e.g. `cppe-5`). Run via Jobs (avoids local SSL/dependency issues), locally with `uv run scripts/dataset_inspector.py --dataset ... --split train`, or via `HfApi().run_uv_job(script="scripts/dataset_inspector.py", script_args=[...], flavor="cpu-basic", timeout=300)`. Output markers: `✓ READY` or `✗ NEEDS FORMATTING` (with mapping code).
The object detection training script auto-handles bbox format detection/conversion, sanitization, `image_id` generation, and category remapping — no manual preprocessing needed beyond having `objects.bbox`/`objects.category`.
1. Verify prerequisites (account, token, dataset). 2. Validate dataset format with the inspector, before spending GPU time. 3. Ask the user about dataset size (quick 10% test vs. full) and whether to create a validation split, and which GPU hardware to use — present as explicit options rather than assuming. 4. Prepare the training script: `scripts/object_detection_training.py` (OD), `scripts/image_classification_training.py` (IC), or `scripts/sam_segmentation_training.py` (SAM). All use `HfArgumentParser` — configure via CLI-style `script_args`, not by editing Python variables. See `references/timm_trainer.md` for timm details and `references/finetune_sam2_trainer.md` for SAM2 details. 5. Save the script to `submitted_jobs/<dataset>_<timestamp>.py`, submit the job, and report the job ID, monitoring URL, Trackio dashboard (`https://huggingface.co/spaces/{username}/trackio`), expected time, and estimated cost. Wait for the user to request status checks — don't poll; jobs are asynchronous and can take hours.
Submit via the `hf jobs uv run` CLI, an `hf_jobs()` MCP tool if the Hugging Face MCP server is configured, or the Python API directly:
from huggingface_hub import HfApi, get_token
api = HfApi()
job_info = api.run_uv_job(
script="scripts/object_detection_training.py", # file PATH, not inline content, for the Python API
script_args=["--dataset_name", "cppe-5", "--push_to_hub", "--hub_model_id", "username/model-name", ...],
flavor="a10g-large",
timeout=14400, # seconds
env={"PYTHONUNBUFFERED": "1"},
secrets={"HF_TOKEN": get_token()}, # use get_token(), not the literal string "$HF_TOKEN"
)
print(f"Job ID: {job_info.id}") # .id, not .job_id or .nameIf using an MCP `hf_jobs()` tool instead, the `script` parameter accepts inline code or a URL (not local paths), timeout is a string (`"4h"`), and secrets use the literal `"$HF_TOKEN"` placeholder (auto-replaced) rather than `get_token()`. Either way, the training script must include PEP 723 inline dependency metadata and must NOT use `image`/`command` parameters (those belong to a different job type).
**Token injection is required in custom scripts**: the Transformers `Trainer` calls `create_repo(token=self.args.hub_token)` when `push_to_hub=True`, so the script must set `training_args.hub_token` from `os.environ.get("HF_TOKEN")` after parsing args but before constructing `Trainer` — `scripts/object_detection_training.py` already does this; replicate it in custom scripts. Don't call `login()` unless replicating that same pattern, and don't rely on implicit token resolution.
**Object detection**: `--no_remove_unused_columns` (preserves the image column), `--no_eval_do_concat_batches` (variable box counts per image), `--push_to_hub`, `--hub_model_id`, `--metric_for_best_model
55 rigorous skills for Claude Code, Codex, OpenCode 1 and 2, and Pi: code review, security audit, feature development, frontend design, MCP tools, Hugging Face ML/training, and more.
Audit GitHub Actions that run AI agents for prompt injection, unsafe interpolation, sandbox gaps, and permissive actor rules. Use…
Audit and improve project-rules files (AGENTS.md, CLAUDE.md, .agents/instructions, local overrides) so the agent keeps accurate…
Capture learnings from the current session into the project-rules file (AGENTS.md, CLAUDE.md, or local override) so future…
Operational rubric that turns "don't make AI slop" into observable properties, severity levels, evidence requirements, and repair…
Design a feature architecture by analyzing existing codebase patterns and conventions, then provide a comprehensive…
Deeply analyze an existing codebase feature by tracing execution paths, mapping architecture layers, understanding patterns and…
Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication,…
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys)…
Clean and finalize authorized natural-language text intended for readers by auditing suspicious invisible Unicode and rewriting…