synapse-hub 2.7.0 → 3.0.1

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 (141) hide show
  1. package/.agents/agents/live-explorer.md +2 -0
  2. package/.agents/agents/pom-crafter.md +2 -0
  3. package/.agents/agents/test-runner.md +3 -0
  4. package/.agents/rules/communication-style.md +4 -0
  5. package/.agents/rules/context-engineering.md +1 -0
  6. package/.agents/rules/git-push-protocol.md +17 -0
  7. package/.agents/skills/agentless-qa-repair/examples/three_phase_repair_workflow.md +40 -0
  8. package/.agents/skills/antigravity-test-sentinel/examples/sprint_dod_enforcement.md +47 -0
  9. package/.agents/skills/auth-session-and-cookie-manager/examples/multi_role_auth_matrix.md +70 -0
  10. package/.agents/skills/code-refactoring-refactor-clean/examples/refactored_playwright_pom.ts +52 -0
  11. package/.agents/skills/failure-autopsy-and-healing/examples/closed_loop_healing_walkthrough.md +48 -0
  12. package/.agents/skills/lean-impact-scoreboard/SKILL.md +1 -1
  13. package/.agents/skills/lean-impact-scoreboard/examples/sample_scoreboard.md +1 -1
  14. package/.agents/skills/mipro-prompt-compiler/examples/dspy_assertion_optimizer_case.md +46 -0
  15. package/.agents/skills/persistent-planning-files/SKILL.md +1 -1
  16. package/.agents/skills/qa-aci-interface/examples/surgical_code_window_walkthrough.md +40 -0
  17. package/.agents/skills/repo-quality-audit/SKILL.md +1 -1
  18. package/.agents/skills/review-spec/SKILL.md +1 -1
  19. package/.agents/skills/review-spec/examples/pocock_grilling_decision_rubric.md +40 -0
  20. package/.agents/skills/senior-code-review/SKILL.md +1 -1
  21. package/.agents/skills/skillspector-security-guard/examples/audit_threat_vectors_report.json +35 -0
  22. package/.agents/skills/surgical-coding-principles/SKILL.md +1 -1
  23. package/.agents/skills/technical-debt-harvester/SKILL.md +1 -1
  24. package/.agents/skills/tot-exploratory-testing/examples/payment_gateway_tot_tree.json +62 -0
  25. package/.agents/skills/verification-before-completion/SKILL.md +2 -2
  26. package/.agents/skills/verification-before-completion/examples/evidence_log_example.md +2 -2
  27. package/.agents/skills/web-agent-gym-benchmarking/examples/enterprise_tasks_suite.json +38 -0
  28. package/.agents/skills/web-vitals-and-performance-profiler/examples/playwright_cwv_profiler_fixture.ts +61 -0
  29. package/AGENTS.md +6 -4
  30. package/CLAUDE.md +2 -1
  31. package/README.en.md +71 -292
  32. package/README.md +69 -304
  33. package/action.yml +1 -1
  34. package/bin/agent-qa.js +2 -2
  35. package/docs/ARCHITECTURE.en.md +192 -0
  36. package/docs/ARCHITECTURE.md +135 -88
  37. package/docs/CI_CD_INTEGRATION.en.md +96 -0
  38. package/docs/CI_CD_INTEGRATION.md +24 -22
  39. package/docs/CLI_REFERENCE.en.md +174 -0
  40. package/docs/CLI_REFERENCE.md +120 -115
  41. package/docs/CONTRIBUTING.en.md +49 -0
  42. package/docs/CONTRIBUTING.md +26 -68
  43. package/docs/QUALITY_GATES.en.md +115 -0
  44. package/docs/QUALITY_GATES.md +115 -0
  45. package/docs/research/agent_skill_training_analysis.md +1 -1
  46. package/package.json +1 -1
  47. package/scripts/package_dist.py +2 -1
  48. package/skills_manifest.json +6 -6
  49. package/synapse.config.json +1 -1
  50. package/templates/ai_bridges/CLAUDE.md +2 -1
  51. package/templates/ai_bridges/copilot-instructions.md +2 -2
  52. package/tools/__init__.py +18 -1
  53. package/tools/_openapi_parser.py +1 -1
  54. package/tools/agent_canary.py +42 -30
  55. package/tools/agentless_patcher.py +2 -2
  56. package/tools/analyze_project.py +3 -5
  57. package/tools/api_drift_sentinel.py +4 -4
  58. package/tools/api_fuzzer.py +8 -8
  59. package/tools/auto_heal.py +4 -5
  60. package/tools/auto_heal_reflexion.py +10 -2
  61. package/tools/autogen_qa_broker.py +2 -2
  62. package/tools/browser_helpers.js +2 -2
  63. package/tools/browsergym_eval.py +2 -3
  64. package/tools/bug_reporter.py +11 -13
  65. package/tools/bump_version.py +90 -19
  66. package/tools/cache_resolver.py +78 -83
  67. package/tools/check_env.py +9 -1
  68. package/tools/check_version_sync.py +58 -4
  69. package/tools/ci_healing_hook.py +4 -6
  70. package/tools/cli.py +5 -7
  71. package/tools/config_decoupler.py +2 -3
  72. package/tools/contract_validator.py +141 -0
  73. package/tools/core/__init__.py +52 -0
  74. package/tools/count_tokens.py +22 -20
  75. package/tools/dashboard_generator.py +629 -1000
  76. package/tools/db_sandbox.py +87 -62
  77. package/tools/debt_harvester.py +3 -3
  78. package/tools/distill_log.py +3 -3
  79. package/tools/dspy_qa_signatures.py +3 -4
  80. package/tools/export_postman_collection.py +8 -8
  81. package/tools/flaky_detector.py +2 -2
  82. package/tools/fuzz_payloads.py +5 -5
  83. package/tools/generate_allure_report.py +1 -1
  84. package/tools/generate_jmx_plan.py +4 -4
  85. package/tools/gherkin_suite.py +1 -1
  86. package/tools/git_pre_commit_guard.py +2 -2
  87. package/tools/goldfish_review.py +2 -2
  88. package/tools/heal/__init__.py +28 -0
  89. package/tools/heal_pr_automator.py +6 -6
  90. package/tools/heuristic_locator_matcher.py +2 -2
  91. package/tools/infer_linter.py +143 -29
  92. package/tools/interview_story.py +0 -1
  93. package/tools/jtl_analyzer.py +11 -11
  94. package/tools/lint/__init__.py +30 -0
  95. package/tools/lint_ai_docs.py +42 -0
  96. package/tools/lookup_tc.py +1 -1
  97. package/tools/matrix_sharder.py +15 -13
  98. package/tools/mcp/__init__.py +16 -0
  99. package/tools/mcp_excel_server.py +2 -2
  100. package/tools/mcp_server.py +9 -7
  101. package/tools/md_to_xlsx.py +26 -26
  102. package/tools/micro_mutator.py +32 -15
  103. package/tools/network_mock_shield.py +27 -27
  104. package/tools/newman_analyzer.py +2 -3
  105. package/tools/omni_emitter.py +5 -8
  106. package/tools/omni_parser.py +5 -5
  107. package/tools/omni_transpiler.py +5 -5
  108. package/tools/output_formatter.py +19 -0
  109. package/tools/perf/__init__.py +24 -0
  110. package/tools/pinpoint_failure.py +1 -1
  111. package/tools/project_state.py +0 -2
  112. package/tools/qa_event_stream.py +1 -1
  113. package/tools/repo_map.py +8 -8
  114. package/tools/report/__init__.py +32 -0
  115. package/tools/reversible_sandbox.py +3 -4
  116. package/tools/safety_firewall.py +2 -2
  117. package/tools/senior_code_review.py +4 -3
  118. package/tools/setup_project.py +10 -12
  119. package/tools/skill_collision_guard.py +3 -3
  120. package/tools/skill_vault.py +94 -6
  121. package/tools/skillspector.py +10 -8
  122. package/tools/smart_visual_masker.py +4 -6
  123. package/tools/spec_drift_sentinel.py +1 -2
  124. package/tools/swe_qa_aci.py +2 -2
  125. package/tools/synapse_qa_bench.py +3 -3
  126. package/tools/sync_agent_rules.py +18 -3
  127. package/tools/telemetry_correlator.py +3 -2
  128. package/tools/test_impact.py +2 -1
  129. package/tools/test_memory_os.py +15 -5
  130. package/tools/textgrad_mutation_optimizer.py +3 -3
  131. package/tools/tms_sync_bridge.py +5 -5
  132. package/tools/tot_exploratory_tester.py +5 -6
  133. package/tools/traffic_session_converter.py +9 -9
  134. package/tools/universal_ir.py +2 -3
  135. package/tools/update_sentinel.py +6 -9
  136. package/tools/verify_all.py +12 -2
  137. package/tools/visual_diff_canvas.py +4 -4
  138. package/tools/visual_som_helper.py +15 -13
  139. package/tools/watch_mode.py +1 -1
  140. package/tools/wcag_audit.py +22 -1
  141. package/tools/welcome_page.py +5 -6
