Skip to content

Commit 976f10d

Browse files
committed
Add RHDH Users Skill Pack
Agent Skills for adopting and using Red Hat Developer Hub, starting with skill-maker for creating and auditing Agent Skills. Install via `npx skills add redhat-developer/rhdh-users-skill-pack`.
0 parents  commit 976f10d

28 files changed

Lines changed: 3163 additions & 0 deletions

.githooks/pre-commit

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
# Auto-installed via core.hooksPath — no `pre-commit install` needed.
3+
# See .pre-commit-config.yaml for hook definitions.
4+
5+
if command -v pre-commit &>/dev/null; then
6+
pre-commit run --hook-stage pre-commit "${@}"
7+
else
8+
echo "⚠ pre-commit not installed — skipping hooks."
9+
echo " Install: pip install pre-commit (or: uv tool install pre-commit)"
10+
fi

.github/CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Default owners for the RHDH Users Skill Pack.
2+
# Review from a code owner is required before merging pull requests.
3+
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
4+
5+
* @redhat-developer/rhdh-cope

.github/workflows/ci.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
resolve-python:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
min-version: ${{ steps.resolve.outputs.min }}
17+
max-version: ${{ steps.resolve.outputs.max }}
18+
matrix: ${{ steps.resolve.outputs.matrix }}
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- id: resolve
23+
run: |
24+
python3 << 'PYEOF' >> "$GITHUB_OUTPUT"
25+
import re, json
26+
with open('pyproject.toml') as f:
27+
spec = re.search(r'requires-python\s*=\s*"([^"]+)"', f.read())
28+
spec = spec.group(1) if spec else '>=3.9'
29+
min_m = re.search(r'>=\s*([\d.]+)', spec)
30+
max_m = re.search(r'<=?\s*([\d.]+)', spec)
31+
min_v = min_m.group(1) if min_m else '3.9'
32+
max_v = max_m.group(1) if max_m else '3.x'
33+
matrix = [min_v, max_v] if min_v != max_v else [min_v]
34+
print(f'min={min_v}')
35+
print(f'max={max_v}')
36+
print(f'matrix={json.dumps(matrix)}')
37+
PYEOF
38+
39+
lint:
40+
needs: resolve-python
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- uses: astral-sh/setup-uv@v4
46+
with:
47+
enable-cache: true
48+
49+
- uses: actions/setup-python@v5
50+
with:
51+
python-version: ${{ needs.resolve-python.outputs.max-version }}
52+
53+
- run: uv sync --frozen --extra dev
54+
55+
- run: uv run ruff check .
56+
57+
- run: uv run ruff format --check .
58+
59+
test:
60+
needs: resolve-python
61+
runs-on: ubuntu-latest
62+
strategy:
63+
matrix:
64+
python-version: ${{ fromJson(needs.resolve-python.outputs.matrix) }}
65+
steps:
66+
- uses: actions/checkout@v4
67+
68+
- uses: astral-sh/setup-uv@v4
69+
with:
70+
enable-cache: true
71+
72+
- uses: actions/setup-python@v5
73+
with:
74+
python-version: ${{ matrix.python-version }}
75+
76+
- run: uv sync --frozen --extra dev
77+
78+
- run: uv run pytest -v

.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.egg-info/
6+
dist/
7+
build/
8+
.eggs/
9+
10+
# Virtual environments
11+
.venv/
12+
venv/
13+
ENV/
14+
15+
# IDE
16+
.idea/
17+
.vscode/
18+
*.swp
19+
*.swo
20+
21+
# Testing
22+
.pytest_cache/
23+
.coverage
24+
htmlcov/
25+
26+
# OS
27+
.DS_Store
28+
Thumbs.db
29+
30+
# OAuth credentials
31+
client_secret*.json
32+
33+
# uv
34+
.python-version
35+
36+
# Local config (project-specific settings)
37+
.rhdh/
38+
.rhdh-plugin/
39+
40+
# Personal workspace wrapper (not part of the skill repo)
41+
rhdh-local-setup/
42+
43+
# Temporary testing checkouts
44+
tmp/

