Files
yushanhe f097f5bc21
designops-gateway / build (push) Failing after 20m0s
chore: bootstrap DesignOps monorepo (5 subprojects + OKF + annotations)
- merge openpencil/penpot/excalidraw/style-dictionary/storybook as native
  monorepo code (upstream .git removed; origins in okf/manifest.md)
- add project-level okf/ (manifest + memory/rule/skill/decision/lesson)
- add AGENTS.md (OKF annotation standard) + monorepo .gitignore
- annotate 9 entry files with @module/@skill/@rule headers
- add GitOps deploy bundle (infra/gitops/) + Gitea CI (.gitea/workflows/)
2026-09-27 21:28:44 +08:00

3.4 KiB
Raw Permalink Blame History

AGENTS.md — DesignOps 中台项目记忆

本文件是 DesignOps 项目的 AI 协作记忆与代码规范。任何 AI/开发者在本仓库工作时须先读本文件。

项目定位

DesignOps 中台 = 把 OpenPencil + Penpot + Excalidraw + Style Dictionary + Storybook 五个开源工具串成一条自托管、可编程的 Figma 等价闭环,部署在 k3s 集群上,用 Gitea + act_runner + Flux 做可持续迭代(GitOps)。

目录结构

DesignOps/
├── AGENTS.md            # 本文件
├── okf/                 # 项目级 OKF(manifest + memory/rule/skill/decision/lesson)
├── docs/                # 方案文档(DesignOps中台全自动一体化方案.md 是主方案)
├── infra/gitops/        # GitOps 部署包(Flux bootstrap + HelmRelease + ImagePolicy)
├── .gitea/workflows/    # Gitea Actions CI
├── openpencil/          # [MIT] AI 原生矢量设计工具(Rust)
├── penpot/              # [MPL-2.0] 设计平台(Clojure/CLJS)
├── excalidraw/          # [MIT] 白板(TypeScript)
├── style-dictionary/    # [Apache-2.0] 令牌编译(Node)
└── storybook/           # [MIT] 组件开发 + 交互原型(Node)

五个子项目已合并为单一 monorepo(.git 已移除),来源/license/入口见 okf/manifest.md。

OKF 注释标准(强制)

代码变更遵循 okf-annotation-engineering 二步工作流:Step1 注释先行 → Step2 代码跟随。

模块级注释骨架(每个源文件头部)

按语言选对应形态(完整模板见 ~/.dsh/skills/okf-annotation-templates/ 46-50 号):

TypeScript/JSDoc

/**
 * @module {name}
 * @path {relative/path.ts}
 * @description {一句话功能描述(20-60 字符)}
 * @zone {perception|reasoning|memory|action}
 * @tier {Tier1-core|Tier2-support|Tier3-docs}
 *
 * @skill {skill_name} — {描述}
 * @rule {rule_name} P{0|1|2} — {说明}
 */

Rust(模块级 doc comment //!)

//! @module: {name}
//! @path: {relative/path.rs}
//! @description: {一句话功能描述}
//! @zone: {reasoning|action}
//! @tier: Tier2-support
//!
//! @skill: {skill_name} — {描述}
//! @rule: {rule_name} P1 — {说明}

Clojure/CLJS(;; 注释块) / Shell(# 注释块) 同理。

必填度

  • @module(name/path/description/tier 四字段)必需
  • @skill ≥1、@rule ≥1(P0/P1)
  • @zone、@phase 按需;Tier1-core 需 @error/@metric

排除范围(不加 @tag)

纯配置(.json/.yaml)、纯文档(README/CHANGELOG)、数据文件、DSH 运行时数据、单行 fix。

部署方式(可持续迭代 = GitOps)

  • 目标集群:内网 k3s(3 control + 1 worker + 2 备份),拓扑见 ~/.dsh/.serverinfo(凭据不入库)
  • 控制环:git push → Gitea → act_runner(build/test/secret-scan) → 新镜像 tag → Flux ImagePolicy 自动提 PR → 评审合并 → reconcile → k3s 收敛 ← 漂移自愈
  • 部署插件:infra/gitops/(见其 README)

关键约束

  1. 凭据不入库:token/key/password 只经环境变量/Secret 注入,禁止硬编码。
  2. 注释先行:任何代码文件变更先写 @tag 注释 + DocGate 三问,再写代码。
  3. 上游隔离:五个子项目是第三方上游代码,改动需最小化(surgical-changes),避免污染上游语义。
  4. 乐观并发:Penpot update-file 需回显 :revn,冲突重读重试。