Files
solution-erp/.claude/skills
pqhuy1987 b874743081
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 3m21s
[CLAUDE] Docs+Tests: chốt final session 5 — 77 test (Phase 3 mini PE WF) + 3 gotcha CI + 8 doc updates
Final close session 5 — bao gồm:

==== Tests Phase 3 mini (NEW) ====
tests/SolutionErp.Infrastructure.Tests/Application/PeWorkflowAdminTests.cs
- 6 test CreatePeWorkflowDefinitionCommandHandler:
  - First version → IsActive=true, Version=1, ActivatedAt set
  - Second version same Code → auto-increment v2 + deactivate v1 (atomic)
  - Different EvaluationType (A vs B) → independent active state
  - Persists steps ordered by Order field
  - Persists approvers per step
  - Third version → v1 + v2 deactivate, v3 active

Total tests: 71 → 77 pass / ~2s (54 Domain + 23 Infra).
Skip Phase 3 full (UpsertOpinion + Budget link validation) — cần
Identity UserManager DI helper, defer session sau.

==== 3 gotcha CI mới (#39 #40 #41) ====
- #39 act_runner github.com TCP timeout 21s → manual checkout fix (run #108/#109 fail, #110 pass)
- #40 npm junction cache `tsc not found` after Move-Item — rolled back, hypothesis nested junctions
  trong node_modules disrupt .bin/ paths. TODO debug session sau với robocopy hoặc act_runner cache.host
- #41 Gitea Actions paths-ignore behavior — workflow file change vẫn trigger (correct), commit
  MD-only skip 100% (verify 512880c → no run #113)
+ Checklist debug bug mới items 18-20 referencing 3 gotcha trên.

==== Doc updates (8 file) ====
- STATUS.md: header Phase 8 update + 3 row Recently Done CI fixes + cumulative test 71→77
- HANDOFF.md: TL;DR + CI optimize section + Phase status + gotcha count 38→41
- migration-todos.md: Phase 8 §E updated với Phase 3 mini done + CI fixes
- rules.md §7 Testing: rewrite full — stack + test pyramid + quy tắc bổ sung mỗi feature +
  workflow user end-of-task (`dotnet test` local trước push) + CI gate behavior
- architecture.md §11: update test pyramid + phased priority + CI optimization sub-section
  (3 fix manual checkout / path filter / npm cache rollback) + tốc độ deploy table
- gotchas.md: + #39 #40 #41 đầy đủ (triệu chứng + nguyên nhân + fix + reference)
- ef-core-migration SKILL: Phase 8 update note thêm CI fixes + 77 test
- CLAUDE.md root: test count 71→77 + folder structure + CI/CD pipeline 3 fix section
- memory project_solution_erp.md: session 5 summary + workflow user mới
- session log 2026-04-29-2300-chot-final-ci-tests-gotchas.md (NEW — 9 section detail)

==== Skill audit cron ====
`solution-erp-skill-audit-monthly` next fire 2026-05-01 (2 ngày sau).
Cron survives across sessions (setup commit b904a25). Khi fire sẽ:
- Cross-check 6 skill với STATUS/gotchas/migration-todos
- Auto-refresh stale + đề xuất add/archive cho human approve
- Log vào docs/changelog/skill-audit-2026-05.md
- ABORT nếu repo dirty

==== Verify ====
- dotnet test SolutionErp.slnx → 77 pass / ~2s (54 Domain + 23 Infra)
- git status clean sau commit này
- CI: commit này chứa code (test + workflow) → trigger CI test gate

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 23:43:42 +07:00
..

Skill Library — SOLUTION_ERP

Skill này là tài liệu chuyên biệt để Claude (và developer khác) dùng khi cần deep-dive 1 domain area. Claude tự động invoke qua Skill tool dựa trên semantic matching với description trong từng SKILL.md.

Skills hiện có

Domain skills (logic nghiệp vụ)

Skill Mục đích Trigger ví dụ Trạng thái
contract-workflow State machine 9 phase + versioned workflow per ContractType + role × phase guard + SLA + auto-gen mã HĐ RG-001 "approve contract", "chuyển phase", "versioned workflow", "HĐ cũ giữ cũ" Tier 3 + Phase 6 cross-ref PE workflow
form-engine Render template docx/xlsx + FieldSpec JSON + DynamicForm + PDF export LibreOffice "export contract as word", "điền form", "render template", "PDF export" Active
permission-matrix Role × MenuKey × CRUD + seed + 3-layer resolution + inherit Contracts/Workflows/PurchaseEvaluations "permission denied", "gán role", "menu không hiện", "inherit permission" Active (Phase 6 +Pe_/PeWf_)

Ops/infra skills (devops + security + schema)

Skill Mục đích Trigger ví dụ Trạng thái
dependency-audit-erp Scan CVE NuGet + npm 2 FE, respect pin constraint (MediatR 12.4.1, Swashbuckle 6.9.0) "npm audit", "dotnet vulnerable", "deps scan", "nâng cấp package" New Tier 3
ef-core-migration Tạo/revert EF Core 10 migration, 3-file rule, DesignTimeDbContextFactory, 13 migration history (+ Phase 7 pending) "thêm migration", "EF migration", "schema update", "snapshot lỗi" Updated Phase 6 iter 2
iis-deploy-runbook 3 IIS site + win-acme cert + gitea-runner + LibreOffice + debug 500/502/SignalR prod + G-084 IPv4/IPv6 hardening "prod 500", "IIS fail", "cert hết hạn", "restart app pool", "deploy IIS", "port hijack" Updated (G-084)

Format chuẩn 1 skill

Mỗi skill là 1 folder với ít nhất SKILL.md + optional examples/ + references/:

.claude/skills/<skill-name>/
├── SKILL.md                  ← Entry point: description, when-to-use, workflow
├── examples/                 ← Code snippets mẫu (optional)
│   └── *.cs | *.tsx
└── references/               ← Link đến file code thật, docs (optional)

Frontmatter SKILL.md (BẮT BUỘC when-to-use để skill auto-trigger):

---
name: skill-name-kebab-case
description: 1-3 câu mô tả skill làm gì + stack specificity (để embedding match chính xác)
when-to-use:
  - "trigger phrase 1"
  - "trigger phrase 2"
  - "keyword tiếng Việt"
---

# Skill Name

## Context
...

## Workflow / Commands
...

## Pitfalls
...

## Code pointers
- `path/to/file.cs`

Tạo skill mới — checklist

  1. Tạo folder .claude/skills/<kebab-case-name>/
  2. Viết SKILL.md với frontmatter + sections: Context / Workflow / Code pointers / Common pitfalls
  3. Add row vào bảng "Skills hiện có" phía trên
  4. Update docs/CLAUDE.md (dòng skill count)
  5. Commit [CLAUDE] Skill: add <name>

Nguyên tắc design skill

PROJECT-SPECIFIC, không clone generic:

  • Skill user-level global đã có sẵn (code-reviewer, sql-database-assistant, focused-fix, ...)
  • Skill project-level phải encode kiến thức SOLUTION_ERP-only mà generic không có:
    • Commit convention [CLAUDE] <scope>: ...
    • Path pattern src/Backend/SolutionErp.*/...
    • Pin constraint (MediatR 12.4.1, Swashbuckle 6.9.0, TypeScript 6 erasableSyntaxOnly)
    • Gotcha-referenced (dẫn chiếu docs/gotchas.md#N)
    • Workflow Vietnamese-first

Keep it actionable:

  • Commands copy-pastable (không pseudocode)
  • Paths đầy đủ (không src/...)
  • Version pinned (không "latest")
  • Dẫn chiếu gotcha/migration # cụ thể
  • docs/CLAUDE.md — quick rules + full stack context
  • docs/gotchas.md — 32 bẫy đã gặp
  • docs/changelog/migration-todos.md — roadmap 5 phase + Tier 3