@@ -1,151 +1,156 @@
1
- # Agent-QA CLI & Tools Reference Manual
1
+ # Cẩm Nang Tra Cứu Lệnh CLI & Công Cụ Synapse-Hub
2
2
 
3
- The `agent-skills` Hub provides a unified CLI utility `agent-qa` (and direct python scripts in `tools/`) to execute quality gates, linting, impact analysis, and log distillation.
3
+ [🇻🇳 Tiếng Việt](CLI_REFERENCE.md) | [🇬🇧 English Edition](CLI_REFERENCE.en.md)
4
+
5
+ Hệ sinh thái Synapse Hub cung cấp công cụ dòng lệnh `synapse-hub` (hoặc `agent-qa`, cùng các script Python trực tiếp trong `tools/`) để kiểm định chất lượng, lint code test, phân tích tác động và cô đọng log CI.
4
6
 
5
7
  ---
6
8
 
7
- ## 1. Unified CLI Entrypoint (`agent-qa`)
9
+ ## 1. Điểm Vào Dòng Lệnh Thống Nhất (`synapse-hub` / `agent-qa`)
8
10
 
9
- When installed via `pip install -e .`, the `agent-qa` command is globally accessible:
11
+ Sau khi cài đặt qua `npm install -g synapse-hub` hoặc `pip install -e .`, bạn có thể gõ trực tiếp:
10
12
 
11
13
  ```bash
12
- agent-qa <command> [options]
14
+ synapse-hub <lệnh> [tùy_chọn]
15
+ # hoặc
16
+ agent-qa <lệnh> [tùy_chọn]
13
17
  ```
14
18
 
15
- ### Supported Commands (53 Subcommands)
19
+ ### Danh Mục 53 Lệnh Hỗ Trợ
16
20
 
17
- #### A. Core Quality & DoD Gates
18
- | Command | Subsystem | Description | Example |
21
+ #### A. Cốt Lõi Kiểm Định & 10 Cổng DoD
22
+ | Lệnh | Nhóm Chức Năng | Mô Tả Thực Tế | Ví Dụ |
19
23
  | :--- | :--- | :--- | :--- |
20
- | `verify` | Quality Sentinel | Executes all 9 Quality Gates DoD validation | `synapse-hub verify` |
21
- | `lint` | Static Analysis | Polyglot heuristic & static AST defect scanner with baseline & suppression | `synapse-hub lint ./tests` |
22
- | `mutate` | Mutation Sentinel | Syntactic micro-mutator checking assertion sensitivity | `synapse-hub mutate ./tests --min-score 80` |
23
- | `watch` | HUD Sentinel | Incremental live file watcher for real-time quality feedback | `synapse-hub watch` |
24
- | `wcag-audit` | Accessibility | WCAG 2.2 accessibility conformance and contrast auditor | `synapse-hub wcag-audit ./reports/WELCOME.html` |
25
- | `trace-data-flow` | Data Flow | Taint analysis tracing test data lifecycles to detect DB leaks | `synapse-hub trace-data-flow ./tests` |
26
- | `verify-author` | Provenance Guard | Validates canonical author attribution watermark | `synapse-hub verify-author` |
27
- | `debt` | Technical Debt | Harvests `shortcut:` annotations across repo into markdown ledger | `synapse-hub debt` |
28
- | `review` | Senior Review | 6-pillar code change review (Bugs, Security, Scale, Tests, Speed, Bloat) | `synapse-hub review` |
29
-
30
- #### B. Diagnostics, Onboarding & Visual Landing
31
- | Command | Subsystem | Description | Example |
24
+ | `verify` | Gác Cổng DoD | Chạy toàn diện 10 Cổng Chất Lượng trước khi commit/push | `synapse-hub verify` |
25
+ | `lint` | Bắt Lỗi Tĩnh | Quét lỗi tĩnh, bắt test 0-assert, try-catch nuốt lỗi (TS, Python, Groovy) | `synapse-hub lint ./tests` |
26
+ | `mutate` | Kiểm Thử Đột Biến | Bắn vi đột biến kiểm tra độ nhạy của các câu lệnh assert | `synapse-hub mutate ./tests --min-score 80` |
27
+ | `watch` | HUD Thời Gian Thực | Tự động quét và báo lỗi ngay khi có file code thay đổi | `synapse-hub watch` |
28
+ | `wcag-audit` | Khả Năng Tiếp Cận | Kiểm toán chuẩn accessibility WCAG 2.2 và độ tương phản màu | `synapse-hub wcag-audit ./reports/WELCOME.html` |
29
+ | `trace-data-flow` | Dòng Dữ Liệu | Lần vết vòng đời dữ liệu test để phát hiện rò rỉ cơ sở dữ liệu | `synapse-hub trace-data-flow ./tests` |
30
+ | `verify-author` | Bản Quyền Tác Giả | Kiểm tra tính toàn vẹn của watermark tác giả và giấy phép MIT | `synapse-hub verify-author` |
31
+ | `debt` | Nợ Kỹ Thuật | Gom toàn bộ chú thích `shortcut:` trong code thành sổ cái nợ | `synapse-hub debt` |
32
+ | `review` | Senior Review | Review thay đổi code theo 6 trụ cột (Lỗi, Bảo mật, Quy mô, Test, Tốc độ, Rác) | `synapse-hub review` |
33
+
34
+ #### B. Chẩn Đoán Môi Trường, Khởi Tạo & Tiện Ích
35
+ | Lệnh | Nhóm Chức Năng | Mô Tả Thực Tế | Ví Dụ |
32
36
  | :--- | :--- | :--- | :--- |
