gamedev-unity/skills/unity-skills/skills/console/SKILL.md
Capture and query the Unity Editor console — read/filter logs, write custom log entries, and adjust console settings. Use when inspecting console output, filtering errors or warnings, emitting log messages, or configuring the console, even if the user just says "看日志" or "控制台". 捕获并查询 Unity 编辑器控制台(读取/过滤日志、写入自定义日志、调整控制台设置);当用户要查看控制台输出、过滤错误或警告、输出日志消息时使用。
npx skillsauth add bernatmv/ai-rules unity-consoleInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Work with the Unity console - capture logs, write messages, and debug your project.
console_get_logs / console_get_stats,标 SkillMode.SemiAuto)直接执行;其余 skill(console_start_capture / console_stop_capture / console_clear / console_log / console_export / console_set_pause_on_error / console_set_collapse / console_set_clear_on_play,默认 SkillMode.FullAuto)需用户 grant,grant 后一步执行返结果。IsForbiddenInSemi 拦截,不需要 Bypass 才能跑的高危操作。DO NOT (common hallucinations):
console_filter does not exist → use console_get_logs with filter parameterconsole_read does not exist → use console_get_logsconsole_write does not exist → use console_logdebug_get_logs — console_get_logs reads captured buffer, debug_get_logs reads all console entriesRouting:
debug module's debug_check_compilationdebug module's debug_get_stack_traceconsole_set_collapse / console_set_clear_on_play (this module)| Skill | Description |
|-------|-------------|
| console_start_capture | Start capturing logs |
| console_stop_capture | Stop capturing logs |
| console_get_logs | Get captured logs |
| console_clear | Clear console |
| console_log | Write log message |
| console_set_pause_on_error | Enable or disable Error Pause in Play mode |
| console_export | Export console logs to a file |
| console_get_stats | Get log statistics (count by type) |
| console_set_collapse | Set console log collapse mode |
| console_set_clear_on_play | Set clear on play mode |
Start capturing Unity console logs.
No parameters.
Stop capturing logs.
No parameters.
Get Unity Console logs (reads existing console history directly; if console_start_capture is active, returns captured buffer with timestamps instead).
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| type | string | No | "All" | All / Error / Warning / Log |
| filter | string | No | null | Substring content filter |
| limit | int | No | 100 | Max results |
Returns (two shapes depending on mode):
console_start_capture active): {count, logs: [{type, message, time}], source: "capture"} — time formatted HH:mm:ss.fff{count, logs: [{type, message, file, line}], source: "console"} — type is Error / Warning / Log, file / line from Unity's LogEntryClear the Unity console.
No parameters.
Write a custom log message.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| message | string | Yes | - | Log message |
| type | string | No | "Log" | Log/Warning/Error |
console_set_pause_on_errorEnable or disable Error Pause in Play mode.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| enabled | bool | No | true | Enable or disable error pause |
Returns: { success, enabled }
console_exportExport console logs to a file. Uses captured buffer when console_start_capture is active; otherwise reads directly from Unity Console history (no setup needed).
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| savePath | string | No | "Assets/console_log.txt" | File path to save logs |
Returns: { success, path, count, source }
console_get_statsGet log statistics (count by type). Uses captured buffer when console_start_capture is active; otherwise reads directly from Unity Console history.
No parameters.
Returns (two shapes depending on mode):
console_start_capture was called or buffer is non-empty): {success, total, source: "capture", logs, warnings, errors, exceptions, asserts}{success, total, source: "console", logs, warnings, errors} — exceptions / asserts are not reported in direct mode (folded into errors)console_set_collapseSet console log collapse mode.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| enabled | bool | Yes | - | Enable or disable collapse mode |
Returns: { success, setting, enabled }
console_set_clear_on_playSet clear on play mode.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| enabled | bool | Yes | - | Enable or disable clear on play |
Returns: { success, setting, enabled }
import unity_skills
# Start capturing logs before play mode
unity_skills.call_skill("console_start_capture")
# Enter play mode
unity_skills.call_skill("editor_play")
# ... gameplay generates logs ...
unity_skills.call_skill("editor_stop")
# Get all captured logs
logs = unity_skills.call_skill("console_get_logs")
for log in logs['logs']:
print(f"[{log['type']}] {log['message']}")
# Get only errors
errors = unity_skills.call_skill("console_get_logs", type="Error")
if errors['count'] > 0:
print(f"Found {errors['count']} errors!")
# Write custom log
unity_skills.call_skill("console_log",
message="AI Agent: Task completed",
type="Log"
)
# Write warning
unity_skills.call_skill("console_log",
message="AI Agent: Performance issue detected",
type="Warning"
)
# Clear and stop
unity_skills.call_skill("console_clear")
unity_skills.call_skill("console_stop_capture")
Exact names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file.
development
Keyword research and validation with real search-demand data — never ship keywords from intuition alone. Probes Google Autocomplete per language (free, no account) to prove demand and discover the exact phrasing people type, checks SERPs for winnability, and uses Keyword Planner/Ahrefs/Semrush exports when the user has access. Activates when: choosing or reviewing SEO keywords, meta keywords, page titles, article topics or slugs, landing page copy targeting search, App Store/ASO keyword fields, multilingual keyword sets, 'what should we rank for', 'keyword analysis', or auditing why a page doesn't rank. Also invoke it as a validation pass whenever another skill or task produces a keyword list.
development
Automate YooAsset hot-update and asset bundles — build bundles, run Editor simulate builds, manage Collector groups, analyze BuildReport, and validate runtime. Use when building or simulating YooAsset bundles, configuring collectors, or validating hot-update assets, even if the user just says "热更" or "打AB包". 自动化 YooAsset 热更新与资源包(构建 bundle、编辑器模拟构建、管理 Collector 分组、分析 BuildReport、运行时校验);当用户要构建或模拟 YooAsset 资源包、配置 collector、或校验热更资源时使用。
development
Source-anchored design rules for YooAsset v2.3.18 — initialization, default-package shortcuts, play modes, asset handles, loading, updates, filesystem, build, and pitfalls. Use when writing or reviewing YooAsset code, initializing packages, loading assets via handles, setting up hot-update/download, or choosing a play mode, even if the user just says "热更" or "资源包". 为 YooAsset v2.3.18 提供源码锚定的设计规则(初始化、默认包快捷方式、运行模式、资源句柄、加载、更新、文件系统、构建、陷阱);当用户要编写或审查 YooAsset 代码、初始化 package、用句柄加载资源、配置热更/下载、或选择运行模式时使用。
data-ai
Last-resort guidance for safely hand-editing Unity serialized YAML (.unity/.prefab/.asset/.meta/ProjectSettings) — reference/fileID repair, GUID safety, and merge-conflict fixes. Use when REST cannot reach the change and YAML must be hand-edited — fixing m_Script GUIDs, broken fileID references, .meta files, or merge conflicts, even if the user just says "场景文件打不开" or "引用丢了". 安全手编 Unity 序列化 YAML(.unity/.prefab/.asset/.meta/ProjectSettings)的最后手段(引用/fileID 修复、GUID 安全、合并冲突修复);当 REST 无法触达、必须手编 YAML 时使用——修复 m_Script GUID、断裂 fileID 引用、.meta 文件或合并冲突。