# klawisha012/agentsync architecture

> Architecture diagram of the GitHub repository klawisha012/agentsync, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/klawisha012/agentsync
- Repository: https://github.com/klawisha012/agentsync

## Overview

AgentSync helps users manage and share portable AI-agent configurations: users discover accounts and publications, inspect versioned manifests, and use the CLI to apply or publish configurations. The backend also contains account, social, comment, and publication capabilities, plus a local agent and MCP interface. The excerpts confirm several frontend-to-API calls and manifest-rendering relationships; backend handler wiring and most CLI-to-agent relationships were not shown, so those links are omitted.

Main entry points: [`frontend/app/api.js`](https://github.com/klawisha012/agentsync/blob/main/frontend/app/api.js) (API client), [`frontend/app/publications/[id]/page.js`](https://github.com/klawisha012/agentsync/blob/main/frontend/app/publications/%5Bid%5D/page.js) (Publication viewer), [`frontend/app/stats/page.js`](https://github.com/klawisha012/agentsync/blob/main/frontend/app/stats/page.js) (Publication statistics), [`frontend/app/accounts/list.js`](https://github.com/klawisha012/agentsync/blob/main/frontend/app/accounts/list.js) (Account directory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_accounts_ui["Account directory<br/>[list.js]"]
  node_agent_profile["Published agents<br/>[agents.js]"]
  node_comments_ui["Comments<br/>[comments.js]"]
  node_publication_page["Publication viewer<br/>[page.js]"]
  node_manifest["Manifest builder<br/>[manifest.js]"]
  node_file_tree["File tree<br/>[file-tree.js]"]
  node_settings["Account settings<br/>[page.js]"]
  node_login["Login and registration<br/>[card.js]"]
  node_recovery["Password recovery<br/>[page.js]"]
  node_stats["Publication statistics<br/>[page.js]"]
  node_home["Product landing page<br/>[home.js]"]
  node_distribution["Distribution summary<br/>[distribution.js]"]
  node_api_client["API client<br/>[api.js]"]
  node_avatar["Avatar display<br/>[avatar.js]"]
end

subgraph group_service["Backend service"]
  node_server_entry["HTTP server entry<br/>[main.go]"]
  node_server["HTTP handlers<br/>[server.go]"]
  node_accounts_backend["Account management<br/>[account.go]"]
  node_publications_backend["Publication lifecycle<br/>[publish.go]"]
  node_social_backend["Social features<br/>[social.go]"]
  node_comments_backend["Comment handling<br/>[comments.go]"]
  node_database[("Database access<br/>[db.go]")]
end

subgraph group_local["Local agent tools"]
  node_agent_cli["Agent CLI<br/>[run.go]"]
  node_agent_runtime["Local agent runtime<br/>[agent.go]"]
  node_agent_skills["Skill operations<br/>[skills.go]"]
  node_portable_config["Portable configurations<br/>[portable.go]"]
end

subgraph group_protocol["Agent integration"]
  node_mcp_entry["MCP entry point<br/>[main.go]"]
  node_mcp_server["MCP interface<br/>[mcp.go]"]
end

node_http_api(("HTTP API"))

node_accounts_ui -->|"requests accounts"| node_api_client
node_agent_profile -->|"updates agents"| node_api_client
node_comments_ui -->|"requests comments"| node_api_client
node_publication_page -->|"loads publication"| node_api_client
node_publication_page -->|"builds tree"| node_manifest
node_publication_page -->|"renders tree"| node_file_tree
node_settings -->|"updates account"| node_api_client
node_login -->|"authenticates"| node_api_client
node_recovery -->|"requests recovery"| node_api_client
node_stats -->|"loads accounts"| node_api_client
node_stats -->|"computes summary"| node_distribution
node_api_client -->|"fetches API"| node_http_api

click node_accounts_ui "https://github.com/klawisha012/agentsync/blob/main/frontend/app/accounts/list.js"
click node_agent_profile "https://github.com/klawisha012/agentsync/blob/main/frontend/app/%5Bname%5D/agents.js"
click node_comments_ui "https://github.com/klawisha012/agentsync/blob/main/frontend/app/%5Bname%5D/comments.js"
click node_publication_page "https://github.com/klawisha012/agentsync/blob/main/frontend/app/publications/%5Bid%5D/page.js"
click node_manifest "https://github.com/klawisha012/agentsync/blob/main/frontend/app/publications/%5Bid%5D/manifest.js"
click node_file_tree "https://github.com/klawisha012/agentsync/blob/main/frontend/app/file-tree.js"
click node_settings "https://github.com/klawisha012/agentsync/blob/main/frontend/app/settings/page.js"
click node_login "https://github.com/klawisha012/agentsync/blob/main/frontend/app/login/card.js"
click node_recovery "https://github.com/klawisha012/agentsync/blob/main/frontend/app/recover/page.js"
click node_stats "https://github.com/klawisha012/agentsync/blob/main/frontend/app/stats/page.js"
click node_home "https://github.com/klawisha012/agentsync/blob/main/frontend/app/home.js"
click node_distribution "https://github.com/klawisha012/agentsync/blob/main/frontend/app/distribution.js"
click node_api_client "https://github.com/klawisha012/agentsync/blob/main/frontend/app/api.js"
click node_avatar "https://github.com/klawisha012/agentsync/blob/main/frontend/app/avatar.js"
click node_server_entry "https://github.com/klawisha012/agentsync/blob/main/backend/cmd/http/main.go"
click node_server "https://github.com/klawisha012/agentsync/blob/main/backend/internal/server/server.go"
click node_accounts_backend "https://github.com/klawisha012/agentsync/blob/main/backend/internal/server/account.go"
click node_publications_backend "https://github.com/klawisha012/agentsync/blob/main/backend/internal/server/publish.go"
click node_social_backend "https://github.com/klawisha012/agentsync/blob/main/backend/internal/server/social.go"
click node_comments_backend "https://github.com/klawisha012/agentsync/blob/main/backend/internal/server/comments.go"
click node_database "https://github.com/klawisha012/agentsync/blob/main/backend/internal/server/db.go"
click node_agent_cli "https://github.com/klawisha012/agentsync/blob/main/backend/cmd/cli/run.go"
click node_agent_runtime "https://github.com/klawisha012/agentsync/blob/main/backend/internal/agent/agent.go"
click node_agent_skills "https://github.com/klawisha012/agentsync/blob/main/backend/internal/agent/skills.go"
click node_portable_config "https://github.com/klawisha012/agentsync/blob/main/backend/internal/agent/portable.go"
click node_mcp_entry "https://github.com/klawisha012/agentsync/blob/main/backend/cmd/mcp/main.go"
click node_mcp_server "https://github.com/klawisha012/agentsync/blob/main/backend/internal/mcp/mcp.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_accounts_ui,node_agent_profile,node_comments_ui,node_publication_page,node_manifest,node_file_tree,node_settings,node_login,node_recovery,node_stats,node_home,node_distribution,node_api_client,node_avatar toneBlue
class node_server_entry,node_server,node_accounts_backend,node_publications_backend,node_social_backend,node_comments_backend,node_database toneAmber
class node_agent_cli,node_agent_runtime,node_agent_skills,node_portable_config,node_http_api toneMint
class node_mcp_entry,node_mcp_server toneRose
```

## Components

### Web application

- [Account directory](https://github.com/klawisha012/agentsync/blob/main/frontend/app/accounts/list.js): `frontend/app/accounts/list.js`
- [Published agents](https://github.com/klawisha012/agentsync/blob/main/frontend/app/%5Bname%5D/agents.js): `frontend/app/[name]/agents.js`
- [Comments](https://github.com/klawisha012/agentsync/blob/main/frontend/app/%5Bname%5D/comments.js): `frontend/app/[name]/comments.js`
- [Publication viewer](https://github.com/klawisha012/agentsync/blob/main/frontend/app/publications/%5Bid%5D/page.js): `frontend/app/publications/[id]/page.js`
- [Manifest builder](https://github.com/klawisha012/agentsync/blob/main/frontend/app/publications/%5Bid%5D/manifest.js): `frontend/app/publications/[id]/manifest.js`
- [File tree](https://github.com/klawisha012/agentsync/blob/main/frontend/app/file-tree.js): `frontend/app/file-tree.js`
- [Account settings](https://github.com/klawisha012/agentsync/blob/main/frontend/app/settings/page.js): `frontend/app/settings/page.js`
- [Login and registration](https://github.com/klawisha012/agentsync/blob/main/frontend/app/login/card.js): `frontend/app/login/card.js`
- [Password recovery](https://github.com/klawisha012/agentsync/blob/main/frontend/app/recover/page.js): `frontend/app/recover/page.js`
- [Publication statistics](https://github.com/klawisha012/agentsync/blob/main/frontend/app/stats/page.js): `frontend/app/stats/page.js`
- [Product landing page](https://github.com/klawisha012/agentsync/blob/main/frontend/app/home.js): `frontend/app/home.js`
- [Distribution summary](https://github.com/klawisha012/agentsync/blob/main/frontend/app/distribution.js): `frontend/app/distribution.js`
- [API client](https://github.com/klawisha012/agentsync/blob/main/frontend/app/api.js): `frontend/app/api.js`
- [Avatar display](https://github.com/klawisha012/agentsync/blob/main/frontend/app/avatar.js): `frontend/app/avatar.js`

### Backend service

- [HTTP server entry](https://github.com/klawisha012/agentsync/blob/main/backend/cmd/http/main.go): `backend/cmd/http/main.go`
- [HTTP handlers](https://github.com/klawisha012/agentsync/blob/main/backend/internal/server/server.go): `backend/internal/server/server.go`
- [Account management](https://github.com/klawisha012/agentsync/blob/main/backend/internal/server/account.go): `backend/internal/server/account.go`
- [Publication lifecycle](https://github.com/klawisha012/agentsync/blob/main/backend/internal/server/publish.go): `backend/internal/server/publish.go`
- [Social features](https://github.com/klawisha012/agentsync/blob/main/backend/internal/server/social.go): `backend/internal/server/social.go`
- [Comment handling](https://github.com/klawisha012/agentsync/blob/main/backend/internal/server/comments.go): `backend/internal/server/comments.go`
- [Database access](https://github.com/klawisha012/agentsync/blob/main/backend/internal/server/db.go): `backend/internal/server/db.go`

### Local agent tools

- [Agent CLI](https://github.com/klawisha012/agentsync/blob/main/backend/cmd/cli/run.go): `backend/cmd/cli/run.go`
- [Local agent runtime](https://github.com/klawisha012/agentsync/blob/main/backend/internal/agent/agent.go): `backend/internal/agent/agent.go`
- [Skill operations](https://github.com/klawisha012/agentsync/blob/main/backend/internal/agent/skills.go): `backend/internal/agent/skills.go`
- [Portable configurations](https://github.com/klawisha012/agentsync/blob/main/backend/internal/agent/portable.go): `backend/internal/agent/portable.go`

### Agent integration

- [MCP entry point](https://github.com/klawisha012/agentsync/blob/main/backend/cmd/mcp/main.go): `backend/cmd/mcp/main.go`
- [MCP interface](https://github.com/klawisha012/agentsync/blob/main/backend/internal/mcp/mcp.go): `backend/internal/mcp/mcp.go`

### Other components

- **HTTP API**

## Connections

- Account directory → API client: requests accounts (evidence: `frontend/app/accounts/list.js`)
- Published agents → API client: updates agents (evidence: `frontend/app/[name]/agents.js`)
- Comments → API client: requests comments (evidence: `frontend/app/[name]/comments.js`)
- Publication viewer → API client: loads publication (evidence: `frontend/app/publications/[id]/page.js`)
- Publication viewer → Manifest builder: builds tree (evidence: `frontend/app/publications/[id]/page.js`)
- Publication viewer → File tree: renders tree (evidence: `frontend/app/publications/[id]/page.js`)
- Account settings → API client: updates account (evidence: `frontend/app/settings/page.js`)
- Login and registration → API client: authenticates (evidence: `frontend/app/login/card.js`)
- Password recovery → API client: requests recovery (evidence: `frontend/app/recover/page.js`)
- Publication statistics → API client: loads accounts (evidence: `frontend/app/stats/page.js`)
- Publication statistics → Distribution summary: computes summary (evidence: `frontend/app/stats/page.js`)
- API client → HTTP API: fetches API (evidence: `frontend/app/api.js`)
