Skip to content

Commit 6f63fe1

Browse files
committed
feat(rhdh-templates): add a new rhdh-templates skill for authoring and validating Software Templates in RHDH
Signed-off-by: Kashish Mittal <kmittal@redhat.com>
1 parent c1b4506 commit 6f63fe1

61 files changed

Lines changed: 7012 additions & 83 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude-plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
},
66
"metadata": {
77
"description": "Orchestrator skill for RHDH plugin development - onboard, update, and maintain plugins in the Extensions Catalog",
8-
"version": "0.5.0"
8+
"version": "0.5.1"
99
},
1010
"plugins": [
1111
{
1212
"name": "rhdh",
1313
"source": "./",
1414
"description": "Skills for RHDH plugin lifecycle management",
15-
"version": "0.5.0",
15+
"version": "0.5.1",
1616
"strict": true
1717
}
1818
]

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "rhdh",
33
"description": "All-in-one toolkit for Red Hat Developer Hub (RHDH). Covers plugin development, overlay management, environment setup, version compatibility, CI/CD, and RHDH ecosystem navigation.",
4-
"version": "0.5.0",
4+
"version": "0.5.1",
55
"author": {
66
"name": "RHDH Store Manager"
77
},

.pi/agents/supervisor.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: supervisor
3+
# tools: read,write,edit,bash,grep,find,ls
4+
# model:
5+
# standalone: true
6+
---
7+
8+
<!-- ═══════════════════════════════════════════════════════════════════
9+
Project-Specific Supervisor Guidance
10+
11+
This file is COMPOSED with the base supervisor prompt shipped in the
12+
taskplane package. Your content here is appended after the base prompt.
13+
14+
The base prompt (maintained by taskplane) handles:
15+
- Supervisor identity and standing orders
16+
- Recovery action classification and autonomy levels
17+
- Audit trail format and rules
18+
- Batch monitoring, failure handling, operator communication
19+
- Orchestrator tool reference (orch_status, orch_pause, etc.)
20+
- Startup checklist and operational knowledge
21+
22+
Add project-specific supervisor rules below. Common examples:
23+
- Run linter before integration ("always run `npm run lint` after merge")
24+
- CI dashboard URL for failure triage
25+
- PR template or label conventions
26+
- Project-specific recovery procedures
27+
- Team notification preferences (Slack, etc.)
28+
- Custom health check commands
29+
30+
To override frontmatter values (tools, model), uncomment and edit above.
31+
To use this file as a FULLY STANDALONE prompt (ignoring the base),
32+
uncomment `standalone: true` above and write the complete prompt below.
33+
═══════════════════════════════════════════════════════════════════ -->

.pi/taskplane.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"migrations": {
3+
"applied": {
4+
"add-supervisor-local-template-v1": {
5+
"appliedAt": "2026-06-11T19:39:33.459Z"
6+
}
7+
}
8+
}
9+
}

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,29 @@ Build dynamic plugins from scratch — backend or frontend — and get them depl
2222
- **[export](./skills/create-plugin/references/export.md)** — Export, package (OCI/tgz/npm), and push to a container registry.
2323
- **[wiring](./skills/create-plugin/references/wiring.md)** — Analyze plugin source and generate `dynamic-plugins.yaml` wiring config.
2424

25+
### Software Templates
26+
27+
Author RHDH Scaffolder templates with guided workflows — templatize existing codebases, create from scratch, and fix common gotchas.
28+
29+
- **[rhdh-templates](./skills/rhdh-templates/SKILL.md)** — Interactive authoring and validation for Software Templates. Includes curated reference catalog (official library + AI quickstarts), worked examples (`nodejs-backend`, `java-springboot`) and bundled JSON Schema validation. Sub-commands:
30+
- **[init](./skills/rhdh-templates/references/init.md)** — Check tooling, scaffold template repo layout, optional RHDH connectivity.
31+
- **[templatize](./skills/rhdh-templates/references/templatize.md)** — Convert existing codebase into a parameterized template.
32+
- **[create](./skills/rhdh-templates/references/create.md)** — Guided from-scratch template authoring when no reference code exists.
33+
- **[add-parameter](./skills/rhdh-templates/references/add-parameter.md)** — Add a parameter or parameter group to existing `template.yaml`.
34+
- **[add-step](./skills/rhdh-templates/references/add-step.md)** — Add a scaffolder step to existing `template.yaml`.
35+
- **[add-skeleton](./skills/rhdh-templates/references/add-skeleton.md)** — Add or parameterize skeleton files with Nunjucks.
36+
- **[create-location](./skills/rhdh-templates/references/create-location.md)** — Generate or update root `location.yaml` for catalog registration.
37+
- **[fix-gotchas](./skills/rhdh-templates/references/fix-gotchas.md)** — Auto-fix common RHDH template mistakes (raw/endraw blocks, catalog-info path, etc.).
38+
- **[validate](./skills/rhdh-templates/references/validate.md)** — Local YAML schema, gotcha validation, and optional Nunjucks lint via `--lint-skeleton` (no RHDH required).
39+
- **[list-actions](./skills/rhdh-templates/references/list-actions.md)** — List available Scaffolder actions from a running RHDH instance.
40+
- **[dry-run](./skills/rhdh-templates/references/dry-run.md)** — Test template execution via Scaffolder v2 dry-run API.
41+
- **[explain-action](./skills/rhdh-templates/references/explain-action.md)** — Show action input schema or template parameter schema.
42+
- **[example-catalog](./skills/rhdh-templates/references/example-catalog.md)** — Browse curated reference templates (official library, AI quickstarts, bundled).
43+
44+
```bash
45+
npx skills add redhat-developer/rhdh-skill --skill rhdh-templates
46+
```
47+
2548
### Extensions Catalog
2649

