Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

backstage-backend-plugin

БесплатноЗапускает вложенные скриптыНе проверен

Build Backstage backend plugins and modules with createBackendPlugin: DI, httpRouter, secure-by-default auth, Knex DB, scheduler, testing, extension points…

rothenbergtот rothenbergt★ 23 звезды на GitHub19 установок в других каталогах

Об этом скилле

Backstage Backend Plugin (New Backend System)

About This Skill

This skill provides specialized knowledge and workflows for building Backstage backend plugins and modules using the New Backend System. It guides the development of server-side functionality including REST/HTTP APIs, background jobs, data processing, and integrations, plus the module/extension-point pattern used to extend other plugins.

What This Skill Provides

  1. Specialized workflows - Step-by-step procedures for creating and configuring backend plugins and modules
  2. Best practices - Production-ready patterns for auth, validation, error handling, and database usage
  3. Golden path templates - Copy/paste code snippets for common backend patterns
  4. Domain expertise - Backstage-specific knowledge about DI, core services, and secure-by-default architecture

When to Use This Skill

Use this skill when creating server-side functionality for Backstage: REST/HTTP APIs, background jobs, data processing, integrations, or modules that extend an existing plugin's extension points.


Development Workflow

Phase 1: Planning and Research

1.1 Understand the Requirements

Before building a backend plugin, clearly understand:

  • What endpoints or APIs are needed (REST, GraphQL, webhooks)
  • What data storage requirements exist (database, cache)
  • Whether background jobs or scheduled tasks are needed
  • Authentication and authorization requirements
  • Whether you're writing a plugin (new surface area) or a module (extending another plugin's extension points)
  • Integration points with other services or plugins

1.2 Load Reference Documentation

Load reference files as needed based on the plugin requirements:

For Core Services:

  • ⚙️ Core Services Reference - Comprehensive guide to all core backend services including:
    • httpRouter, logger, database, httpAuth, userInfo, auth
    • cache, scheduler, urlReader, discovery, permissions, permissionsRegistry
    • auditor, lifecycle, rootHealth, rootConfig, rootInstanceMetadata
    • Usage patterns and best practices for each service

For Testing:


Phase 2: Implementation

Follow the Golden Path workflow below for implementation, referring to reference files as needed.

Important Decisions:

  • Determine which core services are needed (load ⚙️ Core Services Reference)
  • Plan database schema and migrations if using database
  • Design authentication policies (which endpoints, if any, should be unauthenticated?)
  • Plan error handling and validation strategies
  • Decide whether extension points are needed so other teams can extend this plugin

Phase 3: Testing

After implementing the plugin:

  1. Load the ✅ Testing Reference
  2. Write comprehensive tests for:
    • Plugin/module integration via startTestBackend
    • Router endpoints using supertest against the test server
    • Database operations with TestDatabases
    • External service calls with MSW (v2 API)
    • Authentication flows using mockCredentials and mockServices.httpAuth.mock
  3. Run tests and achieve good coverage:
    yarn backstage-cli package test --coverage --watchAll=false
    

Phase 4: Review and Polish

Before publishing:

  1. Run linting and structure checks
  2. Ensure proper error handling throughout — let errors bubble up so the root HTTP router's error middleware formats them
  3. Verify authentication policies are correct (backends are secure by default)
  4. Check database migrations are production-ready and written in JavaScript
  5. Review the Common Pitfalls section below
  6. Test horizontal scalability (no in-memory state; use the cache or database services)

Quick Facts

  • Scaffold with yarn new → select backend-plugin; the package lives in plugins/<id>-backend/.
  • Define the plugin with createBackendPlugin, declare dependencies via deps, and initialize in register(env).registerInit.
  • Attach routes through coreServices.httpRouter. Backstage prefixes plugin routers with /api/<pluginId>.
  • Backends are secure by default; use httpRouter.addAuthPolicy({ path, allow }) to allow unauthenticated endpoints.
  • allow on addAuthPolicy only accepts 'unauthenticated' or 'user-cookie'.
  • Core services (logger, database, httpRouter, httpAuth, auth, userInfo, urlReader, scheduler, cache, permissions, etc.) are available via coreServices.
  • Validate inputs with zod and throw InputError from @backstage/errors. Let the root HTTP router handle error responses — you usually don't need per-router error middleware.
  • A module (createBackendModule) extends another plugin via its extension points. A plugin exposes extension points with env.registerExtensionPoint(...).

Production Best Practices

Request Va

Полный SKILL.md на GitHub

Установить backstage-backend-plugin в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

LICENSE.txtreference/core_services.mdreference/testing.mdscripts/cleanup-scaffolding-backend.js

FAQ

Что делает скилл backstage-backend-plugin?

Build Backstage backend plugins and modules with createBackendPlugin: DI, httpRouter, secure-by-default auth, Knex DB, scheduler, testing, extension points. Use for APIs, modules, and background jobs.

Как установить скилл backstage-backend-plugin?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл backstage-backend-plugin запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить backstage-backend-plugin с