agentsclimarketplace

Kb friendica

Skill reiver/vibefed/skills/kb-friendica

A Fediverse & ActivityPub plugin for those wishing to use LLM coding tools for the Fediverse and the Social Web.

Install
npx -y skills add reiver/vibefed --skill kb-friendica

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 8 stars8 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Background knowledge about Friendica, the federated social networking platform (Facebook alternative). Covers Friendica's history and lineage (Mistpark 2010, Friendika, Friendica, the Red Matrix/Hubzilla fork), its multi-protocol architecture (ActivityPub, DFRN, Diaspora protocol simultaneously), the DFRN protocol (Distributed Friends and Relations Network — Atom/ActivityStreams XML with public-key crypto handshake, dfrn_notify/dfrn_poll/dfrn_request endpoints), the ActivityPub implementation (Receiver/Processor/Transmitter classes, APDelivery workers, Mastodon-compatible API), the Diaspora protocol integration (reverse-engineered PHP implementation), the addon/plugin system (hook-based with 100+ hooks, Smarty3 templates, module intercept), cross-network connectors (Bluesky bidirectional, Tumblr, GNU Social, email IMAP/SMTP, RSS/Atom, WordPress/LiveJournal/Dreamwidth post-only), privacy controls (ACLs, Circles/Groups, multiple profiles, per-post permissions), content model (200,000-char posts, BBCode, photo albums, events, forums, polls), the database schema (97 tables, hub-and-spoke post model with post/post-user/post-content/post-media separation), the 8-layer architecture (Client/Frontend/Application/Business Logic/ Content Processing/Federation/Data/Background Worker), the tech stack (PHP, MySQL/MariaDB/PostgreSQL, Apache/Nginx, Smarty3, Composer, AGPL-3.0), supported FEPs (group federation, OpenWebAuth, long-form text, FEP-67ff), federation interoperability quirks (bridge role between protocol ecosystems, OStatus dropped in 2024.12), and the relationship to Mike Macgirvin's later projects (Hubzilla, Zot/Nomad protocol, Streams, Forte). Load when the user asks about Friendica federation; implementing a Friendica-compatible ActivityPub server; the DFRN protocol; how Friendica bridges multiple protocol ecosystems; Friendica's addon system; Friendica's privacy model; interoperating with Friendica instances; Friendica's Mastodon API compatibility; the Friendica-to-Hubzilla lineage; or cross-posting from Friendica to Bluesky, Tumblr, Diaspora, or other networks.

SKILL.md

21.7 KB, ~5.0k tokens by cl100k_base, as published. Nobody here has run it

Friendica — Complete Reference

Overview

Friendica is a free, open-source, decentralized social networking platform — the Fediverse's answer to Facebook. Created by Mike Macgirvin (former Netscape/AOL/Sun messaging engineer) in July 2010 under the original name "Mistpark," it is one of the oldest continuously active Fediverse projects, predating Mastodon by six years. Licensed AGPL-3.0.

Friendica's defining characteristic is its multi-protocol bridge role. It simultaneously speaks ActivityPub, the Diaspora protocol, and its native DFRN protocol, and connects (via addons) to Bluesky, Tumblr, GNU Social, email (IMAP/SMTP), and RSS/Atom feeds. Fedi.Tips calls it "a sort of Swiss Army knife of the Fediverse." Where Mastodon is a Twitter replacement (microblogging), Friendica is a Facebook replacement (full social networking) with Circles/Groups, photo albums, events, forums, 200,000-character posts, and fine-grained ACL-based privacy controls.

Current maintainers are Tobias Diekershoff (FSFE) and Michael Vogel. As of 2025: ~220 active instances, ~20,800 registered users, ~2.8 million statuses, 27,000+ commits from 250+ contributors.


1. History and Lineage