33
- | `doctor` | Environment Audit | 1-click diagnostic for Node.js, Python, Chrome, Git | `synapse-hub doctor` |
34
- | `welcome` | Visual Landing | Launches interactive bilingual landing page in browser | `synapse-hub welcome` |
35
- | `setup` | Project Setup | Bootstraps project, generates AI Guide & AI Bridges | `synapse-hub setup --local-only` |
36
- | `uninstall` | Clean Removal | Cleanly removes AI Bridges, hooks, and local configurations | `synapse-hub uninstall` |
37
- | `sync-rules` | AI Bridge Sync | Synchronizes AGENTS.md rules across all IDE assistants | `synapse-hub sync-rules` |
38
- | `version` | Hub Metadata | Displays installed Hub version and catalog summary | `synapse-hub version` |
39
- | `update` | Auto-Update | 1-click upgrade engine syncing latest upstream changes | `synapse-hub update` |
40
- | `clean` | Artifact Janitor | Cleans up temporary artifacts, cache files, and logs | `synapse-hub clean` |
41
-
42
- #### C. Self-Healing, Triage & Token Optimization
43
- | Command | Subsystem | Description | Example |
37
+ | `doctor` | Kiểm Tra Môi Trường | Chẩn đoán 1-click cho Node.js, Python, Chrome, Git | `synapse-hub doctor` |
38
+ | `welcome` | Trang Hướng Dẫn | Mở trang landing giới thiệu trực quan trên trình duyệt | `synapse-hub welcome` |
39
+ | `setup` | Khởi Tạo Dự Án | Bootstrap dự án test, tự tạo AI Guide và kết nối các AI Bridge | `synapse-hub setup --local-only` |
40
+ | `uninstall` | Gỡ Bỏ Cấu Hình | Gỡ sạch các AI Bridge, git hook và file cấu hình tạm | `synapse-hub uninstall` |
41
+ | `sync-rules` | Đồng Bộ Quy Tắc AI | Đồng bộ nội dung AGENTS.md tới Cursor, Claude, Copilot, Windsurf | `synapse-hub sync-rules` |
42
+ | `version` | Xem Phiên Bản | Hiển thị phiên bản Hub và danh mục kỹ năng hiện có | `synapse-hub version` |
43
+ | `update` | Cập Nhật 1-Click | Tự động kéo bản cập nhật mới nhất từ kho lưu trữ trung tâm | `synapse-hub update` |
44
+ | `clean` | Dọn Dẹp File Rác | Xóa sạch các file tạm thời, cache và log thừa trong repo | `synapse-hub clean` |
45
+
46
+ #### C. Tự Sửa Lỗi, Khám Nghiệm Thất Bại & Nén Log
47
+ | Lệnh | Nhóm Chức Năng | Mô Tả Thực Tế | Ví Dụ |
44
48
  | :--- | :--- | :--- | :--- |
45
- | `heal` | Semantic Memory | Queries zero-token semantic error memory cache | `synapse-hub heal query "StaleElement"` |
46
- | `auto-heal` | Closed-Loop | Autonomous test healing engine parsing JUnit failures | `synapse-hub auto-heal` |
47
- | `heal-pr` | PR Automator | Creates automated Git branch and PR with healing patch | `synapse-hub heal-pr --branch heal/fix-login` |
48
- | `distill` | Token Optimizer | Filters verbose CLI/Gradle/CI logs by 95% | `synapse-hub distill build.log` |
49
- | `pinpoint-failure` | Failure Autopsy | Parses JUnit XML reports and locates exact failing lines in 0.1s | `synapse-hub pinpoint-failure report.xml` |
50
- | `flaky` | Quarantine | Detects non-deterministic flaky tests and manages quarantine | `synapse-hub flaky --detect` |
51
- | `lookup-tc` | TC Index | Searches test cases by ID, tag, priority, or flow name | `synapse-hub lookup-tc TC-101` |
52
- | `lookup-xpath` | Selector Cache | Queries cached resilient XPath & AOM element locators | `synapse-hub lookup-xpath "Submit"` |
53
- | `impact` | AST Knowledge | Analyzes blast radius of git code changes | `synapse-hub impact --git-diff` |
54
- | `canary` | Resilience Arena | Injects failure vectors to test autonomous recovery MTTR | `synapse-hub canary --run` |
55
- | `report-bug` | Bug Triage | Generates structured Markdown/Jira defect reports from RCA | `synapse-hub report-bug --junit report.xml` |
56
- | `ci-hook` | CI Integration | CI/CD hook executing automated triage on build failure | `synapse-hub ci-hook --log ci.log` |
57
- | `tokens` | Token Counter | Measures prompt tokens across files and subagent contexts | `synapse-hub tokens path/to/prompt.md` |
58
-
59
- #### D. API, Performance & Security Testing
60
- | Command | Subsystem | Description | Example |
49
+ | `heal` | Bộ Nhớ Tra Cứu | Tra cứu cách sửa lỗi đã được kiểm chứng (0 tốn token AI) | `synapse-hub heal query "StaleElement"` |
50
+ | `auto-heal` | Tự Động Sửa Test | Tự động đọc file JUnit XML lỗi và cập nhật lại locator bị hỏng | `synapse-hub auto-heal` |
51
+ | `heal-pr` | Mở PR Sửa Lỗi | Tự tạo nhánh Git và mở Pull Request kèm bản vá sửa test | `synapse-hub heal-pr --branch heal/fix-login` |
52
+ | `distill` | Nén Log CI | Lọc sạch 95% log thừa, chỉ giữ lại đúng stacktrace nguyên nhân gốc | `synapse-hub distill build.log` |
53
+ | `pinpoint-failure` | Khám Nghiệm Lỗi | Phân tích file JUnit XML, chỉ ra ngay dòng code gây fail trong 0.1s | `synapse-hub pinpoint-failure report.xml` |
54
+ | `flaky` | Cách Ly Test Chập Chờn | Nhận diện test chạy chập chờn (flaky) và đưa vào vùng cách ly | `synapse-hub flaky --detect` |
55
+ | `lookup-tc` | Tra Cứu Test Case | Tìm nhanh test case theo ID, tag, độ ưu tiên hoặc tên luồng | `synapse-hub lookup-tc TC-101` |
56
+ | `lookup-xpath` | Bộ Nhớ Locator | Tìm locator hoặc XPath ổn định đã được cache trong bộ nhớ | `synapse-hub lookup-xpath "Submit"` |
57
+ | `impact` | Đo Bán Kính Ảnh Hưởng | Phân tích AST xem thay đổi git diff ảnh hưởng tới những test nào | `synapse-hub impact --git-diff` |
58
+ | `canary` | Thao Trường Phục Hồi | Thử nghiệm tiêm lỗi để đo tốc độ tự phục hồi MTTR của agent | `synapse-hub canary --run` |
59
+ | `report-bug` | Tạo Báo Cáo Bug | Xuất báo cáo lỗi chuẩn Markdown/Jira từ phân tích nguyên nhân gốc | `synapse-hub report-bug --junit report.xml` |
60
+ | `ci-hook` | Hook Tự Động Trên CI | Chạy tự động phân tích nguyên nhân ngay khi build CI bị fail | `synapse-hub ci-hook --log ci.log` |
61
+ | `tokens` | Đo Đếm Token | Đếm chính xác số lượng token của prompt hoặc tài liệu | `synapse-hub tokens path/to/prompt.md` |
62
+
63
+ #### D. Kiểm Thử API, Hiệu Năng & Bảo Mật
64
+ | Lệnh | Nhóm Chức Năng | Mô Tả Thực Tế | Ví Dụ |
61
65
  | :--- | :--- | :--- | :--- |
