@teevee98/synapse-hub 4.2.0 → 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 (107) hide show
  1. package/.agents/skills/01-web-automation/auth-session-and-cookie-manager/SKILL.md +46 -2
  2. package/.agents/skills/01-web-automation/bats-testing-patterns/SKILL.md +49 -4
  3. package/.agents/skills/01-web-automation/clean-pom-crafter/SKILL.md +56 -66
  4. package/.agents/skills/01-web-automation/e2e-testing-patterns/SKILL.md +48 -3
  5. package/.agents/skills/01-web-automation/katalon-cli-runner/SKILL.md +56 -11
  6. package/.agents/skills/01-web-automation/lam-script-generator/SKILL.md +49 -7
  7. package/.agents/skills/01-web-automation/mobile-appium-som/SKILL.md +54 -11
  8. package/.agents/skills/01-web-automation/playwright-live-interaction/SKILL.md +48 -90
  9. package/.agents/skills/01-web-automation/playwright-webapp-testing/SKILL.md +53 -10
  10. package/.agents/skills/01-web-automation/web-agent-gym-benchmarking/SKILL.md +44 -3
  11. package/.agents/skills/02-test-design/architecture-decision-records/SKILL.md +49 -8
  12. package/.agents/skills/02-test-design/gherkin-to-suite/SKILL.md +49 -8
  13. package/.agents/skills/02-test-design/rbt-manual-testing/SKILL.md +49 -7
  14. package/.agents/skills/02-test-design/review-spec/SKILL.md +46 -5
  15. package/.agents/skills/02-test-design/tot-exploratory-testing/SKILL.md +44 -3
  16. package/.agents/skills/03-api-and-contracts/api-network-mocking-interception/SKILL.md +50 -4
  17. package/.agents/skills/03-api-and-contracts/api-spec-to-e2e-matrix/SKILL.md +47 -6
  18. package/.agents/skills/03-api-and-contracts/consumer-driven-contract-testing/SKILL.md +79 -34
  19. package/.agents/skills/04-performance-and-load/backend-load-and-stress-patterns/SKILL.md +47 -4
  20. package/.agents/skills/04-performance-and-load/lean-impact-scoreboard/SKILL.md +46 -5
  21. package/.agents/skills/04-performance-and-load/web-vitals-and-performance-profiler/SKILL.md +44 -2
  22. package/.agents/skills/05-security-and-compliance/security-dast-sentinel/SKILL.md +57 -13
  23. package/.agents/skills/05-security-and-compliance/skillspector-security-guard/SKILL.md +45 -4
  24. package/.agents/skills/05-security-and-compliance/wcag-audit-patterns/SKILL.md +48 -3
  25. package/.agents/skills/06-healing-and-resilience/agentless-qa-repair/SKILL.md +45 -4
  26. package/.agents/skills/06-healing-and-resilience/antigravity-test-sentinel/SKILL.md +47 -5
  27. package/.agents/skills/06-healing-and-resilience/failure-autopsy-and-healing/SKILL.md +48 -7
  28. package/.agents/skills/06-healing-and-resilience/flaky-test-sentinel-and-quarantine/SKILL.md +54 -23
  29. package/.agents/skills/06-healing-and-resilience/self-healing-locator/SKILL.md +46 -5
  30. package/.agents/skills/06-healing-and-resilience/systematic-debugging/SKILL.md +50 -9
  31. package/.agents/skills/06-healing-and-resilience/test-driven-development/SKILL.md +52 -11
  32. package/.agents/skills/06-healing-and-resilience/verification-before-completion/SKILL.md +52 -11
  33. package/.agents/skills/06-healing-and-resilience/visual-regression-sentinel/SKILL.md +47 -4
  34. package/.agents/skills/07-data-and-state/db-state-verifier-and-seeder/SKILL.md +50 -4
  35. package/.agents/skills/07-data-and-state/file-and-report-validator/SKILL.md +47 -3
  36. package/.agents/skills/07-data-and-state/synthetic-test-data-generator/SKILL.md +52 -4
  37. package/.agents/skills/08-code-quality/code-refactoring-refactor-clean/SKILL.md +51 -10
  38. package/.agents/skills/08-code-quality/graphify-impact-analyzer/SKILL.md +78 -34
  39. package/.agents/skills/08-code-quality/graphify-impact-analyzer/examples/dependency_blast_radius.json +3 -4
  40. package/.agents/skills/08-code-quality/lean-code-ladder/SKILL.md +49 -9
  41. package/.agents/skills/08-code-quality/repo-quality-audit/SKILL.md +45 -5
  42. package/.agents/skills/08-code-quality/senior-code-review/SKILL.md +48 -6
  43. package/.agents/skills/08-code-quality/surgical-coding-principles/SKILL.md +49 -9
  44. package/.agents/skills/08-code-quality/technical-debt-harvester/SKILL.md +47 -4
  45. package/.agents/skills/09-ci-and-devops/github-actions-templates/SKILL.md +48 -16
  46. package/.agents/skills/09-ci-and-devops/github-actions-templates/examples/matrix_test_pipeline.yml +2 -1
  47. package/.agents/skills/10-agent-orchestration/actor-qa-swarm/SKILL.md +44 -3
  48. package/.agents/skills/10-agent-orchestration/agent-orchestration-multi-agent-optimize/SKILL.md +47 -6
  49. package/.agents/skills/10-agent-orchestration/event-stream-qa-orchestrator/SKILL.md +44 -3
  50. package/.agents/skills/10-agent-orchestration/persistent-planning-files/SKILL.md +52 -12
  51. package/.agents/skills/10-agent-orchestration/qa-memory-os/SKILL.md +45 -4
  52. package/.agents/skills/11-ai-and-prompting/meta-prompt-crafter/SKILL.md +51 -9
  53. package/.agents/skills/11-ai-and-prompting/mipro-prompt-compiler/SKILL.md +44 -3
  54. package/.agents/skills/11-ai-and-prompting/qa-aci-interface/SKILL.md +44 -3
  55. package/.agents/skills/11-ai-and-prompting/token-and-context-optimizer/SKILL.md +49 -8
  56. package/.cursor/rules/synapse-qa.mdc +20 -7
  57. package/.cursorrules +19 -5
  58. package/.windsurfrules +18 -3
  59. package/AGENTS.md +51 -65
  60. package/CLAUDE.md +38 -24
  61. package/README.en.md +2 -2
  62. package/README.md +2 -2
  63. package/agentskills.json +1 -1
  64. package/docs/ARCHITECTURE.en.md +1 -1
  65. package/docs/ARCHITECTURE.md +1 -1
  66. package/docs/CLIENT_SUPPORT_MATRIX.md +44 -0
  67. package/docs/SIDE_EFFECTING_TOOLS_INVENTORY.md +233 -0
  68. package/package.json +1 -1
  69. package/plugin.json +1 -1
  70. package/skills_manifest.json +1 -1
  71. package/synapse.config.json +1 -1
  72. package/templates/ai_bridges/CLAUDE.md +29 -26
  73. package/templates/ai_bridges/copilot-instructions.md +14 -5
  74. package/templates/ai_bridges/cursor_synapse_qa.mdc +16 -7
  75. package/templates/ai_bridges/windsurfrules +14 -3
  76. package/tools/TOOLS_RUNBOOK.md +1 -1
  77. package/tools/__init__.py +1 -1
  78. package/tools/api_fuzzer.py +295 -41
  79. package/tools/benchmark_swarm_context.py +11 -4
  80. package/tools/browser_helpers.js +2 -2
  81. package/tools/cli.py +4 -4
  82. package/tools/core/bm25_retriever.py +1 -1
  83. package/tools/core/i18n.py +1 -1
  84. package/tools/core/provider_usage_adapter.py +66 -0
  85. package/tools/core/token_estimator.py +39 -1
  86. package/tools/count_tokens.py +2 -2
  87. package/tools/dashboard_generator.py +8 -8
  88. package/tools/db_sandbox.py +182 -43
  89. package/tools/distill_log.py +1 -1
  90. package/tools/distill_skill.py +17 -2
  91. package/tools/git_pre_commit_guard.py +190 -1
  92. package/tools/mcp_docx_server.py +1 -1
  93. package/tools/mcp_excel_server.py +1 -1
  94. package/tools/mcp_server.py +33 -5
  95. package/tools/micro_mutator.py +30 -1
  96. package/tools/pentest_scope_guard.py +288 -15
  97. package/tools/project_state.py +29 -5
  98. package/tools/reversible_sandbox.py +58 -13
  99. package/tools/rules_router.py +80 -27
  100. package/tools/skill_canonical_digest.py +60 -2
  101. package/tools/sync_agent_rules.py +187 -61
  102. package/tools/task_memory_manager.py +16 -1
  103. package/tools/ui_server.py +3 -1
  104. package/tools/update_sentinel.py +3 -3
  105. package/tools/validate_skills_schema.py +349 -56
  106. package/tools/verify_all.py +96 -2
  107. package/tools/welcome_page.py +1 -1
