@musashishao/agent-kit 1.9.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/agents/ai-asset-factory.md +700 -0
- package/.agent/agents/ai-audio-factory.md +503 -0
- package/.agent/agents/game-developer.md +4 -4
- package/.agent/agents/orchestrator.md +113 -3
- package/.agent/agents/project-planner.md +67 -0
- package/.agent/agents/unity-mobile-master.md +949 -0
- package/.agent/mcp/config/registry.json +65 -51
- package/.agent/mcp/servers/notebooklm/README.md +114 -0
- package/.agent/mcp/servers/notebooklm/package.json +35 -0
- package/.agent/mcp/servers/notebooklm/src/auth/chrome.ts +225 -0
- package/.agent/mcp/servers/notebooklm/src/auth/index.ts +1 -0
- package/.agent/mcp/servers/notebooklm/src/index.ts +516 -0
- package/.agent/mcp/servers/notebooklm/src/services/index.ts +3 -0
- package/.agent/mcp/servers/notebooklm/src/services/library.ts +217 -0
- package/.agent/mcp/servers/notebooklm/src/services/notebooklm.ts +380 -0
- package/.agent/mcp/servers/notebooklm/tsconfig.json +15 -0
- package/.agent/mcp-gateway/README.md +169 -20
- package/.agent/mcp-gateway/package.json +22 -7
- package/.agent/mcp-gateway/src/auth/index.ts +55 -0
- package/.agent/mcp-gateway/src/auth/middleware.ts +242 -0
- package/.agent/mcp-gateway/src/auth/oauth.ts +462 -0
- package/.agent/mcp-gateway/src/auth/scopes.ts +227 -0
- package/.agent/mcp-gateway/src/index.ts +252 -105
- package/.agent/mcp-gateway/src/observability/index.ts +5 -0
- package/.agent/mcp-gateway/src/observability/otel.ts +405 -0
- package/.agent/mcp-gateway/src/transports/index.ts +5 -0
- package/.agent/mcp-gateway/src/transports/streamableHttp.ts +235 -0
- package/.agent/rules/CODEX.md +89 -0
- package/.agent/rules/CODE_RULES.md +73 -0
- package/.agent/rules/GEMINI.md +25 -0
- package/.agent/rules/MEMORY_STATE.md +110 -0
- package/.agent/rules/REFERENCE.md +33 -141
- package/.agent/rules/REF_SKILLS.md +116 -0
- package/.agent/rules/REF_WORKFLOWS.md +81 -0
- package/.agent/scripts/ak_cli.py +106 -5
- package/.agent/scripts/memory_manager.py +48 -9
- package/.agent/skills/anti-hallucination/SKILL.md +295 -0
- package/.agent/skills/anti-hallucination/scripts/check_hallucination.py +299 -0
- package/.agent/skills/bifurcation-analysis/SKILL.md +56 -0
- package/.agent/skills/brainstorming/SKILL.md +80 -6
- package/.agent/skills/decision-memory/SKILL.md +317 -0
- package/.agent/skills/emergence-detector/SKILL.md +230 -0
- package/.agent/skills/emergence-detector/scripts/check_emergence.py +265 -0
- package/.agent/skills/explained-qa/SKILL.md +142 -0
- package/.agent/skills/explained-qa/game-terminology.md +214 -0
- package/.agent/skills/game-development/ai-dialogue-engine/SKILL.md +442 -0
- package/.agent/skills/game-development/ai-graphics-generator/SKILL.md +463 -0
- package/.agent/skills/game-development/ai-playtest-framework/SKILL.md +570 -0
- package/.agent/skills/game-development/camera-systems/SKILL.md +607 -0
- package/.agent/skills/game-development/card-battle-engine/SKILL.md +618 -0
- package/.agent/skills/game-development/character-controller-3d/SKILL.md +908 -0
- package/.agent/skills/game-development/cloud-save-sync/SKILL.md +527 -0
- package/.agent/skills/game-development/combat-system/SKILL.md +748 -0
- package/.agent/skills/game-development/compliance-rating/SKILL.md +277 -0
- package/.agent/skills/game-development/crossplatform-build/SKILL.md +386 -0
- package/.agent/skills/game-development/cultivation-progression/SKILL.md +520 -0
- package/.agent/skills/game-development/data-driven-balance/SKILL.md +535 -0
- package/.agent/skills/game-development/game-analytics-integrator/SKILL.md +410 -0
- package/.agent/skills/game-development/game-audio-advanced/SKILL.md +646 -0
- package/.agent/skills/game-development/game-economy-designer/SKILL.md +375 -0
- package/.agent/skills/game-development/game-marketing/SKILL.md +85 -0
- package/.agent/skills/game-development/game-state-manager/SKILL.md +883 -0
- package/.agent/skills/game-development/hybrid-game-spec/SKILL.md +220 -0
- package/.agent/skills/game-development/inventory-quest/SKILL.md +747 -0
- package/.agent/skills/game-development/liveops/SKILL.md +308 -0
- package/.agent/skills/game-development/localization/SKILL.md +286 -0
- package/.agent/skills/game-development/mobile-input-patterns/SKILL.md +343 -0
- package/.agent/skills/game-development/monetization-strategy/SKILL.md +94 -0
- package/.agent/skills/game-development/multiplayer-master/SKILL.md +727 -0
- package/.agent/skills/game-development/narrative-branching/SKILL.md +593 -0
- package/.agent/skills/game-development/procedural-level-ai/SKILL.md +367 -0
- package/.agent/skills/game-development/prototyping-rapid/SKILL.md +205 -0
- package/.agent/skills/game-development/spec-ecosystem/SKILL.md +155 -0
- package/.agent/skills/game-development/spec-ecosystem/decision-log-format.md +129 -0
- package/.agent/skills/game-development/spec-ecosystem/templates/PLAN-template.md +178 -0
- package/.agent/skills/game-development/spec-ecosystem/templates/SPEC-template.md +110 -0
- package/.agent/skills/game-development/spec-ecosystem/templates/TASKS-template.md +156 -0
- package/.agent/skills/game-development/survival-systems/SKILL.md +493 -0
- package/.agent/skills/game-development/testing-qa/SKILL.md +270 -0
- package/.agent/skills/game-development/unity-mobile-optimization/SKILL.md +271 -0
- package/.agent/skills/intent-capture/SKILL.md +65 -0
- package/.agent/skills/mcp-composition/SKILL.md +362 -0
- package/.agent/skills/mcp-observability/SKILL.md +323 -0
- package/.agent/skills/mcp-security/SKILL.md +314 -0
- package/.agent/skills/trust-spectrum/SKILL.md +291 -0
- package/.agent/skills/vibe-coding-guard/SKILL.md +328 -0
- package/.agent/templates/AGENTS.game.md +63 -0
- package/.agent/templates/docs/WORKFLOW_GUIDE.en.md +100 -0
- package/.agent/templates/docs/WORKFLOW_GUIDE.vi.md +100 -0
- package/.agent/workflows/ai-agent.md +2 -0
- package/.agent/workflows/autofix.md +1 -0
- package/.agent/workflows/brainstorm.md +1 -0
- package/.agent/workflows/context.md +1 -0
- package/.agent/workflows/create.md +39 -8
- package/.agent/workflows/dashboard.md +1 -0
- package/.agent/workflows/debug.md +14 -0
- package/.agent/workflows/deploy.md +14 -0
- package/.agent/workflows/enhance.md +44 -0
- package/.agent/workflows/gamekit-init.md +177 -0
- package/.agent/workflows/gamekit-launch.md +338 -0
- package/.agent/workflows/gamekit-plan.md +204 -0
- package/.agent/workflows/gamekit-qa.md +153 -0
- package/.agent/workflows/gamekit-spec.md +243 -0
- package/.agent/workflows/gamekit-tasks.md +208 -0
- package/.agent/workflows/marketing.md +2 -0
- package/.agent/workflows/next.md +1 -0
- package/.agent/workflows/orchestrate.md +12 -0
- package/.agent/workflows/pentest.md +2 -0
- package/.agent/workflows/plan.md +42 -0
- package/.agent/workflows/preview.md +1 -0
- package/.agent/workflows/quality.md +1 -0
- package/.agent/workflows/saas.md +2 -0
- package/.agent/workflows/spec.md +42 -0
- package/.agent/workflows/status.md +1 -0
- package/.agent/workflows/test.md +14 -0
- package/.agent/workflows/ui-ux-pro-max.md +1 -0
- package/bin/cli.js +411 -111
- package/package.json +1 -2
- package/.agent/agents/game-asset-curator.md +0 -317
- package/.agent/agents/game-narrative-designer.md +0 -310
- package/.agent/agents/game-qa-agent.md +0 -441
- package/.agent/workflows/game-prototype.md +0 -154
- package/docs/AI_DATA_INFRASTRUCTURE.md +0 -288
- package/docs/CHANGELOG_AI_INFRA.md +0 -141
- package/docs/MIGRATION_GUIDE_V1.9.md +0 -55
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Emergence Detector Script
|
|
4
|
+
Detects unexpected AI behaviors in generated code
|
|
5
|
+
|
|
6
|
+
Usage:
|
|
7
|
+
python check_emergence.py <file_or_directory>
|
|
8
|
+
python check_emergence.py --compare <intent_file> <output_file>
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import argparse
|
|
12
|
+
import json
|
|
13
|
+
import os
|
|
14
|
+
import re
|
|
15
|
+
import subprocess
|
|
16
|
+
import sys
|
|
17
|
+
from dataclasses import dataclass
|
|
18
|
+
from datetime import datetime
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
from typing import List, Optional, Dict, Any
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@dataclass
|
|
24
|
+
class EmergenceIssue:
|
|
25
|
+
type: str # SCOPE_CREEP, PHANTOM_PACKAGE, PHANTOM_API, SECURITY, PATTERN_DEVIATION
|
|
26
|
+
severity: str # CRITICAL, HIGH, MEDIUM, LOW
|
|
27
|
+
file: str
|
|
28
|
+
line: Optional[int]
|
|
29
|
+
detail: str
|
|
30
|
+
suggestion: Optional[str] = None
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class EmergenceDetector:
|
|
34
|
+
"""Detect unexpected behaviors in AI-generated code"""
|
|
35
|
+
|
|
36
|
+
# Patterns that suggest hallucinated APIs
|
|
37
|
+
PHANTOM_API_PATTERNS = [
|
|
38
|
+
(r"fetch\.advanced\(", "fetch.advanced() does not exist"),
|
|
39
|
+
(r"console\.print\(", "console.print() does not exist, use console.log()"),
|
|
40
|
+
(r"Array\.smart\(", "Array.smart() does not exist"),
|
|
41
|
+
(r"Object\.deepMerge\(", "Object.deepMerge() does not exist"),
|
|
42
|
+
(r"String\.format\(", "String.format() does not exist in JS"),
|
|
43
|
+
(r"process\.env\.AUTO_", "AUTO_ prefixed env vars are likely hallucinated"),
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
# Security patterns
|
|
47
|
+
SECURITY_PATTERNS = [
|
|
48
|
+
(r"eval\s*\(", "Dangerous eval() usage", "CRITICAL"),
|
|
49
|
+
(r"innerHTML\s*=", "Potential XSS via innerHTML", "HIGH"),
|
|
50
|
+
(r"document\.write\s*\(", "Deprecated document.write()", "MEDIUM"),
|
|
51
|
+
(r"exec\s*\(", "Dangerous exec() usage", "CRITICAL"),
|
|
52
|
+
(r"__import__\s*\(", "Dynamic import can be dangerous", "HIGH"),
|
|
53
|
+
(r"password\s*=\s*['\"][^'\"]+['\"]", "Hardcoded password detected", "CRITICAL"),
|
|
54
|
+
(r"api_key\s*=\s*['\"][^'\"]+['\"]", "Hardcoded API key detected", "CRITICAL"),
|
|
55
|
+
(r"secret\s*=\s*['\"][^'\"]+['\"]", "Hardcoded secret detected", "CRITICAL"),
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
def __init__(self, verbose: bool = False):
|
|
59
|
+
self.verbose = verbose
|
|
60
|
+
self.issues: List[EmergenceIssue] = []
|
|
61
|
+
|
|
62
|
+
def check_file(self, filepath: str) -> List[EmergenceIssue]:
|
|
63
|
+
"""Check a single file for emergence issues"""
|
|
64
|
+
issues = []
|
|
65
|
+
|
|
66
|
+
try:
|
|
67
|
+
with open(filepath, 'r', encoding='utf-8') as f:
|
|
68
|
+
content = f.read()
|
|
69
|
+
lines = content.split('\n')
|
|
70
|
+
except Exception as e:
|
|
71
|
+
if self.verbose:
|
|
72
|
+
print(f"Could not read {filepath}: {e}")
|
|
73
|
+
return issues
|
|
74
|
+
|
|
75
|
+
# Check for phantom APIs
|
|
76
|
+
for pattern, message in self.PHANTOM_API_PATTERNS:
|
|
77
|
+
for i, line in enumerate(lines, 1):
|
|
78
|
+
if re.search(pattern, line):
|
|
79
|
+
issues.append(EmergenceIssue(
|
|
80
|
+
type="PHANTOM_API",
|
|
81
|
+
severity="HIGH",
|
|
82
|
+
file=filepath,
|
|
83
|
+
line=i,
|
|
84
|
+
detail=message,
|
|
85
|
+
suggestion="Check official documentation"
|
|
86
|
+
))
|
|
87
|
+
|
|
88
|
+
# Check for security issues
|
|
89
|
+
for pattern, message, severity in self.SECURITY_PATTERNS:
|
|
90
|
+
for i, line in enumerate(lines, 1):
|
|
91
|
+
if re.search(pattern, line, re.IGNORECASE):
|
|
92
|
+
issues.append(EmergenceIssue(
|
|
93
|
+
type="SECURITY",
|
|
94
|
+
severity=severity,
|
|
95
|
+
file=filepath,
|
|
96
|
+
line=i,
|
|
97
|
+
detail=message
|
|
98
|
+
))
|
|
99
|
+
|
|
100
|
+
# Check for phantom packages in imports
|
|
101
|
+
issues.extend(self._check_imports(filepath, content))
|
|
102
|
+
|
|
103
|
+
return issues
|
|
104
|
+
|
|
105
|
+
def _check_imports(self, filepath: str, content: str) -> List[EmergenceIssue]:
|
|
106
|
+
"""Check if imported packages actually exist"""
|
|
107
|
+
issues = []
|
|
108
|
+
|
|
109
|
+
# JavaScript/TypeScript imports
|
|
110
|
+
js_imports = re.findall(r"(?:import\s+.*?from\s+['\"]|require\s*\(\s*['\"])([^'\"./][^'\"]*)['\"]", content)
|
|
111
|
+
|
|
112
|
+
# Python imports
|
|
113
|
+
py_imports = re.findall(r"^(?:from\s+(\w+)|import\s+(\w+))", content, re.MULTILINE)
|
|
114
|
+
py_imports = [p[0] or p[1] for p in py_imports]
|
|
115
|
+
|
|
116
|
+
all_imports = js_imports + py_imports
|
|
117
|
+
|
|
118
|
+
for pkg in set(all_imports):
|
|
119
|
+
if not self._package_exists(pkg, filepath):
|
|
120
|
+
issues.append(EmergenceIssue(
|
|
121
|
+
type="PHANTOM_PACKAGE",
|
|
122
|
+
severity="CRITICAL",
|
|
123
|
+
file=filepath,
|
|
124
|
+
line=None,
|
|
125
|
+
detail=f"Package '{pkg}' may not exist",
|
|
126
|
+
suggestion=f"Verify package exists: npm view {pkg} OR pip show {pkg}"
|
|
127
|
+
))
|
|
128
|
+
|
|
129
|
+
return issues
|
|
130
|
+
|
|
131
|
+
def _package_exists(self, package: str, filepath: str) -> bool:
|
|
132
|
+
"""Check if a package exists (basic heuristic)"""
|
|
133
|
+
# Skip checking for common/known packages
|
|
134
|
+
KNOWN_PACKAGES = {
|
|
135
|
+
# JS/TS
|
|
136
|
+
'react', 'next', 'express', 'lodash', 'axios', 'moment', 'dayjs',
|
|
137
|
+
'typescript', 'zod', 'prisma', 'tailwindcss', 'postcss', 'autoprefixer',
|
|
138
|
+
# Python
|
|
139
|
+
'os', 'sys', 'json', 're', 'datetime', 'pathlib', 'typing',
|
|
140
|
+
'requests', 'flask', 'django', 'fastapi', 'pydantic',
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
base_pkg = package.split('/')[0].split('.')[0]
|
|
144
|
+
return base_pkg.lower() in KNOWN_PACKAGES
|
|
145
|
+
|
|
146
|
+
def check_directory(self, dirpath: str, extensions: List[str] = None) -> List[EmergenceIssue]:
|
|
147
|
+
"""Check all files in a directory"""
|
|
148
|
+
if extensions is None:
|
|
149
|
+
extensions = ['.js', '.jsx', '.ts', '.tsx', '.py', '.go', '.rs']
|
|
150
|
+
|
|
151
|
+
issues = []
|
|
152
|
+
for root, dirs, files in os.walk(dirpath):
|
|
153
|
+
# Skip node_modules, .git, etc.
|
|
154
|
+
dirs[:] = [d for d in dirs if d not in ['node_modules', '.git', 'dist', 'build', '__pycache__']]
|
|
155
|
+
|
|
156
|
+
for file in files:
|
|
157
|
+
if any(file.endswith(ext) for ext in extensions):
|
|
158
|
+
filepath = os.path.join(root, file)
|
|
159
|
+
issues.extend(self.check_file(filepath))
|
|
160
|
+
|
|
161
|
+
return issues
|
|
162
|
+
|
|
163
|
+
def compare_intent_output(self, intent: str, output: str) -> Dict[str, Any]:
|
|
164
|
+
"""Compare user intent with AI output to detect scope creep"""
|
|
165
|
+
# This is a simplified heuristic-based approach
|
|
166
|
+
# In production, you'd use LLM for semantic comparison
|
|
167
|
+
|
|
168
|
+
intent_keywords = set(re.findall(r'\b\w+\b', intent.lower()))
|
|
169
|
+
output_keywords = set(re.findall(r'\b\w+\b', output.lower()))
|
|
170
|
+
|
|
171
|
+
# Keywords in output but not in intent might indicate scope creep
|
|
172
|
+
extra_keywords = output_keywords - intent_keywords
|
|
173
|
+
|
|
174
|
+
# Filter out common code keywords
|
|
175
|
+
CODE_KEYWORDS = {'const', 'let', 'var', 'function', 'return', 'if', 'else',
|
|
176
|
+
'import', 'export', 'from', 'class', 'interface', 'type'}
|
|
177
|
+
extra_keywords = extra_keywords - CODE_KEYWORDS
|
|
178
|
+
|
|
179
|
+
return {
|
|
180
|
+
"potential_scope_creep": len(extra_keywords) > len(intent_keywords) * 2,
|
|
181
|
+
"extra_concepts": list(extra_keywords)[:20],
|
|
182
|
+
"recommendation": "Review if these additions were requested" if extra_keywords else "Output appears aligned with intent"
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
def format_report(self, issues: List[EmergenceIssue]) -> str:
|
|
186
|
+
"""Format issues as a readable report"""
|
|
187
|
+
if not issues:
|
|
188
|
+
return "✅ No emergence issues detected"
|
|
189
|
+
|
|
190
|
+
report = []
|
|
191
|
+
report.append(f"⚠️ EMERGENCE REPORT: {len(issues)} issues found\n")
|
|
192
|
+
report.append("=" * 50)
|
|
193
|
+
|
|
194
|
+
# Group by severity
|
|
195
|
+
by_severity = {}
|
|
196
|
+
for issue in issues:
|
|
197
|
+
by_severity.setdefault(issue.severity, []).append(issue)
|
|
198
|
+
|
|
199
|
+
severity_order = ['CRITICAL', 'HIGH', 'MEDIUM', 'LOW']
|
|
200
|
+
severity_emoji = {'CRITICAL': '🔴', 'HIGH': '🟠', 'MEDIUM': '🟡', 'LOW': '🟢'}
|
|
201
|
+
|
|
202
|
+
for severity in severity_order:
|
|
203
|
+
if severity in by_severity:
|
|
204
|
+
report.append(f"\n{severity_emoji[severity]} {severity} ({len(by_severity[severity])})")
|
|
205
|
+
report.append("-" * 30)
|
|
206
|
+
for issue in by_severity[severity]:
|
|
207
|
+
loc = f":{issue.line}" if issue.line else ""
|
|
208
|
+
report.append(f" [{issue.type}] {issue.file}{loc}")
|
|
209
|
+
report.append(f" → {issue.detail}")
|
|
210
|
+
if issue.suggestion:
|
|
211
|
+
report.append(f" 💡 {issue.suggestion}")
|
|
212
|
+
|
|
213
|
+
return "\n".join(report)
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
def main():
|
|
217
|
+
parser = argparse.ArgumentParser(description="Detect emergence issues in AI-generated code")
|
|
218
|
+
parser.add_argument("path", help="File or directory to check")
|
|
219
|
+
parser.add_argument("--json", action="store_true", help="Output as JSON")
|
|
220
|
+
parser.add_argument("--verbose", "-v", action="store_true", help="Verbose output")
|
|
221
|
+
parser.add_argument("--compare", nargs=2, metavar=("INTENT", "OUTPUT"),
|
|
222
|
+
help="Compare intent file with output file")
|
|
223
|
+
|
|
224
|
+
args = parser.parse_args()
|
|
225
|
+
|
|
226
|
+
detector = EmergenceDetector(verbose=args.verbose)
|
|
227
|
+
|
|
228
|
+
if args.compare:
|
|
229
|
+
with open(args.compare[0]) as f:
|
|
230
|
+
intent = f.read()
|
|
231
|
+
with open(args.compare[1]) as f:
|
|
232
|
+
output = f.read()
|
|
233
|
+
result = detector.compare_intent_output(intent, output)
|
|
234
|
+
print(json.dumps(result, indent=2))
|
|
235
|
+
return
|
|
236
|
+
|
|
237
|
+
path = args.path
|
|
238
|
+
|
|
239
|
+
if os.path.isfile(path):
|
|
240
|
+
issues = detector.check_file(path)
|
|
241
|
+
elif os.path.isdir(path):
|
|
242
|
+
issues = detector.check_directory(path)
|
|
243
|
+
else:
|
|
244
|
+
print(f"Error: {path} not found")
|
|
245
|
+
sys.exit(1)
|
|
246
|
+
|
|
247
|
+
if args.json:
|
|
248
|
+
print(json.dumps([{
|
|
249
|
+
"type": i.type,
|
|
250
|
+
"severity": i.severity,
|
|
251
|
+
"file": i.file,
|
|
252
|
+
"line": i.line,
|
|
253
|
+
"detail": i.detail,
|
|
254
|
+
"suggestion": i.suggestion
|
|
255
|
+
} for i in issues], indent=2))
|
|
256
|
+
else:
|
|
257
|
+
print(detector.format_report(issues))
|
|
258
|
+
|
|
259
|
+
# Exit with error code if critical issues found
|
|
260
|
+
if any(i.severity == "CRITICAL" for i in issues):
|
|
261
|
+
sys.exit(1)
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
if __name__ == "__main__":
|
|
265
|
+
main()
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: explained-qa
|
|
3
|
+
description: Skill to generate Q&A with explanations for non-tech stakeholders. Use when asking technical questions to PM, Designer, or non-developer users. Includes game-specific terminology database.
|
|
4
|
+
allowed-tools: Read, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Explained Q&A Skill
|
|
8
|
+
|
|
9
|
+
> **Purpose:** Make technical questions accessible to ALL stakeholders by providing real-world analogies and clear options.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## When to Use This Skill
|
|
14
|
+
|
|
15
|
+
| Scenario | Trigger |
|
|
16
|
+
|----------|---------|
|
|
17
|
+
| Asking game architecture questions | User is PM/Designer |
|
|
18
|
+
| Technical decision needed | User skill_level != "technical" |
|
|
19
|
+
| Complex trade-off question | Any user |
|
|
20
|
+
| Game development terminology | Any game project |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Question Format (MANDATORY)
|
|
25
|
+
|
|
26
|
+
Every technical question MUST follow this structure:
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
### ❓ [Question Title in Simple Terms]
|
|
30
|
+
|
|
31
|
+
> 💡 **Giải thích đơn giản (Explained Simply):**
|
|
32
|
+
> [Real-world analogy in 2-3 sentences]
|
|
33
|
+
>
|
|
34
|
+
> **Ví dụ thực tế:** [Concrete example from everyday life]
|
|
35
|
+
|
|
36
|
+
**Câu hỏi kỹ thuật:** [Original technical question]
|
|
37
|
+
|
|
38
|
+
**Lựa chọn:**
|
|
39
|
+
| Option | Mô tả đơn giản | Phù hợp khi |
|
|
40
|
+
|--------|----------------|-------------|
|
|
41
|
+
| (A) [Name] | [Simple description] | [Use case] |
|
|
42
|
+
| (B) [Name] | [Simple description] | [Use case] |
|
|
43
|
+
| (C) Để AI quyết định | Bạn không chắc, để AI chọn dựa trên context | Bạn tin tưởng AI |
|
|
44
|
+
|
|
45
|
+
**Nếu không chọn:** [Default option + why]
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Example: Timestep Question
|
|
51
|
+
|
|
52
|
+
```markdown
|
|
53
|
+
### ❓ Game của bạn xử lý thời gian như thế nào?
|
|
54
|
+
|
|
55
|
+
> 💡 **Giải thích đơn giản:**
|
|
56
|
+
> Hãy tưởng tượng game như một bộ phim. Camera có thể quay theo 2 cách:
|
|
57
|
+
> - **Cách A:** Quay đúng 24 khung hình/giây, dù máy nhanh hay chậm
|
|
58
|
+
> - **Cách B:** Quay bao nhiêu khung hình tùy khả năng của máy
|
|
59
|
+
>
|
|
60
|
+
> **Ví dụ thực tế:** Cách A giống như đồng hồ cơ - luôn đều đặn. Cách B giống như nhịp tim - thay đổi theo hoạt động.
|
|
61
|
+
|
|
62
|
+
**Câu hỏi kỹ thuật:** Fixed Timestep hay Variable Timestep?
|
|
63
|
+
|
|
64
|
+
**Lựa chọn:**
|
|
65
|
+
| Option | Mô tả đơn giản | Phù hợp khi |
|
|
66
|
+
|--------|----------------|-------------|
|
|
67
|
+
| (A) Fixed | Chính xác, công bằng | Game PvP, esport, multiplayer |
|
|
68
|
+
| (B) Variable | Mượt mà, linh hoạt | Game casual, single-player |
|
|
69
|
+
| (C) Để AI quyết định | Dựa trên loại game bạn mô tả | Bạn không chắc |
|
|
70
|
+
|
|
71
|
+
**Nếu không chọn:** Fixed Timestep (an toàn hơn cho hầu hết game)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Analogy Bank (Quick Reference)
|
|
77
|
+
|
|
78
|
+
| Technical Concept | Analogy |
|
|
79
|
+
|-------------------|---------|
|
|
80
|
+
| **Fixed Timestep** | Đồng hồ cơ - luôn đều đặn |
|
|
81
|
+
| **Variable Timestep** | Nhịp tim - thay đổi theo hoạt động |
|
|
82
|
+
| **ECS** | LEGO - entity là hộp rỗng, component là viên gạch |
|
|
83
|
+
| **State Machine** | Đèn giao thông - chỉ 1 màu tại 1 thời điểm |
|
|
84
|
+
| **Object Pooling** | Hồ bơi bi - tái sử dụng thay vì tạo mới |
|
|
85
|
+
| **Event Bus** | Loa phát thanh - thông báo cho tất cả ai quan tâm |
|
|
86
|
+
| **Singleton** | Vua của vương quốc - chỉ có 1, ai cũng biết |
|
|
87
|
+
| **ScriptableObject** | Công thức nấu ăn - dữ liệu tách riêng khỏi nồi nấu |
|
|
88
|
+
|
|
89
|
+
> **Full terminology:** See `game-terminology.md` in this skill folder.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Decision Logging
|
|
94
|
+
|
|
95
|
+
After EVERY answered question, log to `.agent/memory/decisions.md`:
|
|
96
|
+
|
|
97
|
+
```markdown
|
|
98
|
+
## Session: [DATE]
|
|
99
|
+
|
|
100
|
+
### Q[N]: [Topic]
|
|
101
|
+
- **Câu hỏi:** [Technical question]
|
|
102
|
+
- **Giải thích:** [Analogy used]
|
|
103
|
+
- **Trả lời:** [User's choice]
|
|
104
|
+
- **Lý do:** "[User's reasoning if provided]"
|
|
105
|
+
- **Ảnh hưởng:** [Technical impact on project]
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Integration Points
|
|
113
|
+
|
|
114
|
+
| Skill/Workflow | Integration |
|
|
115
|
+
|----------------|-------------|
|
|
116
|
+
| `brainstorming` | Use Explained Q&A format for all Socratic questions |
|
|
117
|
+
| `/game-from-idea` | Phase 1 ideation uses this for all decisions |
|
|
118
|
+
| `/game-hybrid` | Tier 1 Macro Spec uses this for architecture questions |
|
|
119
|
+
| `/gamekit.spec` | All spec clarification questions use this |
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Anti-Patterns (AVOID)
|
|
124
|
+
|
|
125
|
+
| ❌ Don't | ✅ Do |
|
|
126
|
+
|----------|-------|
|
|
127
|
+
| Ask raw technical question | Always include "Giải thích đơn giản" box |
|
|
128
|
+
| Use jargon without context | Provide real-world analogy |
|
|
129
|
+
| Assume user knows terms | Link to terminology if complex |
|
|
130
|
+
| Skip decision logging | ALWAYS log to decisions.md |
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Quality Checklist
|
|
135
|
+
|
|
136
|
+
Before asking any question:
|
|
137
|
+
|
|
138
|
+
- [ ] Analogy is from everyday life (not another tech domain)
|
|
139
|
+
- [ ] Options have simple descriptions
|
|
140
|
+
- [ ] "Để AI quyết định" option available
|
|
141
|
+
- [ ] Default specified if user skips
|
|
142
|
+
- [ ] Decision will be logged after answer
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
# Game Development Terminology - Explained for Non-Tech
|
|
2
|
+
|
|
3
|
+
> Database of game development terms with simple explanations and real-world analogies.
|
|
4
|
+
> Used by `explained-qa` skill to help PM, Designer, and non-developers understand technical decisions.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 🎮 Core Game Concepts
|
|
9
|
+
|
|
10
|
+
### Game Loop
|
|
11
|
+
**Technical:** The continuous cycle of input-update-render that runs every frame.
|
|
12
|
+
**Simple:** Như nhịp tim của game - liên tục đập: đọc nút bấm → tính toán → vẽ lên màn hình.
|
|
13
|
+
**Ví dụ:** Mỗi lần "đập" là 1/60 giây (60 FPS).
|
|
14
|
+
|
|
15
|
+
### Fixed Timestep
|
|
16
|
+
**Technical:** Game logic updates at a constant rate regardless of frame rate.
|
|
17
|
+
**Simple:** Như đồng hồ cơ học - luôn tích tắc đều đặn, dù pin yếu hay mạnh.
|
|
18
|
+
**Phù hợp:** Game cần công bằng (PvP, esport), multiplayer sync.
|
|
19
|
+
|
|
20
|
+
### Variable Timestep
|
|
21
|
+
**Technical:** Game logic updates based on actual time elapsed since last frame.
|
|
22
|
+
**Simple:** Như nhịp tim - đập nhanh hơn khi chạy, chậm hơn khi nghỉ.
|
|
23
|
+
**Phù hợp:** Game single-player, casual, cần mượt mà trên nhiều máy.
|
|
24
|
+
|
|
25
|
+
### Frame Rate (FPS)
|
|
26
|
+
**Technical:** Frames per second - how many images drawn per second.
|
|
27
|
+
**Simple:** Như flipbook (sách lật) - càng nhiều trang/giây, hoạt hình càng mượt.
|
|
28
|
+
**Chuẩn:** 30 FPS = chấp nhận được, 60 FPS = mượt, 120 FPS = cực mượt.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 🏗️ Architecture Patterns
|
|
33
|
+
|
|
34
|
+
### ECS (Entity Component System)
|
|
35
|
+
**Technical:** Architecture separating entities (IDs), components (data), and systems (logic).
|
|
36
|
+
**Simple:** Như LEGO - Entity là hộp rỗng, Component là viên gạch bạn gắn vào (tốc độ, máu, hình ảnh).
|
|
37
|
+
**Phù hợp:** Game có nhiều đối tượng tương tự (bullet hell, RTS, particle systems).
|
|
38
|
+
|
|
39
|
+
### State Machine
|
|
40
|
+
**Technical:** System where object can only be in one state at a time, with defined transitions.
|
|
41
|
+
**Simple:** Như đèn giao thông - chỉ có thể Đỏ HOẶC Vàng HOẶC Xanh, không bao giờ 2 màu cùng lúc.
|
|
42
|
+
**Phù hợp:** Nhân vật (Idle→Walk→Jump), AI đơn giản, menu states.
|
|
43
|
+
|
|
44
|
+
### Object Pooling
|
|
45
|
+
**Technical:** Reusing objects instead of creating/destroying them.
|
|
46
|
+
**Simple:** Như hồ bơi bi - khi cần bi, lấy từ hồ ra; khi xong, trả lại hồ thay vì vứt đi.
|
|
47
|
+
**Phù hợp:** Đạn, particle, enemies spawn nhiều - tránh lag do tạo/xóa liên tục.
|
|
48
|
+
|
|
49
|
+
### Singleton
|
|
50
|
+
**Technical:** Design pattern ensuring only one instance of a class exists.
|
|
51
|
+
**Simple:** Như Vua của vương quốc - chỉ có 1, ai cũng biết ai là Vua, không cần hỏi.
|
|
52
|
+
**Phù hợp:** GameManager, AudioManager, UIManager - những thứ chỉ cần 1 cái duy nhất.
|
|
53
|
+
|
|
54
|
+
### Event Bus / Observer
|
|
55
|
+
**Technical:** Publish-subscribe pattern for decoupled communication.
|
|
56
|
+
**Simple:** Như loa phát thanh trong trường - khi có thông báo, ai quan tâm thì nghe.
|
|
57
|
+
**Phù hợp:** UI cập nhật khi điểm thay đổi, Achievement unlock khi đạt điều kiện.
|
|
58
|
+
|
|
59
|
+
### ScriptableObject (Unity)
|
|
60
|
+
**Technical:** Data containers that store configuration separate from code.
|
|
61
|
+
**Simple:** Như công thức nấu ăn tách riêng khỏi nồi nấu - thay đổi công thức không cần đập nồi.
|
|
62
|
+
**Phù hợp:** Game balance (damage, speed), item definitions, level configs.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 🎨 Graphics & Rendering
|
|
67
|
+
|
|
68
|
+
### Sprite
|
|
69
|
+
**Technical:** 2D image used as game object.
|
|
70
|
+
**Simple:** Như sticker dán - hình 2D di chuyển trên màn hình.
|
|
71
|
+
**Phù hợp:** Game 2D, UI elements.
|
|
72
|
+
|
|
73
|
+
### Shader
|
|
74
|
+
**Technical:** Program that runs on GPU to determine how pixels look.
|
|
75
|
+
**Simple:** Như filter Instagram - thay đổi cách hình ảnh được hiển thị.
|
|
76
|
+
**Phù hợp:** Effects (glow, blur, water), visual style.
|
|
77
|
+
|
|
78
|
+
### Draw Call
|
|
79
|
+
**Technical:** Command sent to GPU to render something.
|
|
80
|
+
**Simple:** Như đơn hàng gửi đến nhà bếp - mỗi đơn tốn thời gian xử lý.
|
|
81
|
+
**Quan trọng:** Ít draw call = game chạy nhanh hơn.
|
|
82
|
+
|
|
83
|
+
### Batching
|
|
84
|
+
**Technical:** Combining multiple draw calls into one.
|
|
85
|
+
**Simple:** Như gom nhiều đơn hàng nhỏ thành 1 đơn lớn - nhà bếp xử lý nhanh hơn.
|
|
86
|
+
**Phù hợp:** Khi có nhiều object giống nhau (cây, đá, enemy cùng loại).
|
|
87
|
+
|
|
88
|
+
### LOD (Level of Detail)
|
|
89
|
+
**Technical:** Using simpler models for distant objects.
|
|
90
|
+
**Simple:** Như mắt người - nhìn xa thấy mờ, nhìn gần thấy chi tiết.
|
|
91
|
+
**Phù hợp:** Game 3D với world lớn, open world.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## 🔊 Audio
|
|
96
|
+
|
|
97
|
+
### Spatial Audio
|
|
98
|
+
**Technical:** 3D positioned sound that changes based on listener position.
|
|
99
|
+
**Simple:** Như tai người thật - nghe được âm thanh từ trái/phải/trước/sau.
|
|
100
|
+
**Phù hợp:** Game FPS, VR, horror - cần biết hướng âm thanh.
|
|
101
|
+
|
|
102
|
+
### Audio Mixer
|
|
103
|
+
**Technical:** Tool to control volume and effects for groups of sounds.
|
|
104
|
+
**Simple:** Như bàn trộn DJ - điều chỉnh âm lượng Music, SFX, Voice riêng biệt.
|
|
105
|
+
**Phù hợp:** Mọi game cần settings âm thanh.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 🌐 Multiplayer
|
|
110
|
+
|
|
111
|
+
### Client-Server
|
|
112
|
+
**Technical:** Architecture where server is authoritative and clients send inputs.
|
|
113
|
+
**Simple:** Như lớp học - Thầy giáo (server) quyết định điểm, học sinh (client) chỉ nộp bài.
|
|
114
|
+
**Phù hợp:** Game cần chống gian lận, competitive.
|
|
115
|
+
|
|
116
|
+
### Peer-to-Peer (P2P)
|
|
117
|
+
**Technical:** Direct connection between players without central server.
|
|
118
|
+
**Simple:** Như nhóm bạn nói chuyện trực tiếp - không qua ai trung gian.
|
|
119
|
+
**Phù hợp:** Game casual, co-op, ít người chơi.
|
|
120
|
+
|
|
121
|
+
### Lag Compensation
|
|
122
|
+
**Technical:** Techniques to hide network latency from players.
|
|
123
|
+
**Simple:** Như dự đoán thời tiết - đoán trước vị trí người chơi để game vẫn mượt dù mạng chậm.
|
|
124
|
+
**Phù hợp:** Game FPS tốc độ cao, fighting games.
|
|
125
|
+
|
|
126
|
+
### Rollback Netcode
|
|
127
|
+
**Technical:** Predicting inputs and correcting when actual inputs arrive.
|
|
128
|
+
**Simple:** Như viết thư - đoán thư trả lời trước, sửa lại nếu đoán sai.
|
|
129
|
+
**Phù hợp:** Fighting games, games cần phản hồi tức thì.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## 💾 Data & Save
|
|
134
|
+
|
|
135
|
+
### PlayerPrefs
|
|
136
|
+
**Technical:** Simple key-value storage for small data.
|
|
137
|
+
**Simple:** Như ghi chú Post-it - nhanh, tiện, nhưng chỉ cho thông tin nhỏ.
|
|
138
|
+
**Phù hợp:** Settings, high scores, simple progress.
|
|
139
|
+
|
|
140
|
+
### JSON Save
|
|
141
|
+
**Technical:** Structured data format saved as text file.
|
|
142
|
+
**Simple:** Như hồ sơ bệnh án - có cấu trúc rõ ràng, dễ đọc.
|
|
143
|
+
**Phù hợp:** Complex game state, inventory, quest progress.
|
|
144
|
+
|
|
145
|
+
### Cloud Save
|
|
146
|
+
**Technical:** Saving game data to remote server.
|
|
147
|
+
**Simple:** Như lưu file lên Google Drive - chơi máy nào cũng có dữ liệu.
|
|
148
|
+
**Phù hợp:** Game mobile, cross-platform, account-based.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 📊 AI & Behavior
|
|
153
|
+
|
|
154
|
+
### Behavior Tree
|
|
155
|
+
**Technical:** Hierarchical structure for complex AI decision making.
|
|
156
|
+
**Simple:** Như sơ đồ tư duy - "Nếu thấy địch → tiến công, nếu máu thấp → chạy".
|
|
157
|
+
**Phù hợp:** AI phức tạp, boss patterns, NPCs thông minh.
|
|
158
|
+
|
|
159
|
+
### Finite State Machine (FSM)
|
|
160
|
+
**Technical:** AI with discrete states and transitions.
|
|
161
|
+
**Simple:** Như đèn giao thông cho AI - Patrol → Chase → Attack → Return.
|
|
162
|
+
**Phù hợp:** AI đơn giản đến trung bình, enemies cơ bản.
|
|
163
|
+
|
|
164
|
+
### Pathfinding (A*)
|
|
165
|
+
**Technical:** Algorithm to find shortest path between points.
|
|
166
|
+
**Simple:** Như Google Maps cho nhân vật - tìm đường đi ngắn nhất tránh vật cản.
|
|
167
|
+
**Phù hợp:** Bất kỳ game nào AI cần di chuyển thông minh.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## 🎯 Game Design Terms
|
|
172
|
+
|
|
173
|
+
### Core Loop
|
|
174
|
+
**Technical:** The primary repeated gameplay cycle.
|
|
175
|
+
**Simple:** Vòng lặp 30 giây mà người chơi lặp đi lặp lại: Hành động → Phần thưởng → Tiến bộ.
|
|
176
|
+
**Ví dụ:** Candy Crush: Ghép → Điểm → Level mới.
|
|
177
|
+
|
|
178
|
+
### Progression System
|
|
179
|
+
**Technical:** How players advance and unlock content.
|
|
180
|
+
**Simple:** Như leo thang - mỗi bậc là reward mới, giữ người chơi muốn tiếp tục.
|
|
181
|
+
**Ví dụ:** XP + Level, Skill Tree, Story chapters.
|
|
182
|
+
|
|
183
|
+
### Meta Game
|
|
184
|
+
**Technical:** Systems outside core gameplay that affect long-term engagement.
|
|
185
|
+
**Simple:** "Game ngoài game" - collection, achievements, daily rewards.
|
|
186
|
+
**Phù hợp:** F2P games, live service games.
|
|
187
|
+
|
|
188
|
+
### Gacha
|
|
189
|
+
**Technical:** Random reward system, often monetized.
|
|
190
|
+
**Simple:** Như máy gắp thú - bỏ tiền, quay ngẫu nhiên, may mắn được đồ hiếm.
|
|
191
|
+
**Lưu ý:** Cần cân nhắc ethical design.
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## 🔧 Performance
|
|
196
|
+
|
|
197
|
+
### Garbage Collection (GC)
|
|
198
|
+
**Technical:** Automatic memory cleanup that can cause frame drops.
|
|
199
|
+
**Simple:** Như dọn rác tự động - đôi khi dừng mọi thứ để dọn, gây giật.
|
|
200
|
+
**Giải pháp:** Object pooling, tránh tạo object trong Update().
|
|
201
|
+
|
|
202
|
+
### Memory Leak
|
|
203
|
+
**Technical:** Memory not released when no longer needed.
|
|
204
|
+
**Simple:** Như bồn rửa bị tắc - nước (memory) cứ đổ vào mà không thoát ra.
|
|
205
|
+
**Hậu quả:** Game ngày càng chậm, crash.
|
|
206
|
+
|
|
207
|
+
### Profiling
|
|
208
|
+
**Technical:** Measuring performance to find bottlenecks.
|
|
209
|
+
**Simple:** Như khám sức khỏe cho game - tìm chỗ nào "bệnh" (chậm) để chữa.
|
|
210
|
+
**Tool:** Unity Profiler, Godot Profiler, Chrome DevTools.
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
*Tài liệu này được sử dụng bởi `explained-qa` skill để giúp mọi người hiểu các quyết định kỹ thuật trong phát triển game.*
|