62
- | `fuzz-api` | Security Fuzzer | Non-production API security, boundary, and chaos fuzzer | `synapse-hub fuzz-api --spec openapi.json` |
63
- | `contract-drift` | Drift Sentinel | Detects breaking changes and schema drift in API specs | `synapse-hub contract-drift --baseline v1.json --current v2.json` |
64
- | `generate-jmx` | Load Testing | Compiles User Story / API specs into Apache JMeter JMX plan | `synapse-hub generate-jmx --threads 50` |
65
- | `analyze-jtl` | Load Analysis | Parses JMeter JTL execution logs and asserts SLA thresholds | `synapse-hub analyze-jtl results.jtl` |
66
- | `analyze-newman` | Postman Audit | Analyzes Newman execution JSON reports for API quality | `synapse-hub analyze-newman newman_run.json` |
67
- | `export-postman` | Collection Gen | Exports API specification into Postman Collection v2.1 | `synapse-hub export-postman --spec swagger.json` |
68
- | `mock-shield` | Route Mocking | Generates Playwright network route mocks from API specs | `synapse-hub mock-shield --spec openapi.json` |
69
- | `skillspector` | AI Security | Audits AI Agent skills and MCP configs for prompt injection | `synapse-hub skillspector --dir .agents/skills` |
70
- | `safety-check` | Firewall Guard | Dry-run code snippet analysis for destructive UI actions | `synapse-hub safety-check --snippet "btn.click()"` |
71
-
72
- #### E. Code Generation, Transpilation & Formatting
73
- | Command | Subsystem | Description | Example |
66
+ | `fuzz-api` | Fuzzing API | Quét fuzzing bảo mật, boundary & chaos test cho API (chỉ non-prod) | `synapse-hub fuzz-api --spec openapi.json` |
67
+ | `contract-drift` | Bắt Lệch Hợp Đồng API | Phát hiện breaking changes và schema drift so với bản baseline | `synapse-hub contract-drift --baseline v1.json --current v2.json` |
68
+ | `generate-jmx` | Sinh Kịch Bản Tải | Biên dịch User Story / API spec thành kịch bản Apache JMeter JMX | `synapse-hub generate-jmx --threads 50` |
69
+ | `analyze-jtl` | Phân Tích Kết Quả Tải | Đọc log JMeter JTL và kiểm định các ngưỡng SLA thời gian phản hồi | `synapse-hub analyze-jtl results.jtl` |
70
+ | `analyze-newman` | Đánh Giá Chạy Postman | Đọc file JSON kết quả chạy Newman để đánh giá chất lượng API | `synapse-hub analyze-newman newman_run.json` |
71
+ | `export-postman` | Xuất Bộ Sưu Tập Postman | Xuất file đặc tả OpenAPI thành Postman Collection v2.1 | `synapse-hub export-postman --spec swagger.json` |
72
+ | `mock-shield` | Giả Lập Route Mạng | Tự động sinh route mock mạng cho Playwright từ OpenAPI spec | `synapse-hub mock-shield --spec openapi.json` |
73
+ | `skillspector` | Rà Soát Bảo Mật AI | Quét các kỹ năng AI Agent và cấu hình MCP chống prompt injection | `synapse-hub skillspector --dir .agents/skills` |
74
+ | `safety-check` | Tường Lửa Thao Tác | Kiểm tra snippet code để chặn các hành động UI có tính phá hủy | `synapse-hub safety-check --snippet "btn.click()"` |
75
+
76
+ #### E. Sinh Mã, Chuyển Đổi Framework & Báo Cáo
77
+ | Lệnh | Nhóm Chức Năng | Mô Tả Thực Tế | Ví Dụ |
74
78
  | :--- | :--- | :--- | :--- |
