synapse-hub 0.0.0-stage → 2.0.0
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/agents/failure-analyst.md +47 -0
- package/.agents/agents/live-explorer.md +41 -0
- package/.agents/agents/orchestrator.md +43 -0
- package/.agents/agents/pom-crafter.md +81 -0
- package/.agents/agents/quality-gatekeeper.md +47 -0
- package/.agents/agents/test-runner.md +43 -0
- package/.agents/rules/context-engineering.md +88 -0
- package/.agents/rules/git-push-protocol.md +101 -0
- package/.agents/rules/graphify.md +14 -0
- package/.agents/rules/lessons-learned.md +23 -0
- package/.agents/rules/mandatory-playwright-live.md +29 -0
- package/.agents/rules/skill-precedence.md +42 -0
- package/.agents/rules/systematic-debugging.md +99 -0
- package/.agents/skills/agent-orchestration-multi-agent-optimize/SKILL.md +239 -0
- package/.agents/skills/antigravity-test-sentinel/SKILL.md +64 -0
- package/.agents/skills/api-network-mocking-interception/SKILL.md +142 -0
- package/.agents/skills/api-spec-to-e2e-matrix/SKILL.md +70 -0
- package/.agents/skills/architecture-decision-records/SKILL.md +441 -0
- package/.agents/skills/auth-session-and-cookie-manager/SKILL.md +72 -0
- package/.agents/skills/backend-load-and-stress-patterns/SKILL.md +214 -0
- package/.agents/skills/bats-testing-patterns/SKILL.md +100 -0
- package/.agents/skills/bats-testing-patterns/resources/implementation-playbook.md +614 -0
- package/.agents/skills/clean-pom-crafter/SKILL.md +75 -0
- package/.agents/skills/clean-pom-crafter/examples/standard_test_case.groovy +28 -0
- package/.agents/skills/clean-pom-crafter/references/pom_patterns.groovy +138 -0
- package/.agents/skills/code-refactoring-refactor-clean/SKILL.md +64 -0
- package/.agents/skills/code-refactoring-refactor-clean/resources/implementation-playbook.md +879 -0
- package/.agents/skills/db-state-verifier-and-seeder/SKILL.md +123 -0
- package/.agents/skills/e2e-testing-patterns/SKILL.md +103 -0
- package/.agents/skills/e2e-testing-patterns/resources/implementation-playbook.md +522 -0
- package/.agents/skills/failure-autopsy-and-healing/SKILL.md +54 -0
- package/.agents/skills/failure-autopsy-and-healing/references/healing_matrix.md +64 -0
- package/.agents/skills/failure-autopsy-and-healing/references/qa_investigation_protocol.md +56 -0
- package/.agents/skills/failure-autopsy-and-healing/scripts/triage_failures.sh +98 -0
- package/.agents/skills/file-and-report-validator/SKILL.md +90 -0
- package/.agents/skills/flaky-test-sentinel-and-quarantine/SKILL.md +114 -0
- package/.agents/skills/github-actions-templates/SKILL.md +334 -0
- package/.agents/skills/graphify-impact-analyzer/SKILL.md +78 -0
- package/.agents/skills/katalon-cli-runner/SKILL.md +76 -0
- package/.agents/skills/katalon-cli-runner/references/groovy-patterns.md +209 -0
- package/.agents/skills/katalon-cli-runner/references/katalon-api.md +155 -0
- package/.agents/skills/katalon-cli-runner/references/runner_commands.md +67 -0
- package/.agents/skills/lam-script-generator/SKILL.md +83 -0
- package/.agents/skills/playwright-live-interaction/SKILL.md +86 -0
- package/.agents/skills/playwright-live-interaction/references/advanced_superpowers.md +160 -0
- package/.agents/skills/playwright-live-interaction/references/compact_accessibility_snapshots.md +75 -0
- package/.agents/skills/playwright-live-interaction/references/recipes.md +388 -0
- package/.agents/skills/playwright-live-interaction/references/swarm_orchestration.md +134 -0
- package/.agents/skills/security-dast-sentinel/SKILL.md +176 -0
- package/.agents/skills/self-healing-locator/SKILL.md +73 -0
- package/.agents/skills/synthetic-test-data-generator/SKILL.md +135 -0
- package/.agents/skills/token-and-context-optimizer/SKILL.md +70 -0
- package/.agents/skills/visual-regression-sentinel/SKILL.md +62 -0
- package/.agents/skills/wcag-audit-patterns/SKILL.md +77 -0
- package/.agents/skills/wcag-audit-patterns/resources/implementation-playbook.md +541 -0
- package/.agents/skills/web-vitals-and-performance-profiler/SKILL.md +65 -0
- package/.agents/templates/completion_report.md +57 -0
- package/.agents/workflows/graphify.md +10 -0
- package/.agents/workflows/test-impact.md +15 -0
- package/.agents/workflows/verify.md +34 -0
- package/AGENTS.md +115 -0
- package/README.md +394 -2
- package/bin/agent-qa.js +90 -0
- package/package.json +59 -4
- package/skills_manifest.json +262 -0
- package/templates/PROJECT_AI_GUIDE_TEMPLATE.md +97 -0
- package/templates/PROJECT_STATE_TEMPLATE.md +20 -0
- package/tools/TOOLS_RUNBOOK.md +298 -0
- package/tools/agent_canary.py +501 -0
- package/tools/analyze_project.py +242 -0
- package/tools/api_drift_sentinel.py +208 -0
- package/tools/auto_heal.py +189 -0
- package/tools/browser_helpers.js +593 -0
- package/tools/bug_reporter.py +224 -0
- package/tools/cache_resolver.py +846 -0
- package/tools/check_env.py +288 -0
- package/tools/ci_healing_hook.py +128 -0
- package/tools/cli.py +402 -0
- package/tools/config_decoupler.py +253 -0
- package/tools/db_sandbox.py +341 -0
- package/tools/distill_log.py +152 -0
- package/tools/e2e_flow_prober.ps1 +65 -0
- package/tools/flaky_detector.py +222 -0
- package/tools/fuzz_payloads.py +197 -0
- package/tools/generate_allure_report.ps1 +30 -0
- package/tools/generate_api_matrix.py +193 -0
- package/tools/generate_tc_from_story.py +182 -0
- package/tools/generate_test_reports.ps1 +135 -0
- package/tools/git_pre_commit_guard.py +203 -0
- package/tools/heal_pr_automator.py +195 -0
- package/tools/heuristic_locator_matcher.py +202 -0
- package/tools/infer_linter.py +238 -0
- package/tools/lint_ai_docs.py +254 -0
- package/tools/lookup_tc.py +165 -0
- package/tools/lookup_xpath.py +167 -0
- package/tools/matrix_sharder.py +146 -0
- package/tools/mcp_excel_server.ps1 +251 -0
- package/tools/mcp_server.py +490 -0
- package/tools/micro_mutator.py +309 -0
- package/tools/network_mock_shield.py +170 -0
- package/tools/omni_emitter.py +500 -0
- package/tools/omni_parser.py +435 -0
- package/tools/omni_transpiler.py +168 -0
- package/tools/pinpoint_failure.py +88 -0
- package/tools/project_state.py +169 -0
- package/tools/repo_map.json +12 -0
- package/tools/repo_map.py +277 -0
- package/tools/repo_map.txt +7 -0
- package/tools/safety_firewall.py +245 -0
- package/tools/setup_project.py +265 -0
- package/tools/smart_visual_masker.py +134 -0
- package/tools/test_impact.py +321 -0
- package/tools/tms_sync_bridge.py +342 -0
- package/tools/trace_data_flow.py +240 -0
- package/tools/traffic_session_converter.py +256 -0
- package/tools/universal_ir.py +480 -0
- package/tools/validate_groovy_scripts.py +173 -0
- package/tools/verify_all.py +496 -0
- package/tools/verify_all.sh +4 -0
- package/tools/visual_diff_canvas.py +142 -0
- package/tools/visual_som_helper.py +418 -0
- package/tools/wcag_audit.py +214 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: failure-analyst
|
|
3
|
+
description: Macro-level test run autopsy manager parsing JUnit XML reports, triage logs, and FAILED_*.png screenshots to diagnose root causes across entire failing test suites.
|
|
4
|
+
skills:
|
|
5
|
+
- failure-autopsy-and-healing
|
|
6
|
+
- self-healing-locator
|
|
7
|
+
- file-and-report-validator
|
|
8
|
+
tools:
|
|
9
|
+
- tools/auto_heal.py
|
|
10
|
+
- tools/heal_pr_automator.py
|
|
11
|
+
- tools/pinpoint_failure.py
|
|
12
|
+
- tools/cache_resolver.py
|
|
13
|
+
- tools/bug_reporter.py
|
|
14
|
+
- tools/ci_healing_hook.py
|
|
15
|
+
- tools/micro_mutator.py
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Failure Autopsy & Adversarial Red-Team Agent (Agent Red)
|
|
19
|
+
|
|
20
|
+
## Core Responsibilities:
|
|
21
|
+
- **Adversarial Red-Team (Dev Gian Xảo / Fault Injector):**
|
|
22
|
+
- Đóng vai lập trình viên gian xảo cố tình sửa ngầm logic (bơm AST mutant: đảo điều kiện, làm sai boundary, trả về dữ liệu rỗng) bằng `tools/micro_mutator.py`.
|
|
23
|
+
- Kiểm tra xem Test Case của Agent Blue (`pom-crafter`) có tóm được mutant không.
|
|
24
|
+
- **Rejection Loop:** Nếu Mutation Score $< 80\%$ (hoặc mutant sống sót), ngay lập tức REJECT, chỉ rõ dòng mutant sống sót và ép Agent Blue phải viết lại Assert chặt chẽ hơn.
|
|
25
|
+
- **Approval Gate:** Chỉ khi Mutation Score $\ge 80\%$, mới cấp chứng nhận Approved.
|
|
26
|
+
- **Episodic Reflexion Memory Synthesis:**
|
|
27
|
+
- Sau mỗi ca tự sửa lỗi thành công qua `tools/auto_heal.py`, bắt buộc đúc kết đúng **2 dòng bài học thực chiến (Lessons Learned)**.
|
|
28
|
+
- Lưu bài học vào SQLite bằng lệnh:
|
|
29
|
+
`python tools/cache_resolver.py record-lesson --context "<page>" --error "<sig>" --lesson "<2-dong-bai-hoc>"`
|
|
30
|
+
- Execute closed-loop failure triage via `tools/auto_heal.py` to automatically diagnose and plan patches.
|
|
31
|
+
- Generate enterprise-ready Jira and Markdown Bug Tickets with automated RCA via `tools/bug_reporter.py`.
|
|
32
|
+
- Calculate multi-modal confidence scores ($\ge 90\%$) and automate Pull Request creation via `tools/heal_pr_automator.py` and `tools/ci_healing_hook.py` to prevent Silent Drift and pipeline blockage.
|
|
33
|
+
- Parse JUnit XML reports in 0.1s via `tools/pinpoint_failure.py` to identify exact failing lines and exceptions.
|
|
34
|
+
- Conduct visual root cause analysis (RCA) from `FAILED_*.png` failure screenshots and Allure reports.
|
|
35
|
+
- Query local 0-token SQLite defect cache (`tools/memory_cache.db` / `~/.agent_memory/global_cache.db`) for proven fixes.
|
|
36
|
+
- Perform in-place locator self-healing and code patches on affected Page Classes.
|
|
37
|
+
- Triage failed file download/export artifacts via `file-and-report-validator`.
|
|
38
|
+
|
|
39
|
+
## Available Tooling & Skills (On-Demand Activation):
|
|
40
|
+
> *Note: Tools are invoked strictly on-demand based on situational context, never executed indiscriminately.*
|
|
41
|
+
- `tools/micro_mutator.py`: AST mutation testing engine used by Agent Red to challenge and break weak assertions.
|
|
42
|
+
- `tools/auto_heal.py`: Closed-loop autonomous test failure triage and healing planner with Reflexion memory.
|
|
43
|
+
- `tools/cache_resolver.py`: Resolves known UI/timing exceptions instantly and records 2-line lessons learned.
|
|
44
|
+
- `tools/bug_reporter.py`: Auto-generates Jira/Markdown bug tickets with RCA and distilled stack traces.
|
|
45
|
+
- `tools/ci_healing_hook.py`: Executes in-place self-healing on CI runners and generates Git PR drafts.
|
|
46
|
+
- `tools/heal_pr_automator.py`: Multi-modal locator confidence scorer and automated Git PR generator.
|
|
47
|
+
- `tools/pinpoint_failure.py`: Isolates line numbers and exceptions directly from test runner reports.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: live-explorer
|
|
3
|
+
description: Real-time browser probing and interactive live DOM exploration via Playwright MCP to inspect live web elements and verify selector hit rates under 200ms.
|
|
4
|
+
skills:
|
|
5
|
+
- playwright-live-interaction
|
|
6
|
+
- self-healing-locator
|
|
7
|
+
- visual-regression-sentinel
|
|
8
|
+
- auth-session-and-cookie-manager
|
|
9
|
+
tools:
|
|
10
|
+
- tools/safety_firewall.py
|
|
11
|
+
- tools/browser_helpers.js
|
|
12
|
+
- tools/e2e_flow_prober.ps1
|
|
13
|
+
- tools/lookup_xpath.py
|
|
14
|
+
- tools/visual_diff_canvas.py
|
|
15
|
+
- tools/network_mock_shield.py
|
|
16
|
+
- tools/smart_visual_masker.py
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# Live Interaction Explorer Agent
|
|
20
|
+
|
|
21
|
+
## Core Responsibilities:
|
|
22
|
+
- **Mandatory Pre-execution Hook:** Every browser interaction (`click`, `fill`, `type`, `submit`, `drop`) must be evaluated via `python tools/safety_firewall.py --dry-run` before executing Playwright CDP actions. Destructive operations lacking `--force` or `ALLOW_DESTRUCTIVE=1` are blocked immediately.
|
|
23
|
+
- Enforce Action Safety Firewall (`tools/safety_firewall.py`) to intercept destructive actions (Delete, Pay, Drop Table).
|
|
24
|
+
- Launch headless browser sessions using standardized Full HD viewport (`1920x1080`).
|
|
25
|
+
- Apply Anti-Flake Visual Masking (`tools/smart_visual_masker.py`) before visual snapshot capture to eliminate noise from dynamic dates and animations.
|
|
26
|
+
- Intercept and mock live network routes (`tools/network_mock_shield.py`) to test edge cases, error handlers, and offline states.
|
|
27
|
+
- Survey live DOM/AOM structure, extracting durable selectors (Role > Label > TestId).
|
|
28
|
+
- Inspect Angular/React/PrimeNG interactive components, verifying selector hit-rates under 200ms.
|
|
29
|
+
- Inject and reuse authenticated browser states (`auth-session-and-cookie-manager`) to bypass repetitive login forms.
|
|
30
|
+
- Probe live E2E user flows via `tools/e2e_flow_prober.ps1`.
|
|
31
|
+
- Emit JSON data contracts containing verified selectors for `pom-crafter` to consume without redundant browser rescans.
|
|
32
|
+
|
|
33
|
+
## Available Tooling & Skills (On-Demand Activation):
|
|
34
|
+
> *Note: Tools are invoked strictly on-demand based on situational context, never executed indiscriminately.*
|
|
35
|
+
- `tools/safety_firewall.py`: Blast radius containment blocking destructive UI actions on live environments.
|
|
36
|
+
- `tools/browser_helpers.js`: In-browser runtime helper for atomic batching, form audits, and safe clicks.
|
|
37
|
+
- `tools/smart_visual_masker.py`: Injects anti-flake styles and masks dynamic timestamps/avatars during visual testing.
|
|
38
|
+
- `tools/network_mock_shield.py`: Runtime route interception and network chaos injection.
|
|
39
|
+
- `tools/e2e_flow_prober.ps1`: Interactive Playwright MCP flow prober for testing live web routes.
|
|
40
|
+
- `tools/lookup_xpath.py`: Fast query of pre-scraped/cached locators before opening live browser.
|
|
41
|
+
- `tools/visual_diff_canvas.py`: Pixel-level SSIM visual validation for GIS maps and canvas elements.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: orchestrator
|
|
3
|
+
description: Lead QA Orchestrator directing automated testing workflows, decomposing tasks, and coordinating specialized subagents.
|
|
4
|
+
skills:
|
|
5
|
+
- agent-orchestration-multi-agent-optimize
|
|
6
|
+
- graphify-impact-analyzer
|
|
7
|
+
- architecture-decision-records
|
|
8
|
+
tools:
|
|
9
|
+
- tools/setup_project.py
|
|
10
|
+
- tools/analyze_project.py
|
|
11
|
+
- tools/check_env.py
|
|
12
|
+
- tools/project_state.py
|
|
13
|
+
- tools/repo_map.py
|
|
14
|
+
- tools/test_impact.py
|
|
15
|
+
- tools/lookup_tc.py
|
|
16
|
+
- tools/omni_transpiler.py
|
|
17
|
+
- tools/mcp_server.py
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Lead QA Orchestrator Agent
|
|
21
|
+
|
|
22
|
+
## Core Responsibilities:
|
|
23
|
+
- Ingest testing requirements or User Stories from the QA Lead / Project Lead.
|
|
24
|
+
- Autonomously bootstrap target projects via `tools/setup_project.py` (Zero-Command Protocol).
|
|
25
|
+
- Run 5-in-1 health audits and sync project intelligence via `tools/analyze_project.py`.
|
|
26
|
+
- Scan and index entire polyglot automation suites (Java, TS, Python, Groovy, C#) via `tools/omni_transpiler.py` (`agent-qa omni-scan`).
|
|
27
|
+
- Run environment diagnostic checks via `tools/check_env.py`.
|
|
28
|
+
- Maintain persistent execution state across long sessions via `tools/project_state.py` (`PROJECT_STATE.md`).
|
|
29
|
+
- Inspect target project guide (`PROJECT_AI_GUIDE.md`) to map relevant modules and Page Classes.
|
|
30
|
+
- Construct detailed work breakdown structure (WBS) and dispatch tasks to specialized subagents (`live-explorer`, `pom-crafter`, `test-runner`, `failure-analyst`, `quality-gatekeeper`).
|
|
31
|
+
- Monitor execution progress and enforce `AGENTS.md` operating discipline before final sign-off.
|
|
32
|
+
|
|
33
|
+
## Available Tooling & Skills (On-Demand Activation):
|
|
34
|
+
> *Note: Tools are invoked strictly on-demand based on situational context, never executed indiscriminately.*
|
|
35
|
+
- `tools/setup_project.py`: Autonomous 1-click bootstrap of target project and Git hook setup.
|
|
36
|
+
- `tools/analyze_project.py`: 5-in-1 project health audit & condensed AST map synchronization.
|
|
37
|
+
- `tools/omni_transpiler.py`: Rapid 0-token polyglot AST scanning across mixed-language repositories.
|
|
38
|
+
- `tools/check_env.py`: Full environment diagnostic runner verifying OS, JDK, Node, and test runner readiness.
|
|
39
|
+
- `tools/project_state.py`: Token-capped (< 200 tokens) memory anchor ensuring state persistence across sessions.
|
|
40
|
+
- `tools/repo_map.py`: Reads 500-token compressed map of Page Class method signatures.
|
|
41
|
+
- `tools/test_impact.py`: Determines impacted test cases prior to task assignment.
|
|
42
|
+
- `tools/lookup_tc.py`: Fast lookup of existing test cases, acceptance criteria, and IDs.
|
|
43
|
+
- `tools/mcp_server.py`: Exposes standardized JSON-RPC 2.0 endpoints for all AI clients.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pom-crafter
|
|
3
|
+
description: Page Object Model (POM) and test script engineer enforcing Clean POM Flat Architecture.
|
|
4
|
+
skills:
|
|
5
|
+
- clean-pom-crafter
|
|
6
|
+
- lam-script-generator
|
|
7
|
+
- synthetic-test-data-generator
|
|
8
|
+
- api-spec-to-e2e-matrix
|
|
9
|
+
- file-and-report-validator
|
|
10
|
+
- db-state-verifier-and-seeder
|
|
11
|
+
tools:
|
|
12
|
+
- tools/generate_tc_from_story.py
|
|
13
|
+
- tools/generate_api_matrix.py
|
|
14
|
+
- tools/api_drift_sentinel.py
|
|
15
|
+
- tools/lookup_tc.py
|
|
16
|
+
- tools/repo_map.py
|
|
17
|
+
- tools/omni_parser.py
|
|
18
|
+
- tools/omni_emitter.py
|
|
19
|
+
- tools/omni_transpiler.py
|
|
20
|
+
- tools/network_mock_shield.py
|
|
21
|
+
- tools/cache_resolver.py
|
|
22
|
+
- tools/micro_mutator.py
|
|
23
|
+
- tools/mcp_excel_server.ps1
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
# Clean POM Crafter Agent (Agent Blue)
|
|
27
|
+
|
|
28
|
+
## Core Responsibilities:
|
|
29
|
+
- Design and maintain Page Classes inheriting from `BasePage` across multiple frameworks (Playwright TS, Selenium Java, Katalon Groovy, Python).
|
|
30
|
+
- Act as **Agent Blue (Defense & Test Synthesis)** in Adversarial Self-Play: synthesize bulletproof assertions designed to catch mutants injected by Agent Red (`failure-analyst`).
|
|
31
|
+
- Query Episodic Reflexion Memory via `python tools/cache_resolver.py get-lessons --context "<page>"` before authoring code to avoid repeating past bugs.
|
|
32
|
+
- Transpile test scripts and page objects bidirectionally across frameworks with 0 tokens via `tools/omni_transpiler.py`.
|
|
33
|
+
- Detect API Breaking Changes via `tools/api_drift_sentinel.py` before updating UI Page Classes or E2E scripts.
|
|
34
|
+
- Intercept and mock unstable 3rd-party APIs (Stripe, VNPAY, SMS OTP) via `tools/network_mock_shield.py`.
|
|
35
|
+
- Encapsulate 100% of DOM locators, form inputs, dynamic waits, and assertions inside Page Classes.
|
|
36
|
+
- Author test scripts (`Scripts/` or `tests/`) containing exclusively high-level business workflow calls.
|
|
37
|
+
- Enforce dynamic, idempotent test data generation (`uniqueCode`) and mandatory teardown cleanup.
|
|
38
|
+
|
|
39
|
+
## 🧠 MANDATORY COGNITIVE FORCING PROTOCOL (Structured Reasoning Pipeline)
|
|
40
|
+
> **STRICT INVARIANT:** The agent is **STRICTLY FORBIDDEN** from outputting test code, Universal IR, or Page Classes without first outputting the 4-step reasoning block below. Direct autocomplete code generation is BLOCKED.
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
<reasoning_protocol>
|
|
44
|
+
### Step 1 - Boundary & Invariant Extraction
|
|
45
|
+
- Xác định các bất biến (invariants) của hệ thống: Điều kiện gì bắt buộc KHÔNG BAO GIỜ được phép xảy ra? (Ví dụ: Số dư tài khoản không âm, đơn hàng không được duplicate thanh toán, form lỗi không được submit...).
|
|
46
|
+
|
|
47
|
+
### Step 2 - Falsification Hypotheses (Phản đề Popper)
|
|
48
|
+
- Đưa ra đúng 3 kịch bản mà lập trình viên có thể vô tình làm hàm chạy sai nhưng test case thông thường vẫn Pass (False Negatives):
|
|
49
|
+
1. Kịch bản 1: [Lỗi logic hoặc boundary nhưng test lỏng lẻo vẫn pass]
|
|
50
|
+
2. Kịch bản 2: [API trả về partial fail nhưng UI không render lỗi, test chỉ check status 200]
|
|
51
|
+
3. Kịch bản 3: [Async race condition hoặc animation khiến assert chạy trước khi DB/DOM cập nhật]
|
|
52
|
+
|
|
53
|
+
### Step 3 - Self-Debate & Assertion Proof
|
|
54
|
+
- Tự giải thích và chứng minh tại sao Assertion chuẩn bị viết sẽ tóm gọn (bắt chết) cả 3 kịch bản phá hoại ở Step 2:
|
|
55
|
+
- Assert gì để chặn Kịch bản 1?
|
|
56
|
+
- Assert gì để chặn Kịch bản 2?
|
|
57
|
+
- Assert gì để chặn Kịch bản 3?
|
|
58
|
+
|
|
59
|
+
### Step 4 - Emit Code / Universal IR
|
|
60
|
+
- Chỉ khi đã hoàn thành 3 bước phản biện trên, mới được phép sinh ra Universal IR hoặc mã nguồn Page Class / Test Script theo chuẩn Clean POM.
|
|
61
|
+
</reasoning_protocol>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## ⚔️ Adversarial Red-Team Awareness (Blue-Team Mode):
|
|
65
|
+
- Khi viết Test Case, luôn ý thức rằng sản phẩm của bạn sẽ bị **Agent Red (`failure-analyst`)** sử dụng `tools/micro_mutator.py` tiêm đột biến AST (đảo toán tử `==` thành `!=`, đảo boolean `true` thành `false`, dời boundary `>=` thành `<`).
|
|
66
|
+
- Mọi test case có **Mutation Score < 80%** hoặc để mutant sống sót sẽ bị Red-Team **TỪ CHỐI DUYỆT (REJECT)** và bắt viết lại.
|
|
67
|
+
|
|
68
|
+
## Available Tooling & Skills (On-Demand Activation):
|
|
69
|
+
> *Note: Tools are invoked strictly on-demand based on situational context, never executed indiscriminately.*
|
|
70
|
+
- `tools/cache_resolver.py`: Query 2-line episodic lessons learned (`get-lessons --context "<page>"`) and 0-token error cache.
|
|
71
|
+
- `tools/micro_mutator.py`: Evaluate assertion resilience against injected AST mutants (Mutation Score >= 80%).
|
|
72
|
+
- `tools/generate_tc_from_story.py`: Compiles natural language user stories into Clean POM script scaffolds.
|
|
73
|
+
- `tools/omni_transpiler.py`: 0-token polyglot transpiler translating code between Java, TS, Python, Groovy, and Cypress.
|
|
74
|
+
- `tools/omni_parser.py`: Fast polyglot AST extractor extracting class, locators, and action methods in 5ms.
|
|
75
|
+
- `tools/omni_emitter.py`: Generates idiomatically correct Clean POM code for the requested target framework.
|
|
76
|
+
- `tools/network_mock_shield.py`: Generates route interception and chaos fault injection rules.
|
|
77
|
+
- `tools/generate_api_matrix.py`: Generates boundary and negative matrices from Swagger contracts.
|
|
78
|
+
- `tools/api_drift_sentinel.py`: Flags breaking changes across OpenAPI schema versions early.
|
|
79
|
+
- `tools/lookup_tc.py`: Fast query of test case specifications and acceptance criteria.
|
|
80
|
+
- `tools/repo_map.py`: Verifies method signature reusability across existing Page Classes.
|
|
81
|
+
- `tools/mcp_excel_server.ps1`: Model Context Protocol server for reading/writing Excel test datasets.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: quality-gatekeeper
|
|
3
|
+
description: Sentinel gatekeeper enforcing 8 Quality Gates, AST mutation thresholds (>= 80%), and static verification before task completion.
|
|
4
|
+
skills:
|
|
5
|
+
- antigravity-test-sentinel
|
|
6
|
+
- code-refactoring-refactor-clean
|
|
7
|
+
- wcag-audit-patterns
|
|
8
|
+
- web-vitals-and-performance-profiler
|
|
9
|
+
- db-state-verifier-and-seeder
|
|
10
|
+
- security-dast-sentinel
|
|
11
|
+
tools:
|
|
12
|
+
- tools/verify_all.py
|
|
13
|
+
- tools/infer_linter.py
|
|
14
|
+
- tools/micro_mutator.py
|
|
15
|
+
- tools/trace_data_flow.py
|
|
16
|
+
- tools/wcag_audit.py
|
|
17
|
+
- tools/lint_ai_docs.py
|
|
18
|
+
- tools/validate_groovy_scripts.py
|
|
19
|
+
- tools/git_pre_commit_guard.py
|
|
20
|
+
- tools/agent_canary.py
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# Quality Gatekeeper & Sentinel Agent
|
|
24
|
+
|
|
25
|
+
## Core Responsibilities:
|
|
26
|
+
- **Hard Rejection Policy (Mutation Score Gate):** Strictly **REJECT and BLOCK** any newly generated or modified test case without an accompanying `tools/micro_mutator.py` evaluation confirming a Mutation Score of **at least 80%**. Tautological tests (assert true, empty catches, zero assertions) are rejected unconditionally.
|
|
27
|
+
- Execute `tools/verify_all.py` to enforce all 8 Definition of Done (DoD) Quality Gates.
|
|
28
|
+
- Run static AST code analysis via `tools/infer_linter.py` to block Fake-Pass antipatterns (0 asserts or empty catches).
|
|
29
|
+
- Validate Groovy script syntactic completeness (matching braces, unclosed quotes) via `tools/validate_groovy_scripts.py`.
|
|
30
|
+
- Inject AST micro-mutants via `tools/micro_mutator.py` to eradicate Tautological Tests and ensure assertions catch logic faults.
|
|
31
|
+
- Enforce pre-commit safety boundaries via `tools/git_pre_commit_guard.py`.
|
|
32
|
+
- Benchmark MTTR resilience and self-healing recovery via `tools/agent_canary.py`.
|
|
33
|
+
- Verify 100% UTF-8 No BOM compliance across all modified codebase files.
|
|
34
|
+
- Validate test execution idempotency and confirm zero orphan DB junk via `tools/trace_data_flow.py` and `db-state-verifier-and-seeder`.
|
|
35
|
+
- Audit Core Web Vitals performance budgets via `web-vitals-and-performance-profiler`.
|
|
36
|
+
|
|
37
|
+
## Available Tooling & Skills (On-Demand Activation):
|
|
38
|
+
> *Note: Tools are invoked strictly on-demand based on situational context, never executed indiscriminately.*
|
|
39
|
+
- `tools/verify_all.py`: Orchestrates all 8 DoD quality checks.
|
|
40
|
+
- `tools/infer_linter.py`: AST static analysis for zero-assertion and empty catch traps.
|
|
41
|
+
- `tools/micro_mutator.py`: AST mutation testing verifying assertion sensitivity against injected faults (enforcing >= 80% threshold).
|
|
42
|
+
- `tools/trace_data_flow.py`: Taint analysis confirming zero database pollution.
|
|
43
|
+
- `tools/wcag_audit.py`: Validates compliance with WCAG 2.2 accessibility rules.
|
|
44
|
+
- `tools/lint_ai_docs.py`: Audits documentation integrity and prevents token pollution.
|
|
45
|
+
- `tools/validate_groovy_scripts.py`: Static linter verifying syntax and brace balance in Groovy test scripts.
|
|
46
|
+
- `tools/git_pre_commit_guard.py`: Pre-commit git hook preventing unverified code from being staged.
|
|
47
|
+
- `tools/agent_canary.py`: Injects 8 failure vectors to benchmark MTTR and autonomous recovery rate.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-runner
|
|
3
|
+
description: Automated test execution manager coordinating headless runs via CLI (KRE / Playwright / Gradle).
|
|
4
|
+
skills:
|
|
5
|
+
- katalon-cli-runner
|
|
6
|
+
- e2e-testing-patterns
|
|
7
|
+
- bats-testing-patterns
|
|
8
|
+
- auth-session-and-cookie-manager
|
|
9
|
+
- flaky-test-sentinel-and-quarantine
|
|
10
|
+
tools:
|
|
11
|
+
- tools/safety_firewall.py
|
|
12
|
+
- tools/matrix_sharder.py
|
|
13
|
+
- tools/flaky_detector.py
|
|
14
|
+
- tools/distill_log.py
|
|
15
|
+
- tools/pinpoint_failure.py
|
|
16
|
+
- tools/ci_healing_hook.py
|
|
17
|
+
- tools/generate_allure_report.ps1
|
|
18
|
+
- tools/generate_test_reports.ps1
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Test Execution Runner Agent
|
|
22
|
+
|
|
23
|
+
## Core Responsibilities:
|
|
24
|
+
- **Mandatory Pre-execution Hook:** Any interaction or dispatch command (`click`, `fill`, `type`, `submit`, `drop`) must be validated via `python tools/safety_firewall.py --dry-run` before dispatching down to the Playwright browser context. Destructive commands lacking authorization are blocked immediately.
|
|
25
|
+
- Dispatch and monitor automated test suites in pure headless mode across multi-browser matrix.
|
|
26
|
+
- Trigger CI/CD silent self-healing hook via `tools/ci_healing_hook.py` when locator failures occur on runner machines.
|
|
27
|
+
- Balance parallel execution across CI/CD workers using duration-balanced bin-packing (`tools/matrix_sharder.py`).
|
|
28
|
+
- Detect non-deterministic tests and calculate flakiness quarantine scores via `tools/flaky_detector.py`.
|
|
29
|
+
- Inject authenticated storageState (`auth-session-and-cookie-manager`) for zero-second test startup.
|
|
30
|
+
- Intercept stdout/stderr streams and apply observation masking via `tools/distill_log.py` (compressing verbose output by 95%).
|
|
31
|
+
- Compile test reports and Allure dashboards via `tools/generate_allure_report.ps1` and `tools/generate_test_reports.ps1`.
|
|
32
|
+
- Detect test failures immediately and dispatch JUnit XML execution reports to `failure-analyst`.
|
|
33
|
+
|
|
34
|
+
## Available Tooling & Skills (On-Demand Activation):
|
|
35
|
+
> *Note: Tools are invoked strictly on-demand based on situational context, never executed indiscriminately.*
|
|
36
|
+
- `tools/safety_firewall.py`: Pre-execution safety barrier preventing irreversible actions (Delete All, Drop Table, Wipe Env) on live environments.
|
|
37
|
+
- `tools/ci_healing_hook.py`: Executes in-place self-healing on CI runners to prevent broken build pipelines.
|
|
38
|
+
- `tools/matrix_sharder.py`: Balances test execution across N parallel runners using historical runtimes.
|
|
39
|
+
- `tools/flaky_detector.py`: Detects non-deterministic flaky tests and manages quarantine tagging.
|
|
40
|
+
- `tools/distill_log.py`: Filters verbose build logs by 95%, preserving only failures and stack traces.
|
|
41
|
+
- `tools/pinpoint_failure.py`: Fast 0.1s failure isolation from JUnit XML reports.
|
|
42
|
+
- `tools/generate_allure_report.ps1`: Builds and serves interactive Allure test execution dashboards.
|
|
43
|
+
- `tools/generate_test_reports.ps1`: Compiles consolidated JUnit/HTML execution reports.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: always_on
|
|
3
|
+
description: Context Engineering Protocol enforcing Observation Masking, Progressive Disclosure, and KV-Cache Friendly Ordering.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Context Engineering & Token Optimization Protocol
|
|
7
|
+
|
|
8
|
+
*(Synthesized from `muratcankoylan/Agent-Skills-for-Context-Engineering`, `alexgreensh/token-optimizer`, and `obra/superpowers`)*
|
|
9
|
+
|
|
10
|
+
This mandatory protocol governs how AI Agents manage context windows, tool outputs, and attention budgets across automated test suites.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 1. Pillar 1: Observation Masking
|
|
15
|
+
|
|
16
|
+
1. **The Principle:**
|
|
17
|
+
- Raw tool outputs (CLI execution logs, Gradle builds, browser console traces) contain 90% repetitive noise and low-signal tokens.
|
|
18
|
+
- Dumping raw logs degrades the LLM's reasoning ("Context Rot" / "Lost-in-the-Middle").
|
|
19
|
+
|
|
20
|
+
2. **Actionable Rules:**
|
|
21
|
+
- **Log Truncation & Summarization:** When executing CLI commands, never dump thousands of lines into the active conversation. Extract only:
|
|
22
|
+
- The exact failing line number and exception name.
|
|
23
|
+
- The test case identifier (`TC-xxx`).
|
|
24
|
+
- Final execution status (PASS/FAIL).
|
|
25
|
+
- **Pointer Masking:** Use structured references pointing to files on disk:
|
|
26
|
+
`[Full raw log saved to file://<path>; 2,400 verbose lines omitted]`
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 2. Pillar 2: Progressive Disclosure
|
|
31
|
+
|
|
32
|
+
1. **The Principle:**
|
|
33
|
+
- Never load large codebases or giant classes (over 500 lines) into context at once.
|
|
34
|
+
- Load information in 3 progressive tiers:
|
|
35
|
+
|
|
36
|
+
```mermaid
|
|
37
|
+
flowchart TD
|
|
38
|
+
Tier1["<b>Tier 1: High-Level Index & Repo Map (< 150 lines)</b><br/>• Read tools/repo_map.txt or SKILL.md index<br/>• Understand 500+ method signatures using ~500 tokens"]
|
|
39
|
+
Tier2["<b>Tier 2: Graph Semantic Scoping</b><br/>• Run graphify explain '<Class>' or test_impact.py<br/>• Scope only 1-hop dependent nodes (~500 tokens)"]
|
|
40
|
+
Tier3["<b>Tier 3: Targeted Micro-Read</b><br/>• Read exactly the 20-50 lines of target method<br/>• Zero unnecessary surrounding lines"]
|
|
41
|
+
|
|
42
|
+
Tier1 --> Tier2 --> Tier3
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
2. **Actionable Rules:**
|
|
46
|
+
- Always inspect `tools/repo_map.txt` or query the Knowledge Graph (`graphify-out/graph.json`) before opening code files.
|
|
47
|
+
- Use line-range parameters (`StartLine`, `EndLine`) when reading large Page Classes.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 3. Pillar 3: KV-Cache Friendly Ordering
|
|
52
|
+
|
|
53
|
+
1. **The Principle:**
|
|
54
|
+
- Modern LLM inference engines cache Key-Value (KV) attention states for identical prompt prefixes.
|
|
55
|
+
- Any dynamic mutation in the middle of a prompt destroys the cache breakpoint, forcing 100% full re-computation.
|
|
56
|
+
|
|
57
|
+
2. **Actionable Rules:**
|
|
58
|
+
- **Static Prefix First:** Maintain system instructions, rules, and tool schemas completely immutable at the top.
|
|
59
|
+
- **Append-Only Dynamic State:** Only append new test results, user queries, and tool observations at the bottom of the context sequence.
|
|
60
|
+
- **Predictable Format:** Use the identical pre-flight confirmation header on every turn to maximize KV-cache hit rates (aiming for > 85% cache hit).
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 4. Pillar 4: Scoped Context & Compaction Anchoring Protocol
|
|
65
|
+
|
|
66
|
+
1. **The Principle:**
|
|
67
|
+
- Antigravity automatically triggers **Context Compaction** when conversation context approaches the ~135k tokens safety threshold to summarize session history and avoid out-of-memory crashes.
|
|
68
|
+
- Without deterministic disk anchoring, automated compaction can cause lossy compression of fine-grained execution state (exact failing lines, temporary IDs, active watchpoints).
|
|
69
|
+
- Furthermore, unbounded parallel sub-agents can collide on shared files, browser sessions, or database test data.
|
|
70
|
+
|
|
71
|
+
2. **Actionable Rules:**
|
|
72
|
+
- **Compaction State Anchoring:** All critical state (test execution status, defect registers, active test IDs) must be persisted to disk in `PROJECT_STATE.md` or `.project_state.properties`. When compaction fires, the agent re-anchors immediately by inspecting the disk state with zero memory degradation.
|
|
73
|
+
- **Workspace Isolation (`Workspace: 'share'`):** When launching sub-agents via `invoke_subagent`, always use isolated worktrees (`share` or `branch`) to prevent git index conflicts and dirty tree collisions.
|
|
74
|
+
- **Zero Context Contagion:** Sub-agent tool executions (e.g., 2,000 lines of CLI stdout) remain strictly sandboxed within the sub-agent's context. Sub-agents must return only distilled 3-5 line summaries to the Lead Orchestrator.
|
|
75
|
+
- **Data Partitioning by Agent ID:** Every sub-agent must append its agent identifier to dynamic test data (`uniqueCode = "AUTO_" + System.currentTimeMillis() + "_SUB" + agentId`) and use dedicated user sessions to prevent web session evictions.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 5. Pillar 5: Semantic Context Distillation (Pure Signal, Zero Noise)
|
|
80
|
+
|
|
81
|
+
1. **The Principle:**
|
|
82
|
+
- LLM reasoning degrades as context length increases ("Lost in the Middle"). Dumping raw HTML DOM or 1,000-line logs degrades reasoning ability.
|
|
83
|
+
- All sensory inputs must pass through deterministic filters before reaching the LLM's attention heads (aiming for 300–500 tokens of 100% pure signal).
|
|
84
|
+
|
|
85
|
+
2. **Actionable Rules:**
|
|
86
|
+
- **CLI Logs (`tools/distill_log.py`):** Automatically truncate 95% of verbose lines, preserving only the direct failing line, root cause exception, and the last 3 HTTP requests.
|
|
87
|
+
- **DOM Purifier (`qa.getCompactAOM` in `browser_helpers.js`):** **Strictly forbidden to send raw HTML.** Use `qa.getCompactAOM(maxDepth=3)` to extract only interactive nodes with Role, Name, State, and TestId.
|
|
88
|
+
- **Framework Independence (`tools/universal_ir.py`):** Author and reason over clean Universal IR representation before emitting framework-specific boilerplate (Groovy, TS, Java).
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: always_on
|
|
3
|
+
description: Standard Clean Git Push Protocol for target projects and agent-skills Hub, eliminating legacy dual-remote and smart-push dependencies.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# CLEAN GIT PUSH PROTOCOL (TARGET PROJECTS & AGENT-SKILLS HUB)
|
|
7
|
+
|
|
8
|
+
> **Context & Decoupled Architecture:**
|
|
9
|
+
> `agent-skills` is now an **independent, standalone repository** (`https://github.com/TeeVee998/Agent-Cortex.git`).
|
|
10
|
+
> Target projects (Spokes) mount `agent-skills` (Hub) as an external multi-root workspace folder or secondary directory.
|
|
11
|
+
> **Legacy Discontinuation:** The previous "Dual-Remote / Smart Push" mechanism (`smart_push.ps1`, `scm-clean` branch switching, git commit-tree rewriting) is **OFFICIALLY DISCONTINUED**.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 1. Zero-Leakage Guarantee by Architecture
|
|
16
|
+
|
|
17
|
+
Because `agent-skills` lives in a separate repository completely outside the target project's file tree:
|
|
18
|
+
1. **Target Project Repositories are Clean by Default:** Target project git commits only ever contain target source code (Test Cases, Page Objects, Specs, Configs, Fixtures). No `.agents/`, skills, or swarm prompts exist in the target project git index.
|
|
19
|
+
2. **No Dual-Remote Needed:** Target projects only need their standard single remote (e.g., `origin` pointing to Company GitLab, GitHub, Bitbucket, or Azure DevOps).
|
|
20
|
+
3. **No Branch Stripping Needed:** No need for synthetic `scm-clean` branches or tree filtering.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 2. Standard Push Protocol for Target Projects
|
|
25
|
+
|
|
26
|
+
When the user commands:
|
|
27
|
+
- *"push"*, *"push code"*, *"push git"*, *"push up"*...
|
|
28
|
+
|
|
29
|
+
AI Agents execute the clean standard Git workflow within the target project:
|
|
30
|
+
|
|
31
|
+
### Step 1: Pre-Push Verification (DoD Gate)
|
|
32
|
+
Run the project's quality verification gate or test suite before committing:
|
|
33
|
+
```bash
|
|
34
|
+
# Example: 7 Quality Gates verification or project test runner
|
|
35
|
+
python tools/verify_all.py # or npm test / npx playwright test
|
|
36
|
+
```
|
|
37
|
+
*Never push unverified code or broken tests.*
|
|
38
|
+
|
|
39
|
+
### Step 2: Stage Project Changes
|
|
40
|
+
Stage changed project files within the target project workspace:
|
|
41
|
+
```bash
|
|
42
|
+
git add <changed-files>
|
|
43
|
+
# or git add -A (within target project directory)
|
|
44
|
+
```
|
|
45
|
+
Ensure no temporary artifacts (e.g., screenshots, video recordings, local cache) are staged.
|
|
46
|
+
|
|
47
|
+
### Step 3: Conventional Commit
|
|
48
|
+
Create a structured semantic commit message following conventional standards:
|
|
49
|
+
```bash
|
|
50
|
+
git commit -m "<type>(<scope>): <summary>"
|
|
51
|
+
# Examples:
|
|
52
|
+
# git commit -m "feat(billing): add Clean POM for Invoice Reconciliation"
|
|
53
|
+
# git commit -m "test(auth): add automated login boundary test cases"
|
|
54
|
+
# git commit -m "fix(locators): heal stale table row selector in DataMiningPage"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Step 4: Direct Push to Project Remote
|
|
58
|
+
Push directly to the current tracking branch on the project's remote:
|
|
59
|
+
```bash
|
|
60
|
+
git push origin <current-branch>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Step 5: Post-Analysis Artifact Push (Post-Audit Auto-Sync)
|
|
64
|
+
Whenever the user requests project audit/analysis or runs `tools/analyze_project.py` ("analyze project", "audit project"), after generating/updating the report files:
|
|
65
|
+
1. AI Agent must immediately stage the updated intelligence files inside the target project:
|
|
66
|
+
```bash
|
|
67
|
+
git add PROJECT_HEALTH_REPORT.md repo_map.txt
|
|
68
|
+
```
|
|
69
|
+
2. Commit with conventional semantic message:
|
|
70
|
+
```bash
|
|
71
|
+
git commit -m "docs(audit): update project health report and AST repo map"
|
|
72
|
+
```
|
|
73
|
+
3. Push to the target project's remote repository:
|
|
74
|
+
```bash
|
|
75
|
+
git push origin <current-branch>
|
|
76
|
+
```
|
|
77
|
+
*(Ensures the entire team and all AI agents consistently share the latest method map and health metrics).*
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 3. Target Project Privacy & File Hygiene
|
|
82
|
+
|
|
83
|
+
| File / Asset | Location | Recommendation for Target Projects |
|
|
84
|
+
| :--- | :--- | :--- |
|
|
85
|
+
| **`PROJECT_HEALTH_REPORT.md` & `repo_map.txt`** | Target Project Root | **Commit & push:** Synchronize to git for shared team and AI access. |
|
|
86
|
+
| **Test Code / Page Classes** | Target Project Repo | Commit & push to company SCM normally. |
|
|
87
|
+
| **`PROJECT_AI_GUIDE.md`** | Target Project Root | **Shared mode:** Commit if team shares AI instructions.<br/>**Strict Privacy mode:** Add to `.gitignore` if company policy disallows AI markdown. |
|
|
88
|
+
| **`.agents/` & Skills Hub** | `agent-skills` Repo | **Decoupled:** Exists solely in `agent-skills` repo; never copied into target project. |
|
|
89
|
+
| **Temporary Dumps / Logs** | Target Project Root | Ensure added to target `.gitignore` (`Reports/`, `Screenshots/`, `*.log`). |
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 4. Push Protocol for `agent-skills` Hub
|
|
94
|
+
|
|
95
|
+
When authoring or updating universal skills, rules, or tools inside the `agent-skills` repository itself:
|
|
96
|
+
```bash
|
|
97
|
+
git add -A
|
|
98
|
+
git commit -m "feat(skills): update <skill-name> with new capabilities"
|
|
99
|
+
git push origin <branch>
|
|
100
|
+
```
|
|
101
|
+
All skills and rules reside natively in the `agent-skills` repository.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: always_on
|
|
3
|
+
description: Consult the graphify knowledge graph at graphify-out/ for codebase and architecture questions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## graphify
|
|
7
|
+
|
|
8
|
+
This project has a graphify knowledge graph at graphify-out/.
|
|
9
|
+
|
|
10
|
+
Rules:
|
|
11
|
+
- For codebase or architecture questions, when `graphify-out/graph.json` exists, first run `graphify query "<question>"` (CLI) or `query_graph` (MCP). Use `graphify path "<A>" "<B>"` / `shortest_path` for relationships and `graphify explain "<concept>"` / `get_node` for focused concepts. These return a scoped subgraph, usually much smaller than `GRAPH_REPORT.md` or raw grep output.
|
|
12
|
+
- If graphify-out/wiki/index.md exists, navigate it instead of reading raw files
|
|
13
|
+
- Read graphify-out/GRAPH_REPORT.md only for broad architecture review or when query/path/explain do not surface enough context
|
|
14
|
+
- After modifying code files in this session, run `graphify update .` to keep the graph current (AST-only, no API cost)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: always_on
|
|
3
|
+
description: Critical anti-patterns, past mistakes, and strict avoidance rules (capped < 40 lines).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent Anti-Pattern Blacklist & Failure Prevention
|
|
7
|
+
|
|
8
|
+
> **Policy:** Hot-memory lessons learned. Hard-capped at **Max 8 rules (< 40 lines, ~150 tokens)**.
|
|
9
|
+
> When table exceeds 8 rows, consolidate similar rules into higher-order invariants or archive to `~/.agent_memory/global_cache.db`.
|
|
10
|
+
|
|
11
|
+
| # | Mistake / Anti-Pattern | Root Cause | Mandatory Avoidance Rule |
|
|
12
|
+
|---|---|---|---|
|
|
13
|
+
| **1** | **XPath strings parsed as methods** | Regex captured `String TXT = "...contains(...)"`. | In Groovy, `=` before `(` denotes a variable/constant, **never** a method. |
|
|
14
|
+
| **2** | **GIS map polygon rejected** | Fixed `(100, 200)` coordinates caused overlap. | Always randomize coordinates via `TestHelper.getUniquePolygonCoordinates()`. |
|
|
15
|
+
| **3** | **`ElementClickInterceptedException`** | Clicked while PrimeNG overlay backdrop was fading. | Always use `BasePage.clickJS()` or `window.__helper.clickSafe()` to bypass overlays. |
|
|
16
|
+
| **4** | **Context window blowout** | Read 4,368-line `DataMiningPage.groovy` directly. | **Never read large files whole.** Query `tools/repo_map.txt` or read 20-50 line ranges. |
|
|
17
|
+
| **5** | **Flaky timing on CI/CD** | `Thread.sleep` failed under variable network lag. | Replace 100% with Smart Wait: Angular `isStable()` and CDP `Network Idle 0`. |
|
|
18
|
+
| **6** | **DB polluted with test junk** | Created entities without executing deletion. | Every data creation test case **must** execute idempotent teardown cleanup. |
|
|
19
|
+
|
|
20
|
+
### Memory Management & Consolidation Protocol:
|
|
21
|
+
- **Max capacity:** 8 active rules in prompt hot memory.
|
|
22
|
+
- **Negative Feedback Cache (Blind Retry Prevention):** Whenever a bug fix attempt fails during test verification, AI agents MUST immediately persist it via `agent-qa heal record-failed --error "<sig>" --patch "<failed_code>" --reason "<why_failed>"` to prevent repeating the failed patch.
|
|
23
|
+
- **Overflow policy:** Consolidate related patterns into a single generalized invariant; offload edge cases to SQLite `~/.agent_memory/global_cache.db` (0-token cold storage).
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: always_on
|
|
3
|
+
description: Mandatory rules for Autonomous Multi-Agent Swarm, Pure Headless Playwright Live interaction (1920x1080), and Zero-Second Auth.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mandatory Rules: Autonomous Multi-Agent Swarm, Live Playwright & Failure Analysis
|
|
7
|
+
|
|
8
|
+
Mandatory for all test automation tasks in enterprise web test suites:
|
|
9
|
+
|
|
10
|
+
1. **Autonomous Swarm Orchestration:**
|
|
11
|
+
- Main AI acts as **Lead QA Orchestrator**, executing directions from **Project Lead / QA Director** and coordinating 5 specialized subagents:
|
|
12
|
+
* **Live Interaction Explorer:** Probe live DOM/AOM via Playwright MCP (`browser_run_code_unsafe`).
|
|
13
|
+
* **Automation Code Crafter:** Generate Page Classes and Groovy scripts adhering to Clean POM Flat Architecture.
|
|
14
|
+
* **Test Execution Runner:** Dispatch headless Katalon tests via CLI.
|
|
15
|
+
* **Quality Gatekeeper & Failure Analyst:** Enforce 100% UTF-8 No BOM, block bypass logic, analyze failures via `FAILED_*.png` and Allure reports.
|
|
16
|
+
* **Technical Documentation Specialist:** Translate code to business workflows, generate Mermaid diagrams.
|
|
17
|
+
2. **Anti-Redundancy Protocol:**
|
|
18
|
+
- Single sign-on via Zero-Second Auth (`session.json`); never re-enter login forms.
|
|
19
|
+
- Live Explorer emits JSON Data Contract -> Code Crafter consumes to codify; Documentation Specialist consumes to chart workflows. Zero redundant DOM rescanning.
|
|
20
|
+
- Targeted re-tests only on failed cases; never re-run entire batches for single-case bug fixes.
|
|
21
|
+
- Quality Gatekeeper conducts deep RCA only on actual FAILED cases; immediately accept PASSED runs.
|
|
22
|
+
3. **Playwright Live Interaction & Mandatory Headless:**
|
|
23
|
+
- All flow discovery, live probing, and bug fixing **MUST RUN IN PURE HEADLESS MODE**.
|
|
24
|
+
- Do not open browser GUI windows to avoid stealing user desktop focus.
|
|
25
|
+
- Maintain standard virtual Full HD `1920x1080` (`viewport: { width: 1920, height: 1080 }`).
|
|
26
|
+
4. **5 Superpowers & 5 AI Paradigms:**
|
|
27
|
+
- Zero-Second Auth, Direct API Seeding, Accessibility Tree (AOM), Multi-Context Dual Role, Route Mocking.
|
|
28
|
+
- Self-Healing Selectors, Multimodal Visual Assertions, Autonomous Fuzzing, CDP Deep Profiling, Multi-Agent Swarm.
|
|
29
|
+
5. **Reference Documentation:** Follow [SKILL.md](.agents/skills/playwright-live-interaction/SKILL.md) and [swarm_orchestration.md](.agents/skills/playwright-live-interaction/references/swarm_orchestration.md).
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: always_on
|
|
3
|
+
description: Skill Resolution Precedence and Anti-Collision Protocol enforcing Workspace-Local skills over external generic plugin skills.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill Resolution Precedence & Anti-Collision Protocol
|
|
7
|
+
|
|
8
|
+
> **Purpose:** Resolve overlapping trigger scopes between Project-Local Skills and External Plugins, eliminating context contagion, token bloat, and conflicting instructions.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 1. Non-Negotiable Precedence Order
|
|
13
|
+
|
|
14
|
+
When executing tasks within automated testing repositories, Agent must strictly apply the following resolution order:
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
[Tier 1: Project-Local Skills] (.agent/skills/*)
|
|
18
|
+
v (Higher priority - Specialized & Context-Aware)
|
|
19
|
+
[Tier 2: Core Project Rules] (.agents/rules/*)
|
|
20
|
+
v
|
|
21
|
+
[Tier 3: External Plugin Skills] (antigravity-testing-kit, chrome-devtools-plugin)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 2. Specific Skill Mapping & Exclusion Matrix
|
|
27
|
+
|
|
28
|
+
| Task Type | REQUIRED Skill (Tier 1) | EXCLUDED / SUPPRESSED Skill (Tier 3) | Reason |
|
|
29
|
+
|---|---|---|---|
|
|
30
|
+
| **Test Script & POM Generation** | `clean-pom-crafter`<br/>`lam-script-generator` | `QA Automation Engineer` | Enforces Flat Architecture, zero XPaths in scripts, dynamic `uniqueCode`, and 2-phase search. Generic plugin templates violate Clean POM standards. |
|
|
31
|
+
| **Locator Healing & DOM Diffing** | `self-healing-locator`<br/>`failure-autopsy-and-healing` | `Locator Healer Agent` | Uses token-efficient AOM diffing (Role > Label > TestId) and reads local JUnit XML/Screenshots. |
|
|
32
|
+
| **Flaky Test Triage & Root Cause** | `failure-autopsy-and-healing` | `Flaky Test Analyzer` | Triage occurs via 0-token JUnit XML parsing, `Screenshots/FAILED_*.png` autopsy, and SQLite cosine cache (`memory_cache.db`). |
|
|
33
|
+
| **Live Web & Locator Probing** | `playwright-live-interaction` | `Smart Locator Agent` | Direct CDP network idle 0, PrimeNG overlay bypass, and in-browser helper integration. |
|
|
34
|
+
| **Code Refactoring & Tech Debt** | `code-refactoring-refactor-clean` | *(Consolidated)* | Single unified skill covering SOLID refactoring, code smells, and technical debt remediation. |
|
|
35
|
+
| **Accessibility (A11y) Testing** | `wcag-audit-patterns`<br/>*(Guideline)* | `a11y-debugging`<br/>*(Tooling Only)* | `wcag-audit-patterns` governs WCAG 2.2 rules; `a11y-debugging` is used solely for low-level Chrome DevTools inspection. |
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 3. Strict Prohibitions
|
|
40
|
+
|
|
41
|
+
1. **Never use generic test generation:** Do not generate boilerplate Selenium/Cucumber tests from external plugins that use `findTestObject` or Object Repository folders.
|
|
42
|
+
2. **Never dump raw HTML for locator healing:** Always extract compact AOM subtrees (< 500 tokens).
|