@mrtrinhvn/ag-kit 1.0.11 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/bin/cli.js +62 -0
  4. package/package.json +7 -1
  5. package/template/.agent/rules/GEMINI.md +1 -1
  6. package/template/.agent/skills/regent-orchestrator/SKILL.md +31 -0
  7. package/template/.agent/skills/telegram-bridge/SKILL.md +30 -0
  8. package/.agent/.shared/ui-ux-pro-max/data/charts.csv +0 -26
  9. package/.agent/.shared/ui-ux-pro-max/data/colors.csv +0 -97
  10. package/.agent/.shared/ui-ux-pro-max/data/icons.csv +0 -101
  11. package/.agent/.shared/ui-ux-pro-max/data/landing.csv +0 -31
  12. package/.agent/.shared/ui-ux-pro-max/data/products.csv +0 -97
  13. package/.agent/.shared/ui-ux-pro-max/data/prompts.csv +0 -24
  14. package/.agent/.shared/ui-ux-pro-max/data/react-performance.csv +0 -45
  15. package/.agent/.shared/ui-ux-pro-max/data/stacks/flutter.csv +0 -53
  16. package/.agent/.shared/ui-ux-pro-max/data/stacks/html-tailwind.csv +0 -56
  17. package/.agent/.shared/ui-ux-pro-max/data/stacks/jetpack-compose.csv +0 -53
  18. package/.agent/.shared/ui-ux-pro-max/data/stacks/nextjs.csv +0 -53
  19. package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxt-ui.csv +0 -51
  20. package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxtjs.csv +0 -59
  21. package/.agent/.shared/ui-ux-pro-max/data/stacks/react-native.csv +0 -52
  22. package/.agent/.shared/ui-ux-pro-max/data/stacks/react.csv +0 -54
  23. package/.agent/.shared/ui-ux-pro-max/data/stacks/shadcn.csv +0 -61
  24. package/.agent/.shared/ui-ux-pro-max/data/stacks/svelte.csv +0 -54
  25. package/.agent/.shared/ui-ux-pro-max/data/stacks/swiftui.csv +0 -51
  26. package/.agent/.shared/ui-ux-pro-max/data/stacks/vue.csv +0 -50
  27. package/.agent/.shared/ui-ux-pro-max/data/styles.csv +0 -59
  28. package/.agent/.shared/ui-ux-pro-max/data/typography.csv +0 -58
  29. package/.agent/.shared/ui-ux-pro-max/data/ui-reasoning.csv +0 -101
  30. package/.agent/.shared/ui-ux-pro-max/data/ux-guidelines.csv +0 -100
  31. package/.agent/.shared/ui-ux-pro-max/data/web-interface.csv +0 -31
  32. package/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/core.cpython-313.pyc +0 -0
  33. package/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-313.pyc +0 -0
  34. package/.agent/.shared/ui-ux-pro-max/scripts/core.py +0 -258
  35. package/.agent/.shared/ui-ux-pro-max/scripts/design_system.py +0 -1067
  36. package/.agent/.shared/ui-ux-pro-max/scripts/search.py +0 -106
  37. package/.agent/ARCHITECTURE.md +0 -288
  38. package/.agent/agents/backend-specialist.md +0 -263
  39. package/.agent/agents/code-archaeologist.md +0 -106
  40. package/.agent/agents/database-architect.md +0 -226
  41. package/.agent/agents/debugger.md +0 -225
  42. package/.agent/agents/devops-engineer.md +0 -242
  43. package/.agent/agents/documentation-writer.md +0 -104
  44. package/.agent/agents/explorer-agent.md +0 -73
  45. package/.agent/agents/frontend-specialist.md +0 -556
  46. package/.agent/agents/game-developer.md +0 -162
  47. package/.agent/agents/mobile-developer.md +0 -377
  48. package/.agent/agents/orchestrator.md +0 -416
  49. package/.agent/agents/penetration-tester.md +0 -188
  50. package/.agent/agents/performance-optimizer.md +0 -187
  51. package/.agent/agents/product-manager.md +0 -112
  52. package/.agent/agents/product-owner.md +0 -95
  53. package/.agent/agents/project-planner.md +0 -406
  54. package/.agent/agents/qa-automation-engineer.md +0 -103
  55. package/.agent/agents/quant-architect.md +0 -31
  56. package/.agent/agents/security-auditor.md +0 -170
  57. package/.agent/agents/seo-specialist.md +0 -111
  58. package/.agent/agents/test-engineer.md +0 -158
  59. package/.agent/mcp_config.json +0 -24
  60. package/.agent/rules/GEMINI.md +0 -280
  61. package/.agent/scripts/auto_preview.py +0 -148
  62. package/.agent/scripts/checklist.py +0 -217
  63. package/.agent/scripts/session_manager.py +0 -120
  64. package/.agent/scripts/verify_all.py +0 -327
  65. package/.agent/skills/api-patterns/SKILL.md +0 -81
  66. package/.agent/skills/api-patterns/api-style.md +0 -42
  67. package/.agent/skills/api-patterns/auth.md +0 -24
  68. package/.agent/skills/api-patterns/documentation.md +0 -26
  69. package/.agent/skills/api-patterns/graphql.md +0 -41
  70. package/.agent/skills/api-patterns/rate-limiting.md +0 -31
  71. package/.agent/skills/api-patterns/response.md +0 -37
  72. package/.agent/skills/api-patterns/rest.md +0 -40
  73. package/.agent/skills/api-patterns/scripts/api_validator.py +0 -211
  74. package/.agent/skills/api-patterns/security-testing.md +0 -122
  75. package/.agent/skills/api-patterns/trpc.md +0 -41
  76. package/.agent/skills/api-patterns/versioning.md +0 -22
  77. package/.agent/skills/app-builder/SKILL.md +0 -75
  78. package/.agent/skills/app-builder/agent-coordination.md +0 -71
  79. package/.agent/skills/app-builder/feature-building.md +0 -53
  80. package/.agent/skills/app-builder/project-detection.md +0 -34
  81. package/.agent/skills/app-builder/scaffolding.md +0 -118
  82. package/.agent/skills/app-builder/tech-stack.md +0 -40
  83. package/.agent/skills/app-builder/templates/SKILL.md +0 -39
  84. package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +0 -76
  85. package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +0 -92
  86. package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +0 -88
  87. package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +0 -88
  88. package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +0 -83
  89. package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +0 -90
  90. package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +0 -90
  91. package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +0 -82
  92. package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +0 -100
  93. package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +0 -106
  94. package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +0 -101
  95. package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +0 -83
  96. package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +0 -93
  97. package/.agent/skills/architecture/SKILL.md +0 -55
  98. package/.agent/skills/architecture/context-discovery.md +0 -43
  99. package/.agent/skills/architecture/examples.md +0 -94
  100. package/.agent/skills/architecture/pattern-selection.md +0 -68
  101. package/.agent/skills/architecture/patterns-reference.md +0 -50
  102. package/.agent/skills/architecture/trade-off-analysis.md +0 -77
  103. package/.agent/skills/bash-linux/SKILL.md +0 -199
  104. package/.agent/skills/behavioral-modes/SKILL.md +0 -242
  105. package/.agent/skills/brainstorming/SKILL.md +0 -168
  106. package/.agent/skills/brainstorming/dynamic-questioning.md +0 -350
  107. package/.agent/skills/business-ops/SKILL.md +0 -26
  108. package/.agent/skills/clean-code/SKILL.md +0 -202
  109. package/.agent/skills/cli-generator/SKILL.md +0 -48
  110. package/.agent/skills/code-review-checklist/SKILL.md +0 -109
  111. package/.agent/skills/cognitive-session/SKILL.md +0 -28
  112. package/.agent/skills/data-science/SKILL.md +0 -28
  113. package/.agent/skills/database-design/SKILL.md +0 -52
  114. package/.agent/skills/database-design/database-selection.md +0 -43
  115. package/.agent/skills/database-design/indexing.md +0 -39
  116. package/.agent/skills/database-design/migrations.md +0 -48
  117. package/.agent/skills/database-design/optimization.md +0 -36
  118. package/.agent/skills/database-design/orm-selection.md +0 -30
  119. package/.agent/skills/database-design/schema-design.md +0 -56
  120. package/.agent/skills/database-design/scripts/schema_validator.py +0 -172
  121. package/.agent/skills/deployment-procedures/SKILL.md +0 -241
  122. package/.agent/skills/doc.md +0 -177
  123. package/.agent/skills/documentation-templates/SKILL.md +0 -194
  124. package/.agent/skills/frontend-design/SKILL.md +0 -418
  125. package/.agent/skills/frontend-design/animation-guide.md +0 -331
  126. package/.agent/skills/frontend-design/color-system.md +0 -311
  127. package/.agent/skills/frontend-design/decision-trees.md +0 -418
  128. package/.agent/skills/frontend-design/motion-graphics.md +0 -306
  129. package/.agent/skills/frontend-design/scripts/accessibility_checker.py +0 -183
  130. package/.agent/skills/frontend-design/scripts/ux_audit.py +0 -722
  131. package/.agent/skills/frontend-design/typography-system.md +0 -345
  132. package/.agent/skills/frontend-design/ux-psychology.md +0 -541
  133. package/.agent/skills/frontend-design/visual-effects.md +0 -383
  134. package/.agent/skills/game-development/2d-games/SKILL.md +0 -119
  135. package/.agent/skills/game-development/3d-games/SKILL.md +0 -135
  136. package/.agent/skills/game-development/SKILL.md +0 -167
  137. package/.agent/skills/game-development/game-art/SKILL.md +0 -185
  138. package/.agent/skills/game-development/game-audio/SKILL.md +0 -190
  139. package/.agent/skills/game-development/game-design/SKILL.md +0 -129
  140. package/.agent/skills/game-development/mobile-games/SKILL.md +0 -108
  141. package/.agent/skills/game-development/multiplayer/SKILL.md +0 -132
  142. package/.agent/skills/game-development/pc-games/SKILL.md +0 -144
  143. package/.agent/skills/game-development/vr-ar/SKILL.md +0 -123
  144. package/.agent/skills/game-development/web-games/SKILL.md +0 -150
  145. package/.agent/skills/geo-fundamentals/SKILL.md +0 -156
  146. package/.agent/skills/geo-fundamentals/scripts/geo_checker.py +0 -289
  147. package/.agent/skills/i18n-localization/SKILL.md +0 -154
  148. package/.agent/skills/i18n-localization/scripts/i18n_checker.py +0 -241
  149. package/.agent/skills/intelligent-routing/SKILL.md +0 -335
  150. package/.agent/skills/knowledge-management/SKILL.md +0 -66
  151. package/.agent/skills/lint-and-validate/SKILL.md +0 -45
  152. package/.agent/skills/lint-and-validate/scripts/lint_runner.py +0 -172
  153. package/.agent/skills/lint-and-validate/scripts/type_coverage.py +0 -173
  154. package/.agent/skills/llm-routing-quirks/SKILL.md +0 -41
  155. package/.agent/skills/mcp-builder/SKILL.md +0 -176
  156. package/.agent/skills/memory-architecture/SKILL.md +0 -107
  157. package/.agent/skills/mini-antigravity-injection/SKILL.md +0 -66
  158. package/.agent/skills/mobile-design/SKILL.md +0 -394
  159. package/.agent/skills/mobile-design/decision-trees.md +0 -516
  160. package/.agent/skills/mobile-design/mobile-backend.md +0 -491
  161. package/.agent/skills/mobile-design/mobile-color-system.md +0 -420
  162. package/.agent/skills/mobile-design/mobile-debugging.md +0 -122
  163. package/.agent/skills/mobile-design/mobile-design-thinking.md +0 -357
  164. package/.agent/skills/mobile-design/mobile-navigation.md +0 -458
  165. package/.agent/skills/mobile-design/mobile-performance.md +0 -767
  166. package/.agent/skills/mobile-design/mobile-testing.md +0 -356
  167. package/.agent/skills/mobile-design/mobile-typography.md +0 -433
  168. package/.agent/skills/mobile-design/platform-android.md +0 -666
  169. package/.agent/skills/mobile-design/platform-ios.md +0 -561
  170. package/.agent/skills/mobile-design/scripts/mobile_audit.py +0 -670
  171. package/.agent/skills/mobile-design/touch-psychology.md +0 -537
  172. package/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +0 -312
  173. package/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +0 -240
  174. package/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +0 -490
  175. package/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +0 -264
  176. package/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +0 -581
  177. package/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +0 -432
  178. package/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +0 -684
  179. package/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +0 -150
  180. package/.agent/skills/nextjs-react-expert/9-cache-components.md +0 -103
  181. package/.agent/skills/nextjs-react-expert/SKILL.md +0 -267
  182. package/.agent/skills/nextjs-react-expert/scripts/convert_rules.py +0 -222
  183. package/.agent/skills/nextjs-react-expert/scripts/react_performance_checker.py +0 -252
  184. package/.agent/skills/nodejs-best-practices/SKILL.md +0 -333
  185. package/.agent/skills/parallel-agents/SKILL.md +0 -175
  186. package/.agent/skills/performance-profiling/SKILL.md +0 -143
  187. package/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +0 -76
  188. package/.agent/skills/plan-writing/SKILL.md +0 -153
  189. package/.agent/skills/powershell-windows/SKILL.md +0 -167
  190. package/.agent/skills/product-management/SKILL.md +0 -30
  191. package/.agent/skills/python-patterns/SKILL.md +0 -441
  192. package/.agent/skills/red-team-tactics/SKILL.md +0 -199
  193. package/.agent/skills/rust-pro/SKILL.md +0 -176
  194. package/.agent/skills/seo-fundamentals/SKILL.md +0 -129
  195. package/.agent/skills/seo-fundamentals/scripts/seo_checker.py +0 -219
  196. package/.agent/skills/server-management/SKILL.md +0 -161
  197. package/.agent/skills/systematic-debugging/SKILL.md +0 -120
  198. package/.agent/skills/tailwind-patterns/SKILL.md +0 -269
  199. package/.agent/skills/tdd-workflow/SKILL.md +0 -148
  200. package/.agent/skills/telegram-agentic-gateway/SKILL.md +0 -80
  201. package/.agent/skills/testing-patterns/SKILL.md +0 -178
  202. package/.agent/skills/testing-patterns/scripts/test_runner.py +0 -219
  203. package/.agent/skills/vulnerability-scanner/SKILL.md +0 -276
  204. package/.agent/skills/vulnerability-scanner/checklists.md +0 -121
  205. package/.agent/skills/vulnerability-scanner/scripts/security_scan.py +0 -458
  206. package/.agent/skills/web-design-guidelines/SKILL.md +0 -57
  207. package/.agent/skills/webapp-testing/SKILL.md +0 -187
  208. package/.agent/skills/webapp-testing/scripts/playwright_runner.py +0 -173
  209. package/.agent/workflows/brainstorm.md +0 -113
  210. package/.agent/workflows/create.md +0 -59
  211. package/.agent/workflows/debug.md +0 -103
  212. package/.agent/workflows/deploy.md +0 -176
  213. package/.agent/workflows/enhance.md +0 -63
  214. package/.agent/workflows/orchestrate.md +0 -237
  215. package/.agent/workflows/plan.md +0 -89
  216. package/.agent/workflows/preview.md +0 -81
  217. package/.agent/workflows/status.md +0 -86
  218. package/.agent/workflows/test.md +0 -144
  219. package/.agent/workflows/ui-ux-pro-max.md +0 -296
