Skip to content

Add agent skill for creating integration packages, with AdonisJS and Nuxt as proof#671

Closed
2chanhaeng wants to merge 10 commits intofedify-dev:mainfrom
2chanhaeng:main
Closed

Add agent skill for creating integration packages, with AdonisJS and Nuxt as proof#671
2chanhaeng wants to merge 10 commits intofedify-dev:mainfrom
2chanhaeng:main

Conversation

@2chanhaeng
Copy link
Copy Markdown
Contributor

Summary

Closes #653, #139, #149.

Background

Most Fedify integration packages follow the same pattern: wrap federation.fetch() as middleware. This PR adds an AI coding agent skill that automates the entire workflow—from framework research through package creation, fedify init support, example apps, and testing.

To prove the skill works, two integrations were created with it in a single exchange each:

  • @fedify/adonis — by Claude Opus 4.6
  • @fedify/nuxt — by GPT 5.4

Changes

create-integration-package skill

.agents/skills/create-integration-package/SKILL.md with step-by-step guide and reference templates (package/, example/, init/) covering framework research, package implementation, fedify init integration, example creation, and testing.

@fedify/adonis (#139)

  • Middleware for AdonisJS v6/v7 that converts AdonisJS request/response to Web API standards
  • fedify init templates, example app, test registration

@fedify/nuxt (#149)

  • Nuxt 4.x integration via fedifyHandler() (server middleware) and fedifyErrorHandler() (Nitro error handler) for shared-path content negotiation
  • fedify init templates, example app, test registration

Co-Authored-By: Claude Opus 4.6 (Anthropic), GPT 5.4 (OpenAI)

2chanhaeng and others added 9 commits April 9, 2026 11:42
Replace @david/dax process spawning with node:child_process.spawn()
using detached: true to create a new process group.  On cleanup, use
process.kill(-child.pid, 'SIGKILL') to terminate the entire process
group, ensuring all descendant processes (tsx watch, dotenvx, etc.)
are killed.

@david/dax's CommandChild.kill() only sends a signal through its
internal KillSignal abstraction, which cannot propagate to the full
OS process tree.  This is a known limitation (dsherret/dax#351).

Closes: fedify-dev#667

Co-Authored-By: GitHub Copilot <noreply@github.com>
…-package` skill in one-shot

No error while `mise test:init`.
…skill in one-shot

The agent did not automatically formatted, so it was manually formatted by a human.
No error while `mise test:init`.
@issues-auto-labeler issues-auto-labeler bot added breaking change Breaking change component/cli CLI tools related component/federation Federation object related component/integration Web framework integration labels Apr 9, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c42017bc-ea35-425f-bacc-635ec75dc2f8

📥 Commits

Reviewing files that changed from the base of the PR and between e4180b6 and 06ed6ca.

📒 Files selected for processing (1)
  • CHANGES.md

📝 Walkthrough

Walkthrough

Adds agent skill and example templates for creating framework integration packages; introduces Adonis and Nuxt integration packages with examples, updates init scaffolding/templates to support both frameworks, and adjusts workspace/config/docs (changelog, contributing, examples, workspace manifests).

Changes

Cohort / File(s) Summary
Agent Skill & Example Docs
.agents/skills/create-integration-package/SKILL.md, .agents/skills/create-integration-package/example/...
ARCHITECTURE.md, DESIGN.md, README.md, deno.jsonc, package.jsonc, public/style.css, public/theme.js, src/federation.ts, src/logging.ts, src/main.ts, src/store.ts
New agent skill documentation plus a complete example scaffold (architecture, design, README, build config, styles, theme script) and an in-process example federation, logging, and in-memory stores.
Integration Package (scaffold)
.agents/skills/create-integration-package/init/framework.ts, .agents/skills/create-integration-package/package/...
package/README.md, package/deno.jsonc, package/package.jsonc, package/src/mod.ts, package/tsdown.config.ts
Templates and a starter typed middleware helper for creating framework integration packages (placeholders and build configuration included).
Adonis Package
packages/adonis/...
README.md, deno.json, package.json, tsdown.config.ts, src/mod.ts
New @fedify/adonis package implementing Adonis middleware adapter with request/response conversion, context-data factory type, and build config.
Nuxt Package
packages/nuxt/...
README.md, deno.json, package.json, tsdown.config.ts, src/index.ts
New @fedify/nuxt package with fedifyHandler (Nitro/h3 middleware) and fedifyErrorHandler for deferred 406 responses, plus build config and exports.
Adonis Example
examples/adonis/...
.gitignore, README.md, package.json, tsconfig.json, src/app.ts, src/federation.ts, src/logging.ts, src/main.ts
Example Adonis app wiring fedify middleware, example federation dispatchers, logging, and a Node server adapter for demo use.
Nuxt Example
examples/nuxt/...
.gitignore, app/app.vue, app/pages/*, nuxt.config.ts, package.json, tsconfig.json, server/error.ts, server/federation.ts, server/middleware/federation.ts, server/store.ts
Nuxt 4 example with Vue pages, Nitro middleware wiring to fedify, error handler integration, server-side federation, and shared in-memory stores.
Init Scaffolding & Templates
packages/init/src/...
action/templates.ts, const.ts, json/deps.json, templates/adonis/*, templates/nuxt/*, test/port.ts, test/server.ts, types.ts, webframeworks/*, webframeworks/mod.ts
Adds Adonis/Nuxt framework descriptions and templates for fedify init, port/test handling updates, template selection logic (including top-level await detection), and refactors test process spawning to Node spawn() with improved stream handling.
Examples Test Registry
examples/test-examples/mod.ts
Registers nuxt as a server example with build/preview steps and readiness configuration.
Repo Config & Docs
.hongdown.toml, deno.json, pnpm-workspace.yaml, cspell.json, AGENTS.md, CONTRIBUTING.md, CHANGES.md, docs/manual/integration.md, docs/.vitepress/config.mts, examples/README.md, packages/fedify/README.md
Workspace and packaging updates (new workspace members), spellcheck additions, docs and contributing updates to reference the new agent skill and framework integrations, changelog entries for new packages, and minor docs formatting edits.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Nuxt_Nitro as Nitro/Event Pipeline
  participant FedifyHandler as `@fedify/nuxt.fedifyHandler`
  participant Federation as Federation Instance
  participant ErrorHandler as `@fedify/nuxt.fedifyErrorHandler`

  Client->>Nuxt_Nitro: HTTP Request (Accept: application/activity+json)
  Nuxt_Nitro->>FedifyHandler: invoke handler(event)
  FedifyHandler->>Federation: federation.fetch(Request, {contextData})
  Federation-->>FedifyHandler: Response (status 200 / 404 / 406)
  alt status 200
    FedifyHandler->>Nuxt_Nitro: event.respondWith(Response)
    Nuxt_Nitro-->>Client: Response (ActivityPub JSON)
  else status 404
    FedifyHandler-->>Nuxt_Nitro: return (allow Nuxt routing)
    Nuxt_Nitro->>Nuxt_Nitro: proceed to route (may throw 404)
    Nuxt_Nitro-->>Client: route response or 404
  else status 406
    FedifyHandler->>Nuxt_Nitro: store Response in event.context
    FedifyHandler-->>Nuxt_Nitro: return (defer)
    Nuxt_Nitro->>ErrorHandler: error handling stage (error thrown or 404)
    ErrorHandler->>Nuxt_Nitro: if stored 406 and error is 404 -> respondWith(stored 406)
    Nuxt_Nitro-->>Client: Response (406 ActivityPub JSON)
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~70 minutes

Possibly related PRs

Suggested labels

activitypub/interop

Suggested reviewers

  • dahlia
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 45.45% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding an agent skill for creating integration packages, with AdonisJS and Nuxt as concrete examples.
Description check ✅ Passed The description is related to the changeset, detailing the skill creation, background rationale, and the two integration packages created as proof.
Linked Issues check ✅ Passed The PR successfully implements the core objective from #653: creating an agent skill for integration packages, with two working implementations (#139, #149) and comprehensive testing/documentation.
Out of Scope Changes check ✅ Passed All changes are directly related to the three linked issues: the skill definition, two integration packages, supporting infrastructure, and documentation updates are all within scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces integration packages for AdonisJS and Nuxt, accompanied by example applications and updates to the @fedify/init package. It also adds a new AI agent skill to provide a structured workflow for creating future framework integrations. Feedback includes a recommendation to define a command for the 'dev' script in the integration package template and a suggestion to implement error logging for child processes within the server test utility.

// `dev` script STRONGLY RECOMMENDED for `mise test:example`.
// Other scripts can be added as needed.
// Follow the convention of the framework you are integrating with.
"dev": ""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The 'dev' script is empty. Please provide a command to run the development server, as this is required for the example to be functional.

});

// Prevent unhandled exception when the process is killed
child.on("error", () => {});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The error handler for the child process is empty. It is better to log the error to help with debugging if the process fails to start.

Suggested change
child.on("error", () => {});
child.on("error", (err) => console.error("Server process error:", err));

@2chanhaeng
Copy link
Copy Markdown
Contributor Author

Too big to review.

@2chanhaeng 2chanhaeng closed this Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Breaking change component/cli CLI tools related component/federation Federation object related component/integration Web framework integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add agent skill to create integration packages

1 participant