75
- | `generate-tc` | Story Compiler | Compiles natural language user stories into Clean POM test cases | `synapse-hub generate-tc story.md` |
76
- | `export-excel` | Excel Reporter | Converts Markdown test cases to standard 12-column Excel | `synapse-hub export-excel` |
77
- | `gherkin` | BDD Compiler | Compiles Gherkin .feature specs into executable suites | `synapse-hub gherkin specs/checkout.feature` |
78
- | `transpile` | Omni Transpiler | Transpiles test code between Playwright, Pytest, Katalon | `synapse-hub transpile tests/spec.ts --to pytest` |
79
- | `omni-scan` | Engine Scanner | Scans polyglot repositories for test framework presence | `synapse-hub omni-scan` |
80
- | `shard` | Matrix Sharder | Partitions test suites across parallel CI runners | `synapse-hub shard ./tests --runners 4` |
81
- | `visual-mask` | Visual Sentinel | Computes anti-flake coordinate masks for visual testing | `synapse-hub visual-mask screenshot.png` |
82
- | `som` | Vision Testing | Visual Set-of-Marks helper for interactive elements | `synapse-hub som screen.png` |
83
- | `decouple-config`| Config Isolator | Decouples environment variables and credentials from code | `synapse-hub decouple-config config.groovy` |
84
- | `correlate-telemetry` | Correlator | Correlates browser traces, HTTP logs, and server logs | `synapse-hub correlate-telemetry --trace trace.zip` |
85
- | `dashboard` | Project HUD | Generates standalone HTML5 executive health dashboard | `synapse-hub dashboard` |
86
- | `analyze` | Health Audit | Comprehensive 5-in-1 repository health and DoD audit | `synapse-hub analyze` |
87
- | `mcp-serve` | MCP Server | Launches Model Context Protocol (MCP) server over stdio | `synapse-hub mcp-serve` |
79
+ | `generate-tc` | Biên Dịch User Story | Chuyển đổi User Story ngôn ngữ tự nhiên thành test case Clean POM | `synapse-hub generate-tc story.md` |
80
+ | `export-excel` | Xuất Báo Cáo Excel | Xuất các test case Markdown thành file Excel 12 cột tiêu chuẩn | `synapse-hub export-excel` |
81
+ | `gherkin` | Biên Dịch BDD | Biên dịch file Gherkin .feature thành kịch bản test thực thi | `synapse-hub gherkin specs/checkout.feature` |
82
+ | `transpile` | Chuyển Đổi Framework | Chuyển đổi mã test qua lại giữa Playwright, Pytest, Katalon | `synapse-hub transpile tests/spec.ts --to pytest` |
83
+ | `omni-scan` | Nhận Diện Framework | Tự động quét repo để nhận diện framework test đang sử dụng | `synapse-hub omni-scan` |
84
+ | `shard` | Phân Mảnh Chạy Song Song | Chia đều test suite thành nhiều phần để chạy song song trên CI | `synapse-hub shard ./tests --runners 4` |
85
+ | `visual-mask` | Tạo Mask Chống Flaky | Tính toán tọa độ che các vùng động khi so sánh screenshot UI | `synapse-hub visual-mask screenshot.png` |
86
+ | `som` | Đánh Dấu UI Cho Vision AI | Tiện ích Set-of-Marks đánh dấu số thứ tự lên phần tử giao diện | `synapse-hub som screen.png` |
87
+ | `decouple-config`| Tách Biệt Cấu Hình | Tách rời biến môi trường và mật khẩu ra khỏi mã nguồn test | `synapse-hub decouple-config config.groovy` |
88
+ | `correlate-telemetry` | Đối Chiếu Log Đa Kênh | Khớp nối dấu vết browser trace, HTTP log và server log khi debug | `synapse-hub correlate-telemetry --trace trace.zip` |
89
+ | `dashboard` | Bảng Điều Khiển HUD | Tạo bảng điều khiển HTML5 tổng quan sức khỏe dự án test | `synapse-hub dashboard` |
90
+ | `analyze` | Kiểm Toán Toàn Diện | Báo cáo sức khỏe dự án 5-trong-1 và kiểm định 10 cổng DoD | `synapse-hub analyze` |
91
+ | `mcp-serve` | Khởi Chạy Máy Chủ MCP | Chạy máy chủ Model Context Protocol (MCP) qua giao thức stdio | `synapse-hub mcp-serve` |
88
92
 
89
93
  ---
90
94
 
91
- ## 2. Direct Python Scripts Runbook
95
+ ## 2. Hướng Dẫn Chạy Trực Tiếp Qua Script Python
92
96
 
93
- If running without global package installation, tools can be executed directly via Python:
97
+ Nếu bạn không muốn cài đặt package toàn cục, toàn bộ công cụ đều có thể chạy trực tiếp bằng Python:
94
98
 
95
- ### 2.1. Verify 9 Quality Gates (Gate 0 - Gate 8)
99
+ ### 2.1. Chạy 10 Cổng Kiểm Định DoD (Gate 0 - Gate 9)
96
100
  ```bash
97
- # Auto-detect mode (default: detects Hub vs Target Test Project)
101
+ # Tự động nhận diện chế độ (mặc định: tự phát hiện Hub hoặc Dự án test con)
98
102
  python tools/verify_all.py
99
103
 
100
- # Explicit mode selection
101
- python tools/verify_all.py --mode hub # QA Hub integrity validation
102
- python tools/verify_all.py --mode target # Target automation suite validation
104
+ # Chọn chế độ rõ ràng
105
+ python tools/verify_all.py --mode hub # Kiểm tra tính toàn vẹn của QA Hub
106
+ python tools/verify_all.py --mode target # Kiểm định dự án kiểm thử thực tế
103
107
  ```
104
- - **Operational Modes:**
105
- - `--mode hub`: Validates QA Hub assets, skills, tools integrity, zero BOM, path portability, and universal credential security across repository files without requiring target test scripts.
106
- - `--mode target`: Enforces target automation suite standards including Clean POM across test scripts and credential encryption.
107
- - **Gate 0:** Author Attribution & Provenance Guard (preserves MIT author notice).
108
- - **Gate 1:** 100% UTF-8 No BOM check across all scripts, markdown, and config files.
109
- - **Gate 2:** Path Portability (zero absolute host/machine directory paths).
110
- - **Gate 3:** Clean POM & Flat Architecture (zero raw XPaths/CSS in test scripts).
111
- - **Gate 4:** AI Docs & Artifacts Anti-Drift check (zero hallucinated tools/classes).
112
- - **Gate 5:** Temporary file and properties artifact cleanup.
113
- - **Gate 6:** Credential Security & Secret Scanner (zero hardcoded plaintext passwords or API tokens).
114
- - **Gate 7:** Static Defect & AST Fake-Pass Sentinel.
115
- - **Gate 8:** Syntactic Micro-Mutation Sentinel (Requires Mutation Score >= 80%).
116
-
117
- ### 2.2. AST Fake-Pass Sentinel
108
+ - **Ý Nghĩa Các Chế Độ:**
109
+ - `--mode hub`: Kiểm tra tài nguyên của Hub, tính toàn vẹn của các kỹ năng, công cụ, không byte BOM rác, đường dẫn linh hoạt và bảo mật secret trên toàn bộ repo mà không bắt buộc có file test nghiệp vụ.
110
+ - `--mode target`: Bắt buộc tuân thủ chuẩn kiểm thử cho dự án thực tế: 100% selector nằm trong Page Class (Clean POM) và không lộ mật khẩu.
111
+ - **Gate 0:** Bảo Toàn Tác Quyền & Giấy Phép MIT (giữ thông báo bản quyền của Thế Vị @TeeVee998).
112
+ - **Gate 1:** Quét 100% file không chứa ký tự UTF-8 BOM rác.
113
+ - **Gate 2:** Đường Dẫn Linh Hoạt (không hardcode path máy cá nhân).
114
+ - **Gate 3:** Kiến Trúc Clean POM Phẳng (không chứa XPath/CSS selector trong file test).
115
+ - **Gate 4:** Chống Bịa Đặt Tài Liệu AI (không nhắc tới class hay hàm ảo giác).
116
+ - **Gate 5:** Dọn dẹp sạch file tạm thời, file rác build và sandbox.
117
+ - **Gate 6:** Quét Bảo Mật Thông Tin Nhạy Cảm (chặn mật khẩu và token bị hardcode).
118
+ - **Gate 7:** Bắt Lỗi Tĩnh & Test Pass Ảo (Meta Infer-style).
119
+ - **Gate 8:** Đo Độ Nhạy Assert Bằng Micro-Mutation (yêu cầu điểm diệt mutant >= 80%).
120
+ - **Gate 9:** Điều Phối Kỹ Năng Tránh Trùng Lặp (độ tương đồng cosine < 0.75).
121
+
122
+ ### 2.2. Quét Lỗi Tĩnh & Bắt Test Pass Ảo AST
118
123
  ```bash
119
124
  python tools/infer_linter.py
120
125
  ```
