agentleFS
hillwang1983-webhillwang1983-web/agent-factory/AGENTS.md

agent-factory

AGENTS.md2 starsChanged 5 months agoApache-2.0View on GitHub

面向 AI 编码助手的项目上下文。目录虽名为 open5gs,但实际项目是 Agent Factory。 Agent Factory 是一套面向任意 Git 软件项目的*多 Agent 需求开发与质量治理平台*。以 Hermes 作为 Agent 执行器,驱动从自然语言需求到交付的完整流水线: 核心概念: - ADU:小型、单模块、依赖简单的开发单元。 - Epic:跨模块、需要拆分或存在依赖关系的需求,会拆成带 DAG 依赖的多个子 ADU。 - Contract:授权 Agent 可修改的文件路径范围与验收约束。 - **质量门(human_gate / Validator)**:确定性质量门 + 人工审核,阻止事实性假通过。 - Operator Override:对 Validator 误判进行可审计、幂等的人工纠偏(不能替代缺失的实现/测试)。 Git · Python ≥ 3.10 · Node.js ≥ 20 · npm · 可用的 Hermes CLI 与模型 Provider。 Hermes 配置默认在 ~/.hermes/config.yaml(可用 HERMES_CONFIG_PATH 覆盖)。 均在 agent-factory-dashboard/backend(或 frontend)下执行。 默认地址:Dashboard http://localhost:5175 · API http://localhost:3011 · WS ws://localhost:3012。 工厂自身缺陷(非业务 ADU)使用本地看板,不依赖 GitHub Issue: 规则:claim 互斥;allowed_write_paths 硬约束;同…

  • Commits and pushes

The file

Files
AGENTS.md

AGENTS.md

面向 AI 编码助手的项目上下文。目录虽名为 open5gs,但实际项目是 Agent Factory。

项目概览

Agent Factory 是一套面向任意 Git 软件项目的多 Agent 需求开发与质量治理平台。以 Hermes 作为 Agent 执行器,驱动从自然语言需求到交付的完整流水线:

项目注册与画像 → 需求草案与澄清 → Epic/ADU 注册 → 需求分析 → 详细设计
→ Contract → 开发与构建修复 → Code Review → Acceptance Review → Evidence

核心概念:

  • ADU:小型、单模块、依赖简单的开发单元。
  • Epic:跨模块、需要拆分或存在依赖关系的需求,会拆成带 DAG 依赖的多个子 ADU。
  • Contract:授权 Agent 可修改的文件路径范围与验收约束。
  • 质量门(human_gate / Validator):确定性质量门 + 人工审核,阻止事实性假通过。
  • Operator Override:对 Validator 误判进行可审计、幂等的人工纠偏(不能替代缺失的实现/测试)。

技术栈与结构

