/idp-skills:backstage-plugin-developmentfrom idp-skills
Guides authoring custom Backstage plugins — scaffolding frontend/backend packages, wiring API clients, and registering routes or entity tabs.
Ships in idp-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Backstage's catalog, TechDocs, and Software Templates cover the platform's
baseline needs, but the moment a platform team wants to surface something
that doesn't already have a plugin — an internal cost-allocation report, a
custom deployment-approval workflow, a proprietary incident tool's live
status — the answer is a custom plugin, not a catalog annotation. Writing
one badly (a frontend page that calls an external API directly with a
hardcoded token, or a backend route bolted onto packages/backend instead
of being its own package) creates something that breaks on every Backstage
upgrade and that only the original author can maintain. Writing one well
means treating it as its own versioned package with a defined frontend/
backend contract, so it upgrades alongside Backstage core, other engineers
can extend it, and it fails predictably instead of silently. This skill
covers scaffolding, structuring, wiring, and locally testing a custom
Backstage plugin — it assumes the baseline catalog/TechDocs/Software
Template setup from
backstage-developer-portal
is already in place and does not repeat it.
Component's catalog page (e.g. "Cost,"
"Security Findings," "Deploy Approvals") backed by data no existing
plugin exposes.@backstage/create-app (or an
existing monorepo with packages/app, packages/backend, and a
plugins/ directory) — plugin development happens inside that monorepo,
not as a standalone project.package.json engines
field — Backstage pins these tightly, and a mismatched Node version is a
common source of yarn new/yarn start failures.@backstage/cli) — yarn new and yarn start are invoked through
Yarn workspace scripts, not a globally installed CLI.createBackendPlugin,
coreServices) — as of Backstage's modern backend (the default for apps
scaffolded since @backstage/create-app moved off the legacy backend in
its 2023+ releases), the legacy createRouter-based backend plugin
style is deprecated for new plugins; check packages/backend/src/index.ts
to confirm which system the app is on before writing new backend code.Scaffold a new frontend plugin with the Backstage CLI's interactive generator, run from the monorepo root:
yarn new
# ? What do you want to create? Plugin
# ? Enter an ID for the plugin [component-name] cost-insights-lite
This creates plugins/cost-insights-lite/ with its own package.json
(name @internal/plugin-cost-insights-lite), src/plugin.ts,
src/routes.ts, and a default page component — a real Yarn workspace
package, versioned and built independently of packages/app.
Scaffold the matching backend plugin the same way, choosing the backend plugin option:
yarn new
# ? What do you want to create? Backend plugin
# ? Enter an ID for the plugin [component-name] cost-insights-lite
This creates plugins/cost-insights-lite-backend/ (package name
@internal/plugin-cost-insights-lite-backend) with a
createBackendPlugin skeleton already wired up — separate package,
separate lifecycle, so the frontend can be developed and released
without forcing a backend redeploy and vice versa.
Define the frontend plugin and its route in src/plugin.ts and
src/routes.ts:
// plugins/cost-insights-lite/src/routes.ts
import { createRouteRef } from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
id: 'cost-insights-lite',
});
// plugins/cost-insights-lite/src/plugin.ts
import {
createPlugin,
createRoutableExtension,
createApiFactory,
discoveryApiRef,
fetchApiRef,
} from '@backstage/core-plugin-api';
import { rootRouteRef } from './routes';
import { costInsightsApiRef, CostInsightsClient } from './api';
export const costInsightsLitePlugin = createPlugin({
id: 'cost-insights-lite',
routes: { root: rootRouteRef },
apis: [
createApiFactory({
api: costInsightsApiRef,
deps: { discoveryApi: discoveryApiRef, fetchApi: fetchApiRef },
factory: ({ discoveryApi, fetchApi }) =>
new CostInsightsClient({ discoveryApi, fetchApi }),
}),
],
});
export const CostInsightsLitePage = costInsightsLitePlugin.provide(
createRoutableExtension({
name: 'CostInsightsLitePage',
component: () =>
import('./components/Router').then(m => m.Router),
mountPoint: rootRouteRef,
}),
);
Define the API client contract via createApiRef so the page
component never talks to fetch() directly — it depends on an
interface the app wires an implementation into:
// plugins/cost-insights-lite/src/api.ts
import { createApiRef, DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';
export interface CostInsightsApi {
getMonthlyCost(componentName: string): Promise<{ amountUsd: number }>;
}
export const costInsightsApiRef = createApiRef<CostInsightsApi>({
id: 'plugin.cost-insights-lite.service',
});
export class CostInsightsClient implements CostInsightsApi {
constructor(
private readonly deps: { discoveryApi: DiscoveryApi; fetchApi: FetchApi },
) {}
async getMonthlyCost(componentName: string) {
const baseUrl = await this.deps.discoveryApi.getBaseUrl('cost-insights-lite');
const res = await this.deps.fetchApi.fetch(
`${baseUrl}/components/${componentName}/monthly-cost`,
);
if (!res.ok) throw new Error(`Cost lookup failed: ${res.status}`);
return res.json();
}
}
The component consumes it with useApi(costInsightsApiRef) —
never new CostInsightsClient() directly inside a component, since
that bypasses the app's ApiFactory registration and makes the client
impossible to mock in tests or swap in dev.
Write the backend plugin on the new backend system, declaring only
the coreServices it actually needs:
// plugins/cost-insights-lite-backend/src/plugin.ts
import { createBackendPlugin, coreServices } from '@backstage/backend-plugin-api';
import { createRouter } from './router';
export const costInsightsLitePlugin = createBackendPlugin({
pluginId: 'cost-insights-lite',
register(env) {
env.registerInit({
deps: {
logger: coreServices.logger,
httpRouter: coreServices.httpRouter,
database: coreServices.database,
},
async init({ logger, httpRouter, database }) {
const router = await createRouter({ logger, database });
httpRouter.use(router);
logger.info('cost-insights-lite backend plugin initialized');
},
});
},
});
Register it in the app's backend entrypoint, packages/backend/src/index.ts:
backend.add(import('@internal/plugin-cost-insights-lite-backend'));
This one line is the only change packages/backend needs — the plugin
package owns its own routes, dependencies, and lifecycle.
Surface the frontend page in packages/app/src/App.tsx, either as
a standalone top-level route:
import { CostInsightsLitePage } from '@internal/plugin-cost-insights-lite';
<FlatRoutes>
<Route path="/cost-insights-lite" element={<CostInsightsLitePage />} />
</FlatRoutes>
or, more commonly for a plugin scoped to a single service, as a tab on
the Component entity page in packages/app/src/components/catalog/EntityPage.tsx:
const serviceEntityPage = (
<EntityLayout>
{/* existing tabs: Overview, CI/CD, API, ... */}
<EntityLayout.Route path="/cost" title="Cost">
<CostInsightsLitePage />
</EntityLayout.Route>
</EntityLayout>
);
Run the plugin in isolation during development before testing it inside the full app, using the scaffolded dev entrypoint:
yarn workspace @internal/plugin-cost-insights-lite start
This boots a minimal standalone dev app (plugins/cost-insights-lite/dev/index.tsx,
generated by yarn new) around just this plugin — much faster iteration
than rebuilding the whole app on every change. Once the component and
API client behave correctly in isolation, run yarn start at the repo
root to verify it inside the full app (catalog context, real
discoveryApi resolving the real backend, entity-page routing).
Version and ship as part of the monorepo release, not an
independent npm publish: internal plugins are pinned to the app's
Backstage core version by living in the same Yarn workspace, so a
yarn backstage-cli versions:bump that upgrades core packages
upgrades the plugin's dependency versions in the same commit — see the
version-pinning guidance already covered in
backstage-developer-portal,
which applies unchanged here.
fetch() directly from a component — always go through
a createApiRef-defined client injected via useApi(), so the
implementation can be swapped (mocked in tests, pointed at a different
backend in dev) without touching component code.coreServices minimal —
declaring coreServices.database when the plugin doesn't persist
anything, or coreServices.httpAuth when it doesn't need caller
identity, makes the plugin's actual capability surface unclear to
reviewers and to Backstage's own dependency-injection validation.pluginId (handled
automatically by httpRouter under /api/<pluginId>/...) rather than
inventing a separate path scheme — this is also what discoveryApi.getBaseUrl(pluginId)
on the frontend resolves against, so the two must agree.yarn workspace <plugin> start for the frontend dev loop, not
the full yarn start, until the component and API client work in
isolation — cuts iteration time from a full-app rebuild to a single
plugin's build.Symptom: A component throws Error: No implementation available for apiRef 'plugin.cost-insights-lite.service' at runtime.
Fix: The createApiRef was defined but never registered into the
plugin's apis array in createPlugin(...) (or the ApiFactory isn't
exported/imported into the app), so nothing implements the interface the
component asked for via useApi(). Add the createApiFactory entry to
the plugin definition (step 3) and confirm the plugin package is
actually imported somewhere the app's dependency graph reaches.
Symptom: The backend plugin's routes 404 at
/api/cost-insights-lite/... even though the plugin package builds
cleanly.
Fix: The plugin was scaffolded and coded but never added to
packages/backend/src/index.ts via backend.add(import(...)) — a
backend plugin package existing in plugins/ does nothing until the
backend's entrypoint registers it.
Symptom: A new catalog entity-page tab never appears on any
Component, despite the plugin's page rendering fine when accessed
directly by URL.
Fix: The EntityLayout.Route was added to the wrong entity-page
variant in EntityPage.tsx (Backstage typically defines separate page
layouts per spec.type, e.g. service vs. website vs. library) —
add the route to every entity-page variant that should show it, or to a
shared layout all variants compose.
Symptom: yarn new fails, or the generated plugin doesn't build,
immediately after a Backstage core upgrade.
Fix: The CLI's plugin template version is tied to the installed
@backstage/cli version; a partially completed upgrade (some
@backstage/* packages bumped, others not) leaves the generator
producing code against APIs the rest of the app doesn't have yet. Run
yarn backstage-cli versions:bump to align all @backstage/*
dependencies to a single release line before scaffolding new plugins.
Symptom: A plugin works correctly under yarn workspace <plugin> start in isolation, but breaks once mounted in the full app.
Fix: The isolated dev harness provides its own mock
discoveryApi/fetchApi and catalog context that can mask a real
dependency the plugin needs from the full app (e.g. auth headers the
full app's fetchApi attaches automatically but the dev harness
doesn't). Always do a final verification with yarn start against the
full app before considering the plugin done.
Scenario: The platform team at Acme wants a "Deploy Approvals" tab on
every Component catalog page, showing pending/approved/rejected
deployment-approval requests from an internal approvals service, and
letting a developer approve a request without leaving Backstage.
yarn new → Backend plugin → id deploy-approvals, creating
plugins/deploy-approvals-backend/ with a createBackendPlugin
skeleton.coreServices.logger, coreServices.httpRouter,
and coreServices.httpAuth (to forward the calling user's identity to
the approvals service so "who approved this" is accurate):
env.registerInit({
deps: {
logger: coreServices.logger,
httpRouter: coreServices.httpRouter,
httpAuth: coreServices.httpAuth,
},
async init({ logger, httpRouter, httpAuth }) {
httpRouter.use(await createRouter({ logger, httpAuth }));
},
});
backend.add(import('@internal/plugin-deploy-approvals-backend'));
in packages/backend/src/index.ts.yarn new → Plugin → id deploy-approvals, creating
plugins/deploy-approvals/ for the frontend.deployApprovalsApiRef with listForComponent(componentName)
and approve(requestId) methods, implemented by a DeployApprovalsClient
calling the backend via discoveryApi.getBaseUrl('deploy-approvals').Router.tsx listing pending requests with an "Approve" button
calling deployApprovalsApi.approve(requestId), and register the page
via createRoutableExtension in plugin.ts.<EntityLayout.Route path="/deploy-approvals" title="Deploy Approvals"><DeployApprovalsPage /></EntityLayout.Route> to the
service entity-page layout in EntityPage.tsx.yarn workspace @internal/plugin-deploy-approvals start
against a mocked API response, then yarn start against the full app
and a real approvals-service sandbox before merging.The result: any Component in the catalog now has a "Deploy Approvals"
tab backed by a real internal service, built as two independently
versioned packages that upgrade alongside Backstage core rather than as
code bolted onto packages/app/packages/backend directly.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin idp-skills20 skills in this plugin
/complete-idp-deployment-on-aws-from-scratchSequences a complete, from-scratch Internal Developer Platform deployment on AWS: landing zone → EKS cluster → Helm-deployed Backstage backed by RDS PostgreSQL → golden-path scaffolding template → self-service API wired to AWS provisioning (IRSA roles, RDS instances) → scorecards. This is the integration runbook that orders the individual AWS/EKS/Backstage skills correctly and flags the handoffs between them. Use when a user asks to "deploy an IDP on AWS from scratch," "stand up Backstage on EKS end-to-end," "build our internal developer platform on AWS," "wire self-service database/IAM provisioning into Backstage on AWS," or "sequence an AWS platform rollout from account creation to golden-path templates."
/complete-idp-deployment-on-azure-from-scratchSequences a complete, from-scratch Internal Developer Platform deployment on Azure: landing zone → AKS cluster → Helm-deployed Backstage backed by Azure Database for PostgreSQL Flexible Server → golden-path scaffolding template → self-service API wired to Azure provisioning (Azure AD Workload Identity federated credentials, Flexible Server instances) → scorecards. This is the integration runbook that orders the individual Azure/AKS/Backstage skills correctly and flags the handoffs between them. Use when a user asks to "deploy an IDP on Azure from scratch," "stand up Backstage on AKS end-to-end," "build our internal developer platform on Azure," "wire self-service database/identity provisioning into Backstage on AKS," or "sequence an Azure platform rollout from subscription vending to golden-path templates."
/complete-idp-deployment-on-gcp-from-scratchSequences a complete, from-scratch Internal Developer Platform deployment on GCP: landing zone → GKE cluster → Helm-deployed Backstage backed by Cloud SQL for PostgreSQL → golden-path scaffolding template → self-service API wired to GCP provisioning (Workload Identity Federation bindings, Cloud SQL instances) → scorecards. This is the integration runbook that orders the individual GCP/GKE/Backstage skills correctly and flags the handoffs between them. Use when a user asks to "deploy an IDP on GCP from scratch," "stand up Backstage on GKE end-to-end," "build our internal developer platform on Google Cloud," "wire self-service database/identity provisioning into Backstage on GKE," or "sequence a GCP platform rollout from project vending to golden-path templates."
/complete-idp-deployment-on-k3s-from-scratchSequences a lightweight Internal Developer Platform deployment on K3s for edge, on-prem, and development contexts where a full Backstage footprint isn't justified: K3s install → a resource-right-sized IDP choice (slimmed single-replica Backstage vs. a hosted no-code catalog tool) → a thin golden-path template → minimal-governance self-service → lightweight scorecards, all explicitly scoped to small teams and constrained hardware rather than restating the full cloud/enterprise build. Use when a user asks to "set up a lightweight internal developer platform," "run Backstage or a service catalog on K3s," "build a dev-team-sized IDP without enterprise overhead," "stand up a platform for an edge or small on-prem deployment," or "decide whether a full Backstage is overkill for our team size."
/complete-idp-deployment-on-kubernetes-from-scratchSequences a complete, cloud-agnostic Internal Developer Platform deployment on any CNCF-conformant Kubernetes cluster: cluster conformance validation → cluster add-ons (ingress, TLS, in-cluster storage) → Helm-deployed Backstage backed by an in-cluster PostgreSQL instance → golden-path scaffolding template → self-service scaffolder actions calling generic Kubernetes/Crossplane APIs, deliberately not tied to one cloud's IAM or managed-database provisioning APIs → scorecards. Use when a user asks to "deploy an IDP on Kubernetes without tying it to one cloud," "build a portable/cloud-agnostic internal developer platform," "stand up Backstage on any conformant cluster," "design self-service provisioning that doesn't assume AWS/Azure/GCP," or "sequence a vendor-neutral platform rollout on Kubernetes."
/complete-idp-deployment-on-oci-from-scratchSequences a complete, from-scratch Internal Developer Platform deployment on Oracle Cloud Infrastructure: compartment/Identity-Domain landing zone → OKE cluster → Helm-deployed Backstage backed by OCI Database with PostgreSQL → golden-path scaffolding template → self-service API wired to OCI provisioning (Dynamic Group/Resource Principal identity, Database with PostgreSQL instances) → scorecards. This is the integration runbook that orders the individual OCI/Backstage skills correctly and flags the handoffs between them, including the OKE cluster-provisioning gap this repo doesn't yet cover with a dedicated skill. Use when a user asks to "deploy an IDP on OCI from scratch," "stand up Backstage on OKE end-to-end," "build our internal developer platform on Oracle Cloud," "wire self-service database/identity provisioning into Backstage on OKE," or "sequence an OCI platform rollout from compartment design to golden-path templates."
Other plugins' skills for the same job