@anhlp/alp-core 0.0.1-beta.7 → 0.0.1-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dist/library-edit.d.ts +51 -2
  2. package/dist/library-edit.js +160 -8
  3. package/dist/library.d.ts +14 -1
  4. package/dist/library.js +73 -5
  5. package/dist/models.d.ts +35 -0
  6. package/dist/models.js +17 -1
  7. package/dist/packs.d.ts +57 -0
  8. package/dist/packs.js +247 -0
  9. package/dist/permissions.d.ts +3 -2
  10. package/dist/permissions.js +6 -3
  11. package/dist/profiles.js +3 -3
  12. package/dist/providers.d.ts +2 -4
  13. package/dist/providers.js +20 -4
  14. package/dist/skill-validate.d.ts +85 -0
  15. package/dist/skill-validate.js +298 -0
  16. package/dist/upgrade.d.ts +10 -0
  17. package/dist/upgrade.js +112 -6
  18. package/dist/validation.js +2 -3
  19. package/package.json +18 -2
  20. package/src/library-edit.js +170 -8
  21. package/src/library.js +96 -6
  22. package/src/models.js +24 -0
  23. package/src/packs.js +246 -0
  24. package/src/permissions.d.ts +3 -2
  25. package/src/permissions.js +13 -3
  26. package/src/profiles.js +4 -4
  27. package/src/providers.js +20 -5
  28. package/src/resolver.js +1 -1
  29. package/src/skill-validate.js +287 -0
  30. package/src/upgrade.js +54 -6
  31. package/src/validation.js +3 -4
  32. package/templates/ALP.md +52 -52
  33. package/templates/agents/lead/AGENT.md +77 -74
  34. package/templates/agents/main/AGENT.md +153 -145
  35. package/templates/agents/oracle/AGENT.md +38 -37
  36. package/templates/agents/peer/AGENT.md +56 -52
  37. package/templates/agents/reviewer/AGENT.md +63 -65
  38. package/templates/agents/supervisor/AGENT.md +63 -63
  39. package/templates/packs/architecture/agents/architect/AGENT.md +41 -0
  40. package/templates/packs/architecture/agents/architect/agent.json +5 -0
  41. package/templates/packs/architecture/agents/docs-maintainer/AGENT.md +33 -0
  42. package/templates/packs/architecture/agents/docs-maintainer/agent.json +4 -0
  43. package/templates/packs/architecture/pack.json +7 -0
  44. package/templates/packs/architecture/teams/blueprint/HOUSE_RULES.md +12 -0
  45. package/templates/packs/architecture/teams/blueprint/team.json +19 -0
  46. package/templates/packs/backend/pack.json +6 -0
  47. package/templates/packs/backend/skills/backend-development/SKILL.md +102 -0
  48. package/templates/packs/backend/skills/backend-development/references/api-design.md +96 -0
  49. package/templates/packs/backend/skills/backend-development/references/authentication.md +78 -0
  50. package/templates/packs/backend/skills/backend-development/references/error-handling.md +86 -0
  51. package/templates/packs/backend/skills/backend-development/references/testing.md +81 -0
  52. package/templates/packs/backend/skills/databases/SKILL.md +103 -0
  53. package/templates/packs/backend/skills/databases/references/query-performance.md +87 -0
  54. package/templates/packs/backend/skills/databases/references/schema-and-migrations.md +87 -0
  55. package/templates/packs/design/pack.json +6 -0
  56. package/templates/packs/design/skills/ui-design/SKILL.md +86 -0
  57. package/templates/packs/design/skills/ui-design/references/design-tokens.md +67 -0
  58. package/templates/packs/design/skills/ui-design/references/interaction-states.md +73 -0
  59. package/templates/packs/design/skills/ui-design/references/layout-and-typography.md +71 -0
  60. package/templates/packs/design/skills/ui-design/references/ui-review.md +83 -0
  61. package/templates/packs/frontend/pack.json +6 -0
  62. package/templates/packs/frontend/skills/frontend-development/SKILL.md +105 -0
  63. package/templates/packs/frontend/skills/frontend-development/references/accessibility.md +86 -0
  64. package/templates/packs/frontend/skills/frontend-development/references/components-and-state.md +79 -0
  65. package/templates/packs/frontend/skills/frontend-development/references/data-fetching.md +86 -0
  66. package/templates/packs/frontend/skills/frontend-development/references/frameworks.md +77 -0
  67. package/templates/packs/frontend/skills/frontend-development/references/performance.md +78 -0
  68. package/templates/packs/integration/pack.json +6 -0
  69. package/templates/packs/integration/skills/mcp-integration/SKILL.md +100 -0
  70. package/templates/packs/integration/skills/mcp-integration/references/server-implementation.md +95 -0
  71. package/templates/packs/integration/skills/mcp-integration/references/testing.md +78 -0
  72. package/templates/packs/integration/skills/mcp-integration/references/tool-design.md +97 -0
  73. package/templates/packs/operations/pack.json +6 -0
  74. package/templates/packs/operations/skills/devops/SKILL.md +85 -0
  75. package/templates/packs/operations/skills/devops/references/ci-cd.md +84 -0
  76. package/templates/packs/operations/skills/devops/references/containers.md +85 -0
  77. package/templates/packs/operations/skills/devops/references/deployment-and-rollback.md +85 -0
  78. package/templates/packs/operations/skills/devops/references/observability.md +86 -0
  79. package/templates/packs/quality/pack.json +6 -0
  80. package/templates/packs/quality/skills/web-testing/SKILL.md +102 -0
  81. package/templates/packs/quality/skills/web-testing/references/e2e.md +85 -0
  82. package/templates/packs/quality/skills/web-testing/references/performance-testing.md +85 -0
  83. package/templates/packs/quality/skills/web-testing/references/security-testing.md +78 -0
  84. package/templates/packs/quality/skills/web-testing/references/unit-and-component.md +78 -0
  85. package/templates/role-skills.json +4 -4
  86. package/templates/skills/architecture-docs/SKILL.md +81 -0
  87. package/templates/skills/architecture-docs/references/adr.md +62 -0
  88. package/templates/skills/architecture-docs/references/diagrams.md +60 -0
  89. package/templates/skills/architecture-docs/references/evidence-rules.md +49 -0
  90. package/templates/skills/bug-loop/SKILL.md +41 -40
  91. package/templates/skills/bug-loop/references/test-proof.md +21 -19
  92. package/templates/skills/compact/SKILL.md +2 -2
  93. package/templates/skills/curate/SKILL.md +6 -5
  94. package/templates/skills/feature-architecture/SKILL.md +90 -0
  95. package/templates/skills/feature-architecture/references/architecture-contract.md +95 -0
  96. package/templates/skills/feature-architecture/references/feature-design.md +69 -0
  97. package/templates/skills/feature-architecture/scripts/check-boundaries.mjs +270 -0
  98. package/templates/skills/goal-griller/SKILL.md +27 -27
  99. package/templates/skills/prompt-leverage/SKILL.md +29 -27
  100. package/templates/skills/prompt-leverage/references/brief-template.md +9 -9
  101. package/templates/skills/release-readiness/SKILL.md +83 -0
  102. package/templates/skills/release-readiness/references/checklist.md +40 -0
  103. package/templates/skills/release-readiness/references/verdict-template.md +53 -0
  104. package/templates/skills/safe-refactor/SKILL.md +84 -0
  105. package/templates/skills/safe-refactor/references/characterization-tests.md +57 -0
  106. package/templates/skills/safe-refactor/references/compatibility-checklist.md +56 -0
  107. package/templates/skills/security-review/SKILL.md +87 -0
  108. package/templates/skills/security-review/references/checklist.md +74 -0
  109. package/templates/skills/security-review/references/severity.md +61 -0
  110. package/templates/skills/sequence-execution-plan/SKILL.md +41 -38
  111. package/templates/skills/sequence-execution-plan/references/plan-template.md +5 -5
  112. package/templates/skills/skill-authoring/SKILL.md +84 -0
  113. package/templates/skills/skill-authoring/references/evaluation.md +45 -0
  114. package/templates/skills/skill-authoring/references/skill-anatomy.md +74 -0
  115. package/templates/skills/skill-authoring/references/trigger-design.md +52 -0
  116. package/templates/skills/smart-commits/SKILL.md +37 -36
  117. package/templates/skills/test-strategy/SKILL.md +83 -0
  118. package/templates/skills/test-strategy/references/contract-tests.md +46 -0
  119. package/templates/skills/test-strategy/references/risk-matrix.md +53 -0
  120. package/templates/skills/xia/SKILL.md +40 -38
  121. package/templates/teams/cafe/HOUSE_RULES.md +1 -1
  122. package/templates/teams/cafe/team.json +1 -1
  123. package/templates/teams/pho/HOUSE_RULES.md +1 -1
  124. package/templates/teams/pho/team.json +1 -1