.
├── agent-factory-dashboard/
│   ├── backend/    # Express + TypeScript,DDD 分层,API + WebSocket
│   │   └── src/{domain,application,infrastructure,interfaces,websocket}
│   └── frontend/   # React + Vite + TypeScript + Tailwind + zustand
│       └── src/{api,components,hooks,stores,types}
├── scripts/        # Python:Runner / Orchestrator / Validator / 策略引擎
├── .ai-agent/      # Agent 运行时:prompts / registry / policies / runs / evidence ...
├── config/         # 默认配置
├── docs/           # 设计、实施计划、调试记录(含 docs/superpowers/)
└── tests/          # 测试夹具
  • 后端(DDD):domain(实体/仓储接口)、application(服务,如 adu-intake、epic-factory、evidence-governance、token-governance、operator-override-service)、infrastructure(文件仓储、registry-lock、Hermes 配置)、interfaces/websocket。
  • Python 脚本:hermes_agent_run.py(Runner)、hermes_agent_orchestrator.py / hermes_epic_orchestrator.py(编排)、validate_*.py(Contract/质量/证据 Validator)、*_policy.py(运行/写路径/命令策略)、agent_factory_bootstrap.py(初始化)、agent_factory_doctor.py(体检)。
  • Agent Prompts:.ai-agent/prompts/ 下 16 个 Agent(project-profiler、requirement-analyst、detail-designer、contract、developer、buildfix-debugger、code-reviewer、acceptance-reviewer、evidence、adu-splitter、rework-planner 等)。
  • Registry:.ai-agent/registry/*.json 为主机本地运行态数据(adu/epics/projects/runs/reviews/token-budget 等),多数已被 .gitignore 排除。

环境要求

Git · Python ≥ 3.10 · Node.js ≥ 20 · npm · 可用的 Hermes CLI 与模型 Provider。 Hermes 配置默认在 ~/.hermes/config.yaml(可用 HERMES_CONFIG_PATH 覆盖)。

常用命令

均在 agent-factory-dashboard/backend(或 frontend)下执行。

初始化 / 体检:

python3 scripts/agent_factory_bootstrap.py --workspace "$PWD"   # 不覆盖已有数据
cd agent-factory-dashboard/backend && npm run doctor -- --skip-hermes

构建与启动:

# 后端(终端一)
cd agent-factory-dashboard/backend && npm run build && npm run start
# 前端(终端二)
cd agent-factory-dashboard/frontend && npm run dev

默认地址:Dashboard http://localhost:5175 · API http://localhost:3011 · WS ws://localhost:3012。

测试与质量门:

npm run build                       # 后端 tsc / 前端 tsc + vite build
npm run test:phase37-regression
npm run test:operator
npm run test:adu1351-regressions
npm run test:quality-gates
npm run test:epic-dag
npm run check:portable              # 移植性门禁(路径泄漏 + prompt 移植性)

提交前建议:

cd agent-factory-dashboard/backend
npm run check:portable && npm run doctor -- --skip-hermes
git diff --check

关键约定与边界

  • 不要直接 push 到远端:git 操作、合并 fix/bug、完成任务后一律保持本地变更,提交交由用户 review。除非用户明确要求,绝不执行 git push。(当前分支 main)
  • 不提交敏感数据:API Key、Hermes 配置、私钥、模型凭据、运行日志一律不入库。.ai-agent/registry/ 多为本地运行态数据。
  • 写路径受控:Agent 只能修改 ADU/Contract 授权范围内的文件;写路径扩展需策略引擎自动审批或人工审批。
  • 可信命令:验收证据以 Runner 执行的可信命令为准,Agent 自报的 commands_run 不作为独立证据。
  • 人工门处理:遇到 human_gate 在看板人工门页面处理,不要直接改 Registry JSON。
  • Operator Override 仅用于 Validator 误判纠偏,需保留操作理由与校验证据。

本地 BUG 看板(多 Agent 并行修工厂缺陷)

工厂自身缺陷(非业务 ADU)使用本地看板,不依赖 GitHub Issue:

.ai-agent/bugs/          # board.json + items/ + waves/
scripts/local_bug_board.py
python3 scripts/local_bug_board.py list
python3 scripts/local_bug_board.py plan              # 当前可并行集合
python3 scripts/local_bug_board.py claim BUG-0006 --by agent-1
python3 scripts/local_bug_board.py dispatch BUG-0006 --by agent-1

规则:claim 互斥;allowed_write_paths 硬约束;同 wave 依赖未完成不可 claim;claims/dispatches 本地锁不入库。

  • 命令与规则: .ai-agent/bugs/README.md
  • 从发现到分配的业务流程: .ai-agent/bugs/WORKFLOW.md

当前版本

主线覆盖 Phase 1 → Phase 3.7(通用项目画像 → ADU 流水线 → 自然语言/文档接入 → Epic 拆分编排 → 人工质量门/证据/Token 治理 → 移植性/自举/Doctor → Operator 控制层与人工纠偏)。详细设计与调试记录见 docs/superpowers/。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.