@@ -10,12 +10,36 @@ policies:
10
10
  ---
11
11
  # QA Test Memory OS Skill — Hierarchical Persistent Memory
12
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:** Hierarchical 3-tier memory operating system for test automation: Core Memory blocks, Recall step logs, and Archival semantic store with AUT version scoping. Use when managing long-term test session state, auth tokens, and preventing context rot.
20
+ - **Activation Scope:** Domain workflows for `10-agent-orchestration` involving `qa-memory-os`.
21
+
22
+ ---
23
+
24
+ ## 2. Non-Goals & Boundary Constraints
25
+
26
+ - **What NOT to do:**
27
+ - Do NOT store large binary artifacts or full repository files in memory databases.
28
+ - Do NOT persist sensitive authentication tokens or plaintext passwords in memory caches.
29
+ - Do NOT allow episodic memory caches to grow unbounded without retention limits.
30
+ - **Sibling Skill Boundaries:**
31
+ - persistent-planning-files stores human-readable markdown state; qa-memory-os manages 3-tier episodic and semantic SQLite memory.
32
+
33
+ ---
34
+
35
+ ## 3. Ordered Execution Workflow
36
+
13
37
  > **Paradigm Attribution:** Inspired by **Letta AI / UC Berkeley SkyLab (MemGPT & MemFS)**.
