synapse-hub 3.0.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.
- package/.agents/rules/communication-style.md +4 -0
- package/.agents/rules/context-engineering.md +1 -0
- package/.agents/rules/git-push-protocol.md +17 -0
- package/.agents/skills/agentless-qa-repair/examples/three_phase_repair_workflow.md +40 -0
- package/.agents/skills/antigravity-test-sentinel/examples/sprint_dod_enforcement.md +47 -0
- package/.agents/skills/auth-session-and-cookie-manager/examples/multi_role_auth_matrix.md +70 -0
- package/.agents/skills/code-refactoring-refactor-clean/examples/refactored_playwright_pom.ts +52 -0
- package/.agents/skills/failure-autopsy-and-healing/examples/closed_loop_healing_walkthrough.md +48 -0
- package/.agents/skills/lean-impact-scoreboard/examples/sample_scoreboard.md +1 -1
- package/.agents/skills/mipro-prompt-compiler/examples/dspy_assertion_optimizer_case.md +46 -0
- package/.agents/skills/persistent-planning-files/SKILL.md +1 -1
- package/.agents/skills/qa-aci-interface/examples/surgical_code_window_walkthrough.md +40 -0
- package/.agents/skills/review-spec/examples/pocock_grilling_decision_rubric.md +40 -0
- package/.agents/skills/skillspector-security-guard/examples/audit_threat_vectors_report.json +35 -0
- package/.agents/skills/surgical-coding-principles/SKILL.md +1 -1
- package/.agents/skills/tot-exploratory-testing/examples/payment_gateway_tot_tree.json +62 -0
- package/.agents/skills/verification-before-completion/SKILL.md +2 -2
- package/.agents/skills/verification-before-completion/examples/evidence_log_example.md +2 -2
- package/.agents/skills/web-agent-gym-benchmarking/examples/enterprise_tasks_suite.json +38 -0
- package/.agents/skills/web-vitals-and-performance-profiler/examples/playwright_cwv_profiler_fixture.ts +61 -0
- package/AGENTS.md +6 -4
- package/CLAUDE.md +1 -0
- package/README.en.md +8 -8
- package/README.md +3 -3
- package/action.yml +1 -1
- package/bin/agent-qa.js +2 -2
- package/docs/ARCHITECTURE.en.md +192 -0
- package/docs/ARCHITECTURE.md +127 -126
- package/docs/CI_CD_INTEGRATION.en.md +96 -0
- package/docs/CI_CD_INTEGRATION.md +24 -22
- package/docs/CLI_REFERENCE.en.md +174 -0
- package/docs/CLI_REFERENCE.md +120 -115
- package/docs/CONTRIBUTING.en.md +49 -0
- package/docs/CONTRIBUTING.md +25 -67
- package/docs/QUALITY_GATES.en.md +115 -0
- package/docs/QUALITY_GATES.md +82 -80
- package/docs/research/agent_skill_training_analysis.md +1 -1
- package/package.json +1 -1
- package/skills_manifest.json +1 -1
- package/synapse.config.json +1 -1
- package/templates/ai_bridges/CLAUDE.md +1 -0
- package/tools/__init__.py +1 -1
- package/tools/auto_heal_reflexion.py +8 -0
- package/tools/browser_helpers.js +2 -2
- package/tools/bump_version.py +15 -14
- package/tools/check_version_sync.py +24 -7
- package/tools/cli.py +3 -3
- package/tools/contract_validator.py +141 -0
- package/tools/dashboard_generator.py +11 -11
- package/tools/db_sandbox.py +22 -9
- package/tools/generate_allure_report.py +1 -1
- package/tools/infer_linter.py +135 -21
- package/tools/mcp_excel_server.py +1 -1
- package/tools/mcp_server.py +7 -4
- package/tools/micro_mutator.py +21 -3
- package/tools/reversible_sandbox.py +2 -2
- package/tools/senior_code_review.py +2 -1
- package/tools/skill_vault.py +82 -3
- package/tools/skillspector.py +5 -1
- package/tools/sync_agent_rules.py +1 -0
- package/tools/test_impact.py +2 -1
- package/tools/update_sentinel.py +3 -3
- package/tools/verify_all.py +2 -2
- package/tools/visual_diff_canvas.py +3 -2
- package/tools/welcome_page.py +1 -1
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# Agent-QA CLI & Tools Reference Manual
|
|
2
|
+
|
|
3
|
+
[🇻🇳 Tiếng Việt](CLI_REFERENCE.md) | [🇬🇧 English Edition](CLI_REFERENCE.en.md)
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Unified CLI Entrypoint (`agent-qa`)
|
|
10
|
+
|
|
11
|
+
When installed via `pip install -e .`, the `agent-qa` command is globally accessible:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
agent-qa <command> [options]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Supported Commands (53 Subcommands)
|
|
18
|
+
|
|
19
|
+
#### A. Core Quality & DoD Gates
|
|
20
|
+
| Command | Subsystem | Description | Example |
|
|
21
|
+
| :--- | :--- | :--- | :--- |
|
|
22
|
+
| `verify` | Quality Sentinel | Executes all 9 Quality Gates DoD validation | `synapse-hub verify` |
|
|
23
|
+
| `lint` | Static Analysis | Polyglot heuristic & static AST defect scanner with baseline & suppression | `synapse-hub lint ./tests` |
|
|
24
|
+
| `mutate` | Mutation Sentinel | Syntactic micro-mutator checking assertion sensitivity | `synapse-hub mutate ./tests --min-score 80` |
|
|
25
|
+
| `watch` | HUD Sentinel | Incremental live file watcher for real-time quality feedback | `synapse-hub watch` |
|
|
26
|
+
| `wcag-audit` | Accessibility | WCAG 2.2 accessibility conformance and contrast auditor | `synapse-hub wcag-audit ./reports/WELCOME.html` |
|
|
27
|
+
| `trace-data-flow` | Data Flow | Taint analysis tracing test data lifecycles to detect DB leaks | `synapse-hub trace-data-flow ./tests` |
|
|
28
|
+
| `verify-author` | Provenance Guard | Validates canonical author attribution watermark | `synapse-hub verify-author` |
|
|
29
|
+
| `debt` | Technical Debt | Harvests `shortcut:` annotations across repo into markdown ledger | `synapse-hub debt` |
|
|
30
|
+
| `review` | Senior Review | 6-pillar code change review (Bugs, Security, Scale, Tests, Speed, Bloat) | `synapse-hub review` |
|
|
31
|
+
|
|
32
|
+
#### B. Diagnostics, Onboarding & Visual Landing
|
|
33
|
+
| Command | Subsystem | Description | Example |
|
|
34
|
+
| :--- | :--- | :--- | :--- |
|
|
35
|
+
| `doctor` | Environment Audit | 1-click diagnostic for Node.js, Python, Chrome, Git | `synapse-hub doctor` |
|
|
36
|
+
| `welcome` | Visual Landing | Launches interactive bilingual landing page in browser | `synapse-hub welcome` |
|
|
37
|
+
| `setup` | Project Setup | Bootstraps project, generates AI Guide & AI Bridges | `synapse-hub setup --local-only` |
|
|
38
|
+
| `uninstall` | Clean Removal | Cleanly removes AI Bridges, hooks, and local configurations | `synapse-hub uninstall` |
|
|
39
|
+
| `sync-rules` | AI Bridge Sync | Synchronizes AGENTS.md rules across all IDE assistants | `synapse-hub sync-rules` |
|
|
40
|
+
| `version` | Hub Metadata | Displays installed Hub version and catalog summary | `synapse-hub version` |
|
|
41
|
+
| `update` | Auto-Update | 1-click upgrade engine syncing latest upstream changes | `synapse-hub update` |
|
|
42
|
+
| `clean` | Artifact Janitor | Cleans up temporary artifacts, cache files, and logs | `synapse-hub clean` |
|
|
43
|
+
|
|
44
|
+
#### C. Self-Healing, Triage & Token Optimization
|
|
45
|
+
| Command | Subsystem | Description | Example |
|
|
46
|
+
| :--- | :--- | :--- | :--- |
|
|
47
|
+
| `heal` | Semantic Memory | Queries zero-token semantic error memory cache | `synapse-hub heal query "StaleElement"` |
|
|
48
|
+
| `auto-heal` | Closed-Loop | Autonomous test healing engine parsing JUnit failures | `synapse-hub auto-heal` |
|
|
49
|
+
| `heal-pr` | PR Automator | Creates automated Git branch and PR with healing patch | `synapse-hub heal-pr --branch heal/fix-login` |
|
|
50
|
+
| `distill` | Token Optimizer | Filters verbose CLI/Gradle/CI logs by 95% | `synapse-hub distill build.log` |
|
|
51
|
+
| `pinpoint-failure` | Failure Autopsy | Parses JUnit XML reports and locates exact failing lines in 0.1s | `synapse-hub pinpoint-failure report.xml` |
|
|
52
|
+
| `flaky` | Quarantine | Detects non-deterministic flaky tests and manages quarantine | `synapse-hub flaky --detect` |
|
|
53
|
+
| `lookup-tc` | TC Index | Searches test cases by ID, tag, priority, or flow name | `synapse-hub lookup-tc TC-101` |
|
|
54
|
+
| `lookup-xpath` | Selector Cache | Queries cached resilient XPath & AOM element locators | `synapse-hub lookup-xpath "Submit"` |
|
|
55
|
+
| `impact` | AST Knowledge | Analyzes blast radius of git code changes | `synapse-hub impact --git-diff` |
|
|
56
|
+
| `canary` | Resilience Arena | Injects failure vectors to test autonomous recovery MTTR | `synapse-hub canary --run` |
|
|
57
|
+
| `report-bug` | Bug Triage | Generates structured Markdown/Jira defect reports from RCA | `synapse-hub report-bug --junit report.xml` |
|
|
58
|
+
| `ci-hook` | CI Integration | CI/CD hook executing automated triage on build failure | `synapse-hub ci-hook --log ci.log` |
|
|
59
|
+
| `tokens` | Token Counter | Measures prompt tokens across files and subagent contexts | `synapse-hub tokens path/to/prompt.md` |
|
|
60
|
+
|
|
61
|
+
#### D. API, Performance & Security Testing
|
|
62
|
+
| Command | Subsystem | Description | Example |
|
|
63
|
+
| :--- | :--- | :--- | :--- |
|
|
64
|
+
| `fuzz-api` | Security Fuzzer | Non-production API security, boundary, and chaos fuzzer | `synapse-hub fuzz-api --spec openapi.json` |
|
|
65
|
+
| `contract-drift` | Drift Sentinel | Detects breaking changes and schema drift in API specs | `synapse-hub contract-drift --baseline v1.json --current v2.json` |
|
|
66
|
+
| `generate-jmx` | Load Testing | Compiles User Story / API specs into Apache JMeter JMX plan | `synapse-hub generate-jmx --threads 50` |
|
|
67
|
+
| `analyze-jtl` | Load Analysis | Parses JMeter JTL execution logs and asserts SLA thresholds | `synapse-hub analyze-jtl results.jtl` |
|
|
68
|
+
| `analyze-newman` | Postman Audit | Analyzes Newman execution JSON reports for API quality | `synapse-hub analyze-newman newman_run.json` |
|
|
69
|
+
| `export-postman` | Collection Gen | Exports API specification into Postman Collection v2.1 | `synapse-hub export-postman --spec swagger.json` |
|
|
70
|
+
| `mock-shield` | Route Mocking | Generates Playwright network route mocks from API specs | `synapse-hub mock-shield --spec openapi.json` |
|
|
71
|
+
| `skillspector` | AI Security | Audits AI Agent skills and MCP configs for prompt injection | `synapse-hub skillspector --dir .agents/skills` |
|
|
72
|
+
| `safety-check` | Firewall Guard | Dry-run code snippet analysis for destructive UI actions | `synapse-hub safety-check --snippet "btn.click()"` |
|
|
73
|
+
|
|
74
|
+
#### E. Code Generation, Transpilation & Formatting
|
|
75
|
+
| Command | Subsystem | Description | Example |
|
|
76
|
+
| :--- | :--- | :--- | :--- |
|
|
77
|
+
| `generate-tc` | Story Compiler | Compiles natural language user stories into Clean POM test cases | `synapse-hub generate-tc story.md` |
|
|
78
|
+
| `export-excel` | Excel Reporter | Converts Markdown test cases to standard 12-column Excel | `synapse-hub export-excel` |
|
|
79
|
+
| `gherkin` | BDD Compiler | Compiles Gherkin .feature specs into executable suites | `synapse-hub gherkin specs/checkout.feature` |
|
|
80
|
+
| `transpile` | Omni Transpiler | Transpiles test code between Playwright, Pytest, Katalon | `synapse-hub transpile tests/spec.ts --to pytest` |
|
|
81
|
+
| `omni-scan` | Engine Scanner | Scans polyglot repositories for test framework presence | `synapse-hub omni-scan` |
|
|
82
|
+
| `shard` | Matrix Sharder | Partitions test suites across parallel CI runners | `synapse-hub shard ./tests --runners 4` |
|
|
83
|
+
| `visual-mask` | Visual Sentinel | Computes anti-flake coordinate masks for visual testing | `synapse-hub visual-mask screenshot.png` |
|
|
84
|
+
| `som` | Vision Testing | Visual Set-of-Marks helper for interactive elements | `synapse-hub som screen.png` |
|
|
85
|
+
| `decouple-config`| Config Isolator | Decouples environment variables and credentials from code | `synapse-hub decouple-config config.groovy` |
|
|
86
|
+
| `correlate-telemetry` | Correlator | Correlates browser traces, HTTP logs, and server logs | `synapse-hub correlate-telemetry --trace trace.zip` |
|
|
87
|
+
| `dashboard` | Project HUD | Generates standalone HTML5 executive health dashboard | `synapse-hub dashboard` |
|
|
88
|
+
| `analyze` | Health Audit | Comprehensive 5-in-1 repository health and DoD audit | `synapse-hub analyze` |
|
|
89
|
+
| `mcp-serve` | MCP Server | Launches Model Context Protocol (MCP) server over stdio | `synapse-hub mcp-serve` |
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 2. Direct Python Scripts Runbook
|
|
94
|
+
|
|
95
|
+
If running without global package installation, tools can be executed directly via Python:
|
|
96
|
+
|
|
97
|
+
### 2.1. Verify 10 Quality Gates (Gate 0 - Gate 9)
|
|
98
|
+
```bash
|
|
99
|
+
# Auto-detect mode (default: detects Hub vs Target Test Project)
|
|
100
|
+
python tools/verify_all.py
|
|
101
|
+
|
|
102
|
+
# Explicit mode selection
|
|
103
|
+
python tools/verify_all.py --mode hub # QA Hub integrity validation
|
|
104
|
+
python tools/verify_all.py --mode target # Target automation suite validation
|
|
105
|
+
```
|
|
106
|
+
- **Operational Modes:**
|
|
107
|
+
- `--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.
|
|
108
|
+
- `--mode target`: Enforces target automation suite standards including Clean POM across test scripts and credential encryption.
|
|
109
|
+
- **Gate 0:** Author Attribution & Provenance Guard (preserves MIT author notice).
|
|
110
|
+
- **Gate 1:** 100% UTF-8 No BOM check across all scripts, markdown, and config files.
|
|
111
|
+
- **Gate 2:** Path Portability (zero absolute host/machine directory paths).
|
|
112
|
+
- **Gate 3:** Clean POM & Flat Architecture (zero raw XPaths/CSS in test scripts).
|
|
113
|
+
- **Gate 4:** AI Docs & Artifacts Anti-Drift check (zero hallucinated tools/classes).
|
|
114
|
+
- **Gate 5:** Temporary file and properties artifact cleanup.
|
|
115
|
+
- **Gate 6:** Credential Security & Secret Scanner (zero hardcoded plaintext passwords or API tokens).
|
|
116
|
+
- **Gate 7:** Static Defect & AST Fake-Pass Sentinel.
|
|
117
|
+
- **Gate 8:** Syntactic Micro-Mutation Sentinel (Requires Mutation Score >= 80%).
|
|
118
|
+
- **Gate 9:** Skill Routing & Collision Guard (Cosine similarity < 0.75).
|
|
119
|
+
|
|
120
|
+
### 2.2. AST Fake-Pass Sentinel
|
|
121
|
+
```bash
|
|
122
|
+
python tools/infer_linter.py
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### 2.3. Semantic Memory Cache & Negative Feedback Blacklist
|
|
126
|
+
```bash
|
|
127
|
+
# Initialize database with seed solutions and forbidden anti-patches
|
|
128
|
+
python tools/cache_resolver.py init
|
|
129
|
+
|
|
130
|
+
# Query pre-tested patches AND retrieve blacklisted anti-patches (0 tokens)
|
|
131
|
+
python tools/cache_resolver.py query --error "ElementClickInterceptedException"
|
|
132
|
+
|
|
133
|
+
# Learn a verified working solution (Positive Memory)
|
|
134
|
+
python tools/cache_resolver.py learn --error "Timeout" --cause "Slow API" --patch "waitForNetworkIdle()" --symptom "Spinner"
|
|
135
|
+
|
|
136
|
+
# Record a failed bug fix attempt into blacklist (Negative Memory)
|
|
137
|
+
python tools/cache_resolver.py record-failed --error "StaleElement" --patch "sleep(5000)" --reason "Still fails under network latency"
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### 2.4. Log Distiller
|
|
141
|
+
```bash
|
|
142
|
+
python tools/distill_log.py execution.log
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### 2.5. Technical Debt Harvester
|
|
146
|
+
```bash
|
|
147
|
+
python tools/debt_harvester.py --scan
|
|
148
|
+
python tools/debt_harvester.py --scan ./src --output DEBT_LEDGER.md
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 2.6. Senior Code Reviewer (6 Pillars)
|
|
152
|
+
```bash
|
|
153
|
+
python tools/senior_code_review.py
|
|
154
|
+
python tools/senior_code_review.py --staged
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## 3. Standard Exit Code Specification & Terminal Environment
|
|
160
|
+
|
|
161
|
+
Synapse Hub adheres to deterministic, standardized UNIX exit codes across all CLI tools:
|
|
162
|
+
|
|
163
|
+
| Exit Code | Constant Name | Description | Typical Remediation |
|
|
164
|
+
| :---: | :--- | :--- | :--- |
|
|
165
|
+
| **`0`** | `EXIT_SUCCESS` | Operation passed; all Quality Gates satisfied; 0 critical defects. | Proceed to next pipeline stage or commit. |
|
|
166
|
+
| **`1`** | `EXIT_FAILURE` | Quality Gate rejection; test execution failure; linter defect found. | Review failing check details; fix unasserted or swallowed code. |
|
|
167
|
+
| **`2`** | `EXIT_USAGE_ERROR` | Invalid CLI arguments; unknown subcommand; syntax error. | Check command syntax via `--help`. |
|
|
168
|
+
| **`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. |
|
|
169
|
+
| **`4`** | `EXIT_ENVIRONMENT_ERROR` | Incompatible runtime; missing required tool (e.g. Python < 3.9). | Install recommended runtime (Python 3.10+, Node 20+). |
|
|
170
|
+
|
|
171
|
+
### Terminal Environment Standards:
|
|
172
|
+
- **`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.
|
|
173
|
+
- **`--quiet` / `-q` Flag:** Pass `-q` or `--quiet` to suppress informational banners and output only critical verdicts or machine-readable results.
|
|
174
|
+
- **Machine-Readable Formats:** Use `--format json`, `--format sarif`, or `--format junit` for clean, parseable pipeline outputs.
|
package/docs/CLI_REFERENCE.md
CHANGED
|
@@ -1,151 +1,156 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Cẩm Nang Tra Cứu Lệnh CLI & Công Cụ Synapse-Hub
|
|
2
2
|
|
|
3
|
-
|
|
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.
|
|
9
|
+
## 1. Điểm Vào Dòng Lệnh Thống Nhất (`synapse-hub` / `agent-qa`)
|
|
8
10
|
|
|
9
|
-
|
|
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
|
-
|
|
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
|
-
###
|
|
19
|
+
### Danh Mục 53 Lệnh Hỗ Trợ
|
|
16
20
|
|
|
17
|
-
#### A.
|
|
18
|
-
|
|
|
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` |
|
|
21
|
-
| `lint` |
|
|
22
|
-
| `mutate` |
|
|
23
|
-
| `watch` | HUD
|
|
24
|
-
| `wcag-audit` |
|
|
25
|
-
| `trace-data-flow` |
|
|
26
|
-
| `verify-author` |
|
|
27
|
-
| `debt` |
|
|
28
|
-
| `review` | Senior Review |
|
|
29
|
-
|
|
30
|
-
#### B.
|
|
31
|
-
|
|
|
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` |
|
|
34
|
-
| `welcome` |
|
|
35
|
-
| `setup` |
|
|
36
|
-
| `uninstall` |
|
|
37
|
-
| `sync-rules` |
|
|
38
|
-
| `version` |
|
|
39
|
-
| `update` |
|
|
40
|
-
| `clean` |
|
|
41
|
-
|
|
42
|
-
#### C.
|
|
43
|
-
|
|
|
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` |
|
|
46
|
-
| `auto-heal` |
|
|
47
|
-
| `heal-pr` | PR
|
|
48
|
-
| `distill` |
|
|
49
|
-
| `pinpoint-failure` |
|
|
50
|
-
| `flaky` |
|
|
51
|
-
| `lookup-tc` |
|
|
52
|
-
| `lookup-xpath` |
|
|
53
|
-
| `impact` |
|
|
54
|
-
| `canary` |
|
|
55
|
-
| `report-bug` | Bug
|
|
56
|
-
| `ci-hook` |
|
|
57
|
-
| `tokens` | Token
|
|
58
|
-
|
|
59
|
-
#### D. API,
|
|
60
|
-
|
|
|
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` |
|
|
63
|
-
| `contract-drift` |
|
|
64
|
-
| `generate-jmx` |
|
|
65
|
-
| `analyze-jtl` |
|
|
66
|
-
| `analyze-newman` | Postman
|
|
67
|
-
| `export-postman` |
|
|
68
|
-
| `mock-shield` | Route
|
|
69
|
-
| `skillspector` | AI
|
|
70
|
-
| `safety-check` |
|
|
71
|
-
|
|
72
|
-
#### E.
|
|
73
|
-
|
|
|
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
|
|
76
|
-
| `export-excel` | Excel
|
|
77
|
-
| `gherkin` | BDD
|
|
78
|
-
| `transpile` |
|
|
79
|
-
| `omni-scan` |
|
|
80
|
-
| `shard` |
|
|
81
|
-
| `visual-mask` |
|
|
82
|
-
| `som` | Vision
|
|
83
|
-
| `decouple-config`|
|
|
84
|
-
| `correlate-telemetry` |
|
|
85
|
-
| `dashboard` |
|
|
86
|
-
| `analyze` |
|
|
87
|
-
| `mcp-serve` | MCP
|
|
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.
|
|
95
|
+
## 2. Hướng Dẫn Chạy Trực Tiếp Qua Script Python
|
|
92
96
|
|
|
93
|
-
|
|
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.
|
|
99
|
+
### 2.1. Chạy 10 Cổng Kiểm Định DoD (Gate 0 - Gate 9)
|
|
96
100
|
```bash
|
|
97
|
-
#
|
|
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
|
-
#
|
|
101
|
-
python tools/verify_all.py --mode hub # QA Hub
|
|
102
|
-
python tools/verify_all.py --mode target #
|
|
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
|
-
-
|
|
105
|
-
- `--mode hub`:
|
|
106
|
-
- `--mode target`:
|
|
107
|
-
- **Gate 0:**
|
|
108
|
-
- **Gate 1:** 100%
|
|
109
|
-
- **Gate 2:**
|
|
110
|
-
- **Gate 3:** Clean POM
|
|
111
|
-
- **Gate 4:**
|
|
112
|
-
- **Gate 5:**
|
|
113
|
-
- **Gate 6:**
|
|
114
|
-
- **Gate 7:**
|
|
115
|
-
- **Gate 8:**
|
|
116
|
-
|
|
117
|
-
|
|
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.
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
134
|
-
python tools/cache_resolver.py record-failed --error "StaleElement" --patch "sleep(5000)" --reason "
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
161
|
+
## 3. Quy Ước Mã Thoát Tiêu Chuẩn (Exit Codes) & Môi Trường Terminal
|
|
157
162
|
|
|
158
|
-
Synapse Hub
|
|
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
|
-
|
|
|
165
|
+
| Mã Thoát | Hằng Số | Ý Nghĩa Thực Tế | Cách Xử Lý |
|
|
161
166
|
| :---: | :--- | :--- | :--- |
|
|
162
|
-
| **`0`** | `EXIT_SUCCESS` |
|
|
163
|
-
| **`1`** | `EXIT_FAILURE` |
|
|
164
|
-
| **`2`** | `EXIT_USAGE_ERROR` |
|
|
165
|
-
| **`3`** | `EXIT_SECURITY_BLOCK` |
|
|
166
|
-
| **`4`** | `EXIT_ENVIRONMENT_ERROR` |
|
|
167
|
-
|
|
168
|
-
###
|
|
169
|
-
-
|
|
170
|
-
-
|
|
171
|
-
-
|
|
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.
|