@teevee98/synapse-hub 4.1.4 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/.agents/rules/git-push-protocol.md +2 -2
  2. package/.agents/skills/01-web-automation/auth-session-and-cookie-manager/SKILL.md +52 -3
  3. package/.agents/skills/01-web-automation/bats-testing-patterns/SKILL.md +55 -5
  4. package/.agents/skills/01-web-automation/clean-pom-crafter/SKILL.md +62 -67
  5. package/.agents/skills/01-web-automation/e2e-testing-patterns/SKILL.md +54 -4
  6. package/.agents/skills/01-web-automation/katalon-cli-runner/SKILL.md +62 -12
  7. package/.agents/skills/01-web-automation/lam-script-generator/SKILL.md +55 -8
  8. package/.agents/skills/01-web-automation/mobile-appium-som/SKILL.md +60 -12
  9. package/.agents/skills/01-web-automation/mobile-appium-som/examples/BaseScreen.java +2 -2
  10. package/.agents/skills/01-web-automation/mobile-appium-som/examples/LoginScreen.java +2 -2
  11. package/.agents/skills/01-web-automation/mobile-appium-som/examples/TC_MobileLogin.java +2 -2
  12. package/.agents/skills/01-web-automation/playwright-live-interaction/SKILL.md +54 -91
  13. package/.agents/skills/01-web-automation/playwright-webapp-testing/SKILL.md +59 -11
  14. package/.agents/skills/01-web-automation/web-agent-gym-benchmarking/SKILL.md +50 -4
  15. package/.agents/skills/02-test-design/architecture-decision-records/SKILL.md +55 -9
  16. package/.agents/skills/02-test-design/gherkin-to-suite/SKILL.md +55 -9
  17. package/.agents/skills/02-test-design/rbt-manual-testing/SKILL.md +55 -8
  18. package/.agents/skills/02-test-design/review-spec/SKILL.md +50 -6
  19. package/.agents/skills/02-test-design/tot-exploratory-testing/SKILL.md +50 -4
  20. package/.agents/skills/03-api-and-contracts/api-network-mocking-interception/SKILL.md +56 -5
  21. package/.agents/skills/03-api-and-contracts/api-spec-to-e2e-matrix/SKILL.md +53 -7
  22. package/.agents/skills/03-api-and-contracts/consumer-driven-contract-testing/SKILL.md +86 -36
  23. package/.agents/skills/04-performance-and-load/backend-load-and-stress-patterns/SKILL.md +54 -6
  24. package/.agents/skills/04-performance-and-load/lean-impact-scoreboard/SKILL.md +50 -6
  25. package/.agents/skills/04-performance-and-load/web-vitals-and-performance-profiler/SKILL.md +50 -3
  26. package/.agents/skills/05-security-and-compliance/security-dast-sentinel/SKILL.md +63 -14
  27. package/.agents/skills/05-security-and-compliance/skillspector-security-guard/SKILL.md +51 -5
  28. package/.agents/skills/05-security-and-compliance/wcag-audit-patterns/SKILL.md +54 -4
  29. package/.agents/skills/06-healing-and-resilience/agentless-qa-repair/SKILL.md +51 -5
  30. package/.agents/skills/06-healing-and-resilience/antigravity-test-sentinel/SKILL.md +53 -6
  31. package/.agents/skills/06-healing-and-resilience/failure-autopsy-and-healing/SKILL.md +54 -8
  32. package/.agents/skills/06-healing-and-resilience/flaky-test-sentinel-and-quarantine/SKILL.md +60 -24
  33. package/.agents/skills/06-healing-and-resilience/self-healing-locator/SKILL.md +52 -6
  34. package/.agents/skills/06-healing-and-resilience/systematic-debugging/SKILL.md +56 -10
  35. package/.agents/skills/06-healing-and-resilience/test-driven-development/SKILL.md +58 -12
  36. package/.agents/skills/06-healing-and-resilience/verification-before-completion/SKILL.md +58 -12
  37. package/.agents/skills/06-healing-and-resilience/visual-regression-sentinel/SKILL.md +53 -5
  38. package/.agents/skills/07-data-and-state/db-state-verifier-and-seeder/SKILL.md +56 -5
  39. package/.agents/skills/07-data-and-state/file-and-report-validator/SKILL.md +53 -4
  40. package/.agents/skills/07-data-and-state/synthetic-test-data-generator/SKILL.md +58 -5
  41. package/.agents/skills/08-code-quality/code-refactoring-refactor-clean/SKILL.md +57 -11
  42. package/.agents/skills/08-code-quality/graphify-impact-analyzer/SKILL.md +83 -34
  43. package/.agents/skills/08-code-quality/graphify-impact-analyzer/examples/dependency_blast_radius.json +3 -4
  44. package/.agents/skills/08-code-quality/lean-code-ladder/SKILL.md +55 -10
  45. package/.agents/skills/08-code-quality/repo-quality-audit/SKILL.md +49 -6
  46. package/.agents/skills/08-code-quality/senior-code-review/SKILL.md +52 -7
  47. package/.agents/skills/08-code-quality/surgical-coding-principles/SKILL.md +55 -10
  48. package/.agents/skills/08-code-quality/technical-debt-harvester/SKILL.md +51 -5
  49. package/.agents/skills/09-ci-and-devops/github-actions-templates/SKILL.md +54 -17
  50. package/.agents/skills/09-ci-and-devops/github-actions-templates/examples/matrix_test_pipeline.yml +2 -1
  51. package/.agents/skills/10-agent-orchestration/actor-qa-swarm/SKILL.md +50 -4
  52. package/.agents/skills/10-agent-orchestration/agent-orchestration-multi-agent-optimize/SKILL.md +53 -7
  53. package/.agents/skills/10-agent-orchestration/event-stream-qa-orchestrator/SKILL.md +50 -4
  54. package/.agents/skills/10-agent-orchestration/persistent-planning-files/SKILL.md +58 -13
  55. package/.agents/skills/10-agent-orchestration/qa-memory-os/SKILL.md +51 -5
  56. package/.agents/skills/11-ai-and-prompting/meta-prompt-crafter/SKILL.md +57 -10
  57. package/.agents/skills/11-ai-and-prompting/mipro-prompt-compiler/SKILL.md +50 -4
  58. package/.agents/skills/11-ai-and-prompting/qa-aci-interface/SKILL.md +50 -4
  59. package/.agents/skills/11-ai-and-prompting/token-and-context-optimizer/SKILL.md +55 -9
  60. package/.cursor/rules/synapse-qa.mdc +20 -7
  61. package/.cursorrules +19 -5
  62. package/.windsurfrules +18 -3
  63. package/AGENTS.md +51 -59
  64. package/CLAUDE.md +38 -24
  65. package/LICENSE +5 -5
  66. package/NOTICE +1 -1
  67. package/README.en.md +4 -4
  68. package/README.md +4 -4
  69. package/agentskills.json +1 -1
  70. package/docs/ARCHITECTURE.en.md +2 -2
  71. package/docs/ARCHITECTURE.md +11 -2
  72. package/docs/CLIENT_SUPPORT_MATRIX.md +44 -0
  73. package/docs/CLI_REFERENCE.en.md +6 -4
  74. package/docs/CLI_REFERENCE.md +1 -1
  75. package/docs/CONTRIBUTING.en.md +1 -1
  76. package/docs/CONTRIBUTING.md +2 -2
  77. package/docs/SIDE_EFFECTING_TOOLS_INVENTORY.md +233 -0
  78. package/docs/TOOL_CATALOG.md +6 -2
  79. package/docs/research/agent_skill_training_analysis.md +1 -1
  80. package/package.json +1 -1
  81. package/plugin.json +1 -1
  82. package/skills_manifest.json +320 -55
  83. package/synapse.config.json +1 -1
  84. package/templates/ai_bridges/CLAUDE.md +29 -26
  85. package/templates/ai_bridges/copilot-instructions.md +14 -5
  86. package/templates/ai_bridges/cursor_synapse_qa.mdc +16 -7
  87. package/templates/ai_bridges/windsurfrules +14 -3
  88. package/templates/ui/index.html +2 -2
  89. package/tools/TOOLS_RUNBOOK.md +1 -1
  90. package/tools/TOOL_CATALOG.json +63 -3
  91. package/tools/__init__.py +1 -1
  92. package/tools/api_fuzzer.py +447 -132
  93. package/tools/author_integrity.py +121 -11
  94. package/tools/benchmark_swarm_context.py +130 -22
  95. package/tools/break_ui_generator.py +233 -0
  96. package/tools/browser_helpers.js +2 -2
  97. package/tools/check_version_sync.py +18 -50
  98. package/tools/cli.py +110 -19
  99. package/tools/core/bm25_retriever.py +218 -0
  100. package/tools/core/i18n.py +5 -5
  101. package/tools/core/provider_usage_adapter.py +383 -0
  102. package/tools/core/token_estimator.py +81 -15
  103. package/tools/count_tokens.py +7 -2
  104. package/tools/coverage_reporter.py +245 -0
  105. package/tools/dashboard_generator.py +8 -8
  106. package/tools/db_sandbox.py +290 -9
  107. package/tools/distill_log.py +1 -1
  108. package/tools/distill_skill.py +206 -0
  109. package/tools/git_pre_commit_guard.py +202 -1
  110. package/tools/humanize_linter.py +3 -0
  111. package/tools/mcp_docx_server.py +1 -1
  112. package/tools/mcp_excel_server.py +1 -1
  113. package/tools/mcp_server.py +104 -16
  114. package/tools/micro_mutator.py +114 -15
  115. package/tools/pentest_scope_guard.py +674 -58
  116. package/tools/perf/benchmark_perf_runner.py +42 -0
  117. package/tools/project_state.py +29 -5
  118. package/tools/reversible_sandbox.py +58 -13
  119. package/tools/rules_router.py +473 -60
  120. package/tools/security_scanner.py +80 -0
  121. package/tools/senior_code_review.py +14 -0
  122. package/tools/skill_canonical_digest.py +302 -0
  123. package/tools/skill_profiles.py +77 -7
  124. package/tools/slide_deck_exporter.py +477 -0
  125. package/tools/sync_agent_rules.py +187 -61
  126. package/tools/sync_skills_manifest.py +166 -0
  127. package/tools/task_memory_manager.py +275 -0
  128. package/tools/ui_server.py +3 -1
  129. package/tools/update_sentinel.py +3 -3
  130. package/tools/validate_host_interop.py +485 -0
  131. package/tools/validate_skills_schema.py +575 -0
  132. package/tools/verify_all.py +668 -44
  133. package/tools/welcome_page.py +2 -2