2750
Manage plugins in the [rhdh-plugin-export-overlays](https://github.com/redhat-developer/rhdh-plugin-export-overlays) repository.

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "rhdh-skill"
3-
version = "0.5.0"
3+
version = "0.5.1"
44
description = "Claude Code skill for RHDH plugin development"
55
readme = "README.md"
66
license = "Apache-2.0"
@@ -15,7 +15,8 @@ include = ["rhdh*"]
1515
[project.optional-dependencies]
1616
dev = [
1717
"pytest>=7.0",
18-
"pyyaml>=6.0", # Only for SKILL.md structure tests
18+
"pyyaml>=6.0", # SKILL.md structure tests and template YAML parsing
19+
"jsonschema>=4.0", # Optional full JSON Schema validation in rhdh-templates
1920
"ruff>=0.4.0",
2021
]
2122

skills/rhdh-templates/SKILL.md

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
---
2+
name: rhdh-templates
3+
description: >-
4+
Author and validate RHDH Software Templates (Scaffolder) with AI-guided workflows. Use when
5+
asked to "create software template", "templatize a codebase", "convert repo to
6+
template", "write template.yaml", "location.yaml for templates", "scaffolder
7+
template", "golden path template", "parameterize skeleton files", "fix template
8+
gotchas", "validate template", "dry-run template", "list scaffolder actions",
9+
"explain scaffolder action", "Nunjucks in template", "template best practices",
10+
"reference templates", "example templates", "what templates do customers use",
11+
"Template Editor", or mentions RHDH template
12+
authoring, Software Catalog templates, or /rhdh-templates commands. Covers setup,
13+
templatize (highest value), from-scratch create, reference example discovery,
14+
incremental parameter/step/skeleton authoring, location.yaml generation, common
15+
convention fixes, local validation, and live Scaffolder API dry-run/action discovery.
16+
---
17+
18+
<essential_principles>
19+
20+
## Domain
21+
22+
Software Templates are `kind: Template` entities processed by the Scaffolder. Each template has:
23+
24+
- `template.yaml` — metadata, `spec.parameters` (form), `spec.steps` (actions), `spec.output`
25+
- `skeleton/` — files copied/templated into the target repo (Nunjucks `{% raw %}` blocks where needed)
26+
- `location.yaml` (repo root) — `kind: Location` registering all `template.yaml` files for catalog import
27+
28+
Read `references/conventions.md` before editing any template artifact — it encodes RHDH-specific rules that differ from generic Backstage docs.
29+
30+
Read `references/best-practices.md` when authoring or reviewing templates — it encodes Red Hat's 10 tips for repository layout, Template Editor workflow, custom fields, Nunjucks, secrets, type/tags, TechDocs, and maintenance.
31+
32+
## Authoring stance
33+
34+
- **Interactive, not fully automatic.** Templatize proposes parameterization; the user confirms each literal-to-parameter mapping.
35+
- **Conservative parameterization.** Under-parameterize rather than expose every string — users can add parameters incrementally.
36+
- **First-try correctness.** Generated artifacts should pass local `validate` with zero critical findings before merge.
37+
38+
## Script paths
39+
40+
All `scripts/` and `references/` paths are relative to this SKILL.md directory. Resolve them before invoking.
41+
42+
</essential_principles>
43+
44+
<setup>
45+
46+
## Setup gates (non-optional before file edits)
47+
48+
| Gate | Required check | If fail |
49+
|------|----------------|---------|
50+
| Command | Sub-command reference loaded | Load the matching `references/<command>.md` (or `example-catalog.md` for `examples`) |
51+
| Layout | Template project initialized or path confirmed | Run `init` or ask user for template repo root |
52+
| Conventions | `references/conventions.md` read for authoring commands | Read it first |
53+
54+
</setup>
55+
56+
<intake>
57+
58+
## What would you like to do?
59+
60+
| # | Command |
61+
|---|---------|
62+
| 1 | `init` |
63+
| 2 | `templatize` |
64+
| 3 | `create` |
65+
| 4 | `add-parameter` |
66+
| 5 | `add-step` |
67+
| 6 | `add-skeleton` |
68+
| 7 | `create-location` |
69+
| 8 | `fix-gotchas` |
70+
| 9 | `validate` |
71+
| 10 | `list-actions` |
72+
| 11 | `dry-run` |
73+
| 12 | `explain-action` |
74+
| 13 | `examples` |
75+
76+
Command descriptions and argument hints: `scripts/command-metadata.json`
77+
78+
**Wait for response before proceeding.**
79+
80+
</intake>
81+
82+
<routing>
83+
84+
| Response | Reference |
85+
|----------|-----------|
86+
| 1, "init", "setup", "scaffold", "prerequisites" | [references/init.md](references/init.md) |
87+
| 2, "templatize", "convert", "parameterize repo", "existing codebase" | [references/templatize.md](references/templatize.md) |
88+
| 3, "create", "from scratch", "new template" | [references/create.md](references/create.md) |
89+
| 4, "add-parameter", "add parameter", "form field" | [references/add-parameter.md](references/add-parameter.md) |
90+
| 5, "add-step", "add step", "scaffolder action", "pipeline step" | [references/add-step.md](references/add-step.md) |
91+
| 6, "add-skeleton", "skeleton file", "nunjucks" | [references/add-skeleton.md](references/add-skeleton.md) |
92+
| 7, "create-location", "location.yaml", "register templates" | [references/create-location.md](references/create-location.md) |
93+
| 8, "fix-gotchas", "fix template", "gotchas", "raw endraw" | [references/fix-gotchas.md](references/fix-gotchas.md) |
94+
| 9, "validate", "lint template", "check template", "lint-nunjucks", "lint nunjucks", "djlint", "nunjucks lint" | [references/validate.md](references/validate.md) |
95+
| 10, "list-actions", "list actions", "scaffolder actions" | [references/list-actions.md](references/list-actions.md) |
96+
| 11, "dry-run", "dry run", "test template remotely" | [references/dry-run.md](references/dry-run.md) |
97+
| 12, "explain-action", "action schema", "parameter schema" | [references/explain-action.md](references/explain-action.md) |
98+
| 13, "examples", "reference templates", "show me templates", "what templates exist" | [references/example-catalog.md](references/example-catalog.md) |
99+
| First word doesn't match | Infer from context. "Turn my Spring Boot app into a template" → `templatize`. "Add owner picker to my template" → `add-parameter`. "Does my template validate?" → `validate`. "What templates do customers use?" → `examples`. |
100+
101+
</routing>
102+
103+
<cli_commands>
104+
105+
## Bundled scripts
106+
107+
```bash
108+
# Resolve skill directory (adjust if SKILL.md path differs)
109+
SKILL_DIR="<path-to>/skills/rhdh-templates"
110+
111+
python "$SKILL_DIR/scripts/init.py" --help
112+
python "$SKILL_DIR/scripts/analyze.py" --help
113+
python "$SKILL_DIR/scripts/create_location.py" --help
114+
python "$SKILL_DIR/scripts/fix_gotchas.py" --help
115+
python "$SKILL_DIR/scripts/validate.py" --help
116+
python "$SKILL_DIR/scripts/list_actions.py" --help
117+
python "$SKILL_DIR/scripts/dry_run.py" --help
118+
python "$SKILL_DIR/scripts/explain_action.py" --help
119+
python "$SKILL_DIR/scripts/list_examples.py" --help
120+
```
121+
122+
Run `init.py` for deterministic tooling checks and project scaffolding. Use `analyze.py` during `templatize` Phase 1. Use `list_examples.py` during `create`, `templatize`, or `examples` to rank upstream reference templates. Use `create_location.py` and `fix_gotchas.py` where the reference files direct you — they produce structured JSON when piped.
123+
124+
Validation scripts: `validate.py` for local checks (include `--lint-skeleton` for Nunjucks/djLint); `list_actions.py`, `dry_run.py`, and `explain_action.py` require a reachable RHDH `--rhdh-url` and optional bearer token (`RHDH_TOKEN` env or `--token`).
125+
126+
</cli_commands>
127+
128+
<reference_index>
129+
130+
| File | Load when... |
131+
|------|-------------|
132+
| `references/conventions.md` | Any authoring command — RHDH template rules |
133+
| `references/best-practices.md` | Authoring/review — Red Hat 10 tips and pre-merge checklist |
134+
| `references/template-structure.md` | Writing or reviewing `template.yaml` anatomy |
135+
| `references/parameter-widgets.md` | Choosing form fields and UI widgets for parameters |
136+
| `references/example-catalog.md` | Command `examples` or picking upstream study references (`assets/example-catalog.json` is the data source; bundled templates under `assets/examples/`) |
137+
| `references/schemas/template-v1beta3.schema.json` | Bundled JSON Schema for deep `validate` checks |
138+
139+
</reference_index>

0 commit comments

Comments
 (0)