DateEvent
July 2010Mike Macgirvin creates Mistpark in Australia, motivated by "Quit Facebook Day" privacy concerns
Mid-2010Within first month: federation with StatusNet (OStatus), RSS, email integration
Late 2010Renamed to Friendika
July 2011Zot protocol first named (Macgirvin's next-gen protocol design)
Sep 2011Macgirvin forks as "Free-Friendika" (MIT license)
Oct 2011Name changed to Friendica
Jan 2012First "Friendica" release (v2.37)
2012Diaspora protocol reverse-engineered from scratch (~6 months)
May 2012Macgirvin departs, forks into Red / Friendica Red (MIT)
2012-2013Red becomes Red Matrix
May 2015Red Matrix renamed to Hubzilla
Dec 2018ActivityPub support shipped
May 2023Initial Bluesky connector
Dec 2023Bidirectional Bluesky; Circles and Channels introduced
Jan 2025v2024.12: OStatus dropped, Prometheus metrics, FEP-67ff
Jan 2026v2026.01 "Blutwurz": reworked hook system, media embedding overhaul

The Fork Lineage

Mistpark (2010)
  └─> Friendika (2010) ─> Friendica (2011, AGPL-3.0)
  └─> Free-Friendika (2011, MIT)
        └─> Red / Friendica Red (2012)
              └─> Red Matrix (2013)
                    └─> Hubzilla (2015, Zot protocol)
                          └─> Osada, Zap, Roadhouse (2018-2022)
                                └─> Streams (2021-present, Nomad protocol)
                                      └─> Forte (2024, ActivityPub-only)

Founding Motivation

Macgirvin left Facebook in early 2010 and found no decentralized alternative with both Facebook-like interactivity and privacy. StatusNet's OStatus had "absolutely nothing in the way of privacy." He created the DFRN protocol to address four gaps:

  1. No protocol for friend connections
  2. No privacy support in social protocols
  3. No cross-server wall posting
  4. Private media required sending copies to all recipients

2. Technology Stack

LayerTechnology
Backend languagePHP (7.4+, 8.x recommended, supports 8.5)
DatabaseMariaDB (recommended), MySQL, PostgreSQL 9.6+
Web serverApache (mod-rewrite) or Nginx
Template engineSmarty3
Dependency managementComposer
DI containerDice
Themesfrio (default), vier, quattro
LicenseAGPL-3.0
Hardware minimum2 GB RAM
Required PHP extensionsCurl, GD, GMP, PDO, mbstring, Intl, MySQLi, OpenSSL, POSIX

Entry Points

  • Web: index.phpApp::processRequest()
  • CLI: bin/console.phpApp::processConsole()
  • Worker: bin/console.php worker (or legacy bin/worker.php)

Configuration Hierarchy (increasing priority)

  1. static/defaults.config.php — system defaults
  2. static/settings.config.php — admin-configurable defaults
  3. config/local.config.php — instance-specific overrides
  4. config database table — runtime settings (highest)

3. Federation Protocols

Friendica is unique in speaking multiple federation protocols simultaneously, acting as a bridge between otherwise-separate ecosystems.

Currently Supported

ProtocolPurposeSince
ActivityPubFederation with Mastodon, Pleroma, Pixelfed, PeerTube, Lemmy, etc.Dec 2018
Diaspora protocolFederation with Diaspora pods, Hubzilla2012
DFRNNative Friendica-to-Friendica federationJuly 2010
WebFingerUser discovery
HTTP SignaturesRequest authentication for ActivityPub
NodeInfoServer metadata discovery
SalmonMessage exchange for replies and mentions

Dropped

ProtocolDroppedReason
OStatus (PubSubHubbub + Atom)v2024.12Too few active OStatus-only servers

Supported FEPs

Nine FEPs including: group federation (Lemmy/Kbin compatible), OpenWebAuth (Hubzilla login), long-form text (partial), application actor identification, object links, and FEP-67ff (FEDERATION.md).


4. The DFRN Protocol

Distributed Friends and Relations Network — Friendica's native protocol for Friendica-to-Friendica federation. Creates an authenticated pipe between users using public-key cryptography.

Message Format

  • Atom Syndication Protocol wrapper with ActivityStreams 1.0, threading, and media extensions
  • Content in BBCode internally
  • Specification: spec/dfrn2.pdf in the Friendica repository

Key Concepts

  • Distinguishes author (content creator) from owner (profile host)
  • Communication boundary is the individual's profile page
  • "Friends of friends" are visible, but direct contact required for communication with third parties

Endpoints

EndpointPurpose
dfrn_requestFriend/contact requests
dfrn_notifyDelivery (push)
dfrn_pollFeed retrieval (pull)

Handshake

  1. Remote site POSTs to dfrn_poll with type=profile-check
  2. Includes duplex direction, relationship dfrn_id, and a random number encrypted with the site's DFRN public key
  3. Original site decodes dfrn_id, verifies relationship, decodes challenge, matches sec string

Delivery Model

  • Public messages: dual path — BBCode to DFRN clients + HTML conversion with PubSubHubbub notification
  • Private messages: direct delivery via dfrn_notify to recipients only; public hubs remain uninformed
  • Polling: src/Worker/OnePoll.php with configurable intervals (up to 5-minute checks)
  • Retry: failed deliveries are queued for automatic retry

5. ActivityPub Implementation

Architecture

Three main classes in src/Protocol/ActivityPub/:

ClassRole
ReceiverHTTP Signature verification, activity validation, JSON decoding
ProcessorActivity type handling (Create, Update, Delete, Like, Announce)
TransmitterJSON-LD generation for outbound activities

Delivery: Worker/Notifier calculates recipients by protocol, spawning APDelivery workers for ActivityPub contacts.

Supported Features

  • Follow/unfollow accounts
  • Public and non-public messaging
  • Posting, commenting, liking, unliking, deletion
  • Bidirectional comment distribution (thread-based and per-posting models)
  • Thread completion (prevents conversation fragmentation)
  • Failed delivery retry queuing
  • Sends Follow for root post IDs to request inclusion in receiver collections

Known Limitations

  • No native direct messages via ActivityPub (workaround: non-public post restricted to single recipient)
  • No account migration between nodes via ActivityPub

Mastodon-Compatible API

Extensive coverage:

  • Accounts: verify_credentials, follow/unfollow/block/unblock/mute/unmute, followers, following, relationships, search
  • Statuses: create/get/delete, favourite/unfavourite, reblog/unreblog, bookmark, pin/unpin, context
  • Timelines: home, public, tag, list, direct
  • Notifications: list, get, clear, dismiss
  • Other: conversations, lists, media, search v1/v2, instance info, follow requests, emojis, directory, polls, push subscriptions

Not implemented: profile updates via API, familiar followers, trending, poll voting, streaming, admin functions, domain blocks

Compatible clients: Tusky, Fedilab, Sengi, Twidere, AndStatus, Bitlbee, Raccoon for Friendica.


6. Cross-Network Connectivity

Built-in (no addon needed)

NetworkProtocol
Mastodon, Pleroma, Pixelfed, PeerTube, Lemmy, Kbin, MisskeyActivityPub
Diaspora, Hubzilla, SocialhomeDiaspora protocol
Other Friendica nodesDFRN
EmailIMAP4rev1 / ESMTP (bidirectional)
Any website/blogRSS/Atom feed import

Addon Connectors (bidirectional)

NetworkNotes
BlueskyNo API key needed; bidirectional since v2023.12
pump.ioPosting, relaying, reading
GNU SocialVia statusnet addon

Addon Connectors (post-only)

Tumblr, WordPress (XMLRPC), LiveJournal, Dreamwidth, InsaneJournal, Libertree, Blogger, Buffer

Deprecated

  • Twitter — removed due to API changes under Musk
  • Facebook/Google+ — removed when APIs shut down

7. Privacy and Access Control

Friendica's privacy model is significantly more granular than most Fediverse platforms:

  • Posts default to private (configurable by admin to default public)
  • Access Control Lists (ACLs) on every post via lock icon UI
  • Circles (formerly Groups) for organizing contacts into permission sets
  • Per-post overrides: select specific individuals or Circles to allow/deny
  • Multiple profiles: different profiles for different audiences (family, friends, public)
  • Anonymous profile viewing can be disabled
  • Post deletion triggers removal notifications to all recipients
  • Content expiration with automated removal from remote Friendica servers

Cross-Network Limitation

Privacy only fully works within Friendica's native protocols. Posts shared via ActivityPub or other protocols lose fine-grained ACL enforcement — the receiving server controls display. Private photo sharing only works reliably between Friendica members.

Once published, post permissions CANNOT be changed.


8. Content Model

Post Capabilities

FeatureDetails
Maximum length200,000 characters
MarkupBBCode (bold, italic, headings h1-h6, code blocks, tables, spoilers, lists)
MediaImages (with alt text, dimensions), video (YouTube/Vimeo/generic), audio, OEmbed
AlbumsPhoto albums with tagging and per-album privacy
EventsDate, time, location, RSVP
ForumsPublic and private, federated
PollsLimited (not supported via Diaspora protocol)
NotesPrivate notebook (notes to self)
MapsBy address, coordinates, or post location
Abstract/summaryPer-network overrides (e.g., [abstract=twit] for Twitter-length)

Object Types

Friendica represents posts as ActivityPub Note objects when federating via ActivityPub. Internally, content is stored in BBCode and converted to HTML or ActivityPub JSON as needed for each protocol.


9. Database Schema

97 tables, utf8mb4 charset. Schema version tracked by DB_UPDATE_VERSION.

Hub-and-Spoke Content Model

TablePurpose
item-uriURI registry for deduplication
postProtocol-agnostic metadata (author-id, owner-id, created)
post-userPer-user states (starred, hidden, visibility)
post-contentBody text
post-mediaAttachments with MIME types
post-thread / post-thread-userThread structure
post-historyEdit history
post-delivery / post-delivery-dataDelivery tracking
post-tag / post-categoryTags and categories
post-question / post-question-optionPolls
delayed-postScheduled posts

A single post can be visible to multiple users with different permission levels without duplicating content — the post-user table stores per-user state separately from post-content.

Contact Tables

TablePurpose
contactBoth local and remote actors
apcontactActivityPub-specific contact data
fcontactDiaspora-specific contact data
contact-relationRelationship graph
user-contactPer-user contact settings

Relationship Constants

NOTHING=0, FOLLOWER=1, SHARING=2, FRIEND=3, SELF=4

Server/Federation Tables

gserver (known servers), endpoint (AP endpoints), inbox-status (AP inbox tracking), diaspora-interaction (signed Diaspora interactions)


10. Architecture

8-Layer Model

  1. Client Layer — browsers, mobile apps (Raccoon, Fedilab), third-party clients via Mastodon API
  2. Frontend Layer — theme system (frio/vier/quattro), JavaScript, localization
  3. Application Layer — Router with 600+ routes (static/routes.config.php), modules, API endpoints
  4. Business Logic Layer — Model classes: Item, Contact, User
  5. Content Processing Layer — BBCode formatting, media processing, URL parsing
  6. Federation LayerFriendica\Protocol\ActivityPub, Friendica\Protocol\Diaspora, Friendica\Protocol\DFRN
  7. Data Layer — Database abstraction (DBA), schema management (DBStructure)
  8. Background Processing — Worker queue with priority levels

Worker Queue

PriorityValue
CRITICAL10
HIGH20
MEDIUM30
LOW40
NEGLIGIBLE50

Tasks enqueued via Worker::add() into workerqueue table. Default 10 parallel instances. Worker/Notifier routes deliveries to protocol-specific workers (APDelivery, Delivery).

Namespaces

Friendica\Module, Friendica\Model, Friendica\Protocol, Friendica\Worker, Friendica\Core, Friendica\Database, Friendica\Util

Dependency Injection

Dice DI container. Services accessed via static DI class: DI::dba(), DI::config(), DI::logger(), DI::session(), DI::baseUrl(), DI::l10n().


11. Addon/Plugin System

Hook-based architecture with 100+ hooks. Addons live in addon/ directory, each in its own subdirectory.

Required Functions

function <addon>_install() {
    \Friendica\Core\Hook::register($hookname, $file, $function);
}
function <addon>_uninstall() { }

Callback Signature

function <addon>_<hookname>(App $a, &$b) { }

$a is the Friendica App class; $b is hook-specific data passed by reference.

Major Hook Categories

CategoryHooks
Contentpost_local, post_local_end, post_remote, display_item, prepare_body
Authauthenticate, logged_in, register_post
Profileprofile_post, profile_edit, profile_sidebar
Contactsfollow, unfollow, revoke_follow, block, unblock
Settingsaddon_settings, connector_settings
Systeminit_1, load_config, route_collection
Federationprobe_detect, item_by_link

Module Intercept

Addons can act as full page modules by defining:

function <addon>_module() {}      // signals module capability
function <addon>_content(App $a) {} // returns HTML

Notable Addons

  • Cross-posting: bluesky, tumblr, diaspora, discourse, wppost, ljpost, dwpost
  • Storage: s3_storage, webdav_storage
  • Auth: ldapauth, saml, keycloakpassword
  • Privacy: securemail (GPG-encrypted notifications)
  • Filters: advancedcontentfilter, langfilter, nsfw, superblock

12. Installation and Deployment

Methods

  1. Git clone: git clone -b stable + composer install --no-dev + web installer
  2. CLI: bin/console autoinstall with config file or env vars
  3. Docker: docker pull friendica (official image)
  4. YunoHost: app package available

Critical Requirements

  • Cron every 5-10 minutes: bin/worker.php (or daemon mode)
  • HTTPS/TLS mandatory
  • Must be at top-level domain or subdomain (not directory path) for Diaspora federation
  • Domain cannot be changed after installation

Scaling

  • Nginx preferred over Apache (~2x capacity)
  • Database tuning via mysqltuner.pl
  • PHP-FPM for faster processing
  • Configurable worker queue parallelism (default 10)
  • Extended poller intervals (30-60 min) for large instances

13. Federation Interoperability

Friendica as Protocol Bridge

Friendica's unique value is connecting users across protocol boundaries:

Mastodon user ←─ActivityPub─→ Friendica ←─Diaspora protocol─→ Diaspora pod
                                  ↕
                              DFRN native
                                  ↕
                           Bluesky (addon)
                                  ↕
                         RSS/Atom/Email/Tumblr

A Friendica user can follow a Mastodon account, a Diaspora contact, a Bluesky account, and an RSS feed — all in the same timeline.

vs. Mastodon

FeatureFriendicaMastodon
Post length200,000 chars500 chars
ProtocolsAP + Diaspora + DFRN + addonsAP only
Contact groupsCircles with ACLsLists (no ACLs)
RSS readerBuilt-inNo
Photo albumsYesNo
Events/calendarYesNo
Quote postsYes (early pioneer)Added later
ForumsYes (public + private)No
BBCodeYesNo

Known Issues

  • Friendica's rich content (BBCode formatting, long posts) may be truncated or stripped by Mastodon's HTML filtering
  • Privacy ACLs only enforceable within Friendica — remote servers control their own display
  • Private photos only reliable between Friendica members
  • Comment counts may be inaccurate on remote instances due to incomplete thread federation

14. Governance and Community

  • No corporation, foundation, or board — informal volunteer governance
  • Core maintainers: Tobias Diekershoff (FSFE), Michael Vogel
  • Communication: Friendica forums (dogfooding the platform)
  • Code: GitHub + self-hosted Gitea at git.friendi.ca
  • Mascot: Flaxy O'Hare (rabbit, CC0)
  • Release cadence: quarterly stable releases, year.month versioning
  • No direct donations accepted — covers server costs only

15. Common Implementation Mistakes

  • Assuming Friendica only speaks ActivityPub: Friendica may deliver content via DFRN or Diaspora protocol depending on the contact type — inspect the contact's protocol, not just the server software
  • Not handling long posts: Friendica posts can be up to 200,000 characters — truncate gracefully rather than rejecting
  • Ignoring BBCode in content: Friendica's native format is BBCode, converted to HTML for ActivityPub — the HTML may contain richer formatting than typical Mastodon posts
  • Expecting Mastodon API parity: Friendica's Mastodon API has gaps (no streaming, no admin API, no poll voting) — test against a real Friendica instance
  • Not supporting the Application instance actor: Friendica uses an instance-level actor for some federation tasks — verify keys from Application actors, not just Person
  • Dropping unknown properties: Friendica posts may include properties from DFRN or Diaspora context — ignore unknown properties rather than rejecting the entire object
  • Assuming public-by-default: Friendica defaults to private posts (admin-configurable) — a Friendica instance may send fewer public posts than expected

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.