Skip to content

Commit 5457f0e

Browse files
authored
Merge pull request #12 from schultzp2020/fix/skill-review-fixes
Fix skill spec compliance and add automation scripts
2 parents 1c5f188 + 6aa8e50 commit 5457f0e

23 files changed

Lines changed: 3039 additions & 166 deletions

File tree

skills/create-backend-plugin/SKILL.md

Lines changed: 19 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
name: RHDH Backend Dynamic Plugin Bootstrap
3-
description: This skill should be used when the user asks to "create RHDH backend plugin", "bootstrap backend dynamic plugin", "create backstage backend plugin for RHDH", "new backend plugin for Red Hat Developer Hub", "create dynamic backend plugin", "scaffold RHDH backend plugin", "new scaffolder action", "create catalog processor", or mentions creating a new backend plugin, backend module, or server-side functionality for Red Hat Developer Hub or RHDH. This skill is specifically for backend plugins - for frontend plugins, use the separate frontend plugin skill.
2+
name: create-backend-plugin
3+
description: Bootstraps a new backend dynamic plugin for Red Hat Developer Hub (RHDH). Use when the user asks to "create RHDH backend plugin", "bootstrap backend dynamic plugin", "create backstage backend plugin for RHDH", "new backend plugin for Red Hat Developer Hub", "create dynamic backend plugin", "scaffold RHDH backend plugin", "new scaffolder action", "create catalog processor", or mentions creating a new backend plugin, backend module, or server-side functionality for Red Hat Developer Hub or RHDH. This skill is specifically for backend plugins - for frontend plugins, use the separate frontend plugin skill.
44
---
55

66
## Purpose
77

8-
Bootstrap a new **backend** dynamic plugin for Red Hat Developer Hub (RHDH). RHDH is the enterprise-ready Backstage applicationthat supports dynamic plugins - plugins that can be installed or uninstalled without rebuilding the application.
8+
Bootstrap a new **backend** dynamic plugin for Red Hat Developer Hub (RHDH). RHDH is the enterprise-ready Backstage application that supports dynamic plugins - plugins that can be installed or uninstalled without rebuilding the application.
99

1010
> **Note:** This skill covers **backend plugins only**. Frontend dynamic plugins have different requirements (Scalprum configuration, mount points, dynamic routes) and are covered in a separate skill.
1111
@@ -37,48 +37,30 @@ Before starting, ensure the following are available:
3737
## Workflow Overview
3838

3939
1. **Determine RHDH Version** - Identify target RHDH version for compatibility
40-
2. **Create Backstage App** - Scaffold Backstage app with matching version
41-
3. **Create Backend Plugin** - Generate new backend plugin using Backstage CLI
42-
4. **Implement Plugin Logic** - Write the plugin code using new backend system
43-
5. **Export and Package** - Build, export, and package using RHDH CLI (see export-and-package skill)
44-
6. **Configure for RHDH** - Create dynamic-plugins.yaml configuration
40+
2. **Scaffold App and Plugin** - Create Backstage app and generate backend plugin
41+
3. **Implement Plugin Logic** - Write the plugin code using new backend system
42+
4. **Export and Package** - Build, export, and package using RHDH CLI (see export-and-package skill)
43+
5. **Configure for RHDH** - Create dynamic-plugins.yaml configuration
4544

4645
## Step 1: Determine RHDH Version
4746

4847
Check the target RHDH version and find the compatible Backstage version. Consult `../rhdh/references/versions.md` file for the version compatibility matrix and available RHDH versions.
4948

5049
Ask the user which RHDH version they are targeting if not specified.
5150

52-
## Step 2: Create Backstage Application
51+
## Step 2: Scaffold App and Plugin
5352

54-
Create a new Backstage application in the current directory using the version-appropriate create-app:
53+
Run the scaffold script from the directory where the app should be created:
5554

5655
```bash
57-
# For RHDH 1.8 (adjust version as needed)
58-
echo "backstage" | npx @backstage/create-app@0.7.3 --path .
56+
python scripts/scaffold.py \
57+
--rhdh-version 1.9 \
58+
--plugin-id my-plugin
5959
```
6060

61-
After creation, install dependencies:
61+
Run `python scripts/scaffold.py --help` for all options (e.g., `--path`, `--create-app-version`, `--json`).
6262

63-
```bash
64-
yarn install
65-
```
66-
67-
The only purpose this serves is to ensure you can later create the plugin using the correct version of the Backstage CLI. All development and testing will be done in the plugin directory.
68-
69-
## Step 3: Create Backend Plugin
70-
71-
Generate a new backend plugin using the Backstage CLI:
72-
73-
```bash
74-
yarn new
75-
```
76-
77-
When prompted:
78-
79-
1. Select **"backend-plugin"** as the plugin type
80-
2. Enter a plugin ID (e.g., `my-plugin`)
81-
3. The plugin will be created at `plugins/<plugin-id>-backend/`
63+
The Backstage app exists only to provide the correct CLI version for plugin generation. All development and testing happens in the plugin directory.
8264

8365
The generated plugin structure:
8466

@@ -93,7 +75,7 @@ plugins/<plugin-id>-backend/
9375
└── README.md
9476
```
9577

96-
## Step 4: Implement Plugin Logic
78+
## Step 3: Implement Plugin Logic
9779

9880
Backend plugins must use the **new backend system** for dynamic plugin compatibility. The plugin entry point should export a default using `createBackendPlugin()` or `createBackendModule()`.
9981

@@ -147,7 +129,7 @@ cd plugins/<plugin-id>-backend
147129
yarn build
148130
```
149131

150-
## Step 5: Export and Package
132+
## Step 4: Export and Package
151133

152134
Export the plugin as a dynamic plugin and package it for deployment. For detailed export and packaging options, see the **export-and-package** skill.
153135

@@ -171,7 +153,7 @@ podman push quay.io/<namespace>/<plugin-name>:v0.1.0
171153

172154
For advanced options (dependency handling, multi-plugin bundles, tgz/npm packaging), consult the **export-and-package** skill.
173155

174-
## Step 6: Configure for RHDH
156+
## Step 5: Configure for RHDH
175157

176158
Create the dynamic plugin configuration for RHDH. Add to `dynamic-plugins.yaml`:
177159

@@ -191,6 +173,8 @@ For local development/testing, copy `dist-dynamic` to RHDH's `dynamic-plugins-ro
191173
cp -r dist-dynamic /path/to/rhdh/dynamic-plugins-root/<plugin-id>-backend-dynamic
192174
```
193175

176+
> **Windows note:** Use `xcopy /E /I dist-dynamic \path\to\rhdh\dynamic-plugins-root\<plugin-id>-backend-dynamic` or `robocopy dist-dynamic \path\to\rhdh\dynamic-plugins-root\<plugin-id>-backend-dynamic /E` instead of `cp -r`.
177+
194178
See `examples/dynamic-plugins.yaml` for a complete configuration example.
195179

196180
## Common Issues

0 commit comments

Comments
 (0)