118 lines
5.1 KiB
YAML
118 lines
5.1 KiB
YAML
# 三端工作区分类目录 catalog — 机器可读版(schema_version: 1)
|
||
# 知识主本:/srv/share/docs/standards/workspace-directory-standard/catalog.yaml
|
||
# 用途:project-new(新建查模板)/ workspace-tidy(存量先分类)/ classify_workspace.py(判定依据)
|
||
# 配套:同目录 README.md(总规范)第 1 节分类体系
|
||
|
||
schema_version: 1
|
||
last_reviewed: 2026-08-12
|
||
|
||
# ── 六类体系 ─────────────────────────────────────────────
|
||
classes:
|
||
W1:
|
||
name: 内容生产型工作区
|
||
en: content-workspace
|
||
definition: 持续服务多个内容项目,沉淀可复用方法,最终产生 PPT、文档、图表等交付物
|
||
uses_v2: true
|
||
template: templates/w1-content-workspace.md
|
||
mandatory_dirs: [methods, projects, deliverables]
|
||
optional_dirs: [logs]
|
||
decisions:
|
||
- question: 是否同时管理两个以上同类项目,并存在可复用方法与集中交付物?
|
||
if_true: W1
|
||
W2:
|
||
name: 服务型应用
|
||
en: application-service
|
||
definition: 需要长期运行、部署、配置、监控、备份或对外提供接口的应用
|
||
uses_v2: false
|
||
template: templates/w2-service-app.md
|
||
mandatory_dirs: [src]
|
||
optional_dirs: [tests, config, deploy, ops, scripts, data, logs, research, archive]
|
||
decisions:
|
||
- question: 是否需要常驻进程、端口、部署、健康检查、告警或备份恢复?
|
||
if_true: W2
|
||
W3:
|
||
name: 工程型代码项目
|
||
en: engineering-project
|
||
definition: 主要成果是代码、包、命令行工具或可构建软件,不以长期在线运行为主
|
||
uses_v2: false
|
||
template: templates/w3-engineering.md
|
||
mandatory_dirs: [src]
|
||
optional_dirs: [tests, examples, config, data, research, report, scripts, logs, archive]
|
||
decisions:
|
||
- question: 主要成果是否为可测试、可发布的代码或软件包?
|
||
if_true: W3
|
||
W4:
|
||
name: 知识库/档案型
|
||
en: knowledge-base
|
||
definition: 长期积累、检索、引用、归档资料,无明确完成日期
|
||
uses_v2: false
|
||
template: templates/w4-knowledge-base.md
|
||
mandatory_dirs: [inbox, domains]
|
||
optional_dirs: [references, attachments, indexes, templates, exports, archive, logs]
|
||
decisions:
|
||
- question: 是否长期保存和检索知识,且没有明确完成日期?
|
||
if_true: W4
|
||
W5:
|
||
name: 单项目目录
|
||
en: single-project
|
||
definition: 围绕一个有明确目标和结束条件的任务组织材料、数据、代码和报告
|
||
uses_v2: false
|
||
uses_v1: true
|
||
template: templates/w5-single-project.md
|
||
mandatory_dirs: []
|
||
optional_dirs: [code, data, report, research, scripts, logs, archive]
|
||
decisions:
|
||
- question: 是否具有单一目标、负责人和完成条件的目录?
|
||
if_true: W5
|
||
W6:
|
||
name: 共享资产层
|
||
en: shared-assets
|
||
definition: 为多个工作区提供公共资产、脚本、日志、仓库、迁移区或平台级资料
|
||
uses_v2: false
|
||
template: templates/w6-shared-assets.md
|
||
mandatory_dirs: [README.md]
|
||
optional_dirs: [assets, docs, git, knowledge, scripts, logs, migration, inventory]
|
||
decisions:
|
||
- question: 是否供多个互不隶属的工作区共同使用?
|
||
if_true: W6
|
||
|
||
# ── 判定优先级(顺序执行,首个为真即主类型) ────────────
|
||
decision_order:
|
||
- W6 # 共享层最优先(被多个工作区用)
|
||
- W2 # 服务型(常驻运行)
|
||
- W4 # 知识库(长期存知识)
|
||
- W1 # 内容生产(多项目+复用方法)
|
||
- W3 # 工程代码(可发布软件)
|
||
- W5 # 兜底:单项目
|
||
|
||
# 判定信号(classify_workspace.py 用,扫描辅助)
|
||
signals:
|
||
W2: [Dockerfile, docker-compose, compose.yaml, systemd, supervisor, gunicorn, uvicorn, "127.0.0.1", "0.0.0.0", "port", "端口", "健康检查", "systemd"]
|
||
W3: [pyproject.toml, package.json, Cargo.toml, go.mod, setup.py, requirements.txt, "def main", "CLI", "命令行", "pytest", "unittest"]
|
||
W4: [".md", "inbox", "domains", "索引", "知识库", "笔记", "archive"]
|
||
W1: ["methods", "projects", "deliverables", "PPT", "pptx", "模板"]
|
||
W5: ["README.md"]
|
||
W6: ["shared", "共享", "公共", "assets"]
|
||
|
||
# 业务域(v1 继承)
|
||
business_domains: [科研, 写作, 学习, 运维, 生活]
|
||
|
||
# 归属端
|
||
locations: [server, local, huawei, multi]
|
||
|
||
# 命名约定
|
||
naming:
|
||
fixed_structure: "英文小写连字符(methods/projects/src/tests/data/logs)"
|
||
business_root: "业务根和项目名可用中文"
|
||
scripts: "动词_对象.py 或 verb_object.py,必须支持 --help"
|
||
deliverables: "<项目>-<内容>-YYYYMMDD-vN.ext"
|
||
git_tag: "语义化 v<major>.<minor>[.<patch>]"
|
||
|
||
# 规范引用关系
|
||
references:
|
||
v1: "policies/current/single-project-internal-v1.md (单项目内部子规范)"
|
||
v2: "policies/current/content-workspace-v2.md (多项目内容工作区子规范,仅 W1)"
|
||
standard_root: "/srv/share/docs/standards/workspace-directory-standard/"
|
||
local_copy: "D:\\记忆档案\\_规范\\workspace-directory-standard\\"
|
||
huawei_copy: "D:\\Agent\\standards\\workspace-directory-standard\\"
|