.markdownlint.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"MD013": false,
3+
"MD033": false,
4+
"MD041": false,
5+
"MD024": {
6+
"siblings_only": true
7+
},
8+
"MD029": false,
9+
"MD036": false,
10+
"MD040": false,
11+
"MD055": false,
12+
"MD056": false
13+
}

.pre-commit-config.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
repos:
2+
# Python linting and formatting
3+
- repo: https://github.com/astral-sh/ruff-pre-commit
4+
rev: v0.15.10
5+
hooks:
6+
- id: ruff
7+
args: [--fix]
8+
- id: ruff-format
9+
10+
# General file checks
11+
- repo: https://github.com/pre-commit/pre-commit-hooks
12+
rev: v5.0.0
13+
hooks:
14+
- id: trailing-whitespace
15+
- id: end-of-file-fixer
16+
- id: check-yaml
17+
args: ['--allow-multiple-documents']
18+
- id: check-toml
19+
- id: check-added-large-files
20+
args: ['--maxkb=1000']
21+
- id: check-merge-conflict
22+
- id: check-json
23+
24+
# Markdown linting
25+
- repo: https://github.com/DavidAnson/markdownlint-cli2
26+
rev: v0.17.2
27+
hooks:
28+
- id: markdownlint-cli2
29+
args: ["--fix"]
30+
exclude: ^\.planning/
31+
32+
# Secret detection
33+
- repo: https://github.com/gitleaks/gitleaks
34+
rev: v8.24.2
35+
hooks:
36+
- id: gitleaks
37+
38+
# Shell script linting
39+
- repo: https://github.com/shellcheck-py/shellcheck-py
40+
rev: v0.10.0.1
41+
hooks:
42+
- id: shellcheck
43+
args: ["--severity=warning"]
44+
45+
# Run tests before commit
46+
- repo: local
47+
hooks:
48+
- id: pytest
49+
name: pytest
50+
entry: uv run pytest tests/ -q
51+
language: system
52+
types: [python]
53+
pass_filenames: false
54+
stages: [pre-commit]