121
126
 
122
- ### 2.3. Semantic Memory Cache & Negative Feedback Blacklist
127
+ ### 2.3. Bộ Nhớ Ngữ Nghĩa & Danh Sách Đen Chống Lặp Lại Sai Lầm
123
128
  ```bash
124
- # Initialize database with seed solutions and forbidden anti-patches
129
+ # Khởi tạo database với giải pháp mẫu và các bản vá cấm kỵ
125
130
  python tools/cache_resolver.py init
126
131
 
127
- # Query pre-tested patches AND retrieve blacklisted anti-patches (0 tokens)
132
+ # Tra cứu bản vá đã kiểm chứng VÀ lấy danh sách bản vá cấm kỵ (0 tốn token)
128
133
  python tools/cache_resolver.py query --error "ElementClickInterceptedException"
129
134
 
130
- # Learn a verified working solution (Positive Memory)
135
+ # Lưu giải pháp chuẩn khi sửa lỗi thành công (Positive Memory)
131
136
  python tools/cache_resolver.py learn --error "Timeout" --cause "Slow API" --patch "waitForNetworkIdle()" --symptom "Spinner"
132
137
 
133
- # Record a failed bug fix attempt into blacklist (Negative Memory)
134
- python tools/cache_resolver.py record-failed --error "StaleElement" --patch "sleep(5000)" --reason "Still fails under network latency"
138
+ # Lưu lần thử sửa lỗi thất bại vào danh sách đen (Negative Memory để AI không lặp lại)
139
+ python tools/cache_resolver.py record-failed --error "StaleElement" --patch "sleep(5000)" --reason "Van fail khi mang lag"
135
140
  ```
136
141
 
137
- ### 2.4. Log Distiller
142
+ ### 2.4. Cô Đọng Log Lọc Rác CI
138
143
  ```bash
139
144
  python tools/distill_log.py execution.log
140
145
  ```
141
146
 
142
- ### 2.5. Technical Debt Harvester
147
+ ### 2.5. Thu Hoạch Nợ Kỹ Thuật (Technical Debt)
143
148
  ```bash
144
149
  python tools/debt_harvester.py --scan
145
150
  python tools/debt_harvester.py --scan ./src --output DEBT_LEDGER.md
146
151
  ```
147
152
 
