@mrtrinhvn/ag-kit 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +88 -0
- package/package.json +28 -0
- package/template/.agent/agents/backend-specialist.md +263 -0
- package/template/.agent/agents/code-archaeologist.md +106 -0
- package/template/.agent/agents/database-architect.md +226 -0
- package/template/.agent/agents/debugger.md +225 -0
- package/template/.agent/agents/devops-engineer.md +242 -0
- package/template/.agent/agents/documentation-writer.md +104 -0
- package/template/.agent/agents/explorer-agent.md +73 -0
- package/template/.agent/agents/frontend-specialist.md +556 -0
- package/template/.agent/agents/game-developer.md +162 -0
- package/template/.agent/agents/mobile-developer.md +377 -0
- package/template/.agent/agents/orchestrator.md +416 -0
- package/template/.agent/agents/penetration-tester.md +188 -0
- package/template/.agent/agents/performance-optimizer.md +187 -0
- package/template/.agent/agents/product-manager.md +112 -0
- package/template/.agent/agents/product-owner.md +95 -0
- package/template/.agent/agents/project-planner.md +406 -0
- package/template/.agent/agents/qa-automation-engineer.md +103 -0
- package/template/.agent/agents/quant-architect.md +31 -0
- package/template/.agent/agents/security-auditor.md +170 -0
- package/template/.agent/agents/seo-specialist.md +111 -0
- package/template/.agent/agents/test-engineer.md +158 -0
- package/template/.agent/knowledge/.gitkeep +0 -0
- package/template/.agent/rules/GEMINI.md +280 -0
- package/template/.agent/scripts/auto_preview.py +148 -0
- package/template/.agent/scripts/checklist.py +217 -0
- package/template/.agent/scripts/session_manager.py +120 -0
- package/template/.agent/scripts/verify_all.py +327 -0
- package/template/.agent/skills/api-patterns/SKILL.md +81 -0
- package/template/.agent/skills/api-patterns/api-style.md +42 -0
- package/template/.agent/skills/api-patterns/auth.md +24 -0
- package/template/.agent/skills/api-patterns/documentation.md +26 -0
- package/template/.agent/skills/api-patterns/graphql.md +41 -0
- package/template/.agent/skills/api-patterns/rate-limiting.md +31 -0
- package/template/.agent/skills/api-patterns/response.md +37 -0
- package/template/.agent/skills/api-patterns/rest.md +40 -0
- package/template/.agent/skills/api-patterns/scripts/api_validator.py +211 -0
- package/template/.agent/skills/api-patterns/security-testing.md +122 -0
- package/template/.agent/skills/api-patterns/trpc.md +41 -0
- package/template/.agent/skills/api-patterns/versioning.md +22 -0
- package/template/.agent/skills/app-builder/SKILL.md +75 -0
- package/template/.agent/skills/app-builder/agent-coordination.md +71 -0
- package/template/.agent/skills/app-builder/feature-building.md +53 -0
- package/template/.agent/skills/app-builder/project-detection.md +34 -0
- package/template/.agent/skills/app-builder/scaffolding.md +118 -0
- package/template/.agent/skills/app-builder/tech-stack.md +40 -0
- package/template/.agent/skills/app-builder/templates/SKILL.md +39 -0
- package/template/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/template/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/template/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/template/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/template/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/template/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/template/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/template/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +82 -0
- package/template/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +100 -0
- package/template/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +106 -0
- package/template/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +101 -0
- package/template/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/template/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +93 -0
- package/template/.agent/skills/architecture/SKILL.md +55 -0
- package/template/.agent/skills/architecture/context-discovery.md +43 -0
- package/template/.agent/skills/architecture/examples.md +94 -0
- package/template/.agent/skills/architecture/pattern-selection.md +68 -0
- package/template/.agent/skills/architecture/patterns-reference.md +50 -0
- package/template/.agent/skills/architecture/trade-off-analysis.md +77 -0
- package/template/.agent/skills/bash-linux/SKILL.md +199 -0
- package/template/.agent/skills/behavioral-modes/SKILL.md +242 -0
- package/template/.agent/skills/brainstorming/SKILL.md +168 -0
- package/template/.agent/skills/brainstorming/dynamic-questioning.md +350 -0
- package/template/.agent/skills/business-ops/SKILL.md +26 -0
- package/template/.agent/skills/clean-code/SKILL.md +202 -0
- package/template/.agent/skills/code-review-checklist/SKILL.md +109 -0
- package/template/.agent/skills/data-science/SKILL.md +28 -0
- package/template/.agent/skills/database-design/SKILL.md +52 -0
- package/template/.agent/skills/database-design/database-selection.md +43 -0
- package/template/.agent/skills/database-design/indexing.md +39 -0
- package/template/.agent/skills/database-design/migrations.md +48 -0
- package/template/.agent/skills/database-design/optimization.md +36 -0
- package/template/.agent/skills/database-design/orm-selection.md +30 -0
- package/template/.agent/skills/database-design/schema-design.md +56 -0
- package/template/.agent/skills/database-design/scripts/schema_validator.py +172 -0
- package/template/.agent/skills/deployment-procedures/SKILL.md +241 -0
- package/template/.agent/skills/doc.md +177 -0
- package/template/.agent/skills/documentation-templates/SKILL.md +194 -0
- package/template/.agent/skills/frontend-design/SKILL.md +418 -0
- package/template/.agent/skills/frontend-design/animation-guide.md +331 -0
- package/template/.agent/skills/frontend-design/color-system.md +311 -0
- package/template/.agent/skills/frontend-design/decision-trees.md +418 -0
- package/template/.agent/skills/frontend-design/motion-graphics.md +306 -0
- package/template/.agent/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/template/.agent/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/template/.agent/skills/frontend-design/typography-system.md +345 -0
- package/template/.agent/skills/frontend-design/ux-psychology.md +541 -0
- package/template/.agent/skills/frontend-design/visual-effects.md +383 -0
- package/template/.agent/skills/game-development/2d-games/SKILL.md +119 -0
- package/template/.agent/skills/game-development/3d-games/SKILL.md +135 -0
- package/template/.agent/skills/game-development/SKILL.md +167 -0
- package/template/.agent/skills/game-development/game-art/SKILL.md +185 -0
- package/template/.agent/skills/game-development/game-audio/SKILL.md +190 -0
- package/template/.agent/skills/game-development/game-design/SKILL.md +129 -0
- package/template/.agent/skills/game-development/mobile-games/SKILL.md +108 -0
- package/template/.agent/skills/game-development/multiplayer/SKILL.md +132 -0
- package/template/.agent/skills/game-development/pc-games/SKILL.md +144 -0
- package/template/.agent/skills/game-development/vr-ar/SKILL.md +123 -0
- package/template/.agent/skills/game-development/web-games/SKILL.md +150 -0
- package/template/.agent/skills/geo-fundamentals/SKILL.md +156 -0
- package/template/.agent/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/template/.agent/skills/i18n-localization/SKILL.md +154 -0
- package/template/.agent/skills/i18n-localization/scripts/i18n_checker.py +241 -0
- package/template/.agent/skills/intelligent-routing/SKILL.md +335 -0
- package/template/.agent/skills/knowledge-management/SKILL.md +54 -0
- package/template/.agent/skills/lint-and-validate/SKILL.md +45 -0
- package/template/.agent/skills/lint-and-validate/scripts/lint_runner.py +172 -0
- package/template/.agent/skills/lint-and-validate/scripts/type_coverage.py +173 -0
- package/template/.agent/skills/mcp-builder/SKILL.md +176 -0
- package/template/.agent/skills/mobile-design/SKILL.md +394 -0
- package/template/.agent/skills/mobile-design/decision-trees.md +516 -0
- package/template/.agent/skills/mobile-design/mobile-backend.md +491 -0
- package/template/.agent/skills/mobile-design/mobile-color-system.md +420 -0
- package/template/.agent/skills/mobile-design/mobile-debugging.md +122 -0
- package/template/.agent/skills/mobile-design/mobile-design-thinking.md +357 -0
- package/template/.agent/skills/mobile-design/mobile-navigation.md +458 -0
- package/template/.agent/skills/mobile-design/mobile-performance.md +767 -0
- package/template/.agent/skills/mobile-design/mobile-testing.md +356 -0
- package/template/.agent/skills/mobile-design/mobile-typography.md +433 -0
- package/template/.agent/skills/mobile-design/platform-android.md +666 -0
- package/template/.agent/skills/mobile-design/platform-ios.md +561 -0
- package/template/.agent/skills/mobile-design/scripts/mobile_audit.py +670 -0
- package/template/.agent/skills/mobile-design/touch-psychology.md +537 -0
- package/template/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +312 -0
- package/template/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
- package/template/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
- package/template/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
- package/template/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
- package/template/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
- package/template/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
- package/template/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
- package/template/.agent/skills/nextjs-react-expert/SKILL.md +267 -0
- package/template/.agent/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
- package/template/.agent/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
- package/template/.agent/skills/nodejs-best-practices/SKILL.md +333 -0
- package/template/.agent/skills/parallel-agents/SKILL.md +175 -0
- package/template/.agent/skills/performance-profiling/SKILL.md +143 -0
- package/template/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/template/.agent/skills/plan-writing/SKILL.md +153 -0
- package/template/.agent/skills/powershell-windows/SKILL.md +167 -0
- package/template/.agent/skills/product-management/SKILL.md +30 -0
- package/template/.agent/skills/python-patterns/SKILL.md +441 -0
- package/template/.agent/skills/red-team-tactics/SKILL.md +199 -0
- package/template/.agent/skills/seo-fundamentals/SKILL.md +129 -0
- package/template/.agent/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/template/.agent/skills/server-management/SKILL.md +161 -0
- package/template/.agent/skills/systematic-debugging/SKILL.md +110 -0
- package/template/.agent/skills/tailwind-patterns/SKILL.md +269 -0
- package/template/.agent/skills/tdd-workflow/SKILL.md +148 -0
- package/template/.agent/skills/testing-patterns/SKILL.md +178 -0
- package/template/.agent/skills/testing-patterns/scripts/test_runner.py +219 -0
- package/template/.agent/skills/vulnerability-scanner/SKILL.md +276 -0
- package/template/.agent/skills/vulnerability-scanner/checklists.md +121 -0
- package/template/.agent/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/template/.agent/skills/web-design-guidelines/SKILL.md +57 -0
- package/template/.agent/skills/webapp-testing/SKILL.md +187 -0
- package/template/.agent/skills/webapp-testing/scripts/playwright_runner.py +173 -0
- package/template/.agent/workflows/brainstorm.md +113 -0
- package/template/.agent/workflows/create.md +59 -0
- package/template/.agent/workflows/debug.md +103 -0
- package/template/.agent/workflows/deploy.md +176 -0
- package/template/.agent/workflows/enhance.md +63 -0
- package/template/.agent/workflows/orchestrate.md +237 -0
- package/template/.agent/workflows/plan.md +89 -0
- package/template/.agent/workflows/preview.md +81 -0
- package/template/.agent/workflows/status.md +86 -0
- package/template/.agent/workflows/test.md +144 -0
- package/template/.agent/workflows/ui-ux-pro-max.md +296 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
i18n Checker - Detects hardcoded strings and missing translations.
|
|
4
|
+
Scans for untranslated text in React, Vue, and Python files.
|
|
5
|
+
"""
|
|
6
|
+
import sys
|
|
7
|
+
import re
|
|
8
|
+
import json
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
# Fix Windows console encoding for Unicode output
|
|
12
|
+
try:
|
|
13
|
+
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
|
|
14
|
+
sys.stderr.reconfigure(encoding='utf-8', errors='replace')
|
|
15
|
+
except AttributeError:
|
|
16
|
+
pass # Python < 3.7
|
|
17
|
+
|
|
18
|
+
# Patterns that indicate hardcoded strings (should be translated)
|
|
19
|
+
HARDCODED_PATTERNS = {
|
|
20
|
+
'jsx': [
|
|
21
|
+
# Text directly in JSX: <div>Hello World</div>
|
|
22
|
+
r'>\s*[A-Z][a-zA-Z\s]{3,30}\s*</',
|
|
23
|
+
# JSX attribute strings: title="Welcome"
|
|
24
|
+
r'(title|placeholder|label|alt|aria-label)="[A-Z][a-zA-Z\s]{2,}"',
|
|
25
|
+
# Button/heading text
|
|
26
|
+
r'<(button|h[1-6]|p|span|label)[^>]*>\s*[A-Z][a-zA-Z\s!?.,]{3,}\s*</',
|
|
27
|
+
],
|
|
28
|
+
'vue': [
|
|
29
|
+
# Vue template text
|
|
30
|
+
r'>\s*[A-Z][a-zA-Z\s]{3,30}\s*</',
|
|
31
|
+
r'(placeholder|label|title)="[A-Z][a-zA-Z\s]{2,}"',
|
|
32
|
+
],
|
|
33
|
+
'python': [
|
|
34
|
+
# print/raise with string literals
|
|
35
|
+
r'(print|raise\s+\w+)\s*\(\s*["\'][A-Z][^"\']{5,}["\']',
|
|
36
|
+
# Flask flash messages
|
|
37
|
+
r'flash\s*\(\s*["\'][A-Z][^"\']{5,}["\']',
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
# Patterns that indicate proper i18n usage
|
|
42
|
+
I18N_PATTERNS = [
|
|
43
|
+
r't\(["\']', # t('key') - react-i18next
|
|
44
|
+
r'useTranslation', # React hook
|
|
45
|
+
r'\$t\(', # Vue i18n
|
|
46
|
+
r'_\(["\']', # Python gettext
|
|
47
|
+
r'gettext\(', # Python gettext
|
|
48
|
+
r'useTranslations', # next-intl
|
|
49
|
+
r'FormattedMessage', # react-intl
|
|
50
|
+
r'i18n\.', # Generic i18n
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
def find_locale_files(project_path: Path) -> list:
|
|
54
|
+
"""Find translation/locale files."""
|
|
55
|
+
patterns = [
|
|
56
|
+
"**/locales/**/*.json",
|
|
57
|
+
"**/translations/**/*.json",
|
|
58
|
+
"**/lang/**/*.json",
|
|
59
|
+
"**/i18n/**/*.json",
|
|
60
|
+
"**/messages/*.json",
|
|
61
|
+
"**/*.po", # gettext
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
files = []
|
|
65
|
+
for pattern in patterns:
|
|
66
|
+
files.extend(project_path.glob(pattern))
|
|
67
|
+
|
|
68
|
+
return [f for f in files if 'node_modules' not in str(f)]
|
|
69
|
+
|
|
70
|
+
def check_locale_completeness(locale_files: list) -> dict:
|
|
71
|
+
"""Check if all locales have the same keys."""
|
|
72
|
+
issues = []
|
|
73
|
+
passed = []
|
|
74
|
+
|
|
75
|
+
if not locale_files:
|
|
76
|
+
return {'passed': [], 'issues': ["[!] No locale files found"]}
|
|
77
|
+
|
|
78
|
+
# Group by parent folder (language)
|
|
79
|
+
locales = {}
|
|
80
|
+
for f in locale_files:
|
|
81
|
+
if f.suffix == '.json':
|
|
82
|
+
try:
|
|
83
|
+
lang = f.parent.name
|
|
84
|
+
content = json.loads(f.read_text(encoding='utf-8'))
|
|
85
|
+
if lang not in locales:
|
|
86
|
+
locales[lang] = {}
|
|
87
|
+
locales[lang][f.stem] = set(flatten_keys(content))
|
|
88
|
+
except:
|
|
89
|
+
continue
|
|
90
|
+
|
|
91
|
+
if len(locales) < 2:
|
|
92
|
+
passed.append(f"[OK] Found {len(locale_files)} locale file(s)")
|
|
93
|
+
return {'passed': passed, 'issues': issues}
|
|
94
|
+
|
|
95
|
+
passed.append(f"[OK] Found {len(locales)} language(s): {', '.join(locales.keys())}")
|
|
96
|
+
|
|
97
|
+
# Compare keys across locales
|
|
98
|
+
all_langs = list(locales.keys())
|
|
99
|
+
base_lang = all_langs[0]
|
|
100
|
+
|
|
101
|
+
for namespace in locales.get(base_lang, {}):
|
|
102
|
+
base_keys = locales[base_lang].get(namespace, set())
|
|
103
|
+
|
|
104
|
+
for lang in all_langs[1:]:
|
|
105
|
+
other_keys = locales.get(lang, {}).get(namespace, set())
|
|
106
|
+
|
|
107
|
+
missing = base_keys - other_keys
|
|
108
|
+
if missing:
|
|
109
|
+
issues.append(f"[X] {lang}/{namespace}: Missing {len(missing)} keys")
|
|
110
|
+
|
|
111
|
+
extra = other_keys - base_keys
|
|
112
|
+
if extra:
|
|
113
|
+
issues.append(f"[!] {lang}/{namespace}: {len(extra)} extra keys")
|
|
114
|
+
|
|
115
|
+
if not issues:
|
|
116
|
+
passed.append("[OK] All locales have matching keys")
|
|
117
|
+
|
|
118
|
+
return {'passed': passed, 'issues': issues}
|
|
119
|
+
|
|
120
|
+
def flatten_keys(d, prefix=''):
|
|
121
|
+
"""Flatten nested dict keys."""
|
|
122
|
+
keys = set()
|
|
123
|
+
for k, v in d.items():
|
|
124
|
+
new_key = f"{prefix}.{k}" if prefix else k
|
|
125
|
+
if isinstance(v, dict):
|
|
126
|
+
keys.update(flatten_keys(v, new_key))
|
|
127
|
+
else:
|
|
128
|
+
keys.add(new_key)
|
|
129
|
+
return keys
|
|
130
|
+
|
|
131
|
+
def check_hardcoded_strings(project_path: Path) -> dict:
|
|
132
|
+
"""Check for hardcoded strings in code files."""
|
|
133
|
+
issues = []
|
|
134
|
+
passed = []
|
|
135
|
+
|
|
136
|
+
# Find code files
|
|
137
|
+
extensions = {
|
|
138
|
+
'.tsx': 'jsx', '.jsx': 'jsx', '.ts': 'jsx', '.js': 'jsx',
|
|
139
|
+
'.vue': 'vue',
|
|
140
|
+
'.py': 'python'
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
code_files = []
|
|
144
|
+
for ext in extensions:
|
|
145
|
+
code_files.extend(project_path.rglob(f"*{ext}"))
|
|
146
|
+
|
|
147
|
+
code_files = [f for f in code_files if not any(x in str(f) for x in
|
|
148
|
+
['node_modules', '.git', 'dist', 'build', '__pycache__', 'venv', 'test', 'spec'])]
|
|
149
|
+
|
|
150
|
+
if not code_files:
|
|
151
|
+
return {'passed': ["[!] No code files found"], 'issues': []}
|
|
152
|
+
|
|
153
|
+
files_with_i18n = 0
|
|
154
|
+
files_with_hardcoded = 0
|
|
155
|
+
hardcoded_examples = []
|
|
156
|
+
|
|
157
|
+
for file_path in code_files[:50]: # Limit
|
|
158
|
+
try:
|
|
159
|
+
content = file_path.read_text(encoding='utf-8', errors='ignore')
|
|
160
|
+
ext = file_path.suffix
|
|
161
|
+
file_type = extensions.get(ext, 'jsx')
|
|
162
|
+
|
|
163
|
+
# Check for i18n usage
|
|
164
|
+
has_i18n = any(re.search(p, content) for p in I18N_PATTERNS)
|
|
165
|
+
if has_i18n:
|
|
166
|
+
files_with_i18n += 1
|
|
167
|
+
|
|
168
|
+
# Check for hardcoded strings
|
|
169
|
+
patterns = HARDCODED_PATTERNS.get(file_type, [])
|
|
170
|
+
hardcoded_found = False
|
|
171
|
+
|
|
172
|
+
for pattern in patterns:
|
|
173
|
+
matches = re.findall(pattern, content)
|
|
174
|
+
if matches and not has_i18n:
|
|
175
|
+
hardcoded_found = True
|
|
176
|
+
if len(hardcoded_examples) < 5:
|
|
177
|
+
hardcoded_examples.append(f"{file_path.name}: {str(matches[0])[:40]}...")
|
|
178
|
+
|
|
179
|
+
if hardcoded_found:
|
|
180
|
+
files_with_hardcoded += 1
|
|
181
|
+
|
|
182
|
+
except:
|
|
183
|
+
continue
|
|
184
|
+
|
|
185
|
+
passed.append(f"[OK] Analyzed {len(code_files)} code files")
|
|
186
|
+
|
|
187
|
+
if files_with_i18n > 0:
|
|
188
|
+
passed.append(f"[OK] {files_with_i18n} files use i18n")
|
|
189
|
+
|
|
190
|
+
if files_with_hardcoded > 0:
|
|
191
|
+
issues.append(f"[X] {files_with_hardcoded} files may have hardcoded strings")
|
|
192
|
+
for ex in hardcoded_examples:
|
|
193
|
+
issues.append(f" β {ex}")
|
|
194
|
+
else:
|
|
195
|
+
passed.append("[OK] No obvious hardcoded strings detected")
|
|
196
|
+
|
|
197
|
+
return {'passed': passed, 'issues': issues}
|
|
198
|
+
|
|
199
|
+
def main():
|
|
200
|
+
target = sys.argv[1] if len(sys.argv) > 1 else "."
|
|
201
|
+
project_path = Path(target)
|
|
202
|
+
|
|
203
|
+
print("\n" + "=" * 60)
|
|
204
|
+
print(" i18n CHECKER - Internationalization Audit")
|
|
205
|
+
print("=" * 60 + "\n")
|
|
206
|
+
|
|
207
|
+
# Check locale files
|
|
208
|
+
locale_files = find_locale_files(project_path)
|
|
209
|
+
locale_result = check_locale_completeness(locale_files)
|
|
210
|
+
|
|
211
|
+
# Check hardcoded strings
|
|
212
|
+
code_result = check_hardcoded_strings(project_path)
|
|
213
|
+
|
|
214
|
+
# Print results
|
|
215
|
+
print("[LOCALE FILES]")
|
|
216
|
+
print("-" * 40)
|
|
217
|
+
for item in locale_result['passed']:
|
|
218
|
+
print(f" {item}")
|
|
219
|
+
for item in locale_result['issues']:
|
|
220
|
+
print(f" {item}")
|
|
221
|
+
|
|
222
|
+
print("\n[CODE ANALYSIS]")
|
|
223
|
+
print("-" * 40)
|
|
224
|
+
for item in code_result['passed']:
|
|
225
|
+
print(f" {item}")
|
|
226
|
+
for item in code_result['issues']:
|
|
227
|
+
print(f" {item}")
|
|
228
|
+
|
|
229
|
+
# Summary
|
|
230
|
+
critical_issues = sum(1 for i in locale_result['issues'] + code_result['issues'] if i.startswith("[X]"))
|
|
231
|
+
|
|
232
|
+
print("\n" + "=" * 60)
|
|
233
|
+
if critical_issues == 0:
|
|
234
|
+
print("[OK] i18n CHECK: PASSED")
|
|
235
|
+
sys.exit(0)
|
|
236
|
+
else:
|
|
237
|
+
print(f"[X] i18n CHECK: {critical_issues} issues found")
|
|
238
|
+
sys.exit(1)
|
|
239
|
+
|
|
240
|
+
if __name__ == "__main__":
|
|
241
|
+
main()
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: intelligent-routing
|
|
3
|
+
description: Automatic agent selection and intelligent task routing. Analyzes user requests and automatically selects the best specialist agent(s) without requiring explicit user mentions.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Intelligent Agent Routing
|
|
8
|
+
|
|
9
|
+
**Purpose**: Automatically analyze user requests and route them to the most appropriate specialist agent(s) without requiring explicit user mentions.
|
|
10
|
+
|
|
11
|
+
## Core Principle
|
|
12
|
+
|
|
13
|
+
> **The AI should act as an intelligent Project Manager**, analyzing each request and automatically selecting the best specialist(s) for the job.
|
|
14
|
+
|
|
15
|
+
## How It Works
|
|
16
|
+
|
|
17
|
+
### 1. Request Analysis
|
|
18
|
+
|
|
19
|
+
Before responding to ANY user request, perform automatic analysis:
|
|
20
|
+
|
|
21
|
+
```mermaid
|
|
22
|
+
graph TD
|
|
23
|
+
A[User Request: Add login] --> B[ANALYZE]
|
|
24
|
+
B --> C[Keywords]
|
|
25
|
+
B --> D[Domains]
|
|
26
|
+
B --> E[Complexity]
|
|
27
|
+
C --> F[SELECT AGENT]
|
|
28
|
+
D --> F
|
|
29
|
+
E --> F
|
|
30
|
+
F --> G[security-auditor + backend-specialist]
|
|
31
|
+
G --> H[AUTO-INVOKE with context]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 2. Agent Selection Matrix
|
|
35
|
+
|
|
36
|
+
**Use this matrix to automatically select agents:**
|
|
37
|
+
|
|
38
|
+
| User Intent | Keywords | Selected Agent(s) | Auto-invoke? |
|
|
39
|
+
| ------------------- | ------------------------------------------ | ------------------------------------------- | ------------ |
|
|
40
|
+
| **Authentication** | "login", "auth", "signup", "password" | `security-auditor` + `backend-specialist` | β
YES |
|
|
41
|
+
| **UI Component** | "button", "card", "layout", "style" | `frontend-specialist` | β
YES |
|
|
42
|
+
| **Mobile UI** | "screen", "navigation", "touch", "gesture" | `mobile-developer` | β
YES |
|
|
43
|
+
| **API Endpoint** | "endpoint", "route", "API", "POST", "GET" | `backend-specialist` | β
YES |
|
|
44
|
+
| **Database** | "schema", "migration", "query", "table" | `database-architect` + `backend-specialist` | β
YES |
|
|
45
|
+
| **Bug Fix** | "error", "bug", "not working", "broken" | `debugger` | β
YES |
|
|
46
|
+
| **Test** | "test", "coverage", "unit", "e2e" | `test-engineer` | β
YES |
|
|
47
|
+
| **Deployment** | "deploy", "production", "CI/CD", "docker" | `devops-engineer` | β
YES |
|
|
48
|
+
| **Security Review** | "security", "vulnerability", "exploit" | `security-auditor` + `penetration-tester` | β
YES |
|
|
49
|
+
| **Performance** | "slow", "optimize", "performance", "speed" | `performance-optimizer` | β
YES |
|
|
50
|
+
| **Product Def** | "requirements", "user story", "backlog", "MVP" | `product-owner` | β
YES |
|
|
51
|
+
| **New Feature** | "build", "create", "implement", "new app" | `orchestrator` β multi-agent | β οΈ ASK FIRST |
|
|
52
|
+
| **Complex Task** | Multiple domains detected | `orchestrator` β multi-agent | β οΈ ASK FIRST |
|
|
53
|
+
|
|
54
|
+
### 3. Automatic Routing Protocol
|
|
55
|
+
|
|
56
|
+
## TIER 0 - Automatic Analysis (ALWAYS ACTIVE)
|
|
57
|
+
|
|
58
|
+
Before responding to ANY request:
|
|
59
|
+
|
|
60
|
+
```javascript
|
|
61
|
+
// Pseudo-code for decision tree
|
|
62
|
+
function analyzeRequest(userMessage) {
|
|
63
|
+
// 1. Classify request type
|
|
64
|
+
const requestType = classifyRequest(userMessage);
|
|
65
|
+
|
|
66
|
+
// 2. Detect domains
|
|
67
|
+
const domains = detectDomains(userMessage);
|
|
68
|
+
|
|
69
|
+
// 3. Determine complexity
|
|
70
|
+
const complexity = assessComplexity(domains);
|
|
71
|
+
|
|
72
|
+
// 4. Select agent(s)
|
|
73
|
+
if (complexity === "SIMPLE" && domains.length === 1) {
|
|
74
|
+
return selectSingleAgent(domains[0]);
|
|
75
|
+
} else if (complexity === "MODERATE" && domains.length <= 2) {
|
|
76
|
+
return selectMultipleAgents(domains);
|
|
77
|
+
} else {
|
|
78
|
+
return "orchestrator"; // Complex task
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## 4. Response Format
|
|
84
|
+
|
|
85
|
+
**When auto-selecting an agent, inform the user concisely:**
|
|
86
|
+
|
|
87
|
+
```markdown
|
|
88
|
+
π€ **Applying knowledge of `@security-auditor` + `@backend-specialist`...**
|
|
89
|
+
|
|
90
|
+
[Proceed with specialized response]
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Benefits:**
|
|
94
|
+
|
|
95
|
+
- β
User sees which expertise is being applied
|
|
96
|
+
- β
Transparent decision-making
|
|
97
|
+
- β
Still automatic (no /commands needed)
|
|
98
|
+
|
|
99
|
+
## Domain Detection Rules
|
|
100
|
+
|
|
101
|
+
### Single-Domain Tasks (Auto-invoke Single Agent)
|
|
102
|
+
|
|
103
|
+
| Domain | Patterns | Agent |
|
|
104
|
+
| --------------- | ------------------------------------------ | ----------------------- |
|
|
105
|
+
| **Security** | auth, login, jwt, password, hash, token | `security-auditor` |
|
|
106
|
+
| **Frontend** | component, react, vue, css, html, tailwind | `frontend-specialist` |
|
|
107
|
+
| **Backend** | api, server, express, fastapi, node | `backend-specialist` |
|
|
108
|
+
| **Mobile** | react native, flutter, ios, android, expo | `mobile-developer` |
|
|
109
|
+
| **Database** | prisma, sql, mongodb, schema, migration | `database-architect` |
|
|
110
|
+
| **Testing** | test, jest, vitest, playwright, cypress | `test-engineer` |
|
|
111
|
+
| **DevOps** | docker, kubernetes, ci/cd, pm2, nginx | `devops-engineer` |
|
|
112
|
+
| **Debug** | error, bug, crash, not working, issue | `debugger` |
|
|
113
|
+
| **Performance** | slow, lag, optimize, cache, performance | `performance-optimizer` |
|
|
114
|
+
| **SEO** | seo, meta, analytics, sitemap, robots | `seo-specialist` |
|
|
115
|
+
| **Game** | unity, godot, phaser, game, multiplayer | `game-developer` |
|
|
116
|
+
|
|
117
|
+
### Multi-Domain Tasks (Auto-invoke Orchestrator)
|
|
118
|
+
|
|
119
|
+
If request matches **2+ domains from different categories**, automatically use `orchestrator`:
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
Example: "Create a secure login system with dark mode UI"
|
|
123
|
+
β Detected: Security + Frontend
|
|
124
|
+
β Auto-invoke: orchestrator
|
|
125
|
+
β Orchestrator will handle: security-auditor, frontend-specialist, test-engineer
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Complexity Assessment
|
|
129
|
+
|
|
130
|
+
### SIMPLE (Direct agent invocation)
|
|
131
|
+
|
|
132
|
+
- Single file edit
|
|
133
|
+
- Clear, specific task
|
|
134
|
+
- One domain only
|
|
135
|
+
- Example: "Fix the login button style"
|
|
136
|
+
|
|
137
|
+
**Action**: Auto-invoke respective agent
|
|
138
|
+
|
|
139
|
+
### MODERATE (2-3 agents)
|
|
140
|
+
|
|
141
|
+
- 2-3 files affected
|
|
142
|
+
- Clear requirements
|
|
143
|
+
- 2 domains max
|
|
144
|
+
- Example: "Add API endpoint for user profile"
|
|
145
|
+
|
|
146
|
+
**Action**: Auto-invoke relevant agents sequentially
|
|
147
|
+
|
|
148
|
+
### COMPLEX (Orchestrator required)
|
|
149
|
+
|
|
150
|
+
- Multiple files/domains
|
|
151
|
+
- Architectural decisions needed
|
|
152
|
+
- Unclear requirements
|
|
153
|
+
- Example: "Build a social media app"
|
|
154
|
+
|
|
155
|
+
**Action**: Auto-invoke `orchestrator` β will ask Socratic questions
|
|
156
|
+
|
|
157
|
+
## Implementation Rules
|
|
158
|
+
|
|
159
|
+
### Rule 1: Silent Analysis
|
|
160
|
+
|
|
161
|
+
#### DO NOT announce "I'm analyzing your request..."
|
|
162
|
+
|
|
163
|
+
- β
Analyze silently
|
|
164
|
+
- β
Inform which agent is being applied
|
|
165
|
+
- β Avoid verbose meta-commentary
|
|
166
|
+
|
|
167
|
+
### Rule 2: Inform Agent Selection
|
|
168
|
+
|
|
169
|
+
**DO inform which expertise is being applied:**
|
|
170
|
+
|
|
171
|
+
```markdown
|
|
172
|
+
π€ **Applying knowledge of `@frontend-specialist`...**
|
|
173
|
+
|
|
174
|
+
I will create the component with the following characteristics:
|
|
175
|
+
[Continue with specialized response]
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Rule 3: Seamless Experience
|
|
179
|
+
|
|
180
|
+
**The user should not notice a difference from talking to the right specialist directly.**
|
|
181
|
+
|
|
182
|
+
### Rule 4: Override Capability
|
|
183
|
+
|
|
184
|
+
**User can still explicitly mention agents:**
|
|
185
|
+
|
|
186
|
+
```text
|
|
187
|
+
User: "Use @backend-specialist to review this"
|
|
188
|
+
β Override auto-selection
|
|
189
|
+
β Use explicitly mentioned agent
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Edge Cases
|
|
193
|
+
|
|
194
|
+
### Case 1: Generic Question
|
|
195
|
+
|
|
196
|
+
```text
|
|
197
|
+
User: "How does React work?"
|
|
198
|
+
β Type: QUESTION
|
|
199
|
+
β No agent needed
|
|
200
|
+
β Respond directly with explanation
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Case 2: Extremely Vague Request
|
|
204
|
+
|
|
205
|
+
```text
|
|
206
|
+
User: "Make it better"
|
|
207
|
+
β Complexity: UNCLEAR
|
|
208
|
+
β Action: Ask clarifying questions first
|
|
209
|
+
β Then route to appropriate agent
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Case 3: Contradictory Patterns
|
|
213
|
+
|
|
214
|
+
```text
|
|
215
|
+
User: "Add mobile support to the web app"
|
|
216
|
+
β Conflict: mobile vs web
|
|
217
|
+
β Action: Ask: "Do you want responsive web or native mobile app?"
|
|
218
|
+
β Then route accordingly
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## Integration with Existing Workflows
|
|
222
|
+
|
|
223
|
+
### With /orchestrate Command
|
|
224
|
+
|
|
225
|
+
- **User types `/orchestrate`**: Explicit orchestration mode
|
|
226
|
+
- **AI detects complex task**: Auto-invoke orchestrator (same result)
|
|
227
|
+
|
|
228
|
+
**Difference**: User doesn't need to know the command exists.
|
|
229
|
+
|
|
230
|
+
### With Socratic Gate
|
|
231
|
+
|
|
232
|
+
- **Auto-routing does NOT bypass Socratic Gate**
|
|
233
|
+
- If task is unclear, still ask questions first
|
|
234
|
+
- Then route to appropriate agent
|
|
235
|
+
|
|
236
|
+
### With GEMINI.md Rules
|
|
237
|
+
|
|
238
|
+
- **Priority**: GEMINI.md rules > intelligent-routing
|
|
239
|
+
- If GEMINI.md specifies explicit routing, follow it
|
|
240
|
+
- Intelligent routing is the DEFAULT when no explicit rule exists
|
|
241
|
+
|
|
242
|
+
## Testing the System
|
|
243
|
+
|
|
244
|
+
### Test Cases
|
|
245
|
+
|
|
246
|
+
#### Test 1: Simple Frontend Task
|
|
247
|
+
|
|
248
|
+
```text
|
|
249
|
+
User: "Create a dark mode toggle button"
|
|
250
|
+
Expected: Auto-invoke frontend-specialist
|
|
251
|
+
Verify: Response shows "Using @frontend-specialist"
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
#### Test 2: Security Task
|
|
255
|
+
|
|
256
|
+
```text
|
|
257
|
+
User: "Review the authentication flow for vulnerabilities"
|
|
258
|
+
Expected: Auto-invoke security-auditor
|
|
259
|
+
Verify: Security-focused analysis
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
#### Test 3: Complex Multi-Domain
|
|
263
|
+
|
|
264
|
+
```text
|
|
265
|
+
User: "Build a chat application with real-time notifications"
|
|
266
|
+
Expected: Auto-invoke orchestrator
|
|
267
|
+
Verify: Multiple agents coordinated (backend, frontend, test)
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
#### Test 4: Bug Fix
|
|
271
|
+
|
|
272
|
+
```text
|
|
273
|
+
User: "Login is not working, getting 401 error"
|
|
274
|
+
Expected: Auto-invoke debugger
|
|
275
|
+
Verify: Systematic debugging approach
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
## Performance Considerations
|
|
279
|
+
|
|
280
|
+
### Token Usage
|
|
281
|
+
|
|
282
|
+
- Analysis adds ~50-100 tokens per request
|
|
283
|
+
- Tradeoff: Better accuracy vs slight overhead
|
|
284
|
+
- Overall SAVES tokens by reducing back-and-forth
|
|
285
|
+
|
|
286
|
+
### Response Time
|
|
287
|
+
|
|
288
|
+
- Analysis is instant (pattern matching)
|
|
289
|
+
- No additional API calls required
|
|
290
|
+
- Agent selection happens before first response
|
|
291
|
+
|
|
292
|
+
## User Education
|
|
293
|
+
|
|
294
|
+
### Optional: First-Time Explanation
|
|
295
|
+
|
|
296
|
+
If this is the first interaction in a project:
|
|
297
|
+
|
|
298
|
+
```markdown
|
|
299
|
+
π‘ **Tip**: I am configured with automatic specialist agent selection.
|
|
300
|
+
I will always choose the most suitable specialist for your task. You can
|
|
301
|
+
still mention agents explicitly with `@agent-name` if you prefer.
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## Debugging Agent Selection
|
|
305
|
+
|
|
306
|
+
### Enable Debug Mode (for development)
|
|
307
|
+
|
|
308
|
+
Add to GEMINI.md temporarily:
|
|
309
|
+
|
|
310
|
+
```markdown
|
|
311
|
+
## DEBUG: Intelligent Routing
|
|
312
|
+
|
|
313
|
+
Show selection reasoning:
|
|
314
|
+
|
|
315
|
+
- Detected domains: [list]
|
|
316
|
+
- Selected agent: [name]
|
|
317
|
+
- Reasoning: [why]
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
## Summary
|
|
321
|
+
|
|
322
|
+
**intelligent-routing skill enables:**
|
|
323
|
+
|
|
324
|
+
β
Zero-command operation (no need for `/orchestrate`)
|
|
325
|
+
β
Automatic specialist selection based on request analysis
|
|
326
|
+
β
Transparent communication of which expertise is being applied
|
|
327
|
+
β
Seamless integration with existing workflows
|
|
328
|
+
β
Override capability for explicit agent mentions
|
|
329
|
+
β
Fallback to orchestrator for complex tasks
|
|
330
|
+
|
|
331
|
+
**Result**: User gets specialist-level responses without needing to know the system architecture.
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
**Next Steps**: Integrate this skill into GEMINI.md TIER 0 rules.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: knowledge-management
|
|
3
|
+
description: Systems thinking and knowledge retention protocol. MANDATORY for maintaining architectural consistency, recording integration knowledge (API characteristics), and ensuring complete, holistic code updates.
|
|
4
|
+
allowed-tools: Read, Write, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Knowledge Management & Systems Thinking
|
|
8
|
+
|
|
9
|
+
> **MANDATORY:** Use this protocol to ensure the AI acts as a long-term technical partner with memory, rather than a stateless coder.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 1. π§ THE KNOWLEDGE BACKBONE (`.agent/knowledge/`)
|
|
14
|
+
|
|
15
|
+
**PRINCIPLE:** Never rely on assumptions or ephemeral conversation memory for project characteristics. Store them permanently.
|
|
16
|
+
|
|
17
|
+
### Mandatory Read Before Action
|
|
18
|
+
Before interacting with any third-party API, database schema, or core system component, you **MUST** search the `.agent/knowledge/` directory for existing documentation.
|
|
19
|
+
*Example: Before coding a DNSE WebSocket feature, read `.agent/knowledge/integrations/dnse_api.md` to get the exact channels and payload structures.*
|
|
20
|
+
|
|
21
|
+
### Mandatory Proactive Updates (Zero Prompting Rule)
|
|
22
|
+
When you successfully:
|
|
23
|
+
- Connect to an API and figure out its exact endpoints/payloads.
|
|
24
|
+
- Discover a system limitation or quirky behavior.
|
|
25
|
+
- Understand how a specific module works after debugging.
|
|
26
|
+
- **Refactor, rewire, or change the core architecture/logic of the system.**
|
|
27
|
+
|
|
28
|
+
You **MUST** proactively document or update this into a structured markdown file in `.agent/knowledge/` **IMMEDIATELY IN THE SAME TASK**.
|
|
29
|
+
*Do NOT wait for the user to remind you. Waiting for the user to say "update the knowledge base" is considered a FAILURE of this protocol. You must ensure the AI brain is synced before you declare the task complete.*
|
|
30
|
+
*Do not just solve the problem for the current session. Build the skeleton for the next session.*
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 2. πΈοΈ SYSTEMS THINKING (HOLISTIC UPDATES)
|
|
35
|
+
|
|
36
|
+
**PRINCIPLE:** A codebase is an interconnected web. Changing one node without checking its dependencies is unacceptable.
|
|
37
|
+
|
|
38
|
+
### The "No Orphaned Code" Rule
|
|
39
|
+
When you are asked to:
|
|
40
|
+
- Rename a feature (e.g., "Audit" -> "Validation").
|
|
41
|
+
- Remove a feature.
|
|
42
|
+
- Change the structure of an API response.
|
|
43
|
+
|
|
44
|
+
You **MUST NOT** just edit the immediate file and stop. You must:
|
|
45
|
+
1. Use `grep_search` to find every instance of the old name/concept across the entire codebase (`Frontend`, `Backend`, `Titles`, `UI Text`).
|
|
46
|
+
2. Update **ALL** related instances.
|
|
47
|
+
*Example Anti-Pattern: Removing the backend logic for an 'Audit Report' but leaving a blank UI Panel with the title "Audit Report" on the frontend.*
|
|
48
|
+
|
|
49
|
+
### Context Boundaries & The Ripple Effect
|
|
50
|
+
When modifying a feature or fixing a bug, ask yourself:
|
|
51
|
+
1. Who calls this function?
|
|
52
|
+
2. What UI component relies on this data?
|
|
53
|
+
3. **Does this change make the current Knowledge Base outdated?**
|
|
54
|
+
- If YES, you **MUST** pause and update the relevant `.md` files in `.agent/knowledge/` right then and there. A working codebase with an outdated AI brain is a broken project.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lint-and-validate
|
|
3
|
+
description: Automatic quality control, linting, and static analysis procedures. Use after every code modification to ensure syntax correctness and project standards. Triggers onKeywords: lint, format, check, validate, types, static analysis.
|
|
4
|
+
allowed-tools: Read, Glob, Grep, Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Lint and Validate Skill
|
|
8
|
+
|
|
9
|
+
> **MANDATORY:** Run appropriate validation tools after EVERY code change. Do not finish a task until the code is error-free.
|
|
10
|
+
|
|
11
|
+
### Procedures by Ecosystem
|
|
12
|
+
|
|
13
|
+
#### Node.js / TypeScript
|
|
14
|
+
1. **Lint/Fix:** `npm run lint` or `npx eslint "path" --fix`
|
|
15
|
+
2. **Types:** `npx tsc --noEmit`
|
|
16
|
+
3. **Security:** `npm audit --audit-level=high`
|
|
17
|
+
|
|
18
|
+
#### Python
|
|
19
|
+
1. **Linter (Ruff):** `ruff check "path" --fix` (Fast & Modern)
|
|
20
|
+
2. **Security (Bandit):** `bandit -r "path" -ll`
|
|
21
|
+
3. **Types (MyPy):** `mypy "path"`
|
|
22
|
+
|
|
23
|
+
## The Quality Loop
|
|
24
|
+
1. **Write/Edit Code**
|
|
25
|
+
2. **Run Audit:** `npm run lint && npx tsc --noEmit`
|
|
26
|
+
3. **Analyze Report:** Check the "FINAL AUDIT REPORT" section.
|
|
27
|
+
4. **Fix & Repeat:** Submitting code with "FINAL AUDIT" failures is NOT allowed.
|
|
28
|
+
|
|
29
|
+
## Error Handling
|
|
30
|
+
- If `lint` fails: Fix the style or syntax issues immediately.
|
|
31
|
+
- If `tsc` fails: Correct type mismatches before proceeding.
|
|
32
|
+
- If no tool is configured: Check the project root for `.eslintrc`, `tsconfig.json`, `pyproject.toml` and suggest creating one.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
**Strict Rule:** No code should be committed or reported as "done" without passing these checks.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Scripts
|
|
40
|
+
|
|
41
|
+
| Script | Purpose | Command |
|
|
42
|
+
|--------|---------|---------|
|
|
43
|
+
| `scripts/lint_runner.py` | Unified lint check | `python scripts/lint_runner.py <project_path>` |
|
|
44
|
+
| `scripts/type_coverage.py` | Type coverage analysis | `python scripts/type_coverage.py <project_path>` |
|
|
45
|
+
|