AGENTS.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# AGENTS.md
2+
3+
Agent Skills for Red Hat Developer Hub (RHDH) users. Skills follow the [Agent Skills open standard](https://agentskills.io/specification).
4+
5+
## 1. Think Before Coding
6+
7+
**Don't assume. Don't hide confusion. Surface tradeoffs.**
8+
9+
Before implementing:
10+
11+
- State your assumptions explicitly. If uncertain, ask.
12+
- If multiple interpretations exist, present them — don't pick silently.
13+
- If a simpler approach exists, say so. Push back when warranted.
14+
- If something is unclear, stop. Name what's confusing. Ask.
15+
16+
## 2. Simplicity First
17+
18+
**Minimum code that solves the problem. Nothing speculative.**
19+
20+
- No features beyond what was asked.
21+
- No abstractions for single-use code.
22+
- No "flexibility" or "configurability" that wasn't requested.
23+
- If you write 200 lines and it could be 50, rewrite it.
24+
25+
Bundled Python scripts should prefer the standard library. Avoid new runtime dependencies unless clearly justified.
26+
27+
## 3. Surgical Changes
28+
29+
**Touch only what you must. Clean up only your own mess.**
30+
31+
When editing existing code:
32+
33+
- Don't "improve" adjacent code, comments, or formatting.
34+
- Don't refactor things that aren't broken.
35+
- Match existing style, even if you'd do it differently.
36+
- If you notice unrelated dead code, mention it — don't delete it.
37+
38+
When your changes create orphans:
39+
40+
- Remove imports/variables/functions that YOUR changes made unused.
41+
- Don't remove pre-existing dead code unless asked.
42+
43+
The test: every changed line should trace directly to what was asked.
44+
45+
## 4. Goal-Driven Execution
46+
47+
**Define success criteria. Loop until verified.**
48+
49+
Transform tasks into verifiable goals:
50+
51+
- "Add validation" → "Write tests for invalid inputs, then make them pass"
52+
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
53+
- "Refactor X" → "Ensure tests pass before and after"
54+
55+
Run `uv run pytest` before reporting any task complete. Do not report completion based on code existing — verify it works.
56+
57+
## 5. No Irreversible Commands Without Confirmation
58+
59+
Never force push, reset HEAD, merge branches, or run destructive commands without asking. If unsure whether a command is destructive, ask.
60+
61+
## 6. Learn From Corrections
62+
63+
If told an implementation was wrong, apply the correction and then record what went wrong so the same mistake is not repeated. Patterns and gotchas specific to this project belong in the relevant `references/` file under each skill.
64+
65+
---
66+
67+
## Available skills
68+
69+
User-facing skills live under `skills/`:
70+
71+
- `skill-maker` — Create, audit, and consolidate Agent Skills
72+
73+
When adding a skill, update [README.md](./README.md) and keep `SKILL.md` `name` aligned with the directory name per the Agent Skills spec.

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@AGENTS.md

CONTRIBUTING.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Contributing to RHDH Users Skill Pack
2+
3+
Thank you for helping improve Agent Skills for Red Hat Developer Hub users.
4+
5+
This project is released under the Apache-2.0 License.
6+
7+
## What belongs in this repository
8+
9+
This pack is for skills that help people **use and extend RHDH**. Skills aimed at Red Hat internal engineering (Jira automation, release trains, internal CI) belong in [`redhat-developer/rhdh-skill`](https://github.com/redhat-developer/rhdh-skill), not here.
10+
11+
The pack currently ships `skill-maker` for authoring new skills. Additional user-facing skills are welcome as focused contributions.
12+
13+
## Get started
14+
15+
```bash
16+
git clone https://github.com/redhat-developer/rhdh-users-skill-pack.git
17+
cd rhdh-users-skill-pack
18+
uv sync --extra dev
19+
git config core.hooksPath .githooks
20+
```
21+
22+
The `core.hooksPath` setting enables the checked-in pre-commit hook (lint + tests). No separate `pre-commit install` is required.
23+
24+
### Run tests
25+
26+
```bash
27+
uv run pytest
28+
```
29+
30+
### Lint
31+
32+
```bash
33+
uv run ruff check .
34+
uv run ruff format --check .
35+
```
36+
37+
Both run automatically via the pre-commit hook when `pre-commit` is installed.
38+
39+
## Adding or changing a skill
40+
41+
1. Follow the [Agent Skills specification](https://agentskills.io/specification).
42+
2. Place the skill at `skills/<name>/` where `<name>` matches the `name` field in `SKILL.md` front matter.
43+
3. Keep `SKILL.md` focused; put detailed guidance in `references/`, scripts in `scripts/`, and examples in `assets/`.
44+
4. Prefer **stdlib-only Python** for bundled scripts unless a dependency is clearly justified.
45+
5. Update the skills table in [README.md](./README.md) when adding a new skill.
46+
6. Add or update tests under `tests/` when changing scripts or validation logic.
47+
48+
Use the bundled `skill-maker` skill to interview, draft, and audit new skills before opening a PR.
49+
50+
## Submitting a pull request
51+
52+
1. Fork the repository and create a branch from `main`.
53+
2. Make focused commits — one concern per commit when practical.
54+
3. Ensure `uv run pytest` and `uv run ruff check .` pass.
55+
4. Open a pull request with:
56+
- What user problem the change solves
57+
- How you tested it
58+
- Any new prerequisites users should know about
59+
60+
## Reporting issues
61+
62+
Use [GitHub Issues](https://github.com/redhat-developer/rhdh-users-skill-pack/issues) for bugs, missing workflows, and skill ideas. Include your RHDH version, agent tool, and the prompt or task that did not work as expected.
63+
64+
## Code of conduct
65+
66+
Be respectful and constructive. This is a public Red Hat Developer project intended for a broad community of RHDH users.

0 commit comments

Comments
 (0)