148
- ### 2.6. Senior Code Reviewer (6 Pillars)
153
+ ### 2.6. Senior Review Đánh Giá Code (6 Trụ Cột)
149
154
  ```bash
150
155
  python tools/senior_code_review.py
151
156
  python tools/senior_code_review.py --staged
@@ -153,19 +158,19 @@ python tools/senior_code_review.py --staged
153
158
 
154
159
  ---
155
160
 
156
- ## 3. Standard Exit Code Specification & Terminal Environment
161
+ ## 3. Quy Ước Mã Thoát Tiêu Chuẩn (Exit Codes) & Môi Trường Terminal
157
162
 
158
- Synapse Hub adheres to deterministic, standardized UNIX exit codes across all CLI tools:
163
+ Synapse Hub áp dụng mã thoát tiêu chuẩn UNIX tất định trên toàn bộ công cụ CLI:
159
164
 
160
- | Exit Code | Constant Name | Description | Typical Remediation |
165
+ | Mã Thoát | Hằng Số | Ý Nghĩa Thực Tế | Cách Xử Lý |
161
166
  | :---: | :--- | :--- | :--- |
162
- | **`0`** | `EXIT_SUCCESS` | Operation passed; all Quality Gates satisfied; 0 critical defects. | Proceed to next pipeline stage or commit. |
163
- | **`1`** | `EXIT_FAILURE` | Quality Gate rejection; test execution failure; linter defect found. | Review failing check details; fix unasserted or swallowed code. |
164
- | **`2`** | `EXIT_USAGE_ERROR` | Invalid CLI arguments; unknown subcommand; syntax error. | Check command syntax via `--help`. |
165
- | **`3`** | `EXIT_SECURITY_BLOCK` | Destructive action blocked by safety firewall; secret token leak; MIT license modified. | Review security violation; set `ALLOW_DESTRUCTIVE=1` if intentional. |
166
- | **`4`** | `EXIT_ENVIRONMENT_ERROR` | Incompatible runtime; missing required tool (e.g. Python < 3.9). | Install recommended runtime (Python 3.10+, Node 20+). |
167
-
168
- ### Terminal Environment Standards:
169
- - **`NO_COLOR` Support:** In accordance with [no-color.org](https://no-color.org), setting the `NO_COLOR` environment variable automatically suppresses all ANSI color escape sequences.
170
- - **`--quiet` / `-q` Flag:** Pass `-q` or `--quiet` to suppress informational banners and output only critical verdicts or machine-readable results.
171
- - **Machine-Readable Formats:** Use `--format json`, `--format sarif`, or `--format junit` for clean, parseable pipeline outputs.
167
+ | **`0`** | `EXIT_SUCCESS` | Thành công; tất cả Cổng Chất Lượng đều đạt; 0 lỗi nghiêm trọng. | Tiến hành bước tiếp theo của pipeline hoặc commit. |
168
+ | **`1`** | `EXIT_FAILURE` | Cổng kiểm định từ chối; test bị fail; phát hiện lỗi tĩnh linter. | Đọc chi tiết báo lỗi; bổ sung câu lệnh assert hoặc gỡ khối nuốt ngoại lệ. |
169
+ | **`2`** | `EXIT_USAGE_ERROR` | Tham số CLI không hợp lệ; gõ sai lệnh; lỗi cú pháp. | Gõ thêm `--help` sau lệnh để xem cú pháp chuẩn. |
170
+ | **`3`** | `EXIT_SECURITY_BLOCK` | Thao tác nguy hiểm bị firewall chặn; lộ token; sửa giấy phép MIT. | Kiểm tra lại vi phạm bảo mật; đặt `ALLOW_DESTRUCTIVE=1` nếu thật sự cố ý. |
171
+ | **`4`** | `EXIT_ENVIRONMENT_ERROR` | Môi trường không tương thích; thiếu công cụ bắt buộc (ví dụ Python < 3.9). | Cài đặt runtime khuyến nghị (Python 3.10+, Node 20+). |
172
+
173
+ ### Tiêu Chuẩn Hiển Thị Trên Terminal:
174
+ - **Hỗ Trợ `NO_COLOR`:** Tuân thủ chuẩn [no-color.org](https://no-color.org), khi đặt biến môi trường `NO_COLOR`, hệ thống tự tắt mọi mã màu ANSI.
175
+ - **Cờ `--quiet` / `-q`:** Thêm cờ `-q` để ẩn bớt banner giới thiệu và chỉ in ra kết quả phán quyết hoặc định dạng dữ liệu cho máy đọc.
176
+ - **Định Dạng Dành Cho CI:** Sử dụng `--format json`, `--format sarif`, hoặc `--format junit` để xuất dữ liệu sạch cho các pipeline CI/CD tích hợp tự động.
@@ -0,0 +1,49 @@
1
+ # Contributing to Synapse-Hub
2
+
3
+ [🇻🇳 Tiếng Việt](CONTRIBUTING.md) | [🇬🇧 English Edition](CONTRIBUTING.en.md)
4
+
5
+ We welcome contributions to expand and refine skills, tools, and rules in the **Synapse-Hub** ecosystem. All contributions must adhere to our **Truth Anchor** (no fake passes) and **Token-Efficiency** standards.
6
+
7
+ ---
8
+
9
+ ## 1. Skill Authoring Standards
10
+
11
+ Every skill resides in `.agents/skills/<skill-name>/` and must satisfy:
12
+
13
+ 1. **`SKILL.md` Structure:**
14
+ - Must contain valid YAML frontmatter with `name` and `description`.
15
+ - `name` must exactly match the directory name in kebab-case.
16
+ - `description` must clearly articulate the triggering scope and disambiguate itself from adjacent skills.
17
+ 2. **Conciseness & Token Budget:**
18
+ - Write instructions in concise technical English to minimize LLM token consumption.
19
+ - Use progressive disclosure: keep `SKILL.md` between 40 and 150 lines, and offload deep code patterns to `references/` or `examples/`.
20
+ 3. **Zero Project Coupling:**
21
+ - Never hardcode specific project names, proprietary URLs, test credentials, or internal namespaces.
22
+ - Always use generic placeholders: `<project_namespace>`, `https://app.example.com`, `APP_PASSWORD`.
23
+
24
+ ---
25
+
26
+ ## 2. Integrity Verification Workflow
27
+
28
+ Before submitting a pull request or committing changes:
29
+
30
+ ```bash
31
+ # 1. Run unit test suite (260+ tests)
32
+ python3 -m unittest discover tests
33
+
34
+ # 2. Verify all 10 DoD Quality Gates (Gate 0–9)
35
+ python3 tools/verify_all.py
36
+
37
+ # 3. Test documentation and entity references integrity
38
+ python3 tools/lint_ai_docs.py
39
+ ```
40
+
41
+ ---
42
+
43
+ ## 3. Tool Development Guidelines
44
+
45
+ All helper scripts in `tools/` must:
46
+ 1. **Rely on Standard Libraries:** Minimize third-party package dependencies so tools execute seamlessly across clean host machines and CI pipelines.
47
+ 2. **Be Fast & Non-Blocking:** AST scans and regex lookups must complete in under 500ms.
48
+ 3. **Zero Test File Pollution:** Tests must use `tempfile.TemporaryDirectory()` and never write temporary test artifacts to the repository tree.
49
+ 4. **Handle Errors Gracefully:** Provide clear remedies and pointers rather than dumping raw stack traces.
@@ -1,91 +1,49 @@
1
- # Hướng Dẫn Đóng Góp / Contributing to Synapse-Hub
1
+ # Hướng Dẫn Đóng Góp Vào Synapse-Hub
2
2
 