14
38
  > **Core Principle:** Replace flat SQLite caches with a disciplined 3-tier memory operating system. Eliminate memory rot across application versions by tagging locator mutations and flaky histories with explicit AUT release versions.
15
39
 
16
40
  ---
17
41
 
18
- ## 1. The 3-Tier Architecture
42
+ ### The 3-Tier Architecture
19
43
 
20
44
  ```mermaid
21
45
  flowchart TD
@@ -46,10 +70,11 @@ flowchart TD
46
70
 
47
71
  ---
48
72
 
49
- ## 2. CLI Tool Usage
73
+ ### CLI Tool Usage
50
74
 
51
75
  Autonomous commands via `tools/test_memory_os.py`:
52
76
 
77
+ <!-- classification: illustrative -->
53
78
  ```bash
54
79
  # 1. Initialize memory OS database
55
80
  python tools/test_memory_os.py init --db-path .agent_memory/qa_memory.db
@@ -79,7 +104,7 @@ python tools/test_memory_os.py gc --scrub-secrets --max-age-days 30
79
104
 
80
105
  ---
81
106
 
82
- ## 3. Session Lifecycle & Teardown Protocol
107
+ ### Session Lifecycle & Teardown Protocol
83
108
 
84
109
  ```mermaid
85
110
  flowchart LR
@@ -94,9 +119,25 @@ flowchart LR
94
119
 
95
120
  ---
96
121
 
97
- ## 4. Strict Operating Invariants
122
+ ### Strict Operating Invariants
98
123
 
99
124
  - **Zero Plaintext Secrets:** Automatic regex masking for passwords, bearer tokens, and private keys (`[MASKED_SECRET]`). Only non-sensitive metadata (hash reference, expiry timestamp, role) may be persisted.
100
125
  - **Session Cleanup Protocol:** Ephemeral storage state files and expired memory blocks must be purged during teardown via GC daemon (`tools/test_memory_os.py gc --scrub-secrets`).
101
126
  - **Memory File Ceiling:** DB size strictly maintained under **50MB**.
102
127
  - **Version Isolation:** Never apply archival locator patches across different incompatible AUT major versions.
128
+
129
+ ---
130
+
131
+ ## 4. Verification Points & DoD
132
+
133
+ 1. Memory records indexed with task type, error signature, and resolution patch.
134
+ 2. Lookups retrieve relevant historical patterns in sub-second query latency.
135
+ 3. Sensitive data filtered before caching.
136
+
137
+ ---
138
+
139
+ ## 5. Handoff Protocol
140
+
141
+ - **Deliverables:** Episodic memory database (`~/.agent_memory/global_cache.db`), memory query logs, and pattern index.
142
+ - **Next Subagent:** orchestrator
143
+ - **Output Format:** Clean POM code, structured JSON telemetry, or validated markdown handoff.
@@ -10,13 +10,37 @@ policies:
10
10
  ---
11
11
  # Meta-Prompt Crafter — Production-Grade Prompt Engineering Engine
12
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:** Meta-prompt engineer transforming rough human requests into high-fidelity, production-grade prompts for ChatGPT, Gemini, Claude, Midjourney, and Coding AIs. Use when the user asks to write, design, refine, or optimize a prompt for another AI.
20
+ - **Activation Scope:** Domain workflows for `11-ai-and-prompting` involving `meta-prompt-crafter`.
21
+
22
+ ---
23
+
24
+ ## 2. Non-Goals & Boundary Constraints
25
+
26
+ - **What NOT to do:**
27
+ - Do NOT craft ambiguous prompts lacking explicit output formats and boundary constraints.
28
+ - Do NOT bloat prompts with redundant conversational filler (eliminate AI slop).
29
+ - Do NOT deploy prompts without testing against edge cases and negative inputs.
30
+ - **Sibling Skill Boundaries:**
31
+ - mipro-prompt-compiler compiles and optimizes prompts algorithmicly; meta-prompt-crafter synthesizes high-fidelity prompt architectures from intents.
32
+
33
+ ---
34
+
35
+ ## 3. Ordered Execution Workflow
36
+
13
37
  The **Meta-Prompt Crafter** skill transforms unstructured, high-level user ideas into production-ready, highly effective prompts optimized for specific target LLMs and multimodal AI systems (ChatGPT, Gemini, Claude, Midjourney, Cursor, Copilot).
14
38
 
15
39
  > **Core Invariant:** The Meta-Prompt Crafter's sole mission is to craft the prompt itself. It **never** executes the prompt on behalf of the target AI or answers the underlying user query directly.
16
40
 
17
41
  ---
18
42
 
19
- ## 1. Operating Lifecycle (3-Step Pipeline)
43
+ ### Operating Lifecycle (3-Step Pipeline)
20
44
 
21
45
  ```mermaid