@@ -1,13 +1,42 @@
1
1
  ---
2
2
  name: code-refactoring-refactor-clean
3
3
  description: "Eliminate technical debt and refactor code using SOLID and Clean Code patterns. Use when refactoring legacy test code toward clean, maintainable structures."
4
+ category: architecture_and_analysis
5
+ version: "2.0.0"
6
+ policies:
7
+ network: none
8
+ shell: workspace-sandbox
9
+ filesystem: workspace-sandbox
4
10
  ---
5
-
6
11
  # Refactor, Clean Code & Technical Debt Remediation
7
12
 
13
+ > **Author Attribution & MIT License Guard:** Synapse Hub is open-source software created by **Thế Vị (@TeeVee98)** (<https://github.com/TeeVee98/Synapse-Hub>) under the MIT License.
14
+
15
+ ---
16
+
17
+ ## 1. Trigger & Activation
18
+
19
+ - **Trigger Clause:** Eliminate technical debt and refactor code using SOLID and Clean Code patterns. Use when refactoring legacy test code toward clean, maintainable structures.
20
+ - **Activation Scope:** Domain workflows for `08-code-quality` involving `code-refactoring-refactor-clean`.
21
+
22
+ ---
23
+
24
+ ## 2. Non-Goals & Boundary Constraints
25
+
26
+ - **What NOT to do:**
27
+ - Do NOT introduce functional behavior changes or new features during a refactoring task.
28
+ - Do NOT refactor code without existing passing tests protecting the behavior boundary.
29
+ - Do NOT perform uncontrolled 'while I'm here' cleanups across untouched files.
30
+ - **Sibling Skill Boundaries:**
31
+ - surgical-coding-principles restricts where to touch; code-refactoring-refactor-clean executes behavior-preserving structure improvements.
32
+
33
+ ---
34
+
35
+ ## 3. Ordered Execution Workflow
36
+
8
37
  You are a code refactoring and technical debt expert specializing in clean code principles, SOLID design patterns, tech debt inventory, and modern software engineering best practices. Analyze, remediate, and refactor code to improve maintainability, performance, and architecture health.
9
38
 
10
- ## Use this skill when
39
+ ### Use this skill when
11
40
 
12
41
  - Refactoring tangled, overly complex, or hard-to-maintain code
13
42
  - Identifying, quantifying, and prioritizing technical debt and code smells
@@ -15,16 +44,16 @@ You are a code refactoring and technical debt expert specializing in clean code
15
44
  - Preparing modules for new features safely without regression
16
45
  - Establishing automated quality gates and debt reduction roadmaps
17
46
 
18
- ## Do not use this skill when
47
+ ### Do not use this skill when
19
48
 
20
49
  - You only need a small one-line fix
21
50
  - Refactoring is prohibited due to production freeze
22
51
  - The request is for documentation only
23
52
 
24
- ## Context
53
+ ### Context
25
54
  The user needs actionable code refactoring and technical debt remediation. Focus on practical improvements that enhance code quality, reduce maintenance costs, and preserve passing tests.
26
55
 
27
- ## Instructions
56
+ ### Instructions
28
57
 
29
58
  - Assess code smells, dependencies, risky hotspots, and technical debt metrics.
30
59
  - Propose a refactor plan with incremental steps and clear ROI.
@@ -32,7 +61,7 @@ The user needs actionable code refactoring and technical debt remediation. Focus
32
61
  - Update tests, verify regressions, and maintain backward compatibility.
33
62
  - If detailed patterns are required, refer to `resources/implementation-playbook.md`.
34
63
 
35
- ## Technical Debt & Code Smell Checklist
64
+ ### Technical Debt & Code Smell Checklist
36
65
 
37
66
  1. **Code Debt:**
38
67
  - Duplication: identical logic, copy-paste snippets, repeated business rules.
@@ -43,15 +72,16 @@ The user needs actionable code refactoring and technical debt remediation. Focus
43
72
  3. **Testing Debt:**
44
73
  - Missing assertions, flaky synchronization, untracked test data collisions.
45
74
 
46
- ## Safety & Verification
75
+ ### Safety & Verification
47
76
 
48
77
  - Never alter business logic without explicit confirmation.
49
78
  - Keep diffs minimal, reviewable, and run verification gates:
50
- ```bash
79
+ <!-- classification: illustrative -->
80
+ ```bash
51
81
  synapse verify
52
- ```
82
+ ```
53
83
 
54
- ## Output Format
84
+ ### Output Format
55
85
 
56
86
  - Summary of identified issues, code smells, and technical debt
57
87
  - Incremental refactoring roadmap with risk assessment
@@ -59,6 +89,22 @@ The user needs actionable code refactoring and technical debt remediation. Focus
59
89
  - Proposed changes and expected impact
60
90
  - Test/verification notes
61
91
 
62
- ## Resources
92
+ ### Resources
63
93
 
64
94
  - `resources/implementation-playbook.md` for detailed patterns and examples.
95
+
96
+ ---
97
+
98
+ ## 4. Verification Points & DoD
99
+
100
+ 1. Existing test suite passes before and after refactoring with zero regressions.
101
+ 2. Code complexity, duplication, and coupling metrics improve measurably.
102
+ 3. All public APIs and method contracts remain backward-compatible.
103
+
104
+ ---
105
+
106
+ ## 5. Handoff Protocol
107
+
108
+ - **Deliverables:** Refactored source files, regression test verification logs, and AST complexity diff.
109
+ - **Next Subagent:** pom-crafter / quality-gatekeeper
110
+ - **Output Format:** Clean POM code, structured JSON telemetry, or validated markdown handoff.
@@ -1,76 +1,125 @@
1
1
  ---
2
2
  name: graphify-impact-analyzer
3
3
  description: "Analyze code change blast radius and scope impacted test cases via AST. Use when analyzing the blast radius of code changes via dependency graphs."
4
+ category: architecture_and_analysis
5
+ version: "2.0.0"
6
+ policies:
7
+ network: none
8
+ shell: workspace-sandbox
9
+ filesystem: workspace-sandbox
4
10
  ---
11
+ # Graphify Impact Analyzer — AST Knowledge Graph Navigation & Impact Analysis
5
12
 
6
- # Graphify Impact Analyzer — AST Knowledge Graph Navigation & Zero-Waste Impact Analysis
13
+ > **Author Attribution & MIT License Guard:** Synapse Hub is open-source software created by **Thế Vị (@TeeVee98)** (<https://github.com/TeeVee98/Synapse-Hub>) under the MIT License.
7
14
 
8
- Specialized skill for navigating the codebase's AST Knowledge Graph (`graphify-out/graph.json`), executing sub-second dependency queries, and performing **Zero-Waste Test Impact Analysis** to execute only tests affected by code modifications.
15
+ ---
16
+
17
+ ## 1. Trigger & Activation
18
+
19
+ - **Trigger Clause:** Use when analyzing the blast radius of code modifications, executing targeted test impact analysis via AST dependency graphs, or locating impacted test suites after refactoring.
20
+ - **Activation Scope:**
21
+ - Code changes in Page Classes, utility helpers, and shared base abstractions.
22
+ - AST knowledge graph queries (`graphify-out/graph.json`).
23
+ - Pre-execution test scoping for CI/CD pipelines to run only affected test cases.
9
24
 
10
25
  ---
11
26
 
12
- ## 1. Core Capabilities
27
+ ## 2. Non-Goals & Boundary Constraints
28
+
29
+ - **What NOT to do:**
30
+ - Do NOT execute blind full-corpus regression runs when changes are strictly localized to isolated leaf classes.
31
+ - Do NOT mutate or corrupt the AST graph without running synchronization (`graphify update .`).
32
+ - Do NOT reference non-existent project files or broken visual report paths.
33
+ - **Sibling Skill Boundaries:**
34
+ - `repo-quality-audit`: Conducts holistic 6-pillar repository architecture and debt audits.
35
+ - `senior-code-review`: Evaluates code diffs against Clean POM, security, and performance standards.
36
+ - `graphify-impact-analyzer` (this skill): Navigates dependency graphs and computes test impact blast radius.
37
+
38
+ ---
39
+
40
+ ## 3. Ordered Execution Workflow
41
+
42
+ ### Phase 1: AST Knowledge Graph Navigation & Capabilities
13
43
 
14
44
  1. **Deterministic AST Parsing (Zero API Cost):**
15
45
  - Automatically maps files, classes, methods, and test scripts into `graphify-out/graph.json`.
16
46
  - Replaces blind, expensive full-corpus grepping with targeted graph traversals.
17
47
 
18
- 2. **Automated Test Impact Analysis (Zero Waste):**
19
- - When any Page Class in `Keywords/<project>/pages/` or `pages/*.ts` is modified, the impact analyzer computes reverse dependencies in `graph.json`.
20
- - Pinpoints the exact subset of Test Cases affected, reducing CI/CD execution time by up to 90+%.
48
+ 2. **Automated Test Impact Analysis:**
49
+ - When a Page Class (e.g. `examples/playwright-crm-suite/pages/CustomerPage.ts`) is modified, the impact analyzer computes reverse dependencies in `graphify-out/graph.json`.
50
+ - Pinpoints the exact subset of Test Cases affected, significantly reducing test execution overhead.
21
51
 
22
52
  3. **God Node & Technical Debt Detection:**
23
53
  - Detects over-coupled classes and guides safe, modular refactoring.
24
54
 
25
- ---
26
-
27
- ## 2. Test Impact Analysis Workflow (`tools/test_impact.py`)
55
+ ### Phase 2: Test Impact Analysis Workflow (`tools/test_impact.py`)
28
56
 
29
57
  Run impact analysis before dispatching test suites:
30
58
 
31
- ### 2.1. Check Impact of Modified Page Class
59
+ #### Check Impact of Modified Page Class
60
+
61
+ <!-- classification: illustrative -->
32
62
  ```bash
33
- synapse impact -f Keywords/pages/CategoryPage.groovy
63
+ # Analyze impact for a specific modified Page Class
64
+ synapse impact -f examples/playwright-crm-suite/pages/CustomerPage.ts
34
65
  ```
35
- *Output:*
36
- - Target File: `Keywords/pages/CategoryPage.groovy`
37
- - Directly Impacted: **12 / 250 TCs**
38
- - Skipped: **238 TCs**
39
- - Time Saved: **95.2%**
40
66
 
41
- ### 2.2. Automatically Analyze Git Changes
67
+ *Expected Output:*
68
+ - Target File: `examples/playwright-crm-suite/pages/CustomerPage.ts`
69
+ - Directly Impacted: `examples/playwright-crm-suite/tests/customers.spec.ts`
70
+ - Status: Isolated blast radius
71
+
72
+ #### Automatically Analyze Git Changes
73
+
74
+ <!-- classification: illustrative -->
42
75
  ```bash
76
+ # Analyze impact from current working tree git diff
43
77
  synapse impact --git-diff
44
78
  ```
45
79
 
46
- ### 2.3. Output Machine-Readable JSON (For CI/CD Pipelines)
80
+ #### Output Machine-Readable JSON (For CI/CD Pipelines)
81
+
82
+ <!-- classification: illustrative -->
47
83
  ```bash
84
+ # Export structured blast radius JSON report
48
85
  synapse impact --git-diff --json
49
86
  ```
50
87
 
51
- ---
88
+ See reference schema in `examples/dependency_blast_radius.json`.
89
+
90
+ ### Phase 3: Knowledge Graph Navigation Commands
91
+
92
+ <!-- classification: illustrative -->
93
+ ```bash
94
+ # Explain a Page Class or Script and its connections
95
+ graphify explain "CustomerPage"
96
+
97
+ # Find shortest dependency path between two classes/scripts
98
+ graphify path "CustomerPage" "BasePage"
99
+
100
+ # Refresh AST graph after code modifications
101
+ graphify update .
102
+ ```
52
103
 
53
- ## 3. Knowledge Graph CLI Navigation Commands
104
+ ### Phase 4: Visual Artifacts Inspection
54
105
 
55
- | Command | Purpose | Example |
56
- |---|---|---|
57
- | `graphify explain "<Node>"` | Explain a Page Class or Script and its connections | `graphify explain "UserAdminPage"` |
58
- | `graphify path "<A>" "<B>"` | Find shortest path between two classes/scripts | `graphify path "LoginPage" "BasePage"` |
59
- | `graphify query "<Concept>"` | Query a concept or test case subgraph | `graphify query "TC-101"` |
60
- | `graphify update .` | Refresh AST graph after code modifications (No LLM needed) | `graphify update .` |
106
+ - **Interactive Visualizer:** `graphify-out/graph.html`
107
+ - **Call-flow Diagrams:** `graphify-out/Agent-Skill-callflow.html`
108
+ - **Summary Report:** `graphify-out/GRAPH_REPORT.md`
61
109
 
62
110
  ---
63
111
 
64
- ## 4. Visual Artifacts
112
+ ## 4. Verification Points & DoD
65
113
 
66
- - **2D/3D Interactive Visualizer:** `graphify-out/graph.html`
67
- - **Call-flow & Mermaid Diagrams:** `graphify-out/callflow.html`
68
- - **Architectural Summary Report:** `graphify-out/GRAPH_REPORT.md`
114
+ 1. **AST Graph Integrity:** `graphify-out/graph.json` exists, parses as valid JSON, and reflects current workspace state.
115
+ 2. **Blast Radius Accuracy:** Impact analysis accurately identifies callers and dependent test suites of touched files.
116
+ 3. **Artifact Resolution:** Visualizer files (`graphify-out/Agent-Skill-callflow.html`, `graphify-out/graph.html`) resolve cleanly.
117
+ 4. **Tool Command Exit Code:** `synapse impact` executes with exit code 0.
69
118
 
70
119
  ---
71
120
 
72
- ## 5. Agent Operational Guardrails
121
+ ## 5. Handoff Protocol
73
122
 
74
- 1. **Before modifying any Page Class:** Run `synapse impact -f <path>` to identify dependent Test Cases.
75
- 2. **After modifying code:** Run `graphify update .` to keep the knowledge graph synchronized.
76
- 3. **DoD Compliance:** Always verify that all changes pass `synapse verify`.
123
+ - **Deliverables:** Impacted test suite list, blast radius classification report (`examples/dependency_blast_radius.json`), and updated knowledge graph.
124
+ - **Next Subagent:** Pass the list of impacted test files to `test-runner` for targeted execution or `quality-gatekeeper` for change validation.
125
+ - **Output Format:** JSON list of affected test files and summary markdown.
@@ -1,8 +1,7 @@
1
1
  {
2
- "modifiedFile": "src/pages/CheckoutPage.ts",
2
+ "modifiedFile": "examples/playwright-crm-suite/pages/CustomerPage.ts",
3
3
  "impactedSuites": [
4
- "tests/e2e/checkout.spec.ts",
5
- "tests/e2e/payment.spec.ts"
4
+ "examples/playwright-crm-suite/tests/customers.spec.ts"
6
5
  ],
7
6
  "blastRadiusScore": "LOW_ISOLATED"
8
- }
7
+ }
@@ -1,15 +1,44 @@
1
1
  ---
2
2
  name: lean-code-ladder
3
3
  description: "Apply a 7-rung reuse-first ladder so every new test-automation code path is the smallest complete change that fully solves the task. Use when adding helpers, Page Class methods, dependencies, or any new code where a shorter existing option might already exist."
4
+ category: architecture_and_analysis
5
+ version: "1.0.0"
6
+ policies:
7
+ network: none
8
+ shell: none
9
+ filesystem: read-only
4
10
  ---
5
-
6
11
  # Lean Code Ladder — Enterprise Reuse-First Standard
7
12
 
13
+ > **Author Attribution & MIT License Guard:** Synapse Hub is open-source software created by **Thế Vị (@TeeVee98)** (<https://github.com/TeeVee98/Synapse-Hub>) under the MIT License.
14
+
15
+ ---
16
+
17
+ ## 1. Trigger & Activation
18
+
19
+ - **Trigger Clause:** Apply a 7-rung reuse-first ladder so every new test-automation code path is the smallest complete change that fully solves the task. Use when adding helpers, Page Class methods, dependencies, or any new code where a shorter existing option might already exist.
20
+ - **Activation Scope:** Domain workflows for `08-code-quality` involving `lean-code-ladder`.
21
+
22
+ ---
23
+
24
+ ## 2. Non-Goals & Boundary Constraints
25
+
26
+ - **What NOT to do:**
27
+ - Do NOT add speculative wrappers, unrequested options, or 'for later' abstractions (YAGNI).
28
+ - Do NOT skip the lower rungs of the 7-rung ladder; use existing code and language stdlib first.
29
+ - Do NOT sacrifice validation, trust boundaries, error handling, or security for code brevity.
30
+ - **Sibling Skill Boundaries:**
31
+ - surgical-coding-principles limits diff surface; lean-code-ladder dictates what minimal solution level to build.
32
+
33
+ ---
34
+
35
+ ## 3. Ordered Execution Workflow
36
+
8
37
  Specialized skill for minimizing newly written code in test automation projects: solve the whole problem with the least new code, then finish the change completely (callers, fixtures, and the small test that proves it).
9
38
 
10
39
  ---
11
40
 
12
- ## 1. The 7-Rung Ladder & Intensity Levels
41
+ ### The 7-Rung Ladder & Intensity Levels
13
42
 
14
43
  ### Intensity Levels
15
44
 
@@ -34,12 +63,12 @@ Before writing any new code, descend the ladder and take the **first rung that f
34
63
  | 5 | One line? | Can it be one line a reader gets at a glance? Then one line. |
35
64
  | 6 | Minimum new code | Write the minimum that works, and no more. |
36
65
 
37
- ## 2. Reading Order Before Writing
66
+ ### Reading Order Before Writing
38
67
 
39
68
  - Read the task and the code it touches. List every place the change must reach: callers, tests, fixtures, config, exports.
40
69
  - Check what the change could break: data it would destroy or expose, callers that stop working. That is scope. Extra features are not.
41
70
 
42
- ## 3. Completeness Rules (Be Lazy About the Solution, Never About the Change)
71
+ ### Completeness Rules (Be Lazy About the Solution, Never About the Change)
43
72
 
44
73
  - Finish every part the task needs, including the callers, tests, and fixtures the change affects.
45
74
  - No abstraction, wrapper, option, config, or "for later" code nobody asked for. Keep values in the form the platform already gives. Deletion beats addition; keep the structure the codebase already has.
@@ -51,7 +80,7 @@ Before writing any new code, descend the ladder and take the **first rung that f
51
80
  - New non-trivial logic (a branch, loop, parser, money/security path, or a whole new script) leaves one small test or assert-based self-check before it counts as finished; trivial changes need none.
52
81
  - A shortcut with a known limit gets a code comment: `shortcut: <the limit>, <when to upgrade>`.
53
82
 
54
- ## 4. Never Cut (Hard Floor)
83
+ ### Never Cut (Hard Floor)
55
84
 
56
85
  The ladder minimizes code, never safety. The following are never removed or skipped in the name of leanness:
57
86
 
@@ -61,13 +90,13 @@ The ladder minimizes code, never safety. The following are never removed or skip
61
90
  - Accessibility behavior
62
91
  - Anything the user explicitly asked for
63
92
 
64
- ## 5. Evidence of Leanness
93
+ ### Evidence of Leanness
65
94
 
66
95
  - Run `python3 tools/infer_linter.py` after the change: zero fake-pass findings confirms the lean diff did not trade rigor for brevity.
67
96
  - Run the affected subset from `python3 tools/test_impact.py --git-diff` to prove the shortest diff still reaches everything it had to reach.
68
97
  - Lean code without its check is unfinished: Gate 8 (`tools/micro_mutator.py`, Mutation Score >= 80%) remains the floor for any assertion logic written on this ladder.
69
98
 
70
- ## 6. Worked Comparison
99
+ ### Worked Comparison
71
100
 
72
101
  | Situation | Bloated answer | Lean answer |
73
102
  |---|---|---|
@@ -75,7 +104,7 @@ The ladder minimizes code, never safety. The following are never removed or skip
75
104
  | Need retry around a flaky API call | New generic retry framework with policy classes | The installed HTTP client's retry option (Rung 4) + one test |
76
105
  | Need a formatted timestamp in test data | New utility module | One line with the stdlib formatter (Rung 2) |
77
106
 
78
- ## 7. Boundary vs Sibling Skills (Do Not Confuse)
107
+ ### Boundary vs Sibling Skills (Do Not Confuse)
79
108
 
80
109
  | Sibling | Owns | Hand-off |
81
110
  |---|---|---|
@@ -83,12 +112,28 @@ The ladder minimizes code, never safety. The following are never removed or skip
83
112
  | `code-refactoring-refactor-clean` | Deliberate SOLID refactors of existing debt | Refactoring is not ladder work; only new/changed code descends the ladder |
84
113
  | `clean-pom-crafter` | Page Class architecture and locator tiers | Ladder applies inside and around Page Classes, not to their architecture contract |
85
114
 
86
- ## 8. Reference Documentation
115
+ ### Reference Documentation
87
116
 
88
117
  - `python3 tools/infer_linter.py` — fake-pass scan for the new logic.
89
118
  - `python3 tools/test_impact.py --git-diff` — confirm the lean diff still covers all impacted tests.
90
119
  - `python3 tools/micro_mutator.py` — Gate 8 mutation floor (>= 80%) for non-trivial new logic.
91
120
 
92
- ## 9. Attribution
121
+ ### Attribution
93
122
 
94
123
  Adapted from **ponytail** (https://github.com/DietrichGebert/ponytail) — MIT License, Copyright (c) 2026 DietrichGebert. The lazy-senior ladder, completeness rules, and never-cut floor are re-scoped for enterprise test automation in Synapse Hub; wording, structure, and examples modified.
124
+
125
+ ---
126
+
127
+ ## 4. Verification Points & DoD
128
+
129
+ 1. Solution stops at the lowest rung of the 7-rung ladder that satisfies the requirement.
130
+ 2. Zero speculative options or unused abstractions added.
131
+ 3. Deliberate simplifications marked with `shortcut: <limit>, <upgrade>` comments.
132
+
133
+ ---
134
+
135
+ ## 5. Handoff Protocol
136
+
137
+ - **Deliverables:** Minimal complete code changes, YAGNI audit rationale, and shortcut markers ledger.
138
+ - **Next Subagent:** orchestrator
139
+ - **Output Format:** Clean POM code, structured JSON telemetry, or validated markdown handoff.
@@ -3,17 +3,44 @@ name: repo-quality-audit
3
3
  description: "Comprehensive codebase quality audit covering bugs, security, bottlenecks, and bloat. Use when auditing an entire project, evaluating repository health, or prioritizing technical debt."
4
4
  category: architecture_and_analysis
5
5
  version: "1.0.0"
6
+ policies:
7
+ network: none
8
+ shell: read-only
9
+ filesystem: read-only
6
10
  ---
7
-
8
11
  # Repo Quality Audit — Comprehensive Repository Health & Risk Audit
9
12
 
13
+ > **Author Attribution & MIT License Guard:** Synapse Hub is open-source software created by **Thế Vị (@TeeVee98)** (<https://github.com/TeeVee98/Synapse-Hub>) under the MIT License.
14
+
15
+ ---
16
+
17
+ ## 1. Trigger & Activation
18
+
19
+ - **Trigger Clause:** Comprehensive codebase quality audit covering bugs, security, bottlenecks, and bloat. Use when auditing an entire project, evaluating repository health, or prioritizing technical debt.
20
+ - **Activation Scope:** Domain workflows for `08-code-quality` involving `repo-quality-audit`.
21
+
22
+ ---
23
+
24
+ ## 2. Non-Goals & Boundary Constraints
25
+
26
+ - **What NOT to do:**
27
+ - Do NOT produce superficial line-count summaries without evaluating architectural health.
28
+ - Do NOT perform full-corpus reading of monolithic files into LLM context window.
29
+ - Do NOT report quality violations without referencing exact file paths and line spans.
30
+ - **Sibling Skill Boundaries:**
31
+ - senior-code-review evaluates pull request diffs; repo-quality-audit inspects holistic codebase architecture across 6 dimensions.
32
+
33
+ ---
34
+
35
+ ## 3. Ordered Execution Workflow
36
+
10
37
  Audit an entire repository like the senior engineer who just inherited it and will be paged when it breaks.
11
38
  Prioritize: **Correctness -> Safety -> Scale -> Tests -> Speed -> Lean**.
12
39
  Always rank issues and provide a clear **"Fix this first"** verdict.
13
40
 
14
41
  ---
15
42
 
16
- ## 1. Mapping the Codebase First
43
+ ### Mapping the Codebase First
17
44
 
18
45
  Before diagnosing defects:
19
46
  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`).
@@ -26,7 +53,7 @@ Before diagnosing defects:
26
53
 
27
54
  ---
28
55
 
29
- ## 2. Six Audit Dimensions
56
+ ### Six Audit Dimensions
30
57
 
31
58
  | Dimension | Inspection Focus | Red Flags |
32
59
  |---|---|---|
@@ -39,7 +66,7 @@ Before diagnosing defects:
39
66
 
40
67
  ---
41
68
 
42
- ## 3. Reporting Structure
69
+ ### Reporting Structure
43
70
 
44
71
  1. **Overview & Assumptions:**
45
72
  - What this codebase does
@@ -55,7 +82,7 @@ Before diagnosing defects:
55
82
 
56
83
  ---
57
84
 
58
- ## 4. Complementary Hub Tools
85
+ ### Complementary Hub Tools
59
86
 
60
87
  - `python3 tools/analyze_project.py` — 5-in-1 automated health audit and AST repo map.
61
88
  - `python3 tools/verify_all.py` — 10 Quality Gates DoD gatekeeper.
@@ -63,6 +90,22 @@ Before diagnosing defects:
63
90
 
64
91
  ---
65
92
 
66
- ## 5. Attribution
93
+ ### Attribution
67
94
 
68
95
  Adapted from **ponytail-audit** (https://github.com/DietrichGebert/ponytail) — MIT License, Copyright (c) 2026 DietrichGebert. Re-architected for Enterprise QA and Synapse Hub Standards.
96
+
97
+ ---
98
+
99
+ ## 4. Verification Points & DoD
100
+
101
+ 1. Codebase mapped via AST / repo_map before auditing.
102
+ 2. Audit covers architecture, Clean POM separation, test coverage, security, and technical debt.
103
+ 3. Findings prioritized by severity with actionable remediation steps.
104
+
105
+ ---
106
+
107
+ ## 5. Handoff Protocol
108
+
109
+ - **Deliverables:** Comprehensive repository quality audit report (`PROJECT_HEALTH_REPORT.md`) and debt catalog.
110
+ - **Next Subagent:** orchestrator
111
+ - **Output Format:** Clean POM code, structured JSON telemetry, or validated markdown handoff.
@@ -3,17 +3,44 @@ name: senior-code-review
3
3
  description: "Review code changes across logic, security, concurrency, and test coverage. Use when conducting pull request reviews, diff inspections, or auditing commit changes before merge."
4
4
  category: architecture_and_analysis
5
5
  version: "1.1.0"
6
+ policies:
7
+ network: none
8
+ shell: read-only
9
+ filesystem: read-only
6
10
  ---
7
-
8
11
  # Senior Code Review — Enterprise Quality & Lean Diff Review
9
12
 
13
+ > **Author Attribution & MIT License Guard:** Synapse Hub is open-source software created by **Thế Vị (@TeeVee98)** (<https://github.com/TeeVee98/Synapse-Hub>) under the MIT License.
14
+
15
+ ---
16
+
17
+ ## 1. Trigger & Activation
18
+
19
+ - **Trigger Clause:** Review code changes across logic, security, concurrency, and test coverage. Use when conducting pull request reviews, diff inspections, or auditing commit changes before merge.
20
+ - **Activation Scope:** Domain workflows for `08-code-quality` involving `senior-code-review`.
21
+
22
+ ---
23
+
24
+ ## 2. Non-Goals & Boundary Constraints
25
+
26
+ - **What NOT to do:**
27
+ - Do NOT approve code containing fake passes, swallowed exceptions, or static sleeps.
28
+ - Do NOT nitpick subjective formatting preferences that automated linters already handle.
29
+ - Do NOT review diffs without inspecting callers and impact blast radius.
30
+ - **Sibling Skill Boundaries:**
31
+ - repo-quality-audit audits entire repos; senior-code-review performs 6-pillar inspection on active git diffs and PRs.
32
+
33
+ ---
34
+
35
+ ## 3. Ordered Execution Workflow
36
+
10
37
  Review code changes like the senior engineer who will be paged at 2 AM when it breaks.
11
38
  Order of importance: **Correctness -> Safety -> Scale -> Tests -> Speed -> Lean**.
12
39
  Lean still matters: every extra line must be read, tested, and fixed later.
13
40
 
14
41
  ---
15
42
 
16
- ## 1. Understand First
43
+ ### Understand First
17
44
 
18
45
  - **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
46
  - **Read Beyond the Diff:** Read the diff, then read the code it touches:
@@ -25,7 +52,7 @@ Lean still matters: every extra line must be read, tested, and fixed later.
25
52
 
26
53
  ---
27
54
 
28
- ## 2. Six Core Review Pillars
55
+ ### Six Core Review Pillars
29
56
 
30
57
  ### 1. Bug & Edge Cases
31
58
  - Wrong calculation, crash, or unhandled edge cases (empty collections, zero values, timezone drift, string encoding).
@@ -64,7 +91,7 @@ Lean still matters: every extra line must be read, tested, and fixed later.
64
91
 
65
92
  ---
66
93
 
67
- ## 3. The 4-Angle Cleanup Model (`simplify`)
94
+ ### The 4-Angle Cleanup Model (`simplify`)
68
95
 
69
96
  > Adapted from the Claude Codex `simplify` plugin. Evaluate every diff through four independent cleanup lenses before accepting changes:
70
97
 
@@ -77,10 +104,11 @@ Lean still matters: every extra line must be read, tested, and fixed later.
77
104
 
78
105
  ---
79
106
 
80
- ## 4. Concrete Reporting Format
107
+ ### Concrete Reporting Format
81
108
 
82
109
  Every finding **must** have a concrete, reproducible failure scenario:
83
110
 
111
+ <!-- classification: illustrative -->
84
112
  ```markdown
85
113
  #### [Severity: Must fix | Should fix | Nice to have] <Finding Title> (`<file>:<line>`)
86
114
  - **What this is:** <One concise sentence describing the touched code>
@@ -91,9 +119,10 @@ Every finding **must** have a concrete, reproducible failure scenario:
91
119
 
92
120
  ---
93
121
 
94
- ## 5. Automation CLI
122
+ ### Automation CLI
95
123
 
96
124
  Run the automated senior review tool on your current working tree:
125
+ <!-- classification: illustrative -->
97
126
  ```bash
98
127
  python3 tools/senior_code_review.py # Review uncommitted changes
99
128
  python3 tools/senior_code_review.py --staged # Review staged git changes
@@ -103,6 +132,22 @@ python3 tools/senior_code_review.py --output-md REVIEW_REPORT.md # Export to ma
103
132
 
104
133
  ---
105
134
 
106
- ## 6. Attribution
135
+ ### Attribution
107
136
 
108
137
  Adapted from **ponytail-review** (https://github.com/DietrichGebert/ponytail) — MIT License, Copyright (c) 2026 DietrichGebert, and **claude-codex-settings / simplify** (Apache-2.0 / MIT). Re-architected for Enterprise QA, Clean POM, and Synapse Hub Quality Gates.
138
+
139
+ ---
140
+
141
+ ## 4. Verification Points & DoD
142
+
143
+ 1. Code diff evaluated across 6 pillars (Architecture, Clean POM, Tests, Security, Performance, Lean Dev).
144
+ 2. Zero raw locators in test scripts and zero secret leaks confirmed.
145
+ 3. Review verdict issued with constructive, actionable pair-programming feedback.
146
+
147
+ ---
148
+
149
+ ## 5. Handoff Protocol
150
+
151
+ - **Deliverables:** Senior code review assessment report with line-specific recommendations.
152
+ - **Next Subagent:** quality-gatekeeper
153
+ - **Output Format:** Clean POM code, structured JSON telemetry, or validated markdown handoff.