[CLAUDE] Skill: Setup multi-agent infrastructure (Investigator + Implementer + Reviewer)
Session 20 turn 12: User paste self-contained template setup multi-agent từ NAMGROUP s41-s43 trial (empirical-grounded Anthropic Building Effective Agents + Cognition "writes single-threaded"). Pre-flight decision gate 6/6 pass → proceed setup. ### Phase 0 — Pre-flight ✅ 6/6 - Codebase > 10K LOC ✅ (59 tables · 27 mig · ~142 endpoints · 34 FE pages) - Project > 6 months ✅ (roadmap T1-T13) - Heavy multi-file features regular ✅ (per-chunk 5-6 commit/session) - User extend ngáo threshold ✅ (S20 đã 12+ turn, deep context) - 25+ gotchas/patterns ✅ (44 gotchas · 14 memory · 6 skills) - Critical changes adversarial review ✅ (UAT live 3 prod domain) ### Phase 1-4 setup .claude/ ├── agents/ │ ├── README.md (master coordination guide ~9.7KB) │ ├── investigator.md (READ — research + audit + WebFetch ~7.3KB) │ ├── implementer.md (WRITE conditional Case 1+2+3+5 ~8.4KB) │ └── reviewer.md (READ adversarial pre-commit + live curl ~9.6KB) └── agent-memory/ ├── investigator/MEMORY.md (seed ~5.9KB) ├── implementer/MEMORY.md (seed ~6.9KB) └── reviewer/MEMORY.md (seed ~6.5KB) ### Customizations per SOLUTION_ERP - Stack: .NET 10 Clean Arch + 2 React 19 FE + SQL Server + Gitea + IIS - Skills preload mỗi agent (reuse 6 skills hiện có): - Investigator: contract-workflow + permission-matrix + ef-core-migration - Implementer: ef-core-migration + permission-matrix + form-engine - Reviewer: dependency-audit-erp + iis-deploy-runbook + contract-workflow - DB: SolutionErp_Dev (LocalDB runtime) + _Design (ef tooling distinct) - Test bearer: admin@solutions.com.vn / Admin@123456 (full) + nv.test@solutions.com.vn / TestUser@123456 (Drafter UAT scope) - Prod UAT: api/admin/eoffice.solutions.com.vn ### Windows MAX_PATH pitfall handled Project path D:\Dropbox\CONG_VIEC\SOLUTION\SOLUTION_ERP\ = 51 chars + nested Dropbox-managed → `isolation: worktree` DROPPED khỏi implementer.md frontmatter per template Pitfall 1. Em main reviews diff before commit (compensate). ### Memory baseline seeded 3 MEMORY.md có: - Patterns proven cross-session (5-chunk discipline, 3-file Mig rule, audit-reuse, service hook derived, FE mirror 2 app, VND format helpers) - 44 gotcha cross-ref - Phase 9 UAT iteration mode (skip test per chunk theo memory feedback_uat_skip_verify) - 5-category Reviewer checklist tinh chỉnh theo SOLUTION_ERP gotcha cluster (#44 silent 403 + #43 Step.Order + #42 V1/V2 dual schema + Wire BE claim) - Tests baseline 81/81 PASS preserve ### Trial workflow Week 1 candidate: Contract V2 wire (Mig 28+29) mirror PE pattern S17-S19 — audit-reuse pattern proven 1×. ~600+ LOC, 2 mig + Service + Controller + FE × 2 app. Investigator pre-flight + Implementer A→E chunks + Reviewer pre-commit verify gotcha #42 dual schema. Em main spawn first time qua /agents command. Pattern tracking ROI 4 tuần trial (week 4 evaluate keep / tune / archive). ### Acceptance criteria 7/7 ✅ - 4 agent .md với valid YAML frontmatter (name/description/model/effort/tools/ skills/memory/color/maxTurns) - 3 MEMORY.md seeds populated SOLUTION_ERP context - All template placeholders {XXX} replaced - Skills 3 đầu agent point tồn tại .claude/skills/ (6 skills sẵn) - File structure đúng template - Implementer isolation worktree dropped (Windows MAX_PATH) - Trial 1 ready (em main /agents spawn dispatch) References: Anthropic Building Effective Agents + Cognition "writes single-threaded" + NAMGROUP s41-s43 empirical curve (+83% → +27% → ~0% overhead). Setup time ~3-5h estimate (đã làm trong S20 turn 12 ~30min do template self-contained + project context đã accumulate). Path filter CI sẽ skip (.claude/skills/** trong paths-ignore, mirror cho .claude/agents/** + .claude/agent-memory/** thực tế cũng docs-class). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
119
.claude/agent-memory/investigator/MEMORY.md
Normal file
119
.claude/agent-memory/investigator/MEMORY.md
Normal file
@ -0,0 +1,119 @@
|
||||
# Investigator Agent — Persistent Memory
|
||||
|
||||
> **Persistent diary cross-session.** Auto-injected first 200 lines / 25KB at spawn.
|
||||
> Update BEFORE every stop. Curate when > 25KB.
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Role baseline
|
||||
|
||||
Read-only research + audit for SOLUTION_ERP codebase. Tools: Read, Grep, Glob, Bash, WebFetch, WebSearch. Output: concise structured findings under 500 words.
|
||||
|
||||
---
|
||||
|
||||
## 📋 Patterns proven (cross-session)
|
||||
|
||||
### Pattern: Smoke verify catalog SOLUTION_ERP
|
||||
- Bearer auth từ `https://api.solutions.com.vn/api/auth/login` (POST email + password)
|
||||
- Status code matrix expected vs actual + JSON output + MD audit
|
||||
- Test credentials: `admin@solutions.com.vn / Admin@123456` (full) OR `nv.test@solutions.com.vn / TestUser@123456` (Drafter UAT scope)
|
||||
|
||||
### Pattern: Schema scan via sqlcmd
|
||||
```bash
|
||||
# LocalDB Dev (runtime — primary)
|
||||
sqlcmd -S "(localdb)\MSSQLLocalDB" -d SolutionErp_Dev -Q "..."
|
||||
|
||||
# LocalDB Design (ef tooling)
|
||||
sqlcmd -S "(localdb)\MSSQLLocalDB" -d SolutionErp_Design -Q "..."
|
||||
|
||||
# Production (qua SSH vietreport-vps)
|
||||
ssh vietreport-vps "sqlcmd -S .\SQLEXPRESS -d SolutionErp -U vrapp -P '...' -Q '...'"
|
||||
```
|
||||
Common queries: `sys.columns`, `sys.triggers`, `__EFMigrationsHistory`, `COUNT(*)`, `sys.indexes`.
|
||||
|
||||
**Gotcha:** 2 LocalDB distinct (memory `feedback_designtime_runtime_db`):
|
||||
- `_Dev` — runtime API (appsettings.Development.json ConnectionStrings:Default)
|
||||
- `_Design` — `dotnet ef migrations add/update` default target
|
||||
- Use `--connection "Server=(localdb)\MSSQLLocalDB;Database=SolutionErp_Dev;..."` override khi cần Dev specifically.
|
||||
|
||||
### Pattern: Controller audit
|
||||
- Grep `\[Route\("api/[a-z]+"\)\]` enumerate ~30+ controllers
|
||||
- Grep `\[Authorize(Policy = "..."` audit per-action policy (gotcha #44 silent 403 class-level quá strict)
|
||||
- Grep `IActionResult` vs `ActionResult<T>` — typed return preferred
|
||||
- Grep `// Mock` / `alert(` / `setEditing(null) // close UI` — wire claim bugs
|
||||
|
||||
### Pattern: Memory cross-reference
|
||||
14 memory entries tại `C:\Users\pqhuy\.claude\projects\D--Dropbox-CONG-VIEC-SOLUTION\memory\`:
|
||||
- `MEMORY.md` — index
|
||||
- `project_solution_erp.md` — cumulative narrative S1-S17
|
||||
- `feedback_per_chunk_commit.md` — 5-chunk A-E discipline
|
||||
- `feedback_uat_skip_verify.md` — Phase 9 skip test rule
|
||||
- `feedback_drastic_refactor_scope.md` — defer dedicated session
|
||||
- `feedback_audit_reuse_before_clone.md` — audit-first pattern (Investigator natural fit)
|
||||
- `feedback_service_hook_vs_endpoint.md` — derived state hook pattern
|
||||
- `feedback_n_stage_workflow_pattern.md` — DEPRECATED (Mig 21 flat workflow replaced)
|
||||
- `feedback_designtime_runtime_db.md` — 2 LocalDB distinct
|
||||
- `feedback_md_compact_narrative.md` — §6.5 KEEP narrative rule
|
||||
- `feedback_unittest_timing.md` — §7 test timing
|
||||
- `feedback_cron_monthly_limitation.md` — Cron SDK 7-day expire
|
||||
- `feedback_user_manual_style.md` — non-tech docs style
|
||||
- `feedback_node_cicd.md` — Node 20.x pin
|
||||
- `reference_session_prompts.md` — canonical session start template
|
||||
|
||||
### Pattern: External research priority sources
|
||||
- `anthropic.com/engineering/` (official patterns)
|
||||
- `cognition.ai/blog/` (Devin lessons)
|
||||
- `philschmid.de` + `eugeneyan.com` + `hamel.dev` (senior engineers)
|
||||
- `learn.microsoft.com/en-us/aspnet/core/` (.NET 10 official)
|
||||
- `tanstack.com/query/latest` (TanStack Query)
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ Anti-patterns observed
|
||||
|
||||
- ❌ Skip MEMORY.md update before stop — lose knowledge tài sản
|
||||
- ❌ Vague conclusion "seems like" / "probably" — em main rejects
|
||||
- ❌ Missing file:line refs — non-verifiable evidence
|
||||
- ❌ Exceed 500 words — em main reads too slow
|
||||
- ❌ Scope drift to architectural recommendations — em main decides, not me
|
||||
|
||||
---
|
||||
|
||||
## 🧠 SOLUTION_ERP context essentials (auto-load)
|
||||
|
||||
- **DB Dev:** `SolutionErp_Dev` LocalDB (59 tables / 27 migrations / Mig 27 latest `AddVisibilityAndDisplayLabelToMenuItems`)
|
||||
- **DB Design:** `SolutionErp_Design` (ef tooling distinct)
|
||||
- **DB Prod:** `.\SQLEXPRESS` / `SolutionErp` / `vrapp` user via SSH `vietreport-vps`
|
||||
- **Tech stack:** .NET 10 Clean Arch (Api → Application ← Domain + Infra) + CQRS MediatR + EF Core 10 + 2 React 19 Vite 8 TS 6 (fe-admin :8082 + fe-user :8080) + SQL Server + Gitea Actions CI + IIS prod
|
||||
- **Live deploys (Prod UAT):** https://api.solutions.com.vn · https://admin.solutions.com.vn · https://eoffice.solutions.com.vn
|
||||
- **Gitea remote:** https://git.baocaogiaoduc.vn/vietreport-admin/solution-erp
|
||||
- **SSH VPS:** `ssh vietreport-vps` (config `~/.ssh/config` user=Administrator key=id_ed25519)
|
||||
- **Gotchas active:** 44 (reference `docs/gotchas.md`)
|
||||
- **Tests baseline:** 81 PASS (58 Domain + 23 Infra) — Phase 9 UAT skip per chunk (memory `feedback_uat_skip_verify`)
|
||||
- **Master HEAD reference:** check via `git log -1 --format='%H'`
|
||||
- **6 skills:** `contract-workflow` · `permission-matrix` · `form-engine` · `ef-core-migration` · `dependency-audit-erp` · `iis-deploy-runbook`
|
||||
|
||||
---
|
||||
|
||||
## 🔄 Active workflow schemas (V1 + V2 coexist post-Session 17)
|
||||
|
||||
- **V1 Mig 21 flat workflow** — `WorkflowDefinition` pin với PE/Contract cũ. Match Dept+PositionLevel.
|
||||
- **V2 Mig 22-27** — `ApprovalWorkflow` pin với PE mới + match `ApproverUserId` 1-1 OR-of-N cùng Cấp. Steps (Phòng) > Levels (Cấp). PE đã wire V2. Contract V2 PENDING Session 21+.
|
||||
|
||||
State machine 5 trạng thái phiếu PE: Nháp / Đã gửi duyệt / **Trả lại (TraLai=98)** / Từ chối / Đã duyệt.
|
||||
|
||||
---
|
||||
|
||||
## 📅 Recent activity (last 10 FIFO)
|
||||
|
||||
- **2026-05-11 (setup):** Investigator agent initialized. Baseline knowledge load complete (44 gotchas + 14 memory entries + 6 skills + 27 mig + 81 test pass cumulative). No investigations performed yet. Awaiting first SendMessage from em main.
|
||||
|
||||
---
|
||||
|
||||
## 🔄 Curate trigger
|
||||
|
||||
- Memory size > 25KB → archive recent entries to `archive/<period>.md`
|
||||
- Duplicate entries detected → merge
|
||||
- Stale > 3 months → remove
|
||||
|
||||
Last curate: 2026-05-11 (initial seed)
|
||||
Reference in New Issue
Block a user