22
46
  flowchart TD
@@ -29,7 +53,7 @@ flowchart TD
29
53
 
30
54
  ---
31
55
 
32
- ## 2. Step 1: Intent Scoping (4 Pillars)
56
+ ### Step 1: Intent Scoping (4 Pillars)
33
57
 
34
58
  Before drafting any prompt, extract 4 fundamental dimensions:
35
59
  1. **Target AI:** (ChatGPT, Gemini, Claude, Midjourney, Cursor, Local LLM). *Default: Universal Conversational Text LLM if unspecified.*
@@ -41,7 +65,7 @@ Before drafting any prompt, extract 4 fundamental dimensions:
41
65
 
42
66
  ---
43
67
 
44
- ## 3. Step 2: Prompt Synthesis Frameworks
68
+ ### Step 2: Prompt Synthesis Frameworks
45
69
 
46
70
  ### A. For Conversational & Text LLMs (ChatGPT, Claude, Gemini)
47
71
  Synthesize prompts using the standardized **7-Part Architecture**:
@@ -75,7 +99,7 @@ Specify:
75
99
 
76
100
  ---
77
101
 
78
- ## 4. Step 3: Self-Audit & Emission Standard
102
+ ### Step 3: Self-Audit & Emission Standard
79
103
 
80
104
  Before outputting to the user, enforce:
81
105
  - **Fidelity:** 100% true to user intent without speculative unrequested scope creep.
@@ -84,14 +108,16 @@ Before outputting to the user, enforce:
84
108
 
85
109
  ---
86
110
 
87
- ## 5. Standard Output Format (Mandatory Structure)
111
+ ### Standard Output Format (Mandatory Structure)
88
112
 
89
113
  Every response from Meta-Prompt Crafter must follow this strict 3-part layout:
90
114
 
115
+ <!-- classification: illustrative -->
91
116
  ````markdown
92
- ```markdown
93
- [COMPLETE COPY-PASTE READY PROMPT HERE]
94
117
  ```
118
+ [COMPLETE COPY-PASTE READY PROMPT HERE]
119
+ <!-- classification: illustrative -->
120
+ ```text
95
121
 
96
122
  **Ghi chú:**
97
123
  - **Giả định đã áp dụng:** [Các giả định ngắn gọn nếu đề bài còn mở]
@@ -100,13 +126,29 @@ Every response from Meta-Prompt Crafter must follow this strict 3-part layout:
100
126
 
101
127
  ---
102
128
  *Bạn muốn tinh chỉnh bản này ngắn gọn hơn (Compact) hay mở rộng chuyên sâu hơn (Advanced)?*
103
- ````
129
+ ```
104
130
 
105
131
  ---
106
132
 
107
- ## 6. Prompt Refinement & Iteration Protocol
133
+ ### Prompt Refinement & Iteration Protocol
108
134
 
109
135
  When the user returns with suboptimal output from the target AI (e.g., *"ChatGPT trả lời dài dòng quá"*, *"Claude hiểu sai ý phần B"*):
110
136
  1. **Diagnose Root Cause:** Identify whether drift stemmed from missing context, ambiguous constraints, lack of negative examples, or unstructured formatting.
111
137
  2. **Issue Refined Patch:** Provide the updated prompt inside a clean code block.
112
138
  3. **Changelog Summary:** Briefly highlight the exact 1-2 changes made to resolve the drift.
139
+
140
+ ---
141
+
142
+ ## 4. Verification Points & DoD
143
+
144
+ 1. Prompt defines clear persona, scope, invariants, output schema, and few-shot examples.
145
+ 2. Token footprint optimized for target LLM context window.
146
+ 3. Evaluation confirms consistent output format adherence across test runs.
147
+
148
+ ---
149
+
150
+ ## 5. Handoff Protocol
151
+
152
+ - **Deliverables:** Production-ready prompt templates, few-shot demonstration sets, and prompt evaluation scorecard.
153
+ - **Next Subagent:** orchestrator
154
+ - **Output Format:** Clean POM code, structured JSON telemetry, or validated markdown handoff.
@@ -10,12 +10,36 @@ policies:
10
10
  ---
11
11
  # MIPROv2 Prompt Compiler Skill — Bayesian Few-Shot & Assertion Optimization
12
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:** MIPROv2 Bayesian teleprompter optimizer and few-shot compiler tuning prompt instructions against AST mutation kill scores. Use when optimizing QA prompts or compiling few-shot assertion generators.
20
+ - **Activation Scope:** Domain workflows for `11-ai-and-prompting` involving `mipro-prompt-compiler`.
21
+
22
+ ---
23
+
24
+ ## 2. Non-Goals & Boundary Constraints
25
+
26
+ - **What NOT to do:**
27
+ - Do NOT optimize prompts without an objective, measurable evaluation metric.
28
+ - Do NOT overfit prompt candidates to small or biased training datasets.
29
+ - Do NOT deploy compiled prompts without evaluating regression performance.
30
+ - **Sibling Skill Boundaries:**
31
+ - meta-prompt-crafter crafts initial prompt architectures; mipro-prompt-compiler applies Bayesian optimization to tune prompt instructions and demonstrations.
32
+
33
+ ---
34
+
35
+ ## 3. Ordered Execution Workflow
36
+
13
37
  > **Paradigm Attribution:** Inspired by **Stanford NLP DSPy v2 (MIPROv2 Teleprompter) & Optuna TPE**.
14
38
  > **Core Principle:** Transition from subjective handcrafted prompting to algorithmic Bayesian compilation. Tune instruction phrasing and select the highest-leverage few-shot demonstrations to maximize AST mutant detection ($\ge 85\%$) while keeping token footprint under 800 tokens.
15
39
 
16
40
  ---
17
41
 
18
- ## 1. The MIPROv2 Compilation Pipeline
42
+ ### The MIPROv2 Compilation Pipeline
19
43
 
20
44
  ```mermaid
21
45
  flowchart LR
@@ -39,10 +63,11 @@ flowchart LR
39
63
 
40
64
  ---
41
65
 
42
- ## 2. CLI Tool Usage
66
+ ### CLI Tool Usage
43
67
 
44
68
  Autonomous commands via `tools/mipro_assertion_tuner.py`:
45
69
 
70
+ <!-- classification: illustrative -->
46
71
  ```bash
47
72
  # 1. Compile and optimize assertion generation prompt
48
73
  python tools/mipro_assertion_tuner.py compile-module \
@@ -57,8 +82,24 @@ python tools/mipro_assertion_tuner.py evaluate \
57
82
 
58
83
  ---
59
84
 
60
- ## 3. Strict Operating Invariants
85
+ ### Strict Operating Invariants
61
86
 
62
87
  - **Mutation Score Hard Floor:** Prompts must achieve a minimum mutant kill rate of **85%**.
63
88
  - **Token Ceiling:** Compiled prompts must not exceed **800 tokens**.
64
89
  - **No Handcrafted Drift:** Do not manually edit compiled JSON modules; re-run `compile-module` when requirements evolve.
90
+
91
+ ---
92
+
93
+ ## 4. Verification Points & DoD
94
+
95
+ 1. MIPROv2 optimization cycle evaluates candidate instructions and demo sets.
96
+ 2. Compiled prompt achieves higher task accuracy score than baseline prompt.
97
+ 3. Evaluation results recorded with clear test-set provenance.
98
+
99
+ ---
100
+
101
+ ## 5. Handoff Protocol
102
+
103
+ - **Deliverables:** Compiled prompt candidate, optimization trajectory log, and evaluation scorecard.
104
+ - **Next Subagent:** orchestrator
105
+ - **Output Format:** Clean POM code, structured JSON telemetry, or validated markdown handoff.
@@ -10,12 +10,36 @@ policies:
10
10
  ---
11
11
  # QA Agent-Computer Interface (ACI) Skill — Context-Safe Code Editing
12
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:** Safe Agent-Computer Interface for inspecting code windows (40-50 lines), surgical editing with pre-commit AST checks, and distilled test execution. Use when inspecting, editing, or refactoring code without context blowout.
20
+ - **Activation Scope:** Domain workflows for `11-ai-and-prompting` involving `qa-aci-interface`.
21
+
22
+ ---
23
+
24
+ ## 2. Non-Goals & Boundary Constraints
25
+
26
+ - **What NOT to do:**
27
+ - Do NOT expose raw unconstrained shell access when restricted ACI tools suffice.
28
+ - Do NOT execute tool actions without validating input arguments and paths.
29
+ - Do NOT emit non-deterministic tool outputs that confuse LLM reasoning loops.
30
+ - **Sibling Skill Boundaries:**
31
+ - actor-qa-swarm manages agent actors; qa-aci-interface provides deterministic Agent-Computer Interface primitives (read, edit, execute).
32
+
33
+ ---
34
+
35
+ ## 3. Ordered Execution Workflow
36
+
13
37
  > **Paradigm Attribution:** Inspired by **Princeton NLP / Stanford SWE-agent ACI**.
14
38
  > **Core Principle:** Prevent context window blowout and hallucinated edits by enforcing bounded file viewing (40–50 lines), surgical contiguous chunk replacements with AST syntax validation, and log distillation.
15
39
 
16
40
  ---
17
41
 
18
- ## 1. The Three ACI Primitives
42
+ ### The Three ACI Primitives
19
43
 
20
44
  ```mermaid
21
45
  flowchart LR
@@ -39,10 +63,11 @@ flowchart LR
39
63
 
40
64
  ---
41
65
 
42
- ## 2. CLI Tool Usage
66
+ ### CLI Tool Usage
43
67
 
44
68
  Autonomous commands via `tools/swe_qa_aci.py`:
45
69
 
70
+ <!-- classification: illustrative -->
46
71
  ```bash
47
72
  # 1. View 40 lines starting at line 20
48
73
  python tools/swe_qa_aci.py view-window \
@@ -65,8 +90,24 @@ python tools/swe_qa_aci.py run-distilled \
65
90
 
66
91
  ---
67
92
 
68
- ## 3. Strict Operating Invariants
93
+ ### Strict Operating Invariants
69
94
 
70
95
  - **Diff Minimization:** Diff length should not exceed 30 lines per edit.
71
96
  - **Syntax Integrity:** Zero syntax errors permitted; the tool rolls back on any syntax invalidity before touching disk.
72
97
  - **No BOM Invariant:** Ensures zero `0xEF, 0xBB, 0xBF` bytes in modified files.
98
+
99
+ ---
100
+
101
+ ## 4. Verification Points & DoD
102
+
103
+ 1. Tool interfaces provide concise, deterministic schemas and clear parameter descriptions.
104
+ 2. Tool outputs return structured results with stdout, stderr, and exit codes.
105
+ 3. Path arguments validated against containment boundaries before execution.
106
+
107
+ ---
108
+
109
+ ## 5. Handoff Protocol
110
+
111
+ - **Deliverables:** ACI tool schemas, tool execution wrappers, and error handling protocols.
112
+ - **Next Subagent:** orchestrator
113
+ - **Output Format:** Clean POM code, structured JSON telemetry, or validated markdown handoff.
@@ -10,11 +10,35 @@ policies:
10
10
  ---
11
11
  # Token & Context Optimizer — Antigravity Engineering Standard
12
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:** Optimize prompt context, distill verbose logs, and prevent context rot in Antigravity. Use when optimizing prompts or reducing token and context overhead.
20
+ - **Activation Scope:** Domain workflows for `11-ai-and-prompting` involving `token-and-context-optimizer`.
21
+
22
+ ---
23
+
24
+ ## 2. Non-Goals & Boundary Constraints
25
+
26
+ - **What NOT to do:**
27
+ - Do NOT read entire monolithic source files into LLM context window when line-range reads suffice.
28
+ - Do NOT dump raw terminal build/test logs without applying log distillation filters.
29
+ - Do NOT exceed managed router token caps in minimal or standard operating modes.
30
+ - **Sibling Skill Boundaries:**
31
+ - lean-code-ladder minimizes generated code; token-and-context-optimizer optimizes consumed input context via sparse retrieval and log distillation.
32
+
33
+ ---
34
+
35
+ ## 3. Ordered Execution Workflow
36
+
13
37
  > **Purpose:** Master context engineering and token efficiency. Directs AI Agents to prevent context rot, mitigate Lost-in-the-Middle attention drops, offload large state to filesystem scratchpads, and maintain clean KV-cache alignment across long test automation sessions.
14
38
 
15
39
  ---
16
40
 
17
- ## 1. The Core Context Architecture
41
+ ### The Core Context Architecture
18
42
 
