# Skill + Doc Audit — 2026-05 > **Cadence:** Cron `solution-erp-skill-audit-monthly` 9:00 ngày 1 mỗi tháng. > **Lần này:** chạy manual 2026-05-04 (trễ 4 ngày so với schedule 2026-05-01 vì cron empty `No scheduled jobs` — recreate khi user trigger). > **Workflow:** combined audit theo `docs/rules.md §6.4` (doc drift) + `§9.4` (skill staleness). ## Phase 1 — Count cross-check | Item | Claim trong MD | Actual | Drift? | |---|---:|---:|:---:| | Tests (`dotnet test SolutionErp.slnx`) | 83 | 83 (54 Domain + 29 Infra) | ✅ | | Migrations (Glob `*.cs` ÷ 2) | 16 | 16 (32 file ÷ 2 + Snapshot) | ✅ | | Gotchas (`### \d+\.` count) | 41 | 41 | ✅ | | Skills (Ls `.claude/skills/`) | 6 | 6 | ✅ | | STATUS Recently Done rows | < 30 | 12 | ✅ chưa cần archive | ### Drift patches applied | File:line | Stale | Patch | |---|---|---| | `docs/CLAUDE.md:70` | `ERD 52 bảng` | → `55 bảng (+§14 DepartmentApprovals Mig 16)` | | `docs/rules.md:368` | `Phase 8 active — 77 test` | → `Phase 9 active — 83 test` | | `docs/architecture.md:329` | `Total: 77 test pass` | → `83 test pass` | | `docs/architecture.md:365` | `cả 77 test ~3s` | → `cả 83 test ~3s` | | `.claude/skills/ef-core-migration/SKILL.md:52` | `Total 77 test pass` | → `Total 83 test pass` (ghi rõ +6 PE 2-stage S9) | ### KEEP (rule §6.5 không cắt narrative) - `docs/rules.md:328` "52 bảng canonical" — example minh họa rule §6.5, KHÔNG drift - `docs/changelog/migration-todos.md:152, 196` "77 test" — historical session record (Phase 8 Tests / Session 8 verify), session log historical = giữ nguyên văn - `docs/changelog/sessions/*.md` — 9 file mention "77 test" hoặc "52 bảng" — TẤT CẢ snapshot lịch sử, KEEP ## Phase 2 — Skill staleness (per §9.4) | Skill | Status hiện tại | Drift findings | Action | |---|---|---|---| | `contract-workflow` | Tier 3 + Phase 6 cross-ref PE | KHÔNG mention 2-stage dept approval (Mig 16 đóng bug anh Kiệt) ở Tier 4+ pending. Lock edit + smart reject cũng chưa nhắc. | ✅ Patch — thêm "Phase 9 cross-ref" block + section "Phase 9 done" trước Tier 4+ | | `permission-matrix` | post Session 6 — 60 menu | Vẫn đúng (chưa thêm menu mới S8/S9). Header "post Session 6" có thể fresh nhưng không critical. | ⏸ optional, skip | | `form-engine` | post Session 6 — Tier 3 FEATURE-COMPLETE | Vẫn đúng. PE PDF export pending nhắc đúng (Phase 9 carry over). | — no patch | | `dependency-audit-erp` | Phase 5.1 backlog | Line 153 "26+ bẫy" stale | ✅ Patch → "41 bẫy" | | `ef-core-migration` | 16 migration → 55 bảng | "Total 77 test pass" line 52 (đã session 8 ending refresh count migration nhưng quên test) | ✅ Patch (cùng Phase 1) | | `iis-deploy-runbook` | Updated G-084 IPv4/IPv6 | Topology + 3 site + win-acme + NSSM runner vẫn đúng | — no patch | ## Phase 3 — Feature gap audit **Feature mới Session 8/9 nào chưa có skill cover?** | Feature S8/S9 | Skill cover? | Decision | |---|---|---| | 2-stage dept approval Migration 16 (cross 3 module) | ❌ chưa | Cross-ref vào `contract-workflow` (rule §9.5 anti-pattern "viết skill chỉ để có thêm" — pattern đủ generic, ghi đủ Domain entity + service + 6 test reusable) | | Smart reject + Resume jump-back | ❌ chưa | Cross-ref `contract-workflow` Phase 9 done section | | Lock edit guards 17 handler | ❌ chưa | Cross-ref `contract-workflow` Phase 9 done | | `IdentityFixture` test pattern (Session 9 E6) | — | Không cần skill — test rule đã ở `rules.md §7`. Pattern reusable trực tiếp từ `tests/Common/IdentityFixture.cs`. | | User.CanBypassReview toggle UI | — | Minor admin UX, không xứng skill | **KHÔNG tạo skill mới.** Tổng số skill giữ **6** (3 domain + 3 ops). **Threshold check:** - gotchas.md +0 gotcha mới session 9 → KHÔNG đạt threshold §9.4 "+5 gotcha mới → audit cluster" - Phase mới (9) đóng → đã audit - Skill drift > 30%? KHÔNG (chỉ 1 line stale ở dependency-audit-erp + 1 block cross-ref ở contract-workflow) ## Phase 4 — Patches applied (Edit, KHÔNG rewrite) 5 file patched (xem Phase 1 + Phase 2 tables above): - `docs/CLAUDE.md` — count 52→55 bảng + section §14 DepartmentApprovals - `docs/rules.md` — Phase header 8→9 + count 77→83 - `docs/architecture.md` — count 77→83 (2 chỗ) - `.claude/skills/ef-core-migration/SKILL.md` — count 77→83 + ghi 6 PE 2-stage - `.claude/skills/contract-workflow/SKILL.md` — Phase 9 cross-ref block + Phase 9 done section - `.claude/skills/dependency-audit-erp/SKILL.md` — 26+→41 bẫy **Tổng diff:** ~30 dòng thêm + ~12 dòng patch. KHÔNG rewrite toàn bộ. KHÔNG cắt narrative. ## Phase 5 — Validation per §6.5 3 câu sau consolidate (per rule §6.5): 1. **Agent mới đọc 6 tháng sau có biết "tại sao chọn approach này" không?** ✅ Có — narrative Phase 6 cross-ref + Phase 9 cross-ref + Tier 3/4 status preserved. 2. **Có còn cảm giác "kể chuyện" tích lũy không, hay chỉ là instructions khô?** ✅ Có — Phase 9 cross-ref block trong contract-workflow kể đủ context "đóng bug anh Kiệt" + 3 mở rộng + reusable test pattern. 3. **Gotcha context vẫn còn ý nghĩa khi đọc rời rạc không?** ✅ Có — gotcha #1-#41 narrative giữ nguyên. dependency-audit-erp chỉ patch số 26→41, narrative pin constraints + workflow vẫn đầy đủ. ## Đề xuất next audit - **Cron 2026-06-01** — recreate `solution-erp-skill-audit-monthly` khi user trigger / cuối session 9. - **Threshold trigger sớm** nếu: - +5 gotcha mới (cluster có thể gom thành skill mới) - Phase 10 đóng (Post-launch — E-signature / Bravo / Mobile / AI OCR — cần skill mới) - Skill drift > 30% (count broken / path broken / mention phase cũ) ## Stats - Total skill: 6 (no add/archive) - Files patched: 6 (5 docs + 1 SKILL.md cross-skill) - Lines diff: ~+30 / ~12 patch - Effort: ~30 phút (thực thi qua Edit, không rewrite) - Audit log: 1 page (file này, theo cadence rule)