@@ -1,120 +0,0 @@
1
- ---
2
- name: systematic-debugging
3
- description: 4-phase systematic debugging methodology with root cause analysis and evidence-based verification. Use when debugging complex issues.
4
- allowed-tools: Read, Glob, Grep
5
- ---
6
-
7
- # Systematic Debugging
8
-
9
- > Source: obra/superpowers
10
-
11
- ## Overview
12
- This skill provides a structured approach to debugging that prevents random guessing and ensures problems are properly understood before solving.
13
-
14
- ## 4-Phase Debugging Process
15
-
16
- ### Phase 1: Reproduce
17
- Before fixing, reliably reproduce the issue.
18
-
19
- ```markdown
20
- ## Reproduction Steps
21
- 1. [Exact step to reproduce]
22
- 2. [Next step]
23
- 3. [Expected vs actual result]
24
-
25
- ## Reproduction Rate
26
- - [ ] Always (100%)
27
- - [ ] Often (50-90%)
28
- - [ ] Sometimes (10-50%)
29
- - [ ] Rare (<10%)
30
- ```
31
-
32
- ### Phase 2: Isolate
33
- Narrow down the source.
34
-
35
- ```markdown
36
- ## Isolation Questions
37
- - When did this start happening?
38
- - What changed recently?
39
- - Does it happen in all environments?
40
- - Can we reproduce with minimal code?
41
- - What's the smallest change that triggers it?
42
- ```
43
-
44
- ### Phase 3: Understand
45
- Find the root cause, not just symptoms.
46
-
47
- ```markdown
48
- ## Root Cause Analysis
49
- ### The 5 Whys
50
- 1. Why: [First observation]
51
- 2. Why: [Deeper reason]
52
- 3. Why: [Still deeper]
53
- 4. Why: [Getting closer]
54
- 5. Why: [Root cause]
55
- ```
56
-
57
- ### Phase 4: Fix & Verify
58
- Fix and verify it's truly fixed.
59
-
60
- ```markdown
61
- ## Fix Verification
62
- - [ ] Bug no longer reproduces
63
- - [ ] Related functionality still works
64
- - [ ] No new issues introduced
65
- - [ ] Test added to prevent regression
66
- ```
67
-
68
- ## Debugging Checklist
69
-
70
- ```markdown
71
- ## Before Starting
72
- - [ ] Can reproduce consistently
73
- - [ ] Have minimal reproduction case
74
- - [ ] Understand expected behavior
75
-
76
- ## During Investigation
77
- - [ ] Check recent changes (git log)
78
- - [ ] Check logs for errors
79
- - [ ] Add logging if needed
80
- - [ ] Use debugger/breakpoints
81
-
82
- ## After Fix
83
- - [ ] Root cause documented
84
- - [ ] Fix verified
85
- - [ ] Regression test added
86
- - [ ] Similar code checked
87
- ```
88
-
89
- ## Common Debugging Commands
90
-
91
- ```bash
92
- # Recent changes
93
- git log --oneline -20
94
- git diff HEAD~5
95
-
96
- # Search for pattern
97
- grep -r "errorPattern" --include="*.ts"
98
-
99
- # Check logs
100
- pm2 logs app-name --err --lines 100
101
- ```
102
-
103
- ## 🛡️ Tool Use Guardian (Execution Protection)
104
-
105
- When executing long chains of tool calls (especially when searching, indexing, or scraping), you MUST act as a Guardian of the execution:
106
- 1. **Pre-Call Validation:** Validate file paths and parameters before executing. Don't guess or hallucinate paths.
107
- 2. **Failure Recovery:** If a tool fails (Timeout, Rate Limit, Truncated JSON), **DO NOT panic and restart from scratch**.
108
- - *Truncated:* Use `view_file` with line ranges to fetch the rest.
109
- - *Timeout:* Simplify the bash command or narrow the `grep_search` scope.
110
- - *Error-as-200:* Always check tool output for disguised `{"error": ...}` messages before assuming success.
111
- 3. **Checkpoints:** Maintain logical mental checkpoints. If Step 5 of a 10-step process fails, resume exactly at Step 5.
112
-
113
- ## Anti-Patterns
114
-
115
- ❌ **Random changes** - "Maybe if I change this..."
116
- ❌ **Ignoring evidence** - "That can't be the cause"
117
- ❌ **Assuming Data/API is dead** - Concluding an API endpoint is removed or data is unavailable just because a simple test failed (e.g., testing outside of service hours or without proper auth). ALWAYS check official documentation or sample SDK code before declaring an API dead.
118
- ❌ **Assuming** - "It must be X" without proof
119
- ❌ **Not reproducing first** - Fixing blindly
120
- ❌ **Stopping at symptoms** - Not finding root cause
@@ -1,269 +0,0 @@
1
- ---
2
- name: tailwind-patterns
3
- description: Tailwind CSS v4 principles. CSS-first configuration, container queries, modern patterns, design token architecture.
4
- allowed-tools: Read, Write, Edit, Glob, Grep
5
- ---
6
-
7
- # Tailwind CSS Patterns (v4 - 2025)
8
-
9
- > Modern utility-first CSS with CSS-native configuration.
10
-
11
- ---
12
-
13
- ## 1. Tailwind v4 Architecture
14
-
15
- ### What Changed from v3
16
-
17
- | v3 (Legacy) | v4 (Current) |
18
- |-------------|--------------|
19
- | `tailwind.config.js` | CSS-based `@theme` directive |
20
- | PostCSS plugin | Oxide engine (10x faster) |
21
- | JIT mode | Native, always-on |
22
- | Plugin system | CSS-native features |
23
- | `@apply` directive | Still works, discouraged |
24
-
25
- ### v4 Core Concepts
26
-
27
- | Concept | Description |
28
- |---------|-------------|
29
- | **CSS-first** | Configuration in CSS, not JavaScript |
30
- | **Oxide Engine** | Rust-based compiler, much faster |
31
- | **Native Nesting** | CSS nesting without PostCSS |
32
- | **CSS Variables** | All tokens exposed as `--*` vars |
33
-
34
- ---
35
-
36
- ## 2. CSS-Based Configuration
37
-
38
- ### Theme Definition
39
-
40
- ```
41
- @theme {
42
- /* Colors - use semantic names */
43
- --color-primary: oklch(0.7 0.15 250);
44
- --color-surface: oklch(0.98 0 0);
45
- --color-surface-dark: oklch(0.15 0 0);
46
-
47
- /* Spacing scale */
48
- --spacing-xs: 0.25rem;
49
- --spacing-sm: 0.5rem;
50
- --spacing-md: 1rem;
51
- --spacing-lg: 2rem;
52
-
53
- /* Typography */
54
- --font-sans: 'Inter', system-ui, sans-serif;
55
- --font-mono: 'JetBrains Mono', monospace;
56
- }
57
- ```
58
-
59
- ### When to Extend vs Override
60
-
61
- | Action | Use When |
62
- |--------|----------|
63
- | **Extend** | Adding new values alongside defaults |
64
- | **Override** | Replacing default scale entirely |
65
- | **Semantic tokens** | Project-specific naming (primary, surface) |
66
-
67
- ---
68
-
69
- ## 3. Container Queries (v4 Native)
70
-
71
- ### Breakpoint vs Container
72
-
73
- | Type | Responds To |
74
- |------|-------------|
75
- | **Breakpoint** (`md:`) | Viewport width |
76
- | **Container** (`@container`) | Parent element width |
77
-
78
- ### Container Query Usage
79
-
80
- | Pattern | Classes |
81
- |---------|---------|
82
- | Define container | `@container` on parent |
83
- | Container breakpoint | `@sm:`, `@md:`, `@lg:` on children |
84
- | Named containers | `@container/card` for specificity |
85
-
86
- ### When to Use
87
-
88
- | Scenario | Use |
89
- |----------|-----|
90
- | Page-level layouts | Viewport breakpoints |
91
- | Component-level responsive | Container queries |
92
- | Reusable components | Container queries (context-independent) |
93
-
94
- ---
95
-
96
- ## 4. Responsive Design
97
-
98
- ### Breakpoint System
99
-
100
- | Prefix | Min Width | Target |
101
- |--------|-----------|--------|
102
- | (none) | 0px | Mobile-first base |
103
- | `sm:` | 640px | Large phone / small tablet |
104
- | `md:` | 768px | Tablet |
105
- | `lg:` | 1024px | Laptop |
106
- | `xl:` | 1280px | Desktop |
107
- | `2xl:` | 1536px | Large desktop |
108
-
109
- ### Mobile-First Principle
110
-
111
- 1. Write mobile styles first (no prefix)
112
- 2. Add larger screen overrides with prefixes
113
- 3. Example: `w-full md:w-1/2 lg:w-1/3`
114
-
115
- ---
116
-
117
- ## 5. Dark Mode
118
-
119
- ### Configuration Strategies
120
-
121
- | Method | Behavior | Use When |
122
- |--------|----------|----------|
123
- | `class` | `.dark` class toggles | Manual theme switcher |
124
- | `media` | Follows system preference | No user control |
125
- | `selector` | Custom selector (v4) | Complex theming |
126
-
127
- ### Dark Mode Pattern
128
-
129
- | Element | Light | Dark |
130
- |---------|-------|------|
131
- | Background | `bg-white` | `dark:bg-zinc-900` |
132
- | Text | `text-zinc-900` | `dark:text-zinc-100` |
133
- | Borders | `border-zinc-200` | `dark:border-zinc-700` |
134
-
135
- ---
136
-
137
- ## 6. Modern Layout Patterns
138
-
139
- ### Flexbox Patterns
140
-
141
- | Pattern | Classes |
142
- |---------|---------|
143
- | Center (both axes) | `flex items-center justify-center` |
144
- | Vertical stack | `flex flex-col gap-4` |
145
- | Horizontal row | `flex gap-4` |
146
- | Space between | `flex justify-between items-center` |
147
- | Wrap grid | `flex flex-wrap gap-4` |
148
-
149
- ### Grid Patterns
150
-
151
- | Pattern | Classes |
152
- |---------|---------|
153
- | Auto-fit responsive | `grid grid-cols-[repeat(auto-fit,minmax(250px,1fr))]` |
154
- | Asymmetric (Bento) | `grid grid-cols-3 grid-rows-2` with spans |
155
- | Sidebar layout | `grid grid-cols-[auto_1fr]` |
156
-
157
- > **Note:** Prefer asymmetric/Bento layouts over symmetric 3-column grids.
158
-
159
- ---
160
-
161
- ## 7. Modern Color System
162
-
163
- ### OKLCH vs RGB/HSL
164
-
165
- | Format | Advantage |
166
- |--------|-----------|
167
- | **OKLCH** | Perceptually uniform, better for design |
168
- | **HSL** | Intuitive hue/saturation |
169
- | **RGB** | Legacy compatibility |
170
-
171
- ### Color Token Architecture
172
-
173
- | Layer | Example | Purpose |
174
- |-------|---------|---------|
175
- | **Primitive** | `--blue-500` | Raw color values |
176
- | **Semantic** | `--color-primary` | Purpose-based naming |
177
- | **Component** | `--button-bg` | Component-specific |
178
-
179
- ---
180
-
181
- ## 8. Typography System
182
-
183
- ### Font Stack Pattern
184
-
185
- | Type | Recommended |
186
- |------|-------------|
187
- | Sans | `'Inter', 'SF Pro', system-ui, sans-serif` |
188
- | Mono | `'JetBrains Mono', 'Fira Code', monospace` |
189
- | Display | `'Outfit', 'Poppins', sans-serif` |
190
-
191
- ### Type Scale
192
-
193
- | Class | Size | Use |
194
- |-------|------|-----|
195
- | `text-xs` | 0.75rem | Labels, captions |
196
- | `text-sm` | 0.875rem | Secondary text |
197
- | `text-base` | 1rem | Body text |
198
- | `text-lg` | 1.125rem | Lead text |
199
- | `text-xl`+ | 1.25rem+ | Headings |
200
-
201
- ---
202
-
203
- ## 9. Animation & Transitions
204
-
205
- ### Built-in Animations
206
-
207
- | Class | Effect |
208
- |-------|--------|
209
- | `animate-spin` | Continuous rotation |
210
- | `animate-ping` | Attention pulse |
211
- | `animate-pulse` | Subtle opacity pulse |
212
- | `animate-bounce` | Bouncing effect |
213
-
214
- ### Transition Patterns
215
-
216
- | Pattern | Classes |
217
- |---------|---------|
218
- | All properties | `transition-all duration-200` |
219
- | Specific | `transition-colors duration-150` |
220
- | With easing | `ease-out` or `ease-in-out` |
221
- | Hover effect | `hover:scale-105 transition-transform` |
222
-
223
- ---
224
-
225
- ## 10. Component Extraction
226
-
227
- ### When to Extract
228
-
229
- | Signal | Action |
230
- |--------|--------|
231
- | Same class combo 3+ times | Extract component |
232
- | Complex state variants | Extract component |
233
- | Design system element | Extract + document |
234
-
235
- ### Extraction Methods
236
-
237
- | Method | Use When |
238
- |--------|----------|
239
- | **React/Vue component** | Dynamic, JS needed |
240
- | **@apply in CSS** | Static, no JS needed |
241
- | **Design tokens** | Reusable values |
242
-
243
- ---
244
-
245
- ## 11. Anti-Patterns
246
-
247
- | Don't | Do |
248
- |-------|-----|
249
- | Arbitrary values everywhere | Use design system scale |
250
- | `!important` | Fix specificity properly |
251
- | Inline `style=` | Use utilities |
252
- | Duplicate long class lists | Extract component |
253
- | Mix v3 config with v4 | Migrate fully to CSS-first |
254
- | Use `@apply` heavily | Prefer components |
255
-
256
- ---
257
-
258
- ## 12. Performance Principles
259
-
260
- | Principle | Implementation |
261
- |-----------|----------------|
262
- | **Purge unused** | Automatic in v4 |
263
- | **Avoid dynamism** | No template string classes |
264
- | **Use Oxide** | Default in v4, 10x faster |
265
- | **Cache builds** | CI/CD caching |
266
-
267
- ---
268
-
269
- > **Remember:** Tailwind v4 is CSS-first. Embrace CSS variables, container queries, and native features. The config file is now optional.
@@ -1,148 +0,0 @@
1
- ---
2
- name: tdd-workflow
3
- description: Test-Driven Development workflow principles. RED-GREEN-REFACTOR cycle.
4
- allowed-tools: Read, Write, Edit, Glob, Grep, Bash
5
- ---
6
-
7
- # TDD Workflow
8
-
9
- > Write tests first, code second.
10
-
11
- ---
12
-
13
- ## 1. The TDD Cycle
14
-
15
- ```
16
- 🔴 RED → Write failing test
17
-
18
- 🟢 GREEN → Write minimal code to pass
19
-
20
- 🔵 REFACTOR → Improve code quality
21
-
22
- Repeat...
23
- ```
24
-
25
- ---
26
-
27
- ## 2. The Three Laws of TDD
28
-
29
- 1. Write production code only to make a failing test pass
30
- 2. Write only enough test to demonstrate failure
31
- 3. Write only enough code to make the test pass
32
-
33
- ---
34
-
35
- ## 3. RED Phase Principles
36
-
37
- ### What to Write
38
-
39
- | Focus | Example |
40
- |-------|---------|
41
- | Behavior | "should add two numbers" |
42
- | Edge cases | "should handle empty input" |
43
- | Error states | "should throw for invalid data" |
44
-
45
- ### RED Phase Rules
46
-
47
- - Test must fail first
48
- - Test name describes expected behavior
49
- - One assertion per test (ideally)
50
-
51
- ---
52
-
53
- ## 4. GREEN Phase Principles
54
-
55
- ### Minimum Code
56
-
57
- | Principle | Meaning |
58
- |-----------|---------|
59
- | **YAGNI** | You Aren't Gonna Need It |
60
- | **Simplest thing** | Write the minimum to pass |
61
- | **No optimization** | Just make it work |
62
-
63
- ### GREEN Phase Rules
64
-
65
- - Don't write unneeded code
66
- - Don't optimize yet
67
- - Pass the test, nothing more
68
-
69
- ---
70
-
71
- ## 5. REFACTOR Phase Principles
72
-
73
- ### What to Improve
74
-
75
- | Area | Action |
76
- |------|--------|
77
- | Duplication | Extract common code |
78
- | Naming | Make intent clear |
79
- | Structure | Improve organization |
80
- | Complexity | Simplify logic |
81
-
82
- ### REFACTOR Rules
83
-
84
- - All tests must stay green
85
- - Small incremental changes
86
- - Commit after each refactor
87
-
88
- ---
89
-
90
- ## 6. AAA Pattern
91
-
92
- Every test follows:
93
-
94
- | Step | Purpose |
95
- |------|---------|
96
- | **Arrange** | Set up test data |
97
- | **Act** | Execute code under test |
98
- | **Assert** | Verify expected outcome |
99
-
100
- ---
101
-
102
- ## 7. When to Use TDD
103
-
104
- | Scenario | TDD Value |
105
- |----------|-----------|
106
- | New feature | High |
107
- | Bug fix | High (write test first) |
108
- | Complex logic | High |
109
- | Exploratory | Low (spike, then TDD) |
110
- | UI layout | Low |
111
-
112
- ---
113
-
114
- ## 8. Test Prioritization
115
-
116
- | Priority | Test Type |
117
- |----------|-----------|
118
- | 1 | Happy path |
119
- | 2 | Error cases |
120
- | 3 | Edge cases |
121
- | 4 | Performance |
122
-
123
- ---
124
-
125
- ## 9. Anti-Patterns
126
-
127
- | ❌ Don't | ✅ Do |
128
- |----------|-------|
129
- | Skip the RED phase | Watch test fail first |
130
- | Write tests after | Write tests before |
131
- | Over-engineer initial | Keep it simple |
132
- | Multiple asserts | One behavior per test |
133
- | Test implementation | Test behavior |
134
-
135
- ---
136
-
137
- ## 10. Cognitive Roleplay TDD
138
-
139
- ### Solo-Agent Pattern
140
-
141
- As a solo agent, you must explicitly shift cognitive contexts:
142
- 1. **Tester Persona**: Write failing tests (RED)
143
- 2. **Coder Persona**: Implement minimal code to pass (GREEN)
144
- 3. **Architect Persona**: Critically review and optimize (REFACTOR)
145
-
146
- ---
147
-
148
- > **Remember:** The test is the specification. If you can't write a test, you don't understand the requirement.
@@ -1,80 +0,0 @@
1
- ---
2
- name: telegram-agentic-gateway
3
- description: Tiêu chuẩn Giao tiếp Telegram (Telegram Gateway) cho các Agentic Projects. Cung cấp bộ lệnh chuẩn mực (Core Commands) để Quản lý Agent, Quản lý Ký ức và Cấp phép Tự Chữa Lành (Self-Healing).
4
- ---
5
-
6
- # KỸ NĂNG: XÂY DỰNG TRẠM ĐIỀU HÀNH TELEGRAM (Telegram Agentic Gateway)
7
-
8
- Khi User yêu cầu "Tạo kênh giao tiếp Telegram" hoặc "Làm cho dự án này điều khiển được qua Telegram giống Quản Đốc", bạn (AI) phải thiết kế một `TelegramGateway` tuân thủ nghiêm ngặt **Tiêu chuẩn Giao tiếp lõi** dưới đây.
9
-
10
- Một Telegram Gateway chuẩn mực không chỉ là bot chat lăng nhăng, mà phải là một **Trạm Chỉ Huy (Command Center)** với các lệnh System-level.
11
-
12
- ---
13
-
14
- ## PHẦN A: BỘ LỆNH QUẢN TRỊ CƠ BẢN (Core Management Commands)
15
- Bất kỳ dự án Agentic nào cũng phải có 4 lệnh sinh tồn sau:
16
-
17
- 1. **`🚀 /start` (Ping Khởi Động)**
18
- - **Tác dụng:** Kiểm tra kết nối xem Lõi AI của dự án có đang thức không. Trả về thông số môi trường hiện tại (Vd: "Bot đang chạy Port 20130, kết nối 9Router ổn định").
19
-
20
- 2. **`📊 /status` (Camera Giám Sát)**
21
- - **Tác dụng:** Liệt kê toàn bộ các Agent (Đặc vụ/Sandbox) ĐANG CHẠY NGẦM trong hệ thống.
22
- - **Giao diện:** Phải trả về Inline Keyboard (Nút bấm) ứng với từng Sandbox để User có thể chọc vào xem Log hoặc Tương tác trực tiếp với Agent đó.
23
-
24
- 3. **`🏭 /spawn <mô_tả>` (Sinh Trực Tiếp Đặc Vụ)**
25
- - **Tác dụng:** Ép hệ thống tách 1 luồng độc lập, đẻ ra 1 Sandbox riêng biệt đi làm cái task `<mô_tả>` ở background, không làm kẹt luồng chat hiện tại của User.
26
-
27
- 4. **`💀 /kill <agent_id>` (Kill-Switch Lệnh Bài Tử thần)**
28
- - **Tác dụng:** Lệnh Tối Cao. Nếu một Sandbox chạy tốn token, bị kẹt (loop), hoặc làm sai định hướng, User gõ lệnh này Hệ thống BẮT BUỘC phải force-kill Process/Thread của Agent đó ngay lập tức để giải phóng RAM.
29
-
30
- ---
31
-
32
- ## PHẦN B: TRÍ NHỚ PHÂN NHIỆM (Topic-Based Memory Isolation)
33
- Khác lập trình Bot thông thường chỉ lấy `chat.id`, một **Agentic Gateway** tiêu chuẩn BẮT BUỘC phải cô lập trí nhớ dựa trên Telegram Topics (Threads).
34
- - Nếu User nhắn trong Group Telegram có tính năng Topics: Phải trích xuất `msg.message_thread_id` để làm định danh Ký ức (Vd: `topic-1234.json`).
35
- - Nếu User nhắn Private: Dùng `chat.id` (Vd: `chat-5678.json`).
36
- - Nhờ vậy, 1 Group Telegram có thể hoạt động hệt như 1 cái Trello/Kanban Board: Mỗi Topic là 1 Luồng Công Việc riêng biệt, Agent nhớ chính xác bối cảnh của từng file/lỗi đang thảo luận mà không bị chập cheng trí nhớ (Cross-Topic Hallucination).
37
-
38
- ---
39
-
40
- ## PHẦN C: BỘ LỆNH QUẢN LÝ KÝ ỨC (Cognitive Management)
41
- Mỗi Topic/Chat trên Telegram sẽ sinh ra 1 File Ký ức lưu Context. Bắt buộc phải có lệnh dọn dẹp cống rãnh:
42
-
43
- 5. **`🧹 /forget` (Hỏa Thiêu Hồ Sơ)**
44
- - **Tác dụng:** Xóa vĩnh viễn File JSON lịch sử chat (Ký ức ngắn hạn) của Topic/Thread hiện tại.
45
- - **CẢNH BÁO TỐI THƯỢNG:** Chỉ được phép xóa file JSON Session. TUYỆT ĐỐI KHÔNG ĐƯỢC thiết kế lệnh `/forget` gọi các hàm xóa Vector Database (Ký ức dài hạn dùng chung của dự án) vì sẽ làm toàn bộ Hệ thống Đại Tướng bị mất trí nhớ!
46
- - **Bảo mật:** Vì lệnh này mang tính phá hủy dữ liệu, **BẮT BUỘC** phải chặn lại bằng Máy Trạng Thái Cấp Phép (Auth-First) yêu cầu nhập `Password` mới được thi hành.
47
-
48
- ---
49
-
50
- ## PHẦN D: BỘ LỆNH TIẾN HÓA VÀ CHỮA LÀNH (Self-Healing Mappers)
51
- Để Dự án có thể tự vá lỗi source code của nó (cần kết hợp với skill `mini-antigravity-injection`), Telegram Gateway phải chứa 2 lệnh Cấp Phép Mổ:
52
-
53
- 6. **`🏥 /heal <triệu_chứng>` (Tiền Trảm Hậu Tấu)**
54
- - **Tác dụng:** Bypass bước duyệt phác đồ.
55
- - **Luồng hoạt động:** Nhận lệnh -> Trạng thái chờ Pass -> Nhập Pass đúng -> Cấp quyền (`hasMutationLicense = true`) -> Agent tự tìm Lỗi -> Tự Mổ code -> Tự Test Sandbox -> Tự Hot-reload -> Báo kết quả cuối cùng.
56
-
57
- 7. **`📋 /healplan <triệu_chứng>` (Khám Bệnh Kê Đơn - Tương Tác)**
58
- - **Tác dụng:** Lập phác đồ, cấm chạm vào code thật.
59
- - **Luồng hoạt động:** Nhận lệnh -> Trạng thái chờ Pass -> Nhập Pass đúng -> Agent đi khám bệnh -> Nhả ra Phác Đồ + 2 Nút Bấm `[✅ Proceed]` và `[❌ Cancel]`.
60
- - User có thể chat qua lại để sửa bản Phác đồ ròng rã cả ngày. Lúc nào ưng ý bấm `Proceed`, Hệ thống bốc Context lôi Agent ra chém đè Code!
61
-
62
- ---
63
-
64
- ## PHẦN E: KIẾN TẠO HẠ TẦNG & HƯỚNG DẪN ÔNG CHỦ (User Setup Instructions)
65
- Khi bạn (AI) code xong cái `TelegramGateway` cho dự án, nghĩa vụ của bạn CƯƠNG QUYẾT phải xuất ra một bảng hướng dẫn `Markdown` dặn dò Ông Chủ (User) cách thiết lập Telegram để chọn 1 trong 2 chế độ chơi:
66
-
67
- 1. **Chế Độ Bệnh Viện Đa Khoa (Group Multi-Topics - Khuyên dùng):**
68
- - Hướng dẫn User tạo 1 Group Telegram mới.
69
- - Thêm con Bot vào Group và cấp quyền Admin.
70
- - **ĐẶC BIỆT QUAN TRỌNG:** Nhắc User phải vào Cài đặt Group (Group Settings) -> Bật tính năng **"Topics"** (Diễn đàn).
71
- - Giải thích cho User: Mỗi khi có 1 "Bệnh nhân" (Lỗi/Tính năng mới), User tạo một cái Topic mới trong Group đó. Bot sẽ phân luồng Ký ức cực mượt theo từng Topic.
72
-
73
- 2. **Chế Độ Phòng Khám Tư (Private Single Chat):**
74
- - Hướng dẫn User chỉ cần nhấp vào Bot và nhắn tin trực tiếp (DM).
75
- - Nhắc User dùng lệnh `/forget` nếu muốn đổi chủ đề để tránh Bot bị chập Ký ức.
76
-
77
- ---
78
-
79
- ## TỔNG KẾT TRIỂN KHAI
80
- *(Ghi chú cho AI)*: Khi code Node.js/Python cho bot, bạn TỰ ĐỘNG đăng ký toàn bộ 7 lệnh này vào Bot Menu (`bot.setMyCommands(...)` trong Telegram API) để User chỉ việc gõ dấu `/` là Menu gợi ý hiện ra đầy đủ và chuyên nghiệp!