19
43
  ```mermaid
20
44
  flowchart TD
@@ -25,7 +49,7 @@ flowchart TD
25
49
 
26
50
  ---
27
51
 
28
- ## 2. Protocol 1: Sparse Context Retrieval
52
+ ### Protocol 1: Sparse Context Retrieval
29
53
 
30
54
  - **Rule:** Never read entire source files exceeding 150 lines into active context.
31
55
  - **Enforcement:**
@@ -35,21 +59,22 @@ flowchart TD
35
59
 
36
60
  ---
37
61
 
38
- ## 3. Protocol 2: Terminal Log Distiller (`tools/distill_log.py`)
62
+ ### Protocol 2: Terminal Log Distiller (`tools/distill_log.py`)
39
63
 
40
64
  - **Rule:** Never dump unparsed execution logs (KRE CLI, Playwright stdout, Gradle) into the active conversation.
41
65
  - **Enforcement:**
42
66
  - Automatically filter out passing step messages, INFO logs, and JVM loading notices.
43
67
  - Forward strictly the distilled failure block:
44
- ```text
68
+ <!-- classification: illustrative -->
69
+ ```text
45
70
  [FAILED] TC-xxx at Line <LineNumber>
46
71
  Exception: <ExceptionName> (<Message>)
47
72
  [Full raw log saved to file://<path>; verbose lines omitted]
48
- ```
73
+ ```
49
74
 
50
75
  ---
51
76
 
52
- ## 4. Protocol 3: Task Scratchpad & File-Backed Context
77
+ ### Protocol 3: Task Scratchpad & File-Backed Context
53
78
 
54
79
  - **Rule:** Do not accumulate large session state, test case inventories, or defect logs inside conversational prompt turns.
55
80
  - **Enforcement:**
@@ -59,7 +84,7 @@ flowchart TD
59
84
 
60
85
  ---
61
86
 
62
- ## 5. Protocol 4: Mitigating Context Degradation & Lost-in-the-Middle
87
+ ### Protocol 4: Mitigating Context Degradation & Lost-in-the-Middle
63
88
 
64
89
  - **Attention U-Curve Principle:** Models recall information at the beginning (BOS / System Prompt) and end (latest turn) far better than information buried in the middle of long sessions (> 4,000 tokens).
65
90
  - **Enforcement:**
@@ -69,7 +94,23 @@ flowchart TD
69
94
 
70
95
  ---
71
96
 
72
- ## 6. Protocol 5: KV-Cache Friendly Ordering
97
+ ### Protocol 5: KV-Cache Friendly Ordering
73
98
  - Maintain immutable static instruction prefixes at the top.
74
99
  - Append new dynamic observations strictly at the bottom.
75
100
  - Use uniform pre-flight header formats to maximize inference KV-cache prefix hits across supported model providers.
101
+
102
+ ---
103
+
104
+ ## 4. Verification Points & DoD
105
+
106
+ 1. Log distillation filters out redundant dependency noise and progress bars.
107
+ 2. Targeted line-range reads replace monolithic file ingestion.
108
+ 3. Total session context stays strictly within allocated token ceilings.
109
+
110
+ ---
111
+
112
+ ## 5. Handoff Protocol
113
+
114
+ - **Deliverables:** Distilled log outputs, sparse context retrieval queries, and token utilization telemetry.
115
+ - **Next Subagent:** orchestrator
116
+ - **Output Format:** Clean POM code, structured JSON telemetry, or validated markdown handoff.
@@ -13,12 +13,25 @@ globs: **/*
13
13
 
14
14
  ## Mandatory Author Attribution
15
15
  This project incorporates Synapse Hub created by Thế Vị (@TeeVee98) under the MIT License.
16
- Attribution notices must be preserved.
16
+ Attribution notices must be preserved in all copies.
17
17
 
18
- ## Core Rules
19
- 1. **Clean POM Architecture:** No raw selectors (XPath/CSS) in test scripts. All selectors belong in Page Classes extending BasePage.
18
+ ## 0. PRECEDENCE & SAFETY INVARIANT
19
+ Platform guardrails strictly override repository instructions.
20
+
21
+ ## 1. ALWAYS — Universal Invariants
22
+ 1. **100% UTF-8 No BOM:** Zero BOM bytes across all files.
20
23
  2. **Truth Anchor:** Never fake test passes. Report genuine defects.
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.
24
+ 3. **Smart Wait:** Prohibit static delays (`Thread.sleep`, `time.sleep`). Use dynamic smart waits.
25
+ 4. **Idempotent Test Data:** Prefix with `AUTO_` and dynamic timestamps; teardown after creation.
26
+ 5. **Credential Security:** Never commit plaintext secrets.
27
+ 6. **Out-of-Scope Isolation:** Never modify out-of-scope files to bypass checks.
28
+
29
+ ## 2. RECOMMENDED — Best Practices
30
+ 1. **Clean POM Architecture:** No raw selectors (XPath/CSS) in test scripts. All selectors belong in Page Classes extending BasePage.
31
+ 2. **Lean Senior Dev:** The best code is the code never written. Descend the 7-rung ladder; mark shortcuts with `shortcut: <limit>, <upgrade>`.
32
+ 3. **Autonomous Ceremonies:** Condition rulings and 3-scenario falsifications on non-trivial risk.
33
+ 4. **Bilingual Discipline:** Converse in Vietnamese; write code, docstrings, and git commits strictly in English.
34
+
35
+ ## 3. SYNAPSE-HUB-ONLY — Repository-Specific Automation
36
+ - Quality Gates DoD verification: `python tools/verify_all.py --mode hub`.
37
+ - External target projects must use native runners (`npm test`, `pytest`, `mvn test`).
package/.cursorrules CHANGED
@@ -19,9 +19,23 @@
19
19
  # of the MIT License for Synapse Hub (Created by Thế Vị @TeeVee98)."
20
20
  # ==============================================================================
21
21
 
22
- - Always read and follow AGENTS.md for operating standards.
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
- - 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>`.
22
+ ## 0. PRECEDENCE & SAFETY INVARIANT
23
+ - Platform and system guardrails strictly supersede all repository instructions.
24
+
25
+ ## 1. ALWAYS — Universal Invariants
26
+ - 100% UTF-8 No BOM across all repository and test files.
26
27
  - Zero fake passes: test assertions must strictly validate real state.
