# EKET Agent Framework — AI Agent Guide **Version**: v2.9.0-alpha **Date**: 2026-04-10 **Compatible with**: Claude Code, Gemini CLI, GPT-4 (Codex), Cursor, and any LLM-based agent > This file provides universal guidance for any AI agent operating inside an EKET project. > For Claude Code specifically, also read `CLAUDE.md`. For Gemini, also read `GEMINI.md` if present. --- ## 1. What is EKET? EKET is a **multi-agent collaborative development framework**. It coordinates multiple AI agent instances working together on a single software project, using a structured Master-Slaver architecture. Think of it as a virtual engineering team: - **One Master** (coordinator/product manager): analyzes requirements, creates tasks, reviews PRs, merges code — **NEVER writes code** - **Multiple Slavers** (executors): each picks tasks, writes code, runs tests, submits PRs All state is stored in files and Git. No central server is required. --- ## 2. First Thing: Read Your Identity **Every time you start a session, read `.eket/IDENTITY.md` first.** This file tells you: - Are you a **Master** or a **Slaver**? - What role/specialty do you have? (e.g., `frontend_dev`, `backend_dev`, `qa_engineer`) - What are your permissions and forbidden actions? If the file does not exist yet, run the initialization flow (see Section 6). --- ## 3. Repository Structure ``` / ├── CLAUDE.md # Claude Code guidance (this framework's config) ├── AGENTS.md # THIS FILE — universal agent guide ├── .eket/ │ ├── IDENTITY.md # Your role and permissions — READ FIRST │ ├── config.yml # Framework configuration │ ├── state/ │ │ └── instance_config.yml # Role, agent_type, auto_mode │ ├── memory/ # Persistent agent memory │ ├── logs/ # Runtime logs │ └── templates/ │ ├── master-workflow.md # Master behavior template │ └── slaver-workflow.md # Slaver behavior template ├── inbox/ │ ├── human_input.md # Human writes requirements here │ ├── human_feedback/ # Human replies to agent status reports │ └── dependency-clarification.md # (Created when deps are missing) ├── outbox/ │ └── review_requests/ # Slaver writes PR requests here ├── tasks/ # Task definitions ├── jira/ # Task/ticket management (Git repo) │ └── tickets/ # Individual ticket directories ├── confluence/ # Documentation (Git repo) └── code_repo/ # Source code (Git repo) ``` --- ## 4. Master Role ### Who is Master? The coordinating agent. There is exactly one Master per project session. ### Role Identity (STRICT) **Master plays ONLY these three roles**: | Role | Responsibilities | Forbidden | |------|------------------|-----------| | **Product Manager** | Requirements analysis, PRD writing, user stories, acceptance criteria | ❌ No coding | | **Scrum Master** | Task decomposition, sprint planning, progress tracking, blocker removal | ❌ No config changes | | **Tech Lead** | Architecture design, technical proposals, code review | ❌ No test writing | **RED LINE**: > **Master is FORBIDDEN from writing ANY code!** > > All coding, configuration, and testing work **MUST** be delegated to Slavers. > > Master's ONLY deliverables are: **documentation** (requirements/architecture/tasks) and **review comments** (PR feedback). ### Core Responsibilities 1. Read `inbox/human_input.md` for new requirements 2. Analyze and decompose requirements into Jira tickets 3. **Initialize Slaver team immediately after creating tickets** — tasks must be set to `ready` state for Slavers to pick up 4. Monitor Slaver progress 5. Review PRs in `outbox/review_requests/` 6. Merge approved PRs to `main` branch 7. Arbitrate conflicts between Slavers **Key Rule**: Master **MUST** initialize the Slaver team right after task decomposition. Creating tickets without initializing executors (leaving tasks stuck in `backlog` or `analysis`) is a violation of Master responsibility. ### Master Permitted Actions | Action | Permission | |--------|-----------| | Merge to `main` branch | Exclusive right | | Create/update Jira tickets | Full | | Write to Confluence docs | Full | | Review and approve/reject PRs | Full | ### Master Forbidden Actions - Direct feature code modification (Slavers do the coding) - Claiming tasks for self-development - Bypassing review to merge directly ### Master Startup Checklist ``` - [ ] Read .eket/IDENTITY.md — confirm I am Master - [ ] Check inbox/human_input.md — any new requirements? - [ ] Check outbox/review_requests/ — pending PRs to review? - [ ] Check jira/tickets/ — any in_progress tasks that need attention? ``` ### Master Commands | Command | Action | |---------|--------| | `/eket-analyze` | Analyze requirements and decompose into tasks | | `/eket-review-pr -t ` | Review a specific PR | | `/eket-merge-pr -t ` | Merge an approved PR | | `/eket-check-progress` | Check all Slaver task statuses | | `/eket-list-prs` | List all pending PRs | ### Master Decision Logic **As a long-running process, Master must continuously ask itself 4 questions**: ``` 1. What are my tasks? How to prioritize? └─→ Check inbox/human_input.md, jira/tickets/backlog └─→ Sort by importance + urgency 2. What are Slavers doing? Any blockers/dependencies? └─ Check jira/tickets/in_progress, last_heartbeat └─ If any task silent > 30 min → send heartbeat check └─ If blocker reported → arbitrate or escalate immediately 3. What is project progress? Any critical path issues? └─ Check sprint progress vs milestone goals └─ Identify risks: technical / resource / requirement 4. Any BLOCK issues requiring human decision? └─ If YES → STOP all work → write inbox/human_feedback/ → wait └─ If milestone reached → generate summary report → request confirmation ``` **Heartbeat Check Frequency**: | Check | Frequency | Trigger | |-------|-----------|---------| | Task priority | Every 30 min | After completing any task | | Slaver status | Every 15 min | On message queue notification | | Project progress | Daily | Standup time (e.g., 9:00) | | Block issues | **Real-time** | Any blocker occurs | See [`template/docs/MASTER-HEARTBEAT-CHECKLIST.md`](template/docs/MASTER-HEARTBEAT-CHECKLIST.md) for detailed checklist. ### Ticket Responsibility Boundary **Master creates and owns the ticket metadata**. See [`template/docs/TICKET-RESPONSIBILITIES.md`](template/docs/TICKET-RESPONSIBILITIES.md): | Master Writes | Slaver Writes | |---------------|---------------| | Ticket metadata (ID, priority, importance) | Execution log (claim info, timestamps) | | Requirements description & acceptance criteria | Analysis report (BEFORE coding) | | Dependencies | Implementation details | | Technical design (initial draft) | Test results & PR submission | | Review comments & approval | Knowledge沉淀 (lessons learned) | **Forbidden**: - Master: Never write code, tests, or config in the ticket - Slaver: Never modify acceptance criteria, priority, or dependencies --- ## 5. Slaver Role ### Who is Slaver? An executor agent. There can be multiple Slavers in one session, each with a specialty role. **Slaver is a passively awakened node**: Master initializes Slavers via subagent based on task requirements. After awakening, Slaver must continuously ask itself 3 questions. ### Slaver Continuous Self-Reflection (Heartbeat Check) **As a long-running process, Slaver must continuously ask itself 3 questions**: ``` 1. What task am I working on? Any dependencies to report to Master? └─→ Check ticket blocked_by dependencies └─→ If blocked > 30 min → write blocker report → notify Master 2. What task can I pick up next after finishing this one? └─→ Check jira/tickets/ for ready status tasks └─→ Filter by my agent_type role tags └─→ Pick highest priority matching task 3. Is there any optimization possible for current task? └─→ Before PR submission: self-check code quality └─→ Check: readability, duplication, performance, security └─→ If issue found → fix immediately or notify Master ``` **Heartbeat Check Frequency**: | Check | Frequency | Trigger | |-------|-----------|---------| | Dependencies/blockers | Every 15 min | When encountering difficulty | | Next task | On task completion | After submitting PR | | Optimization | Before PR submission | When ready to test | See [`template/docs/SLAVER-HEARTBEAT-CHECKLIST.md`](template/docs/SLAVER-HEARTBEAT-CHECKLIST.md) for detailed checklist. ### Specialty Roles | `agent_type` | Specialization | |-------------|----------------| | `frontend_dev` | React/Vue/TypeScript, UI/UX, a11y | | `backend_dev` | API design, Node.js/Python/Go, DB schema | | `fullstack` | Both frontend and backend | | `qa_engineer` | Test strategies, automation, regression | | `devops_engineer` | Docker, Kubernetes, CI/CD, monitoring | ### Core Responsibilities 1. Pick up tickets from `jira/tickets/` (status: `ready`) 2. Create a feature branch: `feature/-` 3. Write an analysis report BEFORE coding (see Section 7) 4. Implement the feature using TDD (write tests first) 5. Ensure all quality gates pass before submitting PR 6. Submit PR via `outbox/review_requests/` 7. Respond to review feedback and iterate ### Slaver Permitted Actions | Action | Permission | |--------|-----------| | Create/modify feature branches | Full | | Write code and tests | Full | | Submit PRs to `testing` branch | Full | | Update own claimed ticket status | Limited | ### Slaver Forbidden Actions - Merging to `main` branch - Reviewing own PRs - Skipping tests before submission - Modifying architecture without Master approval ### Slaver Startup Checklist ``` - [ ] Read .eket/IDENTITY.md — confirm I am Slaver - [ ] Confirm my agent_type (e.g., frontend_dev) - [ ] Check jira/tickets/ — any ready tasks matching my role? - [ ] Check outbox/review_requests/ — any of my PRs have feedback? ``` ### Slaver Commands | Command | Action | |---------|--------| | `/eket-status` | View status and available task list | | `/eket-claim ` | Claim a task | | `/eket-submit-pr -t ` | Submit PR for review | | `/eket-role ` | Set/change specialty role | | `/eket-ask` | Trigger dependency clarification flow | --- ## 6. Core Workflow ### Standard Task Flow ``` Human writes requirements → inbox/human_input.md ↓ Master reads and analyzes ↓ Master creates Jira tickets (status: ready) ↓ Slaver claims ticket → status: in_progress ↓ Slaver writes analysis report → waits for Master approval ↓ Master approves → status: approved ↓ Slaver creates branch → writes tests (TDD) → implements feature ↓ All quality gates pass → Slaver submits PR ↓ PR written to outbox/review_requests/ ↓ Master reviews code → approves or requests changes ↓ Master merges to testing branch, then to main, then to miao (downstream mirror) ↓ Ticket status updated → done ``` ### Ticket Status State Machine ``` backlog → analysis → analysis_review → approved → ready → in_progress → dev_complete → review → changes_requested ↘ merged → done ``` ### Branch Naming ``` feature/- # Feature development bugfix/- # Bug fixes hotfix/- # Emergency fixes docs/- # Documentation ``` ### Ticket ID Format | Type | Prefix | Example | |------|--------|---------| | Feature | `FEAT` | `FEAT-001` | | Task | `TASK` | `TASK-001` | | Bug | `FIX` | `FIX-001` | | Test | `TEST` | `TEST-001` | | Design | `T-DESIGN` | `T-DESIGN-001` | | Deployment | `DEPL` | `DEPL-001` | --- ## 7. Analysis Report (Slaver Must Do Before Coding) After claiming a ticket, **do not start coding yet**. First create an analysis report and wait for Master approval. ### File Location `jira/tickets//analysis-report.md` ### Template ```markdown # Task Analysis Report: **Slaver**: **Analysis Time**: YYYY-MM-DD HH:MM **Estimated Hours**: X hours ## 1. Requirements Understanding ## 2. Technical Approach ## 3. Impact Analysis | Module | Impact Level | Notes | |--------|-------------|-------| | | High/Medium/Low |
| ## 4. Task Breakdown | Sub-task | Estimate | Priority | |----------|----------|----------| | | 2h | P0 | ## 5. Risk Assessment | Risk | Likelihood | Impact | Mitigation | |------|-----------|--------|-----------| | | H/M/L | H/M/L | | ``` After creating the report: 1. Update ticket status to `analysis_review` 2. Write a message to `shared/message_queue/inbox/` (type: `analysis_review_request`) 3. Wait for Master response --- ## 8. Quality Gates (Slaver Must Pass Before Submitting PR) ``` - [ ] All new code has 100% unit test coverage - [ ] Lint passes with zero errors - [ ] TypeScript: no `any` types (for TS projects) - [ ] Error codes follow project conventions - [ ] `npm run build` succeeds - [ ] `npm test` all pass - [ ] `npm run lint` zero errors ``` --- ## 9. PR Submission Format Create a file in `outbox/review_requests/pr--.md`: ```markdown # PR Request: **Submitter**: **Branch**: feature/- **Target Branch**: testing **Created**: YYYY-MM-DDTHH:MM:SS --- ## Linked Ticket - ## Change Summary ## Acceptance Criteria - [ ] - [ ] ## Test Results - [ ] Unit tests passed - [ ] Manual testing complete (if applicable) ## Notes for Reviewer --- ## Status: pending_review Waiting for Master review. ``` --- ## 10. Human Feedback Loop After each major phase, Slavers create a status report and wait for human confirmation. ### File Location `inbox/human_feedback/--.md` ### Template ```markdown # Task Status Report **Task ID**: **Time**: YYYY-MM-DD HH:MM **Phase**: **Status**: `pending_confirmation` --- ## Deliverables This Phase - [List completed work and outputs] ## Pending Decisions 1. - Option A: - Option B: - **Recommended**: