Skip to content
Apothem
架构

架构

Apothem 架构概览——共享配置档案、工具适配器抽象,以及源代码树的组织方式。

Apothem 围绕一个核心理念构建:一份共享的治理配置档案,由每个工具对应的适配器 物化为各工具的原生配置格式。本节讲解其结构组件——适配器协议、配置档案 模式、源代码树布局,以及将它们串联起来的安装工作流。

系统概览

一目了然,Apothem 就是一条流水线:一份共享配置档案输入工具注册表,注册表解析每个 工具对应的适配器;每个适配器将其工具的原生配置面物化,并由一道常驻的合规闸门 检查每一个已物化的面。

%% provenance: hand-authored %%
%% verified: 2026-06-23 %%
%% cross-reference: src/apothem/lib/harness_registry.py (runtime registry) + src/apothem/harnesses/ (adapter sub-packages) + src/apothem/conformity/ (conformity gate) %%
flowchart TD
    accTitle: Apothem end-to-end materialization flow
    accDescr: One shared profile feeds the harness registry, which resolves seventeen per-harness adapters; each adapter runs its install, uninstall, update, and verify lifecycle, with four single-file-config adapters also rendering a native config file through a materializer, and writes the harness's own native configuration surface. A standing conformity gate checks every materialized surface.
    P["Shared profile<br/>~/.config/apothem/profile.yaml<br/>synced unit: rules, skills, subagents, slash-commands, hooks, output-styles, statuslines, templates, conformity validators, schemas, per-harness instruction templates, settings template<br/>MCP servers"]
    R["Harness registry<br/>authoritative at runtime<br/>(resolves every adapter)"]
    A["17 per-harness adapters<br/>each: install / uninstall / update / verify<br/>+ materializer on 4 single-file-config adapters"]
    N["Each harness's native config surface<br/>Claude Code settings.json, Cursor .mdc,<br/>Gemini GEMINI.md, Copilot instructions.md, …"]
    G["Conformity gate<br/>pre-emission validators"]

    P --> R
    R --> A
    A --> N
    G -.->|standing check over every materialized surface| N

页面

页面描述
工具适配器抽象HarnessAdapter 协议——适配器如何将共享配置档案转换为平台原生配置。
共享配置档案模式位于 ~/.config/apothem/profile.yaml 或 --profile PATH 的由模式支撑的 YAML 配置档案。
源代码布局为何 Apothem 采用 src/ 布局,以及代码树的组织方式。
安装工作流apothem install、update 和 uninstall 如何端到端工作。
委派工作者面向在本仓库中运行的多工作者运行时的仓库范围指令。
自包含运行时Apothem 的引擎如何从任意检出运行——内联依赖、PYTHONPATH=src 调用模型,以及插件树引导。
依赖内联策略Apothem 在 src/apothem/_vendor/ 下内联哪些第三方包、哪些保留为系统前置条件,以及内联副本如何刷新。
集合打包契约用于集合打包与插件清单的稳定、可供下游消费的契约——枚举集合并解析其每个工具的原生目标,而无需重新推导映射。
CI/CD 流水线图门控每次代码变更与发布的构建、测试、lint、安全与发布工作流阶段的可视化映射与泳道分解。

On this page