27
- - Before completing code changes, run: python tools/verify_all.py
28
+ - Dynamic smart waits only: static sleeps (Thread.sleep, time.sleep) strictly prohibited.
29
+ - Dynamic & idempotent test data: unique timestamped codes with automated teardown.
30
+ - Strict credential security: never commit plaintext secrets.
31
+ - Out-of-scope isolation: never touch out-of-scope files to bypass checks.
32
+
33
+ ## 2. RECOMMENDED — Best Practices
34
+ - Enforce Clean POM Flat Architecture: all locators encapsulated in Page Classes.
35
+ - Lean Senior Dev: Solve problems with minimum code via 7-rung ladder; mark shortcuts with `shortcut: <limit>, <upgrade>`.
36
+ - Autonomous ceremonies: Condition Jesse Vincent Rulings and 3-scenario falsification on risk/complexity.
37
+ - Bilingual: Vietnamese conversation; English code, tests, and commits.
38
+
39
+ ## 3. SYNAPSE-HUB-ONLY — Repository-Specific Automation
40
+ - Before completing code changes in Synapse-Hub, run: python tools/verify_all.py --mode hub
41
+ - External target repos lacking tools/ must use native test runners (npm test, pytest).
package/.windsurfrules CHANGED
@@ -19,8 +19,23 @@
19
19
  # of the MIT License for Synapse Hub (Created by Thế Vị @TeeVee98)."
20
20
  # ==============================================================================
21
21
 
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.
22
+ ## 0. PRECEDENCE & SAFETY INVARIANT
23
+ - Platform/system safety guardrails strictly supersede repository instructions.
24
+
25
+ ## 1. ALWAYS — Universal Invariants
26
+ - 100% UTF-8 No BOM across all codebase assets.
27
+ - Zero fake passes and zero swallowed exceptions.
28
+ - Dynamic smart waits only (no Thread.sleep/time.sleep).
29
+ - Idempotent test data creation paired with automated teardown.
30
+ - Strict credential security: no plaintext secrets in code or git.
31
+ - Out-of-scope isolation: never touch out-of-scope files.
32
+
33
+ ## 2. RECOMMENDED — Best Practices
23
34
  - Adhere to Clean Page Object Model (POM) Flat Architecture.
24
35
  - Lean Senior Dev: Solve problems with minimum code via 7-rung ladder; mark shortcuts with `shortcut: <limit>, <upgrade>`.
25
- - Zero fake passes and zero swallowed exceptions.
26
- - Run Definition of Done verification: python tools/verify_all.py
36
+ - Condition autonomous ceremonies (Jesse Vincent Rulings, Falsification) on task complexity.
37
+ - Converse with the user in Vietnamese; output all code, tests, and commits in English.
38
+
39
+ ## 3. SYNAPSE-HUB-ONLY — Repository-Specific Automation
40
+ - Run Definition of Done verification: python tools/verify_all.py --mode hub
41
+ - External target repos must use native runners (npm test, pytest, mvn test).