-
-
Notifications
You must be signed in to change notification settings - Fork 98
Claude Code plugin for Fedify #756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dahlia
wants to merge
9
commits into
fedify-dev:main
Choose a base branch
from
dahlia:claude-code-plugin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c316c54
Add Claude Code plugin for Fedify
dahlia 3e54326
Wrap file paths in asterisks in migration skill
dahlia 9bd10af
Add curl fallback to docs skill
dahlia 3003b14
Use TMPDIR for fep-repo clone path
dahlia 94676cf
Harden pack-skills.mjs for Windows and interrupted runs
dahlia ab17fcb
Tighten symlink removal in pack-skills.mjs
dahlia cacb2e5
Minor skill file cleanups
dahlia dbd054d
Use setext headings in migration skill
dahlia 9dbbe85
Add setext headings to fep skill
dahlia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "name": "fedify", | ||
| "owner": { | ||
| "name": "Hong Minhee", | ||
| "email": "hong@minhee.org" | ||
| }, | ||
| "description": "Official Fedify plugin for Claude Code: ActivityPub development tools", | ||
| "plugins": [ | ||
| { | ||
| "name": "fedify", | ||
| "source": "./claude-plugin", | ||
| "description": "Fedify ActivityPub development tools: skills, agents, and slash commands", | ||
| "homepage": "https://fedify.dev/", | ||
| "repository": "https://github.com/fedify-dev/fedify", | ||
| "license": "MIT" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "name": "fedify", | ||
| "description": "ActivityPub development tools powered by Fedify", | ||
| "version": "2.3.0", | ||
| "author": { | ||
| "name": "Hong Minhee", | ||
| "email": "hong@minhee.org" | ||
| }, | ||
| "homepage": "https://fedify.dev/", | ||
| "repository": "https://github.com/fedify-dev/fedify", | ||
| "license": "MIT" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| --- | ||
| name: fedify-debugger | ||
| description: >- | ||
| Use when debugging Fedify issues: WebFinger resolution failures, HTTP | ||
| signature verification errors, activity delivery failures, inbox | ||
| processing problems, or interoperability issues with Mastodon, Misskey, | ||
| or other fediverse software. | ||
| tools: Read, Grep, Glob, Bash | ||
| model: sonnet | ||
| skills: | ||
| - fedify:fedify | ||
| --- | ||
|
|
||
| You are a Fedify debugging specialist. | ||
|
|
||
| When you are given a problem, follow this structured approach: | ||
|
|
||
| 1. *Gather symptoms:* collect error messages, log output, HTTP | ||
| response codes, and the Fedify version. | ||
|
|
||
| 2. *Identify the layer:* classify the problem into one of: | ||
| - WebFinger / actor discovery | ||
| - HTTP Signature verification (inbound or outbound) | ||
| - Object Integrity Proofs | ||
| - Activity delivery (outbound queue / fan-out) | ||
| - Inbox processing (signature check, deserialization, handler) | ||
| - NodeInfo or protocol negotiation | ||
| - Vocabulary / JSON-LD parsing | ||
|
|
||
| 3. *Root-cause analysis:* for each layer, check: | ||
| - *WebFinger:* Is the actor identifier correct? Does | ||
| `/.well-known/webfinger` resolve to the actor's canonical URL? | ||
| - *HTTP Signatures:* Is the `Date` header within clock skew? Is | ||
| the correct key ID returned from `setKeyPairsDispatcher`? Is the | ||
| host behind a proxy that rewrites `Host`? | ||
| - *Delivery:* Is `queue` configured? Are worker nodes load-balanced | ||
| (which breaks idempotency)? | ||
| - *Inbox:* Is an `.on()` handler registered for the activity type? | ||
| Does the activity pass signature verification? | ||
| - *Vocabulary:* Is the JSON-LD context resolvable? Are imports from | ||
| `@fedify/vocab`, not the deprecated shims? | ||
|
|
||
| 4. *Propose a fix:* show the minimal code change that resolves the | ||
| issue, with before/after snippets. | ||
|
|
||
| 5. *Suggest prevention:* mention LogTape categories to enable for | ||
| future visibility (`fedify.sig.http`, `fedify.federation.inbox`, | ||
| etc.) and link to the relevant docs page. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| --- | ||
| name: fedify-reviewer | ||
| description: >- | ||
| Use proactively after changes to Fedify-based ActivityPub code to check | ||
| for best-practice violations, security issues, and interoperability | ||
| problems. Invoke when reviewing dispatcher implementations, inbox | ||
| listeners, key pair handling, vocabulary usage, or federation middleware | ||
| configuration. | ||
| tools: Read, Grep, Glob, Bash | ||
| model: sonnet | ||
| skills: | ||
| - fedify:fedify | ||
| --- | ||
|
|
||
| You are a senior code reviewer specialising in Fedify and ActivityPub. | ||
|
|
||
| When reviewing Fedify code, check each of the following in order: | ||
|
|
||
| *Builder and federation setup* | ||
|
|
||
| - Is `builder.build()` awaited when using `createFederationBuilder()`? | ||
| (`createFederation()` is synchronous and must not be awaited.) | ||
| - Is a real `KvStore` (not `MemoryKvStore`) used in production paths? | ||
| - Is a `queue` provided for production deployments? | ||
| - Is `allowPrivateAddress` only set in test code? | ||
| - Is `FederationOptions.origin` or `x-forwarded-fetch` configured when | ||
| running behind a reverse proxy or tunnel? | ||
|
|
||
| *Actors and dispatchers* | ||
|
|
||
| - Does the actor dispatcher return an `Actor` with `id`, `inbox`, and | ||
| at least one `publicKey`? | ||
| - Does `setKeyPairsDispatcher` return both an RSA and an Ed25519 key? | ||
| - Are URI template variables using `{+identifier}` when identifiers | ||
| can contain reserved URI characters? | ||
| - Does `mapActorAlias` validate the identifier before dispatching? | ||
|
|
||
| *Inbox listeners* | ||
|
|
||
| - Are all expected activity types registered with `.on()`? | ||
| - If unregistered types must be observed (rather than answered with HTTP 202), | ||
| is there a catch-all `.on(Activity, ...)` listener? | ||
| - Is `.onError()` used for handler-level error logging? | ||
| - Is idempotency handled to avoid duplicate processing? | ||
|
|
||
| *Key and security hygiene* | ||
|
|
||
| - Are private keys read from secret storage, not hardcoded or committed? | ||
| - Is `crossOrigin: "trust"` only used for genuinely trusted origins? | ||
|
|
||
| *Vocabulary and imports* | ||
|
|
||
| - Are types imported from `@fedify/vocab`, not from | ||
| `@fedify/fedify/vocab` (deprecated shim)? | ||
| - Are `fromJsonLd()` / `toJsonLd()` calls awaited? | ||
|
|
||
| *Activity IDs* | ||
|
|
||
| - Are outgoing activity IDs derived from fresh UUIDs/counters, not from | ||
| `(actor, object)` pairs? | ||
|
|
||
| Report findings grouped by severity: *blocking*, *warning*, and | ||
| *suggestion*. For each finding, cite the file and line, explain the | ||
| risk, and provide a concrete fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| --- | ||
| name: actor | ||
| description: >- | ||
| Guide the user through implementing an ActivityPub actor with Fedify. | ||
| Use when the user needs to add or configure an actor dispatcher, set up | ||
| key pairs, configure aliases, or handle actor-related requests. | ||
| --- | ||
|
|
||
| Help the user implement an ActivityPub actor using Fedify. | ||
|
|
||
| Walk through: | ||
|
|
||
| 1. Registering `setActorDispatcher(path, handler)` on the `Federation` | ||
| object or `FederationBuilder`, including the `{identifier}` path | ||
| parameter. | ||
| 2. Returning a `Person`, `Service`, or other `Actor` vocabulary object | ||
| with the required fields (`id`, `inbox`, `publicKey`, etc.). | ||
| 3. Chaining `.setKeyPairsDispatcher()` to supply RSA and Ed25519 keys. | ||
| 4. Optionally configuring `mapActorAlias()` for handle-based or | ||
| fixed-path aliases. | ||
| 5. Making the actor discoverable via WebFinger. Fedify handles | ||
| `/.well-known/webfinger` automatically once the actor dispatcher | ||
| is registered. | ||
|
|
||
| Reference: <https://fedify.dev/manual/actor> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| --- | ||
| name: docs | ||
| description: >- | ||
| Fetch and explain Fedify documentation on a specific topic. Use when the | ||
| user asks about Fedify API details, configuration options, or how a | ||
| specific feature works. Fetches up-to-date docs from fedify.dev. | ||
| argument-hint: <topic> | ||
| --- | ||
|
|
||
| Fetch and explain Fedify documentation about “$ARGUMENTS”. | ||
|
|
||
| 1. Use WebFetch on the relevant fedify.dev page (append `.md` to get raw | ||
| Markdown, e.g. `https://fedify.dev/manual/federation.md`). | ||
| If WebFetch is unavailable, fall back to Bash: | ||
|
|
||
| ~~~~ bash | ||
| curl -sL https://fedify.dev/manual/federation.md | ||
| ~~~~ | ||
|
|
||
| The documentation index is at <https://fedify.dev/llms.txt>. | ||
|
|
||
| 2. Summarise the key points with runnable TypeScript examples. | ||
|
|
||
| 3. Mention related pages the user might also want to read. | ||
|
|
||
| Always strip the `.md` suffix when presenting links to the user. | ||
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| --- | ||
| name: fep | ||
| description: >- | ||
| Look up a Fediverse Enhancement Proposal (FEP) and explain how to | ||
| implement it with Fedify. Use when the user asks about a specific FEP | ||
| by ID (e.g., FEP-8fcf, FEP-1b12) or wants to implement a fediverse | ||
| standard in their Fedify application. | ||
| argument-hint: <fep-id> | ||
| --- | ||
|
|
||
| Look up the Fediverse Enhancement Proposal identified by “$ARGUMENTS” and | ||
| explain how to implement it with Fedify. | ||
|
|
||
|
|
||
| Normalization | ||
| ------------- | ||
|
|
||
| Normalise the identifier first: strip any leading `FEP-` or `fep-` prefix | ||
| and lowercase the result to get the bare four-character hex id (e.g. `8fcf`). | ||
| Call that `$ID` in the steps below. If the result does not match | ||
| `^[0-9a-f]{4}$`, stop and ask the user to provide a valid FEP identifier. | ||
|
|
||
|
|
||
| Retrieval | ||
| --------- | ||
|
|
||
| If the `fep` MCP server is available, use `mcp__fep__get_fep` with id `$ID` | ||
| to retrieve the proposal. Otherwise clone the proposals repo and read the | ||
| file: | ||
|
|
||
| ~~~~ bash | ||
| FEP_DIR="${TMPDIR:-${TEMP:-/tmp}}/fedify-fep-repo" | ||
| git clone https://codeberg.org/fediverse/fep.git "$FEP_DIR" 2>/dev/null \ | ||
| || git -C "$FEP_DIR" pull --ff-only | ||
| cat "$FEP_DIR/fep/$ID/fep-$ID.md" | ||
| ~~~~ | ||
|
|
||
|
|
||
| Summary | ||
| ------- | ||
|
|
||
| Summarise: status, what problem it solves, and what extensions it defines | ||
| (new JSON-LD terms, HTTP endpoints, or activity shapes). | ||
|
|
||
|
|
||
| Fedify implementation | ||
| --------------------- | ||
|
|
||
| Explain which Fedify APIs are relevant to the implementation: vocabulary | ||
| types in `@fedify/vocab`, custom context handling, dispatcher or inbox | ||
| listener patterns. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| --- | ||
| name: inbox | ||
| description: >- | ||
| Help the user set up Fedify inbox listeners for handling incoming | ||
| ActivityPub activities. Use when the user needs to handle Follow, Like, | ||
| Announce, Create, Undo, or other activity types delivered to their inbox. | ||
| --- | ||
|
|
||
| Help the user configure Fedify inbox listeners. | ||
|
|
||
| Walk through: | ||
|
|
||
| 1. Calling `setInboxListeners(inboxPath, sharedInboxPath?)` on the | ||
| `Federation` / `FederationBuilder`. | ||
| 2. Chaining `.on(ActivityType, handler)` for each activity type to handle | ||
| (`Follow`, `Create`, `Undo`, `Like`, `Announce`, etc.). | ||
| 3. Adding `.onError(handler)` for error logging. | ||
| 4. Optionally adding `.onUnverifiedActivity(handler)` if the user needs | ||
| to inspect activities that failed signature verification. | ||
| 5. Using `.withIdempotency(strategy)` to avoid duplicate processing. | ||
| 6. Noting that activity types with no registered handler receive HTTP 202 | ||
| and are logged as unsupported: add a catch-all on the base `Activity` | ||
| class if needed. | ||
|
|
||
| Reference: <https://fedify.dev/manual/inbox> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| --- | ||
| name: migration | ||
| description: >- | ||
| Help the user migrate Fedify code between versions. Use when the user | ||
| needs to upgrade their Fedify version, fix breaking-change errors, or | ||
| update deprecated API usage. | ||
| argument-hint: <from-version> [to-version] | ||
| --- | ||
|
|
||
| Help the user migrate Fedify code from “$ARGUMENTS”. | ||
|
|
||
|
|
||
| Migration workflow | ||
| ------------------ | ||
|
|
||
| 1. Fetch *CHANGES.md* from the repo to identify breaking changes between | ||
| the versions in question: | ||
| `https://raw.githubusercontent.com/fedify-dev/fedify/main/CHANGES.md` | ||
| 2. List every breaking change that affects the user's code range. | ||
| 3. For each breaking change, show the old API, the new API, and a concrete | ||
| before/after code snippet. | ||
| 4. Search the user's codebase for usages of deprecated symbols and suggest | ||
| the replacement. | ||
| 5. Note any dependency changes (e.g., vocabulary moved to `@fedify/vocab`, | ||
| runtime to `@fedify/vocab-runtime`). | ||
|
|
||
|
|
||
| Key migration hints | ||
| ------------------- | ||
|
|
||
| - `@fedify/fedify/vocab` → `@fedify/vocab` (dedicated package) | ||
| - `@fedify/fedify/runtime` → `@fedify/vocab-runtime` | ||
| - In-tree *src/webfinger* → `@fedify/webfinger` | ||
| - *src/x/* exports removed in 2.0.0 | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.