@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.
- package/.agents/rules/git-push-protocol.md +2 -2
- package/.agents/skills/01-web-automation/auth-session-and-cookie-manager/SKILL.md +52 -3
- package/.agents/skills/01-web-automation/bats-testing-patterns/SKILL.md +55 -5
- package/.agents/skills/01-web-automation/clean-pom-crafter/SKILL.md +62 -67
- package/.agents/skills/01-web-automation/e2e-testing-patterns/SKILL.md +54 -4
- package/.agents/skills/01-web-automation/katalon-cli-runner/SKILL.md +62 -12
- package/.agents/skills/01-web-automation/lam-script-generator/SKILL.md +55 -8
- package/.agents/skills/01-web-automation/mobile-appium-som/SKILL.md +60 -12
- package/.agents/skills/01-web-automation/mobile-appium-som/examples/BaseScreen.java +2 -2
- package/.agents/skills/01-web-automation/mobile-appium-som/examples/LoginScreen.java +2 -2
- package/.agents/skills/01-web-automation/mobile-appium-som/examples/TC_MobileLogin.java +2 -2
- package/.agents/skills/01-web-automation/playwright-live-interaction/SKILL.md +54 -91
- package/.agents/skills/01-web-automation/playwright-webapp-testing/SKILL.md +59 -11
- package/.agents/skills/01-web-automation/web-agent-gym-benchmarking/SKILL.md +50 -4
- package/.agents/skills/02-test-design/architecture-decision-records/SKILL.md +55 -9
- package/.agents/skills/02-test-design/gherkin-to-suite/SKILL.md +55 -9
- package/.agents/skills/02-test-design/rbt-manual-testing/SKILL.md +55 -8
- package/.agents/skills/02-test-design/review-spec/SKILL.md +50 -6
- package/.agents/skills/02-test-design/tot-exploratory-testing/SKILL.md +50 -4
- package/.agents/skills/03-api-and-contracts/api-network-mocking-interception/SKILL.md +56 -5
- package/.agents/skills/03-api-and-contracts/api-spec-to-e2e-matrix/SKILL.md +53 -7
- package/.agents/skills/03-api-and-contracts/consumer-driven-contract-testing/SKILL.md +86 -36
- package/.agents/skills/04-performance-and-load/backend-load-and-stress-patterns/SKILL.md +54 -6
- package/.agents/skills/04-performance-and-load/lean-impact-scoreboard/SKILL.md +50 -6
- package/.agents/skills/04-performance-and-load/web-vitals-and-performance-profiler/SKILL.md +50 -3
- package/.agents/skills/05-security-and-compliance/security-dast-sentinel/SKILL.md +63 -14
- package/.agents/skills/05-security-and-compliance/skillspector-security-guard/SKILL.md +51 -5
- package/.agents/skills/05-security-and-compliance/wcag-audit-patterns/SKILL.md +54 -4
- package/.agents/skills/06-healing-and-resilience/agentless-qa-repair/SKILL.md +51 -5
- package/.agents/skills/06-healing-and-resilience/antigravity-test-sentinel/SKILL.md +53 -6
- package/.agents/skills/06-healing-and-resilience/failure-autopsy-and-healing/SKILL.md +54 -8
- package/.agents/skills/06-healing-and-resilience/flaky-test-sentinel-and-quarantine/SKILL.md +60 -24
- package/.agents/skills/06-healing-and-resilience/self-healing-locator/SKILL.md +52 -6
- package/.agents/skills/06-healing-and-resilience/systematic-debugging/SKILL.md +56 -10
- package/.agents/skills/06-healing-and-resilience/test-driven-development/SKILL.md +58 -12
- package/.agents/skills/06-healing-and-resilience/verification-before-completion/SKILL.md +58 -12
- package/.agents/skills/06-healing-and-resilience/visual-regression-sentinel/SKILL.md +53 -5
- package/.agents/skills/07-data-and-state/db-state-verifier-and-seeder/SKILL.md +56 -5
- package/.agents/skills/07-data-and-state/file-and-report-validator/SKILL.md +53 -4
- package/.agents/skills/07-data-and-state/synthetic-test-data-generator/SKILL.md +58 -5
- package/.agents/skills/08-code-quality/code-refactoring-refactor-clean/SKILL.md +57 -11
- package/.agents/skills/08-code-quality/graphify-impact-analyzer/SKILL.md +83 -34
- package/.agents/skills/08-code-quality/graphify-impact-analyzer/examples/dependency_blast_radius.json +3 -4
- package/.agents/skills/08-code-quality/lean-code-ladder/SKILL.md +55 -10
- package/.agents/skills/08-code-quality/repo-quality-audit/SKILL.md +49 -6
- package/.agents/skills/08-code-quality/senior-code-review/SKILL.md +52 -7
- package/.agents/skills/08-code-quality/surgical-coding-principles/SKILL.md +55 -10
- package/.agents/skills/08-code-quality/technical-debt-harvester/SKILL.md +51 -5
- package/.agents/skills/09-ci-and-devops/github-actions-templates/SKILL.md +54 -17
- package/.agents/skills/09-ci-and-devops/github-actions-templates/examples/matrix_test_pipeline.yml +2 -1
- package/.agents/skills/10-agent-orchestration/actor-qa-swarm/SKILL.md +50 -4
- package/.agents/skills/10-agent-orchestration/agent-orchestration-multi-agent-optimize/SKILL.md +53 -7
- package/.agents/skills/10-agent-orchestration/event-stream-qa-orchestrator/SKILL.md +50 -4
- package/.agents/skills/10-agent-orchestration/persistent-planning-files/SKILL.md +58 -13
- package/.agents/skills/10-agent-orchestration/qa-memory-os/SKILL.md +51 -5
- package/.agents/skills/11-ai-and-prompting/meta-prompt-crafter/SKILL.md +57 -10
- package/.agents/skills/11-ai-and-prompting/mipro-prompt-compiler/SKILL.md +50 -4
- package/.agents/skills/11-ai-and-prompting/qa-aci-interface/SKILL.md +50 -4
- package/.agents/skills/11-ai-and-prompting/token-and-context-optimizer/SKILL.md +55 -9
- package/.cursor/rules/synapse-qa.mdc +20 -7
- package/.cursorrules +19 -5
- package/.windsurfrules +18 -3
- package/AGENTS.md +51 -59
- package/CLAUDE.md +38 -24
- package/LICENSE +5 -5
- package/NOTICE +1 -1
- package/README.en.md +4 -4
- package/README.md +4 -4
- package/agentskills.json +1 -1
- package/docs/ARCHITECTURE.en.md +2 -2
- package/docs/ARCHITECTURE.md +11 -2
- package/docs/CLIENT_SUPPORT_MATRIX.md +44 -0
- package/docs/CLI_REFERENCE.en.md +6 -4
- package/docs/CLI_REFERENCE.md +1 -1
- package/docs/CONTRIBUTING.en.md +1 -1
- package/docs/CONTRIBUTING.md +2 -2
- package/docs/SIDE_EFFECTING_TOOLS_INVENTORY.md +233 -0
- package/docs/TOOL_CATALOG.md +6 -2
- package/docs/research/agent_skill_training_analysis.md +1 -1
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/skills_manifest.json +320 -55
- package/synapse.config.json +1 -1
- package/templates/ai_bridges/CLAUDE.md +29 -26
- package/templates/ai_bridges/copilot-instructions.md +14 -5
- package/templates/ai_bridges/cursor_synapse_qa.mdc +16 -7
- package/templates/ai_bridges/windsurfrules +14 -3
- package/templates/ui/index.html +2 -2
- package/tools/TOOLS_RUNBOOK.md +1 -1
- package/tools/TOOL_CATALOG.json +63 -3
- package/tools/__init__.py +1 -1
- package/tools/api_fuzzer.py +447 -132
- package/tools/author_integrity.py +121 -11
- package/tools/benchmark_swarm_context.py +130 -22
- package/tools/break_ui_generator.py +233 -0
- package/tools/browser_helpers.js +2 -2
- package/tools/check_version_sync.py +18 -50
- package/tools/cli.py +110 -19
- package/tools/core/bm25_retriever.py +218 -0
- package/tools/core/i18n.py +5 -5
- package/tools/core/provider_usage_adapter.py +383 -0
- package/tools/core/token_estimator.py +81 -15
- package/tools/count_tokens.py +7 -2
- package/tools/coverage_reporter.py +245 -0
- package/tools/dashboard_generator.py +8 -8
- package/tools/db_sandbox.py +290 -9
- package/tools/distill_log.py +1 -1
- package/tools/distill_skill.py +206 -0
- package/tools/git_pre_commit_guard.py +202 -1
- package/tools/humanize_linter.py +3 -0
- package/tools/mcp_docx_server.py +1 -1
- package/tools/mcp_excel_server.py +1 -1
- package/tools/mcp_server.py +104 -16
- package/tools/micro_mutator.py +114 -15
- package/tools/pentest_scope_guard.py +674 -58
- package/tools/perf/benchmark_perf_runner.py +42 -0
- package/tools/project_state.py +29 -5
- package/tools/reversible_sandbox.py +58 -13
- package/tools/rules_router.py +473 -60
- package/tools/security_scanner.py +80 -0
- package/tools/senior_code_review.py +14 -0
- package/tools/skill_canonical_digest.py +302 -0
- package/tools/skill_profiles.py +77 -7
- package/tools/slide_deck_exporter.py +477 -0
- package/tools/sync_agent_rules.py +187 -61
- package/tools/sync_skills_manifest.py +166 -0
- package/tools/task_memory_manager.py +275 -0
- package/tools/ui_server.py +3 -1
- package/tools/update_sentinel.py +3 -3
- package/tools/validate_host_interop.py +485 -0
- package/tools/validate_skills_schema.py +575 -0
- package/tools/verify_all.py +668 -44
- 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
79
|
+
<!-- classification: illustrative -->
|
|
80
|
+
```bash
|
|
51
81
|
synapse verify
|
|
52
|
-
|
|
82
|
+
```
|
|
53
83
|
|
|
54
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
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
|
|
19
|
-
- When
|
|
20
|
-
- Pinpoints the exact subset of Test Cases affected, reducing
|
|
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
|
-
|
|
59
|
+
#### Check Impact of Modified Page Class
|
|
60
|
+
|
|
61
|
+
<!-- classification: illustrative -->
|
|
32
62
|
```bash
|
|
33
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
104
|
+
### Phase 4: Visual Artifacts Inspection
|
|
54
105
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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.
|
|
112
|
+
## 4. Verification Points & DoD
|
|
65
113
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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.
|
|
121
|
+
## 5. Handoff Protocol
|
|
73
122
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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": "
|
|
2
|
+
"modifiedFile": "examples/playwright-crm-suite/pages/CustomerPage.ts",
|
|
3
3
|
"impactedSuites": [
|
|
4
|
-
"tests/
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|