synapse-hub 2.4.3 → 2.5.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/orchestrator.md +1 -0
- package/.agents/agents/pom-crafter.md +1 -0
- package/.agents/agents/quality-gatekeeper.md +6 -0
- package/.agents/rules/skill-precedence.md +38 -18
- package/.agents/rules/systematic-debugging.md +2 -0
- package/.agents/skills/lean-code-ladder/SKILL.md +12 -1
- package/.agents/skills/lean-impact-scoreboard/SKILL.md +48 -0
- package/.agents/skills/lean-impact-scoreboard/examples/sample_benchmark_gain.md +20 -0
- package/.agents/skills/lean-impact-scoreboard/examples/sample_scoreboard.md +15 -0
- package/.agents/skills/repo-quality-audit/SKILL.md +68 -0
- package/.agents/skills/repo-quality-audit/examples/sample_audit_walkthrough.md +15 -0
- package/.agents/skills/repo-quality-audit/examples/sample_repo_audit.md +33 -0
- package/.agents/skills/senior-code-review/SKILL.md +90 -0
- package/.agents/skills/senior-code-review/examples/sample_review_walkthrough.md +29 -0
- package/.agents/skills/technical-debt-harvester/SKILL.md +70 -0
- package/.agents/skills/technical-debt-harvester/examples/sample_debt_ledger.md +25 -0
- package/.agents/skills/technical-debt-harvester/examples/sample_ledger_output.md +20 -0
- package/.cursor/rules/synapse-qa.mdc +4 -3
- package/.cursorrules +1 -0
- package/.windsurfrules +1 -0
- package/AGENTS.md +51 -179
- package/CLAUDE.md +5 -0
- package/README.en.md +12 -8
- package/README.md +12 -8
- package/bin/agent-qa.js +3 -2
- package/docs/ARCHITECTURE.md +3 -3
- package/docs/CLI_REFERENCE.md +15 -1
- package/package.json +1 -3
- package/skills_manifest.json +38 -2
- package/synapse.config.json +1 -1
- package/templates/ai_bridges/CLAUDE.md +5 -0
- package/templates/ai_bridges/copilot-instructions.md +2 -0
- package/templates/ai_bridges/cursor_synapse_qa.mdc +4 -3
- package/templates/ai_bridges/windsurfrules +1 -0
- package/tools/.infer_baseline.json +7 -1079
- package/tools/TOOLS_RUNBOOK.md +53 -13
- package/tools/__init__.py +1 -1
- package/tools/agent_canary.py +4 -4
- package/tools/analyze_project.py +2 -2
- package/tools/api_fuzzer.py +4 -4
- package/tools/auto_heal.py +4 -2
- package/tools/browser_helpers.js +2 -2
- package/tools/bump_version.py +30 -2
- package/tools/cache_resolver.py +6 -6
- package/tools/check_env.py +13 -7
- package/tools/cli.py +265 -197
- package/tools/count_tokens.py +7 -7
- package/tools/dashboard_generator.py +14 -14
- package/tools/db_sandbox.py +5 -5
- package/tools/debt_harvester.py +236 -0
- package/tools/distill_log.py +2 -2
- package/tools/flaky_detector.py +5 -5
- package/tools/generate_tc_from_story.py +2 -2
- package/tools/generate_test_reports.py +4 -4
- package/tools/git_pre_commit_guard.py +6 -6
- package/tools/infer_linter.py +12 -7
- package/tools/lint_ai_docs.py +2 -2
- package/tools/matrix_sharder.py +4 -4
- package/tools/mcp_excel_server.py +1 -1
- package/tools/mcp_server.py +3 -3
- package/tools/micro_mutator.py +6 -6
- package/tools/omni_transpiler.py +2 -2
- package/tools/output_formatter.py +37 -2
- package/tools/pinpoint_failure.py +4 -1
- package/tools/repo_map.py +2 -2
- package/tools/safety_firewall.py +2 -2
- package/tools/senior_code_review.py +341 -0
- package/tools/setup_project.py +9 -9
- package/tools/skillspector.py +2 -2
- package/tools/sync_agent_rules.py +14 -3
- package/tools/test_impact.py +4 -4
- package/tools/tms_sync_bridge.py +2 -2
- package/tools/update_sentinel.py +17 -17
- package/tools/verify_all.py +12 -12
- package/tools/visual_som_helper.py +8 -8
- package/tools/watch_mode.py +6 -7
- package/tools/wcag_audit.py +5 -1
- package/tools/welcome_page.py +11 -11
- package/benchmarks/qa_eval/README.md +0 -71
- package/benchmarks/qa_eval/build_dataset.py +0 -677
- package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-06_api_contract_drift.json +0 -22
- package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-07_api_contract_drift.json +0 -22
- package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-08_api_contract_drift.json +0 -22
- package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-09_api_contract_drift.json +0 -22
- package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-10_api_contract_drift.json +0 -22
- package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-21_fake_pass_tautology.json +0 -21
- package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-22_fake_pass_tautology.json +0 -21
- package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-23_fake_pass_tautology.json +0 -21
- package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-24_fake_pass_tautology.json +0 -21
- package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-25_fake_pass_tautology.json +0 -21
- package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-01_locator_drift.json +0 -23
- package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-02_locator_drift.json +0 -23
- package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-03_locator_drift.json +0 -23
- package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-04_locator_drift.json +0 -23
- package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-05_locator_drift.json +0 -23
- package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-16_stale_and_mutation.json +0 -22
- package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-17_stale_and_mutation.json +0 -22
- package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-18_stale_and_mutation.json +0 -22
- package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-19_stale_and_mutation.json +0 -22
- package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-20_stale_and_mutation.json +0 -23
- package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-11_timing_and_race.json +0 -22
- package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-12_timing_and_race.json +0 -22
- package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-13_timing_and_race.json +0 -22
- package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-14_timing_and_race.json +0 -22
- package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-15_timing_and_race.json +0 -22
- package/benchmarks/qa_eval/eval_runner.py +0 -418
- package/examples/cypress-ecommerce-suite/README.md +0 -45
- package/examples/cypress-ecommerce-suite/cypress/e2e/checkout.cy.js +0 -17
- package/examples/cypress-ecommerce-suite/cypress/pages/BasePage.js +0 -29
- package/examples/cypress-ecommerce-suite/cypress/pages/CartPage.js +0 -51
- package/examples/cypress-ecommerce-suite/cypress.config.js +0 -13
- package/examples/cypress-ecommerce-suite/package.json +0 -13
- package/examples/katalon-suite/Keywords/pages/BasePage.groovy +0 -19
- package/examples/katalon-suite/Keywords/pages/DashboardPage.groovy +0 -29
- package/examples/katalon-suite/Keywords/pages/LoginPage.groovy +0 -45
- package/examples/katalon-suite/Profiles/default.glbl +0 -12
- package/examples/katalon-suite/README.md +0 -18
- package/examples/katalon-suite/Scripts/Auth/TC_LoginSuccess/Script1234567890.groovy +0 -12
- package/examples/katalon-suite/Scripts/Dashboard/TC_ViewSummary/Script1234567891.groovy +0 -15
- package/examples/katalon-suite/katalon_suite.prj +0 -21
- package/examples/playwright-crm-suite/README.md +0 -40
- package/examples/playwright-crm-suite/package.json +0 -14
- package/examples/playwright-crm-suite/pages/BasePage.ts +0 -37
- package/examples/playwright-crm-suite/pages/CustomerPage.ts +0 -57
- package/examples/playwright-crm-suite/pages/LoginPage.ts +0 -32
- package/examples/playwright-crm-suite/playwright.config.ts +0 -27
- package/examples/playwright-crm-suite/tests/auth.spec.ts +0 -22
- package/examples/playwright-crm-suite/tests/customers.spec.ts +0 -33
- package/examples/plugins/sample-custom-plugin/README.md +0 -14
- package/examples/plugins/sample-custom-plugin/plugin.json +0 -16
- package/examples/plugins/sample-custom-plugin/skills/custom-security-headers-audit/SKILL.md +0 -29
- package/examples/plugins/sample-custom-plugin/skills/custom-security-headers-audit/examples/audit_fixture.json +0 -8
- package/examples/plugins/sample-custom-plugin/tools/custom_security_headers.py +0 -125
- package/examples/practices/README.md +0 -22
- package/examples/practices/requirements/crm/requirements_contracts.md +0 -292
- package/examples/practices/requirements/crm/requirements_customers.md +0 -462
- package/examples/practices/requirements/crm/requirements_login.md +0 -202
- package/examples/practices/requirements/crm/requirements_projects.md +0 -396
- package/examples/practices/requirements/crm/requirements_tasks.md +0 -343
- package/examples/practices/requirements/ecommerce/requirements_category_brand.txt +0 -402
- package/examples/practices/requirements/jira/KAN-5/KAN-1/2026-04-03_04-28-27.png +0 -0
- package/examples/practices/requirements/jira/KAN-5/KAN-1/KAN-1_requirement.md +0 -52
- package/examples/practices/requirements/jira/KAN-5/KAN-4/2026-04-03_04-28-19.png +0 -0
- package/examples/practices/requirements/jira/KAN-5/KAN-4/2026-04-03_04-28-57.png +0 -0
- package/examples/practices/requirements/jira/KAN-5/KAN-4/KAN-4_requirement.md +0 -119
- package/examples/practices/requirements/jira/KAN-5/KAN-5_overview.md +0 -9
- package/examples/practices/requirements/jira/KAN-5/KAN-6/2026-04-03_05-58-08.png +0 -0
- package/examples/practices/requirements/jira/KAN-5/KAN-6/2026-04-03_05-58-23.png +0 -0
- package/examples/practices/requirements/jira/KAN-5/KAN-6/KAN-6_requirement.md +0 -32
- package/examples/practices/testcases/api/book_management_api_test_cases.md +0 -144
- package/examples/practices/testcases/api/user_management_api_test_cases.md +0 -139
- package/examples/practices/testcases/crm/test_cases_crm_login.md +0 -148
- package/examples/practices/testcases/crm/test_cases_customers.md +0 -156
- package/examples/pytest-api-suite/README.md +0 -45
- package/examples/pytest-api-suite/conftest.py +0 -31
- package/examples/pytest-api-suite/pages/user_api_client.py +0 -36
- package/examples/pytest-api-suite/requirements.txt +0 -2
- package/examples/pytest-api-suite/tests/test_user_api.py +0 -44
- package/examples/selenium-suite/README.md +0 -18
- package/examples/selenium-suite/pages/base_page.py +0 -27
- package/examples/selenium-suite/pages/login_page.py +0 -29
- package/examples/selenium-suite/pages/order_page.py +0 -25
- package/examples/selenium-suite/pytest.ini +0 -6
- package/examples/selenium-suite/requirements.txt +0 -2
- package/examples/selenium-suite/tests/test_login.py +0 -10
- package/examples/selenium-suite/tests/test_order.py +0 -10
|
@@ -10,6 +10,8 @@ skills:
|
|
|
10
10
|
- security-dast-sentinel
|
|
11
11
|
- verification-before-completion
|
|
12
12
|
- skillspector-security-guard
|
|
13
|
+
- senior-code-review
|
|
14
|
+
- technical-debt-harvester
|
|
13
15
|
tools:
|
|
14
16
|
- tools/verify_all.py
|
|
15
17
|
- tools/infer_linter.py
|
|
@@ -21,6 +23,8 @@ tools:
|
|
|
21
23
|
- tools/git_pre_commit_guard.py
|
|
22
24
|
- tools/agent_canary.py
|
|
23
25
|
- tools/spec_drift_sentinel.py
|
|
26
|
+
- tools/senior_code_review.py
|
|
27
|
+
- tools/debt_harvester.py
|
|
24
28
|
---
|
|
25
29
|
|
|
26
30
|
# Quality Gatekeeper & Sentinel Agent
|
|
@@ -51,6 +55,8 @@ tools:
|
|
|
51
55
|
- `tools/validate_groovy_scripts.py`: Static linter verifying syntax and brace balance in Groovy test scripts.
|
|
52
56
|
- `tools/git_pre_commit_guard.py`: Pre-commit git hook preventing unverified code from being staged.
|
|
53
57
|
- `tools/agent_canary.py`: Injects 8 failure vectors to benchmark MTTR and autonomous recovery rate.
|
|
58
|
+
- `tools/senior_code_review.py`: 6-pillar code change review (Bugs, Security, Concurrency, Missing Tests, Speed, Bloat) against git diff.
|
|
59
|
+
- `tools/debt_harvester.py`: Harvests `shortcut:` technical debt markers across codebase into tracked debt ledger.
|
|
54
60
|
|
|
55
61
|
## Persona Enhancements (Adapted from wshobson/agents, MIT)
|
|
56
62
|
|
|
@@ -1,42 +1,62 @@
|
|
|
1
1
|
---
|
|
2
2
|
trigger: always_on
|
|
3
|
-
description: Skill Resolution Precedence and Anti-Collision Protocol enforcing Workspace-Local skills over external generic plugin skills.
|
|
3
|
+
description: Skill Resolution Precedence, Inter-Skill Coordination, and Anti-Collision Protocol enforcing Workspace-Local skills over external generic plugin skills.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Skill Resolution Precedence & Anti-Collision Protocol
|
|
7
7
|
|
|
8
|
-
> **Purpose:** Resolve overlapping trigger scopes between Project-Local Skills and External Plugins, eliminating context contagion, token bloat, and conflicting instructions.
|
|
8
|
+
> **Purpose:** Resolve overlapping trigger scopes between Project-Local Skills and External Plugins, as well as distinct operational boundaries among internal skills — eliminating context contagion, token bloat, and conflicting instructions.
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
## 1. Non-Negotiable Precedence Order
|
|
13
13
|
|
|
14
|
-
When executing tasks within automated testing repositories,
|
|
14
|
+
When executing tasks within automated testing repositories, all AI Agents must strictly apply the following 3-tier hierarchy:
|
|
15
15
|
|
|
16
16
|
```text
|
|
17
|
-
[Tier 1: Project-Local Skills] (.
|
|
18
|
-
v (
|
|
17
|
+
[Tier 1: Project-Local Skills] (.agents/skills/*)
|
|
18
|
+
v (Highest priority — Specialized, Context-Aware & Clean POM Enforced)
|
|
19
19
|
[Tier 2: Core Project Rules] (.agents/rules/*)
|
|
20
|
-
v
|
|
21
|
-
[Tier 3: External Plugin Skills] (antigravity-testing-kit, chrome-devtools-plugin)
|
|
20
|
+
v (Mandatory operating invariants & behavioral guardrails)
|
|
21
|
+
[Tier 3: External Plugin Skills] (antigravity-testing-kit, chrome-devtools-plugin, generic plugins)
|
|
22
|
+
v (Suppressed whenever a Tier 1 skill exists)
|
|
22
23
|
```
|
|
23
24
|
|
|
24
25
|
---
|
|
25
26
|
|
|
26
|
-
## 2.
|
|
27
|
+
## 2. External Plugin Suppression Matrix (Tier 1 vs Tier 3)
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
When an external plugin offers a capability that overlaps with a specialized Synapse Hub skill, the external skill is **strictly suppressed**:
|
|
30
|
+
|
|
31
|
+
| Task Domain | REQUIRED Skill (Tier 1) | SUPPRESSED Skill (Tier 3) | Architectural Reason |
|
|
32
|
+
|---|---|---|---|
|
|
33
|
+
| **POM & Test Authoring** | `clean-pom-crafter`<br/>`lam-script-generator` | `QA Automation Engineer`, `Test Generator` | Generic plugins generate raw XPaths and Selenium boilerplate; Hub strictly enforces Flat Architecture and zero raw locators in scripts. |
|
|
34
|
+
| **Code Change Review** | `senior-code-review` | `Generic PR Reviewer`, `Code Reviewer` | Evaluates 6 pillars (Bugs, Security, Concurrency, Missing Tests, Speed, Bloat) specifically against Git Diff. |
|
|
35
|
+
| **Locator Healing & Diffing** | `self-healing-locator`<br/>`failure-autopsy-and-healing` | `Locator Healer Agent` | Uses token-efficient semantic AOM diffing (Role > Label > TestId) instead of dumping thousands of raw HTML lines. |
|
|
36
|
+
| **Flaky Test Triage & RCA** | `failure-autopsy-and-healing`<br/>`flaky-test-sentinel-and-quarantine` | `Flaky Test Analyzer` | Triage occurs via 0-token JUnit XML parsing, screenshot autopsy, and SQLite episodic memory cache (`global_cache.db`). |
|
|
37
|
+
| **Live Probing & Inspection** | `playwright-live-interaction` | `Smart Locator Agent` | Direct CDP network idle 0, dynamic overlay detachment, and in-browser helper integration under 200ms. |
|
|
38
|
+
| **Accessibility (WCAG)** | `wcag-audit-patterns` *(Guideline)* | `a11y-debugging` *(Tooling Only)* | `wcag-audit-patterns` enforces WCAG 2.2 A/AA criteria; Chrome DevTools MCP is used strictly for low-level node inspection. |
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 3. Internal Inter-Skill Coordination & Boundary Separation
|
|
43
|
+
|
|
44
|
+
To prevent decision paralysis among internal skills in `.agents/skills/`, agents must strictly adhere to the following boundary matrix:
|
|
45
|
+
|
|
46
|
+
| Functional Area | Primary Skill | Sibling Skill | Distinct Responsibility & Hand-Off |
|
|
29
47
|
|---|---|---|---|
|
|
30
|
-
| **
|
|
31
|
-
| **
|
|
32
|
-
| **
|
|
33
|
-
| **
|
|
34
|
-
| **
|
|
35
|
-
| **
|
|
48
|
+
| **Code Creation** | `lean-code-ladder` | `surgical-coding-principles` | • `lean-code-ladder` governs **what to build** (descends 7-rung ladder, selects smallest working solution).<br/>• `surgical-coding-principles` governs **where to touch** (keeps git diff surgical, no unrelated file edits). |
|
|
49
|
+
| **Technical Debt** | `technical-debt-harvester` | `code-refactoring-refactor-clean` | • `technical-debt-harvester` is the **accountant** (scans and tracks `shortcut:` comments in Markdown ledgers).<br/>• `code-refactoring-refactor-clean` is the **surgeon** (executes SOLID refactoring and code smell remediation). |
|
|
50
|
+
| **Quality Review** | `senior-code-review` | `review-spec` (`goldfish_review`) | • `senior-code-review` audits **Source Code Diffs** (uncommitted / staged git changes).<br/>• `review-spec` audits **Requirements & User Stories** in a 0-context stress-test (Elephant-Goldfish model). |
|
|
51
|
+
| **System Audit** | `repo-quality-audit` | `analyze_project` (`tools/`) | • `analyze_project.py` produces **deterministic facts** (AST map, env check, data flow, 9 gates DoD).<br/>• `repo-quality-audit` applies **senior engineering judgment** (evaluates real load, ranks *"Fix #1 first"*). |
|
|
52
|
+
| **API Testing** | `api-spec-to-e2e-matrix` | `api-network-mocking-interception` | • `api-spec-to-e2e-matrix` compiles **test matrices** from OpenAPI specs.<br/>• `api-network-mocking-interception` stubs routes and injects **chaos network faults** during UI/API test runs. |
|
|
53
|
+
| **Failure Analysis** | `self-healing-locator` | `failure-autopsy-and-healing` | • `self-healing-locator` fixes **individual broken Page Class selectors**.<br/>• `failure-autopsy-and-healing` triages **suite-wide run crashes**, JUnit XML reports, and logs. |
|
|
54
|
+
| **DoD Verification** | `verification-before-completion` | `antigravity-test-sentinel` | • `verification-before-completion` enforces the **evidence protocol** (fresh command output required in session).<br/>• `antigravity-test-sentinel` is the **hard gatekeeper** (blocks task completion until all 9 Quality Gates pass). |
|
|
36
55
|
|
|
37
56
|
---
|
|
38
57
|
|
|
39
|
-
##
|
|
58
|
+
## 4. Strict Prohibitions
|
|
40
59
|
|
|
41
|
-
1. **
|
|
42
|
-
2. **Never dump
|
|
60
|
+
1. **Zero Generic Test Boilerplate:** Never generate legacy Selenium, Cucumber, or Object Repository (`findTestObject`) code from external plugins.
|
|
61
|
+
2. **Zero Raw HTML Dumps:** Never dump full HTML trees into context for locator healing; always extract compact AOM subtrees (< 500 tokens).
|
|
62
|
+
3. **Zero Unverified Assertions:** Never complete a code or test task without executing fresh verification via `tools/verify_all.py`.
|
|
@@ -57,6 +57,8 @@ This rule governs all AI Agents operating on the repository. It mandates strict
|
|
|
57
57
|
| :--- | :--- | :--- |
|
|
58
58
|
| **New project / Missing `PROJECT_AI_GUIDE.md` / Fresh clone** | `python3 tools/setup_project.py [target]` | 100% Autonomous: Detects framework (Playwright/Katalon/Pytest), generates `PROJECT_AI_GUIDE.md`, installs `pre-push` hook, extracts `repo_map.txt`, runs initial audit. |
|
|
59
59
|
| **User requests: "analyze project" / "re-analyze" / "project audit"** | `python3 tools/analyze_project.py [target]` | Execute comprehensive 5-in-1 health audit, sync repo_map, infer_linter, data_flow, verify_all & generate PROJECT_HEALTH_REPORT.md.<br/>**Post-Action:** Stage, commit & push updated project files (`PROJECT_HEALTH_REPORT.md`, `repo_map.txt`) to git. |
|
|
60
|
+
| **User requests: "review code" / "review diff" / "senior review"** | `python3 tools/senior_code_review.py` | 6-pillar code change review (Bugs, Security, Concurrency, Missing Tests, Speed, Bloat). |
|
|
61
|
+
| **User requests: "scan debt" / "list shortcuts" / "harvest debt"** | `python3 tools/debt_harvester.py` | Harvest `shortcut:` technical debt markers across repo into tracked markdown ledger. |
|
|
60
62
|
| **Starting task / Querying Page Class methods** | `tools/repo_map.txt`<br/>*(run `python3 tools/repo_map.py` if classes changed)* | Read compressed 500-token map for signatures; avoid reading 4,000-line files. |
|
|
61
63
|
| **Dispatching Browser Actions (Live/CDP)** | `python3 tools/safety_firewall.py --dry-run` | Mandatory Pre-execution Hook: Block irreversible/destructive operations before browser dispatch. |
|
|
62
64
|
| **Creating or updating Test Scripts** | `python3 tools/infer_linter.py` | Run AST scan for Fake-Pass (0 asserts) and empty catch blocks. |
|
|
@@ -9,7 +9,18 @@ Specialized skill for minimizing newly written code in test automation projects:
|
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
## 1. The 7-Rung Ladder
|
|
12
|
+
## 1. The 7-Rung Ladder & Intensity Levels
|
|
13
|
+
|
|
14
|
+
### Intensity Levels
|
|
15
|
+
|
|
16
|
+
| Level | Behavior |
|
|
17
|
+
|:---:|---|
|
|
18
|
+
| **lite** | Build what was asked. Name the smaller/lazier option in one line and let the user pick. |
|
|
19
|
+
| **full** | The standard 7-rung ladder rules below. (Default) |
|
|
20
|
+
| **ultra** | Deletion before addition: question the request and push back on any part the business need does not strictly justify. |
|
|
21
|
+
| **off** | Deactivate lean constraints; standard code synthesis. |
|
|
22
|
+
|
|
23
|
+
### The 7-Rung Ladder
|
|
13
24
|
|
|
14
25
|
Before writing any new code, descend the ladder and take the **first rung that fully works**:
|
|
15
26
|
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lean-impact-scoreboard
|
|
3
|
+
description: "Display the measured impact scoreboard (code reduction %, token optimization %, cost reduction %, test rigor) from lean engineering benchmarks."
|
|
4
|
+
category: architecture_and_analysis
|
|
5
|
+
version: "1.0.0"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Lean Impact Scoreboard — Verified Efficiency & Token Benchmarks
|
|
9
|
+
|
|
10
|
+
Displays empirical metrics and benchmarks demonstrating the impact of Lean Engineering (The 7-Rung Ladder, Clean POM, and Verification-First).
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 1. Benchmark Overview
|
|
15
|
+
|
|
16
|
+
Based on extensive agentic benchmarks (39 real-world tasks across backend, frontend, security, and test suites):
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
================================================================================
|
|
20
|
+
Metric Baseline (No Skill) Lean Mode Delta
|
|
21
|
+
================================================================================
|
|
22
|
+
Lines of Code Generated 100% 47% -53% 📉
|
|
23
|
+
Output Tokens Consumed 100% 55% -45% 📉
|
|
24
|
+
API Cost 100% 74% -26% 📉
|
|
25
|
+
Agent Execution Time 100% 59% -41% ⚡
|
|
26
|
+
Risky Logic Shipped with Tests 68% 98% +30% 🛡️
|
|
27
|
+
Bug Detection Rate (Mutants) 46% 66% +20% 🎯
|
|
28
|
+
================================================================================
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 2. Key Insights
|
|
34
|
+
|
|
35
|
+
1. **Less Code, Zero Loss of Safety:**
|
|
36
|
+
The goal is never code golfing. Code is concise because unnecessary abstractions, speculative wrappers, and redundant libraries are eliminated. Validation, trust boundaries, error handling, and accessibility are never compromised.
|
|
37
|
+
2. **Empirical Verification Over Guesswork:**
|
|
38
|
+
98% of all risky logic (branches, parsers, auth, financial paths) ships with an automated unit assertion, compared to only 68% in standard unconstrained AI runs.
|
|
39
|
+
3. **Real Per-Repo Metrics:**
|
|
40
|
+
Never hallucinate synthetic per-repo savings figures. For repository-specific health and debt measurements:
|
|
41
|
+
- Run `agent-qa debt` to review tracked shortcut debt.
|
|
42
|
+
- Run `python3 tools/analyze_project.py` to inspect AST maps and Quality Gate adherence.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## 3. Attribution
|
|
47
|
+
|
|
48
|
+
Adapted from **ponytail-gain** (https://github.com/DietrichGebert/ponytail) — MIT License, Copyright (c) 2026 DietrichGebert. Re-calibrated for Enterprise QA and Synapse Hub benchmarks.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Sample Lean Impact Scoreboard
|
|
2
|
+
|
|
3
|
+
Representative scoreboard displayed by `/synapse-gain`:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
================================================================================
|
|
7
|
+
Metric Baseline (No Skill) Lean Mode Delta
|
|
8
|
+
================================================================================
|
|
9
|
+
Lines of Code Generated 100% 47% -53% 📉
|
|
10
|
+
Output Tokens Consumed 100% 55% -45% 📉
|
|
11
|
+
API Cost 100% 74% -26% 📉
|
|
12
|
+
Agent Execution Time 100% 59% -41% ⚡
|
|
13
|
+
Risky Logic Shipped with Tests 68% 98% +30% 🛡️
|
|
14
|
+
Bug Detection Rate (Mutants) 46% 66% +20% 🎯
|
|
15
|
+
================================================================================
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Explanatory Context
|
|
19
|
+
- **Why less code?** Reuses existing codebase helpers, standard libraries, and native platform widgets instead of reinventing wheels.
|
|
20
|
+
- **Why more tests?** Enforces the completeness invariant: any non-trivial branch, loop, parser, or security logic must ship with a small test proving edge-case correctness.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Sample Lean Impact Scoreboard
|
|
2
|
+
|
|
3
|
+
## Example Display
|
|
4
|
+
```text
|
|
5
|
+
==============================================================================
|
|
6
|
+
SYNAPSE LEAN IMPACT SCOREBOARD
|
|
7
|
+
==============================================================================
|
|
8
|
+
Target Repository : EnterprisePaymentGateway
|
|
9
|
+
Lines of Code Removed : -4,820 lines (-34.2%)
|
|
10
|
+
Token Consumption Drop : -58.4%
|
|
11
|
+
Estimated Cloud Cost : -\$1,420 / mo
|
|
12
|
+
Quality Gate Status : 100% PASS (9/9 Gates DoD)
|
|
13
|
+
Mutation Score : 91.4% (Threshold: >= 80%)
|
|
14
|
+
==============================================================================
|
|
15
|
+
```
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: repo-quality-audit
|
|
3
|
+
description: "Quality audit of a whole codebase: bugs, security risks, concurrency and scale bottlenecks, missing test coverage, and code bloat. Ranks findings with 'Fix this first' priority."
|
|
4
|
+
category: architecture_and_analysis
|
|
5
|
+
version: "1.0.0"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Repo Quality Audit — Comprehensive Repository Health & Risk Audit
|
|
9
|
+
|
|
10
|
+
Audit an entire repository like the senior engineer who just inherited it and will be paged when it breaks.
|
|
11
|
+
Prioritize: **Correctness -> Safety -> Scale -> Tests -> Speed -> Lean**.
|
|
12
|
+
Always rank issues and provide a clear **"Fix this first"** verdict.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 1. Mapping the Codebase First
|
|
17
|
+
|
|
18
|
+
Before diagnosing defects:
|
|
19
|
+
1. **Entry Points & Architecture:** Inspect entry points (CLI commands, route handlers, test runners, background workers) and dependency manifests (`package.json`, `pyproject.toml`, `pom.xml`, `build.gradle`).
|
|
20
|
+
2. **Expected Load:** Determine whether the system is a local utility, a parallel CI suite, or a high-throughput microservice.
|
|
21
|
+
3. **Data Flow Tracing:** Trace critical business flows end-to-end:
|
|
22
|
+
- External inputs and request payloads
|
|
23
|
+
- Authentication & authorization checks
|
|
24
|
+
- Database mutations and state persistence
|
|
25
|
+
- Teardown and cleanup lifecycles
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 2. Six Audit Dimensions
|
|
30
|
+
|
|
31
|
+
| Dimension | Inspection Focus | Red Flags |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| **1. Bugs & Logic** | Edge cases, return type mismatches, error handling | Swallowed exceptions, null dereferences, broken callers |
|
|
34
|
+
| **2. Security & Data** | Trust boundaries, authentication, secrets | Hardcoded tokens, SQLi/RCE risks, missing input sanitization |
|
|
35
|
+
| **3. Concurrency & Scale** | Resource contention, memory lifecycle | Race conditions, static sleeps, unbounded caches, unclosed connections |
|
|
36
|
+
| **4. Test Deficit** | Untested business-critical logic | Complex branches or parsers with zero test assertions |
|
|
37
|
+
| **5. Performance** | Hot paths, loop overhead | Unindexed queries, redundant network calls, $O(n^2)$ iterations |
|
|
38
|
+
| **6. Bloat & Dead Code** | Code that should not exist | Unused dependencies, duplicate helper functions, single-impl interfaces |
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 3. Reporting Structure
|
|
43
|
+
|
|
44
|
+
1. **Overview & Assumptions:**
|
|
45
|
+
- What this codebase does
|
|
46
|
+
- The operational load assumed
|
|
47
|
+
2. **Ranked Findings (Max 20, ordered by severity):**
|
|
48
|
+
- **Must fix (Blockers):** Bugs causing data loss, security CVEs, unhandled crashes.
|
|
49
|
+
- **Should fix (Reliability):** Concurrency races, missing regression tests, flaky waits.
|
|
50
|
+
- **Nice to have (Hygiene):** Dead code removal, dependency pruning, code deduplication.
|
|
51
|
+
3. **Verdict & Lean Metric:**
|
|
52
|
+
- **Verdict:** "Fix #1 first: [Summary of top priority issue]"
|
|
53
|
+
- **Lean Savings Potential:** Potential reduction in lines of code (`-N lines`) and unused dependencies (`-M dependencies`).
|
|
54
|
+
- **Not Checked:** Explicitly state any submodules or third-party assets omitted.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 4. Complementary Hub Tools
|
|
59
|
+
|
|
60
|
+
- `python3 tools/analyze_project.py` — 5-in-1 automated health audit and AST repo map.
|
|
61
|
+
- `python3 tools/verify_all.py` — 9 Quality Gates DoD gatekeeper.
|
|
62
|
+
- `python3 tools/debt_harvester.py` — Scan repository for unaddressed shortcut debt.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 5. Attribution
|
|
67
|
+
|
|
68
|
+
Adapted from **ponytail-audit** (https://github.com/DietrichGebert/ponytail) — MIT License, Copyright (c) 2026 DietrichGebert. Re-architected for Enterprise QA and Synapse Hub Standards.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Sample Repo Quality Audit Walkthrough
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
This walkthrough demonstrates a repo-wide quality audit identifying high-impact risks with "Fix this first" prioritization.
|
|
5
|
+
|
|
6
|
+
## Example Command
|
|
7
|
+
```bash
|
|
8
|
+
agent-qa audit . --output REPO_QUALITY_AUDIT.md
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Sample Output Findings
|
|
12
|
+
1. **Critical:** In-memory queue without persistent backoff under concurrent load (`WorkerPool.groovy:142`).
|
|
13
|
+
- *Fix:* Introduce Redis-backed queue or bounded worker pool.
|
|
14
|
+
2. **Medium:** Unbounded mock API responses causing potential memory bloat (`MockServer.groovy:89`).
|
|
15
|
+
- *Fix:* Enforce pagination or bounded payload limits.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Sample Repository Quality Audit
|
|
2
|
+
|
|
3
|
+
Representative full-repo quality audit report:
|
|
4
|
+
|
|
5
|
+
```markdown
|
|
6
|
+
# Repository Quality Audit Report
|
|
7
|
+
|
|
8
|
+
- **Target Repository:** `warehouse-inventory-api`
|
|
9
|
+
- **Assumed Load:** 50 concurrent warehouse scanners + batch office imports (up to 5,000 items).
|
|
10
|
+
|
|
11
|
+
### Findings (Ranked Priority)
|
|
12
|
+
|
|
13
|
+
#### 1. [Must Fix] Office Batch Import Fails on Row 1,200 (`src/importers/csv.py:45`)
|
|
14
|
+
- **What this is:** In-memory batch processor loading entire CSV into a single transaction.
|
|
15
|
+
- **Problem:** When batch exceeds 1,000 items, database pool exhausts connection limits and drops connection silently.
|
|
16
|
+
- **Fix:** Chunk processing into 250-row windowed transactions.
|
|
17
|
+
- **If we skip it:** Nightly stock sync fails for all regional warehouses.
|
|
18
|
+
|
|
19
|
+
#### 2. [Should Fix] Risky Discount Logic Has No Tests (`src/services/pricing.py:112`)
|
|
20
|
+
- **What this is:** Tiered pricing rule engine based on customer loyalty grade.
|
|
21
|
+
- **Problem:** Complex ternary branching calculates negative discounts if grade is undefined. Zero unit tests cover this branch.
|
|
22
|
+
- **Fix:** Add boundary unit tests in `tests/test_pricing.py` asserting non-negative pricing.
|
|
23
|
+
- **If we skip it:** Special promotions risk leaking negative prices to checkouts.
|
|
24
|
+
|
|
25
|
+
#### 3. [Nice to Have] Dead Legacy XML Exporter (`src/exporters/legacy_xml.py`)
|
|
26
|
+
- **What this is:** Deprecated XML export helper replaced by REST API 6 months ago.
|
|
27
|
+
- **Fix:** Delete the 120-line unused module.
|
|
28
|
+
- **If we skip it:** Maintenance burden and confusion for new team members.
|
|
29
|
+
|
|
30
|
+
### Verdict
|
|
31
|
+
Fix #1 first: Chunk batch imports into 250-row windowed transactions.
|
|
32
|
+
Lean Potential: -120 dead lines, -1 unused XML library.
|
|
33
|
+
```
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: senior-code-review
|
|
3
|
+
description: "Quality review of a code change: verify logic correctness, security boundaries, real concurrency/load, missing test coverage, execution speed, and eliminate bloat. Reads connected callers and data flows, not just the diff."
|
|
4
|
+
category: architecture_and_analysis
|
|
5
|
+
version: "1.0.0"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Senior Code Review — Enterprise Quality & Lean Diff Review
|
|
9
|
+
|
|
10
|
+
Review code changes like the senior engineer who will be paged at 2 AM when it breaks.
|
|
11
|
+
Order of importance: **Correctness -> Safety -> Scale -> Tests -> Speed -> Lean**.
|
|
12
|
+
Lean still matters: every extra line must be read, tested, and fixed later.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 1. Understand First
|
|
17
|
+
|
|
18
|
+
- **Target Scoping:** Review what the user requests: uncommitted or staged changes, a branch, a PR link, or specific files. If unspecified: uncommitted changes (or last commit if clean).
|
|
19
|
+
- **Read Beyond the Diff:** Read the diff, then read the code it touches:
|
|
20
|
+
- Callers of every changed function or Page Class method.
|
|
21
|
+
- Functions and services called by the diff.
|
|
22
|
+
- Associated unit/E2E tests and fixtures.
|
|
23
|
+
- **Trace the Real Flow:** Where does user input arrive? What is validated? Where is state persisted? What is emitted?
|
|
24
|
+
- **Expected Scale:** Identify the expected operational load (single script execution vs concurrent CI runners or thousands of users). Judge scale against that.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 2. Six Core Review Pillars
|
|
29
|
+
|
|
30
|
+
### 1. Bug & Edge Cases
|
|
31
|
+
- Wrong calculation, crash, or unhandled edge cases (empty collections, zero values, timezone drift, string encoding).
|
|
32
|
+
- Callers broken by changed method signatures or altered return types.
|
|
33
|
+
- A bug fixed in one caller while the shared function/keyword remains broken for others.
|
|
34
|
+
|
|
35
|
+
### 2. Risk & Security
|
|
36
|
+
- Injection vulnerabilities (SQL, Shell, Command, Path traversal).
|
|
37
|
+
- Hardcoded secrets, plain tokens, or private keys.
|
|
38
|
+
- Missing input validation at trust boundaries.
|
|
39
|
+
- Data loss risks: swallowed errors, unhandled promise rejections, missing DB transactions.
|
|
40
|
+
|
|
41
|
+
### 3. Scale & Concurrency
|
|
42
|
+
- Race conditions (check-then-act without locking).
|
|
43
|
+
- Memory or cache leaks (unbounded collections that only grow).
|
|
44
|
+
- $O(n^2)$ iterations or N+1 queries on variable-sized data.
|
|
45
|
+
- Static delays (`Thread.sleep`, `time.sleep`) that block event loops or fail under variable network latency.
|
|
46
|
+
|
|
47
|
+
### 4. Missing Tests
|
|
48
|
+
- New non-trivial logic (branch, loop, parser, auth check, payment/money path) lacking a test that fails when broken.
|
|
49
|
+
- Every bug fix must include a regression test proving the fix.
|
|
50
|
+
|
|
51
|
+
### 5. Speed & Latency
|
|
52
|
+
- Bottlenecks in hot paths and repeated iterations.
|
|
53
|
+
- Unnecessary synchronous I/O or redundant API re-fetching.
|
|
54
|
+
|
|
55
|
+
### 6. Lean & Anti-Bloat
|
|
56
|
+
- **Delete:** Dead code, commented-out code, unused options, speculative configuration.
|
|
57
|
+
- **Reuse:** Leverage existing Page Classes, BasePage helpers, or utility functions.
|
|
58
|
+
- **Stdlib / Native:** Use platform features instead of adding external dependencies.
|
|
59
|
+
- **YAGNI:** Remove single-use abstractions, single-impl interfaces, and passthrough wrappers.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 3. Concrete Reporting Format
|
|
64
|
+
|
|
65
|
+
Every finding **must** have a concrete, reproducible failure scenario:
|
|
66
|
+
|
|
67
|
+
```markdown
|
|
68
|
+
#### [Severity: Must fix | Should fix | Nice to have] <Finding Title> (`<file>:<line>`)
|
|
69
|
+
- **What this is:** <One concise sentence describing the touched code>
|
|
70
|
+
- **Problem:** <Specific input or scenario that leads to the defect or failure>
|
|
71
|
+
- **Fix:** <Smallest complete diff or code change to resolve the issue>
|
|
72
|
+
- **If we skip it:** <What goes wrong in production or CI pipeline>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## 4. Automation CLI
|
|
78
|
+
|
|
79
|
+
Run the automated senior review tool on your current working tree:
|
|
80
|
+
```bash
|
|
81
|
+
python3 tools/senior_code_review.py # Review uncommitted changes
|
|
82
|
+
python3 tools/senior_code_review.py --staged # Review staged git changes
|
|
83
|
+
python3 tools/senior_code_review.py --branch main # Compare against main branch
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 5. Attribution
|
|
89
|
+
|
|
90
|
+
Adapted from **ponytail-review** (https://github.com/DietrichGebert/ponytail) — MIT License, Copyright (c) 2026 DietrichGebert. Re-architected for Enterprise QA, Clean POM, and Synapse Hub Quality Gates.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Sample Senior Code Review Walkthrough
|
|
2
|
+
|
|
3
|
+
Below is a representative senior code review performed on an API and test diff.
|
|
4
|
+
|
|
5
|
+
```markdown
|
|
6
|
+
# Senior Developer Quality & Lean Code Review
|
|
7
|
+
|
|
8
|
+
- **Files Changed:** `3`
|
|
9
|
+
- **Findings:** `2` (1 Must fix, 1 Should fix, 0 Nice to have)
|
|
10
|
+
|
|
11
|
+
### 🚨 Must Fix (Blockers)
|
|
12
|
+
|
|
13
|
+
#### 1. Swallowed Database Exception (`src/services/billing.py:84`)
|
|
14
|
+
- **What this is:** Try-catch block around payment transaction commit.
|
|
15
|
+
- **Problem:** When the gateway returns a network error, the exception is caught with `pass`, silently failing the invoice without alerting the user or reverting the database transaction.
|
|
16
|
+
- **Fix:** Rethrow `PaymentGatewayException` and rollback the active DB transaction.
|
|
17
|
+
- **If we skip it:** Invoices will appear as paid in UI while payments actually failed.
|
|
18
|
+
|
|
19
|
+
### ⚠️ Should Fix (Reliability & Scale)
|
|
20
|
+
|
|
21
|
+
#### 2. Static Sleep in Async Test (`tests/test_billing.py:32`)
|
|
22
|
+
- **What this is:** `time.sleep(3)` placed after dispatching webhook.
|
|
23
|
+
- **Problem:** Static wait causes test flakiness on slower CI runners and wastes 3 seconds on fast local runs.
|
|
24
|
+
- **Fix:** Replace with `await waitForCondition(isWebhookReceived, timeout=5000)`.
|
|
25
|
+
- **If we skip it:** CI pipeline will intermittently fail on high queue load.
|
|
26
|
+
|
|
27
|
+
### Verdict
|
|
28
|
+
❌ **Action Required:** Resolve 1 blocker before merging.
|
|
29
|
+
```
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: technical-debt-harvester
|
|
3
|
+
description: "Harvest shortcut: comments into a tracked debt ledger so deliberate compromises do not rot into forgotten tech debt."
|
|
4
|
+
category: architecture_and_analysis
|
|
5
|
+
version: "1.0.0"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Technical Debt Harvester — Pragmatic Shortcut & Deferral Tracker
|
|
9
|
+
|
|
10
|
+
Harvest deliberate shortcut comments (`shortcut: <limit>, <when to upgrade>`) across the entire repository into a structured Markdown ledger so pragmatic compromises do not silently rot into permanent defects.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 1. The Shortcut Comment Standard
|
|
15
|
+
|
|
16
|
+
When writing lean code or taking a pragmatic shortcut under time or scope constraints, leave an inline comment specifying the **ceiling (limit)** and the **upgrade trigger**:
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
# Format:
|
|
20
|
+
# shortcut: <the limit>, <when to upgrade>
|
|
21
|
+
|
|
22
|
+
# Examples:
|
|
23
|
+
# shortcut: max 100 items in memory, migrate to Redis if active sessions exceed 1,000
|
|
24
|
+
# shortcut: SQLite database, switch to PostgreSQL when concurrent writers > 5
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Any shortcut comment that omits an upgrade trigger is classified as `no-trigger` and flagged for review.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 2. Supported Comment Syntaxes
|
|
32
|
+
|
|
33
|
+
The harvester automatically detects markers across all common language comment styles:
|
|
34
|
+
- `# shortcut:` (Python, Bash, Ruby, YAML)
|
|
35
|
+
- `// shortcut:` (TypeScript, JavaScript, Java, Groovy, C++, Go, Rust, C#)
|
|
36
|
+
- `/* shortcut: ... */` (CSS, Multi-line blocks)
|
|
37
|
+
- `-- shortcut:` (SQL, Lua)
|
|
38
|
+
- `<!-- shortcut: ... -->` (HTML, XML, Markdown)
|
|
39
|
+
|
|
40
|
+
*(Also backwards compatible with older `ponytail:` comments).*
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 3. Automation CLI
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Scan working directory and display ledger
|
|
48
|
+
python3 tools/debt_harvester.py
|
|
49
|
+
|
|
50
|
+
# Save output to Markdown file
|
|
51
|
+
python3 tools/debt_harvester.py --output DEBT_LEDGER.md
|
|
52
|
+
|
|
53
|
+
# Output in JSON format for CI tooling
|
|
54
|
+
python3 tools/debt_harvester.py --json
|
|
55
|
+
|
|
56
|
+
# Scan with custom keyword
|
|
57
|
+
python3 tools/debt_harvester.py --keyword "DEBT:"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Or via the unified CLI:
|
|
61
|
+
```bash
|
|
62
|
+
agent-qa debt
|
|
63
|
+
agent-qa debt --output DEBT_LEDGER.md
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 4. Attribution
|
|
69
|
+
|
|
70
|
+
Adapted from **ponytail-debt** (https://github.com/DietrichGebert/ponytail) — MIT License, Copyright (c) 2026 DietrichGebert. Re-architected with native Python tooling for Synapse Hub.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Sample Technical Debt Ledger
|
|
2
|
+
|
|
3
|
+
Representative output from `agent-qa debt`:
|
|
4
|
+
|
|
5
|
+
```markdown
|
|
6
|
+
# Technical Debt & Shortcut Ledger
|
|
7
|
+
|
|
8
|
+
> **Ledger Policy:** Deliberate shortcuts prevent over-engineering. Track limits and upgrade triggers so they never rot silently into permanent defects.
|
|
9
|
+
|
|
10
|
+
- **Repository:** `order-service`
|
|
11
|
+
- **Total Shortcuts:** `3`
|
|
12
|
+
- **Missing Upgrade Triggers:** `1` ⚠️ *(Action Required)*
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
| Location | Description | Ceiling (Limit) | Upgrade Trigger | Status |
|
|
17
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
18
|
+
| `src/cache.py:24` | In-memory Python dictionary cache | 1,000 active sessions | Migrate to Redis when worker count > 2 | ✅ Tracked |
|
|
19
|
+
| `src/auth.py:89` | Synchronous token verification | Max 50 req/sec | Switch to async JWKS cache under high load | ✅ Tracked |
|
|
20
|
+
| `src/pdf.py:14` | Hardcoded paper margin 10px | Not specified | None | ⚠️ `no-trigger` |
|
|
21
|
+
|
|
22
|
+
### Recommended Action
|
|
23
|
+
1. Review the `1` shortcut tagged `no-trigger` above and define concrete upgrade conditions.
|
|
24
|
+
2. Run `agent-qa debt` in CI to monitor debt accumulation.
|
|
25
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Sample Technical Debt Ledger
|
|
2
|
+
|
|
3
|
+
## Example Output
|
|
4
|
+
```markdown
|
|
5
|
+
# Technical Debt & Shortcut Ledger
|
|
6
|
+
|
|
7
|
+
> **Ledger Policy:** Deliberate shortcuts prevent over-engineering. Track limits and upgrade triggers so they never rot silently into permanent defects.
|
|
8
|
+
|
|
9
|
+
- **Repository:** `OrderService`
|
|
10
|
+
- **Total Shortcuts:** `2`
|
|
11
|
+
- **Missing Upgrade Triggers:** `0` ✅ *(All tracked)*
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
### Tracked Shortcuts
|
|
16
|
+
1. `src/services/OrderProcessor.groovy:45`
|
|
17
|
+
- *Shortcut:* In-memory map cache
|
|
18
|
+
- *Ceiling:* 10,000 active orders
|
|
19
|
+
- *Upgrade Trigger:* Migrate to Redis when daily active orders > 10,000
|
|
20
|
+
```
|
|
@@ -18,6 +18,7 @@ Attribution notices must be preserved.
|
|
|
18
18
|
## Core Rules
|
|
19
19
|
1. **Clean POM Architecture:** No raw selectors (XPath/CSS) in test scripts. All selectors belong in Page Classes extending BasePage.
|
|
20
20
|
2. **Truth Anchor:** Never fake test passes. Report genuine defects.
|
|
21
|
-
3. **
|
|
22
|
-
4. **
|
|
23
|
-
5. **
|
|
21
|
+
3. **Lean Senior Dev:** The best code is the code never written. Descend the 7-rung ladder; mark shortcuts with `shortcut: <limit>, <upgrade>`.
|
|
22
|
+
4. **Smart Wait:** Prohibit static delays (`Thread.sleep`). Use dynamic smart waits.
|
|
23
|
+
5. **Idempotent Test Data:** Prefix with `AUTO_` and dynamic timestamps; teardown after creation.
|
|
24
|
+
6. **Bilingual Discipline:** Converse in Vietnamese; write code and git commits strictly in English.
|
package/.cursorrules
CHANGED
|
@@ -22,5 +22,6 @@
|
|
|
22
22
|
- Always read and follow AGENTS.md for operating standards.
|
|
23
23
|
- Communicate with the user in Vietnamese; avoid unnecessary technical jargon overload ("don't be too tech"). All code, tests, and docs stay in English.
|
|
24
24
|
- Enforce Clean POM Flat Architecture: all locators encapsulated in Page Classes.
|
|
25
|
+
- Lean Senior Dev: The best code is the code never written. Descend the 7-rung ladder; mark shortcuts with `shortcut: <limit>, <upgrade>`.
|
|
25
26
|
- Zero fake passes: test assertions must strictly validate real state.
|
|
26
27
|
- Before completing code changes, run: python tools/verify_all.py
|
package/.windsurfrules
CHANGED
|
@@ -21,5 +21,6 @@
|
|
|
21
21
|
|
|
22
22
|
- Communicate with the user in Vietnamese; avoid unnecessary technical jargon overload ("don't be too tech"). All code, tests, and docs stay in English.
|
|
23
23
|
- Adhere to Clean Page Object Model (POM) Flat Architecture.
|
|
24
|
+
- Lean Senior Dev: Solve problems with minimum code via 7-rung ladder; mark shortcuts with `shortcut: <limit>, <upgrade>`.
|
|
24
25
|
- Zero fake passes and zero swallowed exceptions.
|
|
25
26
|
- Run Definition of Done verification: python tools/verify_all.py
|