Hermes Error Handling Agent là cấu hình Hermes để xử lý lỗi từ Slack theo mô hình orchestrator + sub-agents. Slack channel chỉ dùng để xác định project; owner sửa lỗi được chọn sau khi các domain agent cùng phân tích evidence.
.
├── .hermes/
│ ├── SOUL.md
│ ├── config.yaml
│ ├── project-context/
│ │ ├── channels.yaml
│ │ ├── projects/
│ │ │ └── retail-store-sample-app.yaml
│ │ ├── reviewers/
│ │ │ └── reviewer-groups.yaml
│ │ ├── skills/
│ │ │ └── skill-registry.yaml
│ │ ├── project.yaml.example
│ │ ├── profile.yaml.example
│ │ ├── domain-skill.md.example
│ │ └── SOUL.md.example
│ ├── profiles/
│ │ ├── cart-agent/
│ │ ├── checkout-agent/
│ │ ├── catalog-agent/
│ │ ├── ui-agent/
│ │ ├── orders-agent/
│ │ └── infra-agent/
│ ├── skills/
│ │ └── software-development/
│ │ └── hermes-error-orchestrator/
│ └── cart-agent-mock/
├── docs/
│ ├── PROJECT_REPORT.md
│ └── SETUP.md
├── tools/
│ ├── get_project_context.mjs
│ ├── validate_project_config.mjs
│ └── lib/
├── workspace/
├── docker-compose.yml
└── Dockerfile.hermes
| Path | Vai trò |
|---|---|
.hermes/config.yaml |
Cấu hình Hermes gateway, Slack, delegation, dashboard, MCP GitHub, policy hiển thị output. |
.hermes/SOUL.md |
Identity của orchestrator. Chỉ mô tả phong cách và nguyên tắc, không nhét workflow chi tiết. |
.hermes/project-context/ |
Metadata theo project: Slack channel mapping, repo/code-space, profile assignment, reviewer, skill registry. |
.hermes/profiles/<agent>/ |
Hermes profile/sub-agent có SOUL.md, config.yaml, profile.yaml và skill riêng. |
.hermes/skills/software-development/hermes-error-orchestrator/ |
Skill điều phối chính cho triage, owner selection, fix delegation và Slack replies. |
.hermes/cart-agent-mock/ |
Mock Python shopping cart service và unit tests dùng để test/diễn giải cart domain. |
tools/ |
Node.js resolver/validator cho project context. |
docs/ |
Tài liệu setup và report project. |
workspace/ |
Nơi bind mount project thật vào container Hermes. |
Slack channel
-> Hermes default orchestrator
-> tools/get_project_context.mjs
-> project context + profile assignments
-> parallel scope_detection by enabled profiles
-> evidence-based owner selection
-> Slack scope reply
-> selected owner fix_error
-> branch + PR/MR
-> Slack final reply
Slack chỉ nhận hai checkpoint:
- Kết quả scope detection.
- Kết quả fixed/blocked cuối cùng.
Các log lệnh, tool output và progress nội bộ nằm trong Hermes session/gateway logs.
Project đang cấu hình cho repo:
repo: lbngyn/retail-store-sample-app
url: https://github.com/lbngyn/retail-store-sample-app
branch: main
workspace: /workspace/retail-store-sample-app
Slack channel hiện tại:
C0BDD2QA3FT -> retail-store-sample-app
Enabled agents:
cart-agent:src/cart/**checkout-agent:src/checkout/**catalog-agent:src/catalog/**ui-agent:src/ui/**orders-agent:src/orders/**infra-agent:deploy/**,docker-compose*.yml,charts/**,terraform/**
- Docker + Docker Compose.
- Node.js 20+ nếu chạy resolver/validator ngoài container.
- Hermes Agent gateway.
- Slack app token/bot token.
- GitHub token có quyền repo/pull request nếu cần tạo branch/PR.
- Tạo file
.envtừ các biến cần thiết:
HERMES_DASHBOARD_USERNAME=admin
HERMES_DASHBOARD_PASSWORD=change-me
HERMES_DASHBOARD_SECRET=change-me
SLACK_APP_TOKEN=xapp-...
SLACK_BOT_TOKEN=xoxb-...
SLACK_ALLOWED_CHANNELS=C0BDD2QA3FT
SLACK_HOME_CHANNEL=C0BDD2QA3FT
SLACK_HOME_CHANNEL_NAME=error-handling
GITHUB_PAT=github_pat_...- Clone hoặc mount project thật vào
workspace/.
Với config hiện tại, repo mock nên nằm trong container tại:
/workspace/retail-store-sample-app
Nếu chạy trên host Windows, thư mục tương ứng là:
workspace/retail-store-sample-app
- Start Hermes:
docker compose up -d --build- Mở dashboard nếu đã bật:
http://localhost:8642
Chạy từ root repo:
node tools/get_project_context.mjs --channel-id C0BDD2QA3FT
node tools/validate_project_config.mjs --project-id retail-store-sample-appKết quả mong muốn là ok: true. Trong giai đoạn onboarding, missing local workspace/code-space path có thể là warning nếu repo chưa được clone.
Lưu ý: trong retail-store-sample-app.yaml, startup_checks.commands hiện còn command mẫu dùng C_RETAIL_MOCK. Khi áp dụng thật, đổi sang channel id thực tế hoặc thêm mapping tương ứng vào channels.yaml.
Sửa .hermes/project-context/channels.yaml:
channels:
C_PROJECT_CHANNEL:
project_id: my-projectCopy template:
cp .hermes/project-context/project.yaml.example .hermes/project-context/projects/my-project.yamlCập nhật các phần chính:
project_id: my-project
project_name: My Project
ownership_model: monorepo-service-folder
workspace:
path: /workspace/my-project
code_spaces:
app-repo:
type: github_repo
repo: my-org/my-project
url: https://github.com/my-org/my-project
default_branch: main
local_path: /workspace/my-project
api-directory:
type: directory
parent_code_space: app-repo
path: src/api
local_path: /workspace/my-project/src/apiSupported code-space types:
github_repo: một repo GitHub đầy đủ.github_branch: repo + working branch cụ thể.directory: một folder bên trong code-space cha.workspace: local/cloud workspace đã provision sẵn.
Trong project config:
enabled_profiles:
- api-agent
- ui-agent
- infra-agentMỗi profile phải tồn tại tại:
.hermes/profiles/<profile>/
Copy template:
mkdir -p .hermes/profiles/api-agent/skills/api-error-handling
cp .hermes/project-context/profile.yaml.example .hermes/profiles/api-agent/profile.yaml
cp .hermes/project-context/SOUL.md.example .hermes/profiles/api-agent/SOUL.md
cp .hermes/project-context/domain-skill.md.example .hermes/profiles/api-agent/skills/api-error-handling/SKILL.mdVí dụ profile.yaml:
profile: api-agent
display_name: API Agent
agent_type: hermes_profile
default_ownership:
keywords:
- api
- controller
- service
default_skills:
scope_detection:
- api-error-handling
- hermes-error-orchestrator
- systematic-debugging
- codebase-inspection
fix_error:
- api-error-handling
- codebase-inspection
- systematic-debugging
- test-driven-development
- github-auth
- github-pr-workflow
- github-code-reviewTrong .hermes/project-context/projects/my-project.yaml:
profile_assignments:
api-agent:
code_spaces:
- api-directory
ownership:
services:
- api
paths:
- src/api/**
keywords:
- api
- controller
runtime_signals:
- api
reviewers:
- "@api-lead"
constraints:
can_modify_paths:
- src/api/**
cannot_modify_paths:
- src/ui/**Reviewer group:
reviewer_groups:
api:
- "@api-lead"Nếu skill dùng chung nằm ở .hermes/skills/..., thêm vào .hermes/project-context/skills/skill-registry.yaml. Nếu skill nằm local trong profile, validator vẫn chấp nhận khi file tồn tại tại:
.hermes/profiles/<profile>/skills/<skill>/SKILL.md
Trong .env:
SLACK_ALLOWED_CHANNELS=C_PROJECT_CHANNEL
GITHUB_PAT=github_pat_...Trong .hermes/config.yaml, đảm bảo Slack channel prompt có hướng dẫn resolve đúng channel id nếu bạn dùng prompt theo channel.
GitHub token nên có quyền:
- Contents read/write.
- Pull requests read/write.
- Issues read/write nếu dùng PR comments/issues.
- Actions read nếu agent cần đọc CI checks.
workflowscope nếu repo có policy yêu cầu khi push branch.
node tools/get_project_context.mjs --channel-id C_PROJECT_CHANNEL
node tools/validate_project_config.mjs --project-id my-projectSửa toàn bộ errors trước khi bật Slack incident flow. warnings về path chưa tồn tại có thể chấp nhận nếu workspace chưa clone xong.
Nếu agent không được push trực tiếp lên upstream, cấu hình code-space:
code_spaces:
app-repo:
type: github_repo
repo: upstream-org/app
url: https://github.com/upstream-org/app
default_branch: main
local_path: /workspace/app
push_strategy: fork_pull_request
push_remote: fork
fork_repo: your-user/app
fork_url: https://github.com/your-user/app
pr_base_repo: upstream-org/app
pr_base_branch: main
pr_head_repo: your-user/appAgent sẽ push branch lên fork và mở PR về upstream.
.hermes/cart-agent-mock/ chứa mock Python shopping cart service:
python .hermes/cart-agent-mock/demo.py
python -m unittest .hermes/cart-agent-mock/test_cart_service.pyMock này bao gồm add/remove/update item, discount code, tax, shipping, total calculation và custom exceptions.
- Project report
- Setup notes
.hermes/skills/software-development/hermes-error-orchestrator/references/ownership-rules.md.hermes/skills/software-development/hermes-error-orchestrator/references/sub-agent-task-contracts.md.hermes/skills/software-development/hermes-error-orchestrator/references/reply-templates.md