@@ -0,0 +1,53 @@
1
+ # Bảng rủi ro và các ca biên
2
+
3
+ Đọc khi biến hành vi thành rủi ro, khi chọn mức test cho từng rủi ro, hoặc khi liệt kê các ca biên.
4
+
5
+ ## Từ rủi ro sang mức test
6
+ | Rủi ro | Mức rẻ nhất mà chứng minh được | Ghi chú |
7
+ |---|---|---|
8
+ | Tính toán, phân tích cú pháp, rẽ nhánh sai | Unit | Các ca theo bảng trên nhiều input |
9
+ | Input không hợp lệ bị nhận hoặc input hợp lệ bị từ chối | Unit, cộng một integration tại biên | Kiểm tra ngay tại chỗ input đi vào |
10
+ | Nối dây: config, dependency injection, định tuyến | Integration | Đồ thị module thật, bên ngoài là fake |
11
+ | Lưu trữ: truy vấn, migration, transaction | Integration với store thật hoặc nhúng | Dùng chỗ dựng DB test đang có của project |
12
+ | Đổi hình dạng làm vỡ một bên tiêu thụ | Contract | Xem reference contract-tests |
13
+ | Một hành trình người dùng tối quan trọng vỡ từ đầu tới cuối | End-to-end, một đường | Chỉ khi các mức thấp hơn không thấy được |
14
+ | Một bug đã sửa trước đây quay lại | Regression tại đường ráp của bug gốc | Giữ lại bản tái lập gốc |
15
+ | Dependency chết, chậm hay báo lỗi | Integration với một fake biết chèn lỗi | Khẳng định timeout, retry, thông điệp lỗi |
16
+ | Lách quyền hay lách phân quyền | Integration xuyên qua chính phép kiểm thật | Test cả ca được phép và ca bị từ chối |
17
+ | Đồng thời: race, gửi hai lần, mất bản cập nhật | Integration với cách xen kẽ được kiểm soát | Lập lịch tất định, không dùng sleep |
18
+ | Regression hiệu năng trên một đường nóng đã biết | Benchmark hay phép kiểm ngân sách nếu project có | So các khối việc tương đương |
19
+
20
+ Ưu tiên theo khả năng xảy ra nhân với chi phí. Các rủi ro ít khả năng và ít tốn kém có thể được
21
+ chấp nhận mà không test; hãy nói rõ điều đó trong kế hoạch.
22
+
23
+ ## Checklist ca biên theo loại input
24
+ **Chuỗi:** rỗng, chỉ có khoảng trắng, rất dài, Unicode (dấu kết hợp, emoji, RTL), khác nhau về
25
+ chữ hoa chữ thường, khoảng trắng ở đầu hay ở cuối, có ngắt dòng hay NUL bên trong, các ký tự
26
+ injection ứng với điểm tiêu đang dùng (SQL, shell, HTML, dấu phân cách đường dẫn).
27
+
28
+ **Số:** không, số âm, số một, giá trị lớn nhất và nhỏ nhất của kiểu, vừa vượt mỗi giới hạn,
29
+ số không nguyên ở chỗ mong đợi số nguyên, NaN và vô cực, làm tròn và độ chính xác
30
+ tiền tệ, số được mã hoá dưới dạng chuỗi.
31
+
32
+ **Tập hợp:** rỗng, một phần tử, có trùng, rất lớn, chưa sắp xếp, lồng nhau mà rỗng,
33
+ phần tử null, các biên phân trang (trang đầu, trang cuối, vượt quá cuối).
34
+
35
+ **Thời gian:** múi giờ và các lần chuyển DST, ngày nhuận, cuối tháng và cuối năm, lệch đồng hồ,
36
+ timestamp ở quá khứ hay tương lai xa, khoảng thời gian bằng không, hết hạn đúng tại biên.
37
+ Hãy đóng băng hoặc chèn đồng hồ vào.
38
+
39
+ **Đồng thời:** hai người ghi trên một bản ghi, retry sau khi thành công một phần, cùng một
40
+ message được giao trùng, hủy giữa lúc đang xử lý, các giả định về thứ tự.
41
+
42
+ **I/O và service bên ngoài:** thiếu file, bị từ chối quyền, đĩa đầy, đọc hay ghi
43
+ một phần, response sai dạng, timeout, response chậm, kết nối bị reset, hết lượt
44
+ retry, nội dung không phải UTF-8, symlink và path traversal.
45
+
46
+ **Quyền và danh tính:** ẩn danh, đã xác thực nhưng không có role, chủ sở hữu so với người dùng
47
+ khác, credential bị thu hồi hay hết hạn, các hành động chỉ dành cho admin bị gọi từ người dùng
48
+ thường.
49
+
50
+ **Trạng thái và vòng đời:** lần chạy đầu khi chưa có dữ liệu, nâng cấp từ dữ liệu của version
51
+ trước, gọi lặp lại (tính idempotent), các thao tác sau khi đã xoá hay đã đóng.
52
+
53
+ Hãy chọn những mục mà thay đổi thực sự với tới được; đừng mặc định test mọi dòng.
@@ -1,42 +1,44 @@
1
1
  ---