3
- [🇻🇳 Tiếng Việt](#-hướng-dẫn-đóng-góp-tiếng-việt) | [🇬🇧 English Edition](#-english-edition)
3
+ [🇻🇳 Tiếng Việt](CONTRIBUTING.md) | [🇬🇧 English Edition](CONTRIBUTING.en.md)
4
4
 
5
- ---
6
-
7
- ## 🇻🇳 Hướng Dẫn Đóng Góp (Tiếng Việt)
5
+ Chào mừng bạn tham gia đóng góp mở rộng kỹ năng (Skills), công cụ (Tools) và các quy tắc kiểm thử trong hệ sinh thái **Synapse Hub**. Mọi đóng góp đều cần tuân thủ 2 nguyên tắc then chốt: **Truth Anchor** (chống test pass ảo, trung thực kỹ thuật) và **Tiết Kiệm Token Tối Đa**.
8
6
 
9
- Chúng tôi rất hoan nghênh các đóng góp từ cộng đồng nhằm mở rộng kỹ năng (Skills), công cụ (Tools) và các quy chuẩn kiểm thử trong hệ sinh thái **Synapse-Hub**. Mọi đóng góp đều cần tuân thủ triệt để nguyên tắc **Truth Anchor** (chống pass ảo, trung thực kỹ thuật) và **Tiết kiệm Token**.
7
+ ---
10
8
 
11
- ### 1. Quy Chuẩn Viết Kỹ Năng Mới (Skill Standards)
9
+ ## 1. Quy Chuẩn Khi Viết Kỹ Năng Mới (Skill Standards)
12
10
 
13
- Mỗi kỹ năng nằm trong thư mục `.agents/skills/<tên-kỹ-năng>/` và cần đáp ứng:
11
+ Mỗi kỹ năng nằm trong thư mục riêng `.agents/skills/<ten-ky-nang>/` và cần đáp ứng các tiêu chí sau:
14
12
 
15
- 1. **Cấu trúc tệp `SKILL.md`:**
13
+ 1. **Cấu trúc file `SKILL.md`:**
16
14
  - Bắt buộc có phần mở đầu YAML frontmatter chuẩn xác chứa `name` và `description`.
17
- - `name` phải trùng khớp 100% với tên thư mục (dạng `kebab-case`).
18
- - `description` mô tả rõ ràng phạm vi kích hoạt, phân biệt rành mạch với các kỹ năng lân cận để tránh xung đột prompt.
15
+ - `name` phải trùng khớp 100% với tên thư mục (định dạng `kebab-case`).
16
+ - `description` phải nêu rõ phạm vi và ngữ cảnh kích hoạt, phân biệt rõ ràng với các kỹ năng khác để AI không bao giờ gọi nhầm.
19
17
  2. **Ngắn Gọn & Tiết Kiệm Token:**
20
- - Hướng dẫn kỹ thuật viết bằng tiếng Anh ngắn gọn, chuẩn xác để tối ưu hóa lượng token ngữ cảnh cho AI.
21
- - Áp dụng nguyên lý nạp thông tin lũy tiến (Progressive Disclosure): giữ `SKILL.md` trong khoảng 40 đến 150 dòng; các đoạn code mẫu chi tiết đưa vào `examples/` hoặc `references/`.
22
- 3. **Không Ràng Buộc Vào Dự Án Cụ Thể (Decoupled):**
23
- - Tuyệt đối không gán cứng tên dự án riêng tư, domain bí mật, mật khẩu hay endpoint nội bộ.
24
- - Luôn sử dụng định danh mẫu: `https://staging.example.com`, `auto_user_123`.
18
+ - Nội dung chỉ dẫn kỹ thuật viết bằng tiếng Anh ngắn gọn, súc tích để tránh làm đầy ngữ cảnh của AI.
19
+ - Áp dụng nguyên lý tải thông tin lũy tiến (Progressive Disclosure): giữ file `SKILL.md` trong khoảng 40 đến 150 dòng; các đoạn code mẫu dài nên đưa vào thư mục `examples/` hoặc `references/`.
20
+ 3. **Tuyệt Đối Không Phụ Thuộc Vào Dự Án Cụ Thể (Decoupled):**
21
+ - Không được hardcode tên dự án nội bộ, domain riêng tư, mật khẩu hay endpoint bí mật.
22
+ - Luôn dùng định danh mẫu: `https://staging.example.com`, `auto_user_123`.
25
23
 
26
- ### 2. Quy Trình Kiểm Thử Trước Khi Mở Pull Request
24
+ ---
25
+
26
+ ## 2. Quy Trình Kiểm Thử Trước Khi Mở Pull Request
27
27
 
28
- Trước khi gửi PR hoặc đẩy code lên nhánh `develop`:
28
+ Trước khi mở PR hoặc đẩy code lên nhánh `develop`:
29
29
 
30
30
  ```bash
31
- # 1. Chạy toàn bộ 170+ bài kiểm thử đơn vị
31
+ # 1. Chạy toàn bộ 260+ bài unit test
32
32
  python3 -m unittest discover tests
33
33
 
34
- # 2. Kiểm định toàn vẹn 9 Cổng Chất Lượng DoD
34
+ # 2. Kiểm định toàn vẹn 10 Cổng Chất Lượng DoD (Gate 0–9)
35
35
  python3 tools/verify_all.py
36
36
 
37
37
  # 3. Kiểm tra tính toàn vẹn của tài liệu và công cụ
38
38
  python3 tools/lint_ai_docs.py
39
39
  ```
40
40
 
41
- ### 3. Nguyên Tắc Phát Triển Công Cụ (Tools)
42
-
43
- Mọi công cụ tiện ích trong `tools/` cần tuân thủ:
44
- 1. **Ưu Tiên Thư Viện Chuẩn Python (Standard Library):** Hạn chế tối đa thư viện bên ngoài để công cụ chạy được ngay trên máy sạch và CI mà không cần cài đặt phức tạp.
45
- 2. **Tốc Độ Xử Lý Siêu Tốc:** Các phép quét AST và regex phải hoàn tất dưới 500ms.
46
- 3. **Không Ghi Rác Vào Repo:** Khi viết test, bắt buộc sử dụng thư mục tạm `tempfile.TemporaryDirectory()`, không để lại file rác trong repo.
47
- 4. **Thông Báo Lỗi Thân Thiện:** Luôn cung cấp gợi ý sửa lỗi rõ ràng (`Fix Hint`) thay vì chỉ in ra stacktrace thô.
48
-
49
41
  ---
50
42
 
51
- ## 🇬🇧 English Edition
52
-
53
- We welcome contributions to expand and refine skills, tools, and rules in the **Synapse-Hub** ecosystem. All contributions must adhere to our **Truth Anchor** (no fake passes) and **Token-Efficiency** standards.
54
-
55
- ### 1. Skill Authoring Standards
56
-
57
- Every skill resides in `.agents/skills/<skill-name>/` and must satisfy:
58
-
59
- 1. **`SKILL.md` Structure:**
60
- - Must contain valid YAML frontmatter with `name` and `description`.
61
- - `name` must exactly match the directory name in kebab-case.
62
- - `description` must clearly articulate the triggering scope and disambiguate itself from adjacent skills.
63
- 2. **Conciseness & Token Budget:**
64
- - Write instructions in concise technical English to minimize LLM token consumption.
65
- - Use progressive disclosure: keep `SKILL.md` between 40 and 150 lines, and offload deep code patterns to `references/` or `examples/`.
66
- 3. **Zero Project Coupling:**
67
- - Never hardcode specific project names, proprietary URLs, test credentials, or internal namespaces.
68
- - Always use generic placeholders: `<project_namespace>`, `https://app.example.com`, `APP_PASSWORD`.
69
-
70
- ### 2. Integrity Verification Workflow
71
-
72
- Before submitting a pull request or committing changes:
73
-
74
- ```bash
75
- # 1. Run unit test suite (170+ tests)
76
- python3 -m unittest discover tests
77
-
78
- # 2. Verify all 9 DoD Quality Gates
79
- python3 tools/verify_all.py
80
-
81
- # 3. Test documentation and entity references integrity
82
- python3 tools/lint_ai_docs.py
83
- ```
84
-
85
- ### 3. Tool Development Guidelines
43
+ ## 3. Nguyên Tắc Phát Triển Công Cụ Mới (Tools)
86
44
 
87
- All helper scripts in `tools/` must:
88
- 1. **Rely on Standard Libraries:** Minimize third-party package dependencies so tools execute seamlessly across clean host machines and CI pipelines.
89
- 2. **Be Fast & Non-Blocking:** AST scans and regex lookups must complete in under 500ms.
90
- 3. **Zero Test File Pollution:** Tests must use `tempfile.TemporaryDirectory()` and never write temporary test artifacts to the repository tree.
91
- 4. **Handle Errors Gracefully:** Provide clear remedies and pointers rather than dumping raw stack traces.
45
+ Mọi công cụ tiện ích trong thư mục `tools/` cần tuân thủ:
46
+ 1. **Ưu Tiên Thư Viện Chuẩn Python (Standard Library):** Hạn chế tối đa thư viện bên ngoài để công cụ chạy được ngay trên máy sạch và CI mà không cần `pip install` phức tạp.
47
+ 2. **Tốc Độ Xử Lý Phải Nhanh:** Các phép quét AST và regex phải hoàn tất dưới 500ms.
48
+ 3. **Không Làm Bẩn Repo:** Khi viết test cho công cụ, bắt buộc dùng thư mục tạm `tempfile.TemporaryDirectory()`, không được để lại bất kỳ file rác nào trong repo.
49
+ 4. **Báo Lỗi Thân Thiện Kèm Cách Sửa:** Luôn cung cấp gợi ý khắc phục (`Fix Hint`) rõ ràng thay vì chỉ in ra stacktrace thô.