mcpField
U
using-backstage-backend-system

using-backstage-backend-system

github.com/vinzscamDevelopment446 installsUpdated 9w ago
Repository

About using-backstage-backend-system

A skill for developers defining Backstage backend plugins, modules, and extension points. It explains how to choose the right structure and wire registrations, dependencies, and extension points correctly.

Key features

  1. 01Plugin and module structure guidance
  2. 02Extension point definition patterns
  3. 03Registration and dependency wiring
  4. 04Plugin and module ID constraints
  5. 05Scoped and root service distinctions

Use cases

  1. 01Creating a backend plugin
  2. 02Building a module for an existing plugin
  3. 03Choosing between a plugin and module
  4. 04Exposing extension points to modules

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/vinzscam/backstage-skills --skill using-backstage-backend-system

After installing, type/using-backstage-backend-systemin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
extension-points.md
modules.md
plugin-definition.md

Details

From the project README

Backstage Backend System Patterns

When to use this skill

  • Defining a new backend plugin (src/plugin.ts)
  • Defining a backend module (src/module.ts) that extends another plugin
  • Choosing between a full plugin vs a module
  • Exposing extension points so other modules can extend your plugin

Choose the right pattern

Building...PatternReference
The plugin itselfcreateBackendPlugin({ pluginId, register })references/plugin-definition.md
A module that extends another plugincreateBackendModule({ pluginId, moduleId, register })references/modules.md
An extension point so other modules can extend yourscreateExtensionPoint<T>({ id })references/extension-points.md

Two invocation modes

  • Standalone: editing an existing backend plugin/module.
  • Post-scaffold (called by creating-backstage-plugin for backend-plugin, backend-plugin-module, catalog-provider-module, scaffolder-backend-module): wire up the canonical structure (src/plugin.ts or src/module.ts, src/index.ts re-export).

Common gotchas

  • All wiring imports come from @backstage/backend-plugin-api, not @backstage/core-plugin-api (which is frontend-only).
  • The register(env) callback receives an environment object with env.registerInit({ deps, async init }) and env.registerExtensionPoint(point, impl). deps is a map of service refs the init function needs; init receives the resolved instances.
  • registerInit may be called only once per plugin/module. registerExtensionPoint must be called before registerInit.
  • Plugin-scoped vs root-scoped services: most refs (logger, httpRouter, database, scheduler, auth, httpAuth, userInfo, cache, discovery, urlReader, lifecycle, permissions) are plugin-scoped — each plugin gets its own instance with plugin-aware behavior (e.g. logger pre-tagged with pluginId, database giving a per-plugin schema). Six refs (rootConfig, rootLogger, rootLifecycle, rootHealth, rootHttpRouter, rootInstanceMetadata) are root-scoped — single shared instance. Both can be depended on from a plugin's register block; the distinction matters for behavior, not for injection syntax.
  • A plugin's pluginId and a module's moduleId must match the pattern [a-z][a-z0-9-]* (letters, digits, dashes; starts with a letter).
  • Modules depend on the extension points exported by the target plugin's library package (e.g. @backstage/plugin-catalog-node), not on the plugin's main package.

Comments

Markdown supported