2
2
  name: xia
3
- description: Research an unfamiliar implementation, reuse opportunity, or version-sensitive integration using local artifacts and primary sources. Return an evidence-backed recommendation before implementation; do not expand the assigned scope.
3
+ description: Nghiên cứu một implementation chưa quen, một cơ hội tái dùng, hay một tích hợp nhạy cảm với version, dựa trên artifact cục bộ và các nguồn sơ cấp. Trả về một khuyến nghị có bằng chứng hậu thuẫn trước khi hiện thực; đừng mở rộng phạm vi được giao.
4
4
  ---
5
5
 
6
- # Research before building
7
-
8
- Start with a named question that affects a decision. Use a short local inspection
9
- when the relevant seam is clear; broaden to upstream sources only when the question
10
- requires it. Research is read-only with respect to project artifacts. Temporary
11
- experiments require an available isolated scratch location and appropriate authority.
12
-
13
- 1. Establish the actual stack from manifests, lockfiles, configuration, and commands.
14
- Read ALP.md and relevant project guidance. Do not infer a stack from folder names.
15
- 2. Search nearby code, tests, configuration, scripts, and docs for existing behavior
16
- and reusable parts. Record the scope searched before saying something is absent.
17
- 3. For external behavior, inspect primary upstream source/examples and official
18
- documentation matching the installed version. Distinguish current guidance from
19
- the version this project actually uses.
20
- 4. Compare viable approaches only where the choice matters. Prefer an existing
21
- local capability, then a supported dependency capability, then a small adaptation.
22
- Explain what evidence would change the recommendation.
23
-
24
- Label significant findings by evidence type:
25
-
26
- - Local: file path, command output, test, or repository revision.
27
- - Upstream: repository URL and revision when available.
28
- - Docs: official source and applicable version.
29
- - Inference: a conclusion drawn from the cited evidence, with uncertainty stated.
30
-
31
- If browsing is unavailable, return the local findings and the unresolved external
32
- question. Do not invent a source or claim version compatibility without evidence.
33
- Research does not authorize installing dependencies, editing code, or deploying.
34
-
35
- Return the question, findings/sources, reuse candidates, recommendation, alternatives
36
- if material, unknowns, and the next decision. Include actual inspection commands and
37
- results in the handoff. A peer returns this to lead; lead returns unresolved scope
38
- decisions to main. Main can decide technical matters within the user's authorization.
39
-
40
- Use available synchronous delegation for a separate research assignment only when
41
- helpful. Do not assume a Scout role or parallel session exists; research is a peer
42
- disposition. An agent can inspect evidence itself without spawning another agent.
6
+ # Nghiên cứu trước khi xây
7
+
8
+ Bắt đầu từ một câu hỏi được nêu tên rõ ràng có ảnh hưởng tới một quyết định. Hãy xem xét cục bộ
9
+ một lượt ngắn khi đường ráp liên quan đã rõ; chỉ mở rộng ra các nguồn upstream khi câu hỏi
10
+ đòi phải vậy. Việc nghiên cứu là chỉ đọc đối với các artifact của project. Các thí nghiệm
11
+ tạm thời cần một chỗ scratch riêng biệt có sẵn và thẩm quyền phù hợp.
12
+
13
+ 1. Xác lập stack thật từ manifest, lockfile, cấu hình, và các câu lệnh.
14
+ Đọc ALP.md và các hướng dẫn liên quan của project. Đừng suy ra stack từ tên thư mục.
15
+ 2. Tìm trong code, test, cấu hình, script và tài liệu lân cận để biết hành vi đang có
16
+ và các phần tái dùng được. Ghi lại phạm vi đã tìm trước khi nói một thứ gì đó không có.
17
+ 3. Với hành vi bên ngoài, hãy xem nguồn/ví dụ upstream sơ cấp và tài liệu
18
+ chính thức khớp với version đang cài. Phân biệt hướng dẫn hiện hành với
19
+ version mà project này thực sự dùng.
20
+ 4. Chỉ so các phương án khả thi ở chỗ lựa chọn có ý nghĩa. Ưu tiên một năng lực
21
+ cục bộ đang có, rồi một năng lực của dependency được hỗ trợ, rồi một bản thích nghi nhỏ.
22
+ Giải thích bằng chứng nào sẽ làm đổi khuyến nghị.
23
+
24
+ Dán nhãn các phát hiện quan trọng theo loại bằng chứng:
25
+
26
+ - Cục bộ: đường dẫn file, output câu lệnh, test, hay revision của repository.
27
+ - Upstream: URL repository và revision khi có.
28
+ - Tài liệu: nguồn chính thức và version áp dụng.
29
+ - Suy luận: một kết luận rút ra từ bằng chứng đã dẫn, kèm phát biểu rõ mức không chắc.
30
+
31
+ Nếu không duyệt web được, hãy trả về các phát hiện cục bộ và câu hỏi bên ngoài còn chưa giải
32
+ quyết. Đừng bịa ra một nguồn hay tuyên bố tương thích version mà không có bằng chứng.
33
+ Việc nghiên cứu không cấp quyền cài dependency, sửa code, hay triển khai.
34
+
35
+ Trả về câu hỏi, các phát hiện/nguồn, các ứng viên tái dùng, khuyến nghị, các phương án khác nếu
36
+ đáng kể, những điều chưa biết, và quyết định kế tiếp. Đưa các câu lệnh xem xét thật và kết quả
37
+ của chúng vào handoff. Peer trả cái này về cho lead; lead trả các quyết định về phạm vi còn
38
+ chưa giải quyết lên main. Main được quyết các vấn đề kỹ thuật trong thẩm quyền người dùng đã
39
+ cấp.
40
+
41
+ Chỉ dùng cơ chế giao việc đồng bộ có sẵn cho một việc nghiên cứu riêng khi điều đó hữu ích.
42
+ Đừng cho rằng có một role Scout hay một phiên song song nào tồn tại; nghiên cứu là một
43
+ disposition của peer. Một agent có thể tự xem xét bằng chứng mà không cần sinh ra một agent
44
+ khác.
@@ -1 +1 @@
1
- In Phở (pho), main implements or directly delegates to peer; do not create lead. In Cafe (cafe), main supervises lead; lead may implement or delegate to peer. The technical coordinator chooses each peer's model and effort. Use oracle for significant uncertainty; use reviewer for logic changes and risky changes, not mandatory for typo/format fixes. Advisors return only to their requesting coordinator.
1
+ Ở Cafe (cafe), main giám sát lead; lead là điều phối viên kỹ thuật (coordinator): lead tự làm hoặc giao việc cho peer. Lead chọn model và effort cho từng peer. Dùng oracle khi có bất định đáng kể; dùng reviewer cho thay đổi logic và thay đổi rủi ro, không bắt buộc với sửa typo/định dạng. Cố vấn (advisor) chỉ trả kết quả về cho điều phối viên đã gọi mình.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "label": "Cafe",
3
- "description": "Main supervises lead, who implements or delegates to peer; a supervisor reviews the process.",
3
+ "description": "Main giám sát lead, lead tự làm hoặc giao việc cho peer; một supervisor review quy trình.",
4
4
  "main": "main",
