create-integration-package

Creates Fedify integration packages for web frameworks with middleware and tests.

1.0k|132|Updated Mar 2, 2024
One-click install
npx skills add https://github.com/fedify-dev/fedify --skill create-integration-package
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-integration-package
Source: https://github.com/fedify-dev/fedify/tree/main/.agents/skills/create-integration-package
Command: npx skills add https://github.com/fedify-dev/fedify --skill create-integration-package

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @fedify/fedify, tsdown, and includes assets (resource) components.

What problem does it solve?

Adding Fedify's ActivityPub federation to a new web framework requires researching the framework's middleware model, writing request conversion logic, configuring dual JSR/npm publishing, and setting up tests. This Skill automates that entire package-creation workflow, including a feasibility assessment when a framework cannot support middleware.

Core Features & Use Cases

  • Feasibility Research: Investigates whether a target framework supports server middleware and verifies the actual installed version's API before writing code.
  • Template-Based Package Generation: Copies a ready-made package template (deno.json, package.json, tsdown.config.ts, src/mod.ts) into packages/ and guides implementation of federation.fetch() with onNotFound/onNotAcceptable fallthrough behavior.
  • Testing and Release Hygiene: Enforces minimum test coverage with node:test, runs mise deps/fmt/check, and updates CHANGES.md and CONTRIBUTING.md requirements.
  • Use Case: You want Fedify to work with a framework like Hono or Fastify. Provide the framework name, and the Skill researches it, scaffolds packages/framework/, implements the middleware, and validates the result.

Quick Start

Create a Fedify integration package for the web framework named Hono.

Frequently Asked Questions about create-integration-package

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate Fedify with a web framework?

Provide the framework name and the Skill researches its middleware support, scaffolds a package under packages/ from a template, and implements a middleware that calls federation.fetch(). It also configures deno.json and package.json for JSR and npm publishing.

How does Fedify middleware handle non-federation requests?

When federation.fetch() does not recognize a path, the onNotFound callback delegates to the framework's next handler so normal routes still work. When the client does not accept ActivityPub media types, onNotAcceptable lets the framework serve its own response before returning 406.

What happens if a framework cannot support Fedify middleware?

The Skill conducts a feasibility assessment during research, checking whether the framework acts as a server and supports middleware. If integration is not possible, it explains the reasons in detail and stops instead of producing a broken package.

Does the integration package support both Deno and Node.js?

Yes, the template includes both deno.json for JSR publishing and package.json with tsdown.config.ts for npm, targeting Deno, Node.js, and Bun. Running mise deps keeps deno.lock and pnpm-lock.yaml in sync.

What tests are required for a Fedify integration package?

Tests use node:test and node:assert/strict and must cover four scenarios: successful federation responses, onNotFound fallthrough, 406 when no framework route matches, and framework HTML responses on shared routes. Test files follow the *.test.ts naming convention.