5
5
  "members": {
6
6
  "main": { "model": "claude:claude-opus-5-5", "thinking": "high" },
@@ -1 +1 @@
1
- In Phở (pho), main implements or directly delegates to peer; do not create lead. In Cafe (cafe), main supervises lead; lead may implement or delegate to peer. The technical coordinator chooses each peer's model and effort. Use oracle for significant uncertainty; use reviewer for logic changes and risky changes, not mandatory for typo/format fixes. Advisors return only to their requesting coordinator.
1
+ Ở Phở (pho), main là điều phối viên kỹ thuật (coordinator): main tự làm hoặc giao việc trực tiếp cho peer; đừng tạo lead. Main chọn model và effort cho từng peer. Dùng oracle khi có bất định đáng kể; dùng reviewer cho thay đổi logic và thay đổi rủi ro, không bắt buộc với sửa typo/định dạng. Cố vấn (advisor) chỉ trả kết quả về cho điều phối viên đã gọi mình.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "label": "Phở",
3
- "description": "Main implements or delegates to peer; a supervisor reviews the process.",
3
+ "description": "Main tự làm hoặc giao việc cho peer; một supervisor review quy trình.",
4
4
  "main": "main",
5
5
  "members": {
6
6
  "main": { "model": "claude:claude-opus-5-5", "thinking": "high" },