Skill: Management Analytics (MGMT 管理层数据分析)
Environment Variables (Required)
| 变量名 |
是否必填 |
说明 |
DATABRAIN_TOKEN |
必填 |
认证 token(不含 Bearer 前缀) |
DATABRAIN_HOST |
必填 |
API 主机地址 |
DATABRAIN_DISPLAY_HOST |
可选 |
系统链接展示域名 |
0. Skill Scope
- This skill queries MGMT data only: IEGG overall, studio, publishing, project/game management and commercialization metrics.
- Use for: gross revenue / 收入 / 流水, net profit / 利润, KPI / 目标 / 完成率, forecast / 预估 / 预测, market cost / 市场成本 / 营销成本 / 市场费用, R&D cost / 研发成本, headcount / HC / 人力, decision point / 管理决议, project calendar / 项目日历, milestones / 里程碑.
- Dashboard permission (
dashboard_white_games) is unrelated to MGMT. Use this skill even when the project is missing from dashboard_white_games.
- Do not use this skill for Dashboard first-party game-operation drilldowns: DAU, retention, country, zone, channel, platform, feature metrics.
- Granularity: MGMT only supports monthly and yearly granularity. For daily-level revenue/sales queries (e.g. "截止2025-07-17的累计收入", a specific date's revenue), use
databrain-dashboard-service instead.
- Never expose internal routing labels or runtime context IDs in user-facing responses unless the tool output itself includes them.
- Hard tool constraint for MGMT queries: only use
run_skill_script with skills/databrain-mgmt-service/scripts/run_tool.py and the MGMT tools exposed there. Do not use write_file, execute_sandbox_code, custom scripts, raw backend API calls, or sandbox code to work around unsupported MGMT metrics.
- If a requested MGMT metric is unavailable and you use a substitute metric, the final answer must first include (A) 指标差异提示, and any TopN title must name the substitute metric sorting口径 rather than the unavailable metric.
Module Mapping
- IEGG overall KPI →
module="business"
- Studio overall KPI →
module="all_studio"
- Single studio KPI →
module="studio"
- Publishing overall KPI →
module="publishing"
- Single project/game KPI →
module="project"
1. How to Call Tools
run_skill_script(
script_path="skills/databrain-mgmt-service/scripts/run_tool.py",
cli_args=["--tool", "<tool_name>", "--param1", "value1", ...]
)
Rules:
--tool is required.
- Dates must use
YYYY-MM-DD.
- List/dict values must be JSON strings.
- Argument names must exactly match the signatures below; unsupported args are ignored by
run_tool.py.
- Do not pass
studio_id, combine_id, or other entity IDs manually. MGMT tools read IDs from runtime context.
- Each failed tool call may be retried at most once. Do not retry permission/auth failures.
- Always respect explicit user requirements such as exact metrics, granularity, filters, and time range.
- If argument construction fails, read the corresponding
reference/*.md before retrying.
- For MGMT data access, only call
skills/databrain-mgmt-service/scripts/run_tool.py. Do not write ad-hoc debug scripts, do not call backend APIs directly from generated code, and do not use write_file/run_skill_script to bypass MGMT tools.
2. Tool Inventory & Signatures
2.1 mgmt_metrics_query_tool
Query MGMT metric values for IEGG/studio/publishing/project management data.
start_date: str # YYYY-MM-DD
end_date: str # YYYY-MM-DD
metrics: list[str] # MGMT metric_code list; source of truth is runtime metric map API
module: str # business|all_studio|studio|publishing|project
Use for normal metric queries: revenue, profit, KPI, forecast, cost, headcount, decision point.
Critical rules:
metrics must be valid MGMT metric_code. Do not guess or translate metric names into fabricated codes.
- If unsure, call
mgmt_metric_map_tool to inspect the current user's API-backed metric map, then read reference/mgmt_metrics_query_tool.md for parameter rules.
- Do not pass IDs.
studio_id / combine_id are auto-injected from context.
- For TopN follow-up questions, call this tool only once with the correct
module; IDs from previous TopN are already in context.
- For management decisions, use
metrics=["decision_point"]; the tool handles that metric specially.
2.2 mgmt_topn_query_tool
Rank studios or projects by revenue/profit/KPI/headcount/forecast metrics.
start_date: str
end_date: str
order_metric_obj: dict # {"order_metric":"...", "order_by":"...", "order":"desc|asc"}
query_metrics: list[str]
module: str # studio|project only
top_num: int = 10
data_source: str|null # only for module=project: studio|publishing|dev
Use for:
- Top N studios/projects by metric.
- Broad queries like “各个/每个/所有/全部 studio/project” to narrow scope to Top10 first.
TopN rules:
- Use the user's requested
top_num exactly. Do not expand to Top10/Top30 unless the user asked for that size.
- Leave
data_source empty unless the user explicitly asks for studio-issued projects, publishing/self-publishing projects, or dev/in-development projects.
- “Most popular / 最热门 / 最受欢迎 games” without IEGG is usually an intelligence question. Only when the query explicitly says IEGG / IEGG games / IEGG 项目, answer via MGMT as project ranking by
gross_revenue_actual by default, unless the user specifies another MGMT ranking metric.
- Revenue YoY / 同比增长率 ranking:
- For “实际收入同比增长率排行榜 / revenue YoY ranking”, use
order_metric_obj={"order_metric":"gross_revenue_actual","order_by":"yoy","order":"desc"}.
- Do not rank by
gross_revenue_actual absolute value and then re-sort only the returned TopN by YoY; that is not a global YoY ranking.
2.3 mgmt_milestones_query_tool
Query IEGG project milestones such as Soft Launch / Global Launch / Early Access, Gate Review (GR) meetings, Check-in meetings, etc.
start_date: str # YYYY-MM-DD
end_date: str # YYYY-MM-DD
type: str = "all" # "launch" | "gr" | "checkin" | "all"
Use only for IEGG project/game milestone questions. For external/competitor launch dates, do not call this tool.
type parameter — choose by user intent:
"launch" for launch / soft-launch / global-launch / EA / 公测 / 上线时间 / 即将上线 / 最近上线 questions.
"gr" for Gate Review / 管理层评审 / Go/No-Go / 预算审批 / 阶段评审 / 立项评审 questions (GR meetings where GMs and Michelle make Go/No-Go decisions, approve the next GR's budget, and align on the next GR's deliverables and focus).
"checkin" for check-in / 项目同步会 / 进展同步会 / mandate 变更 / 项目授权变更 / mandate change questions (Check-in meetings reviewing updates in specific areas and confirming/discussing changes to the project mandate).
"all" (default) when the user asks broadly without specifying a category.
3. Module Selection Rules
Runtime may inject higher-priority MGMT module rules from agent_context. If a runtime rule conflicts with the baseline below, follow the runtime rule.
Baseline:
- IEGG overall KPI ->
module="business"
- All studios overall KPI ->
module="all_studio"
- Single studio KPI ->
module="studio"
- Publishing overall KPI ->
module="publishing"
- Single project/game KPI ->
module="project"
Important:
- If a project entity is recognized in context, project-level revenue/profit/KPI/forecast queries should use
project.
- If a studio/company entity is recognized in context, studio-level metrics should use
studio.
- IEGG Central Publishing / Central Publishing / 中央发行 usually uses
project.
- Functional Support / 职能支持 usually uses
studio.
4. Metric Selection Rules
- Always use real
metric_code; do not invent codes.
- The full metric list below is generated from MGMT metric map API. Do not edit the generated table by hand.
- Actual metrics are preferred when the user does not specify actual/forecast/KPI.
- Forecast metrics are used only when the user asks forecast / predicted / 预估 / 预测.
- KPI metrics are used only when the user asks target / KPI / 目标 / 完成率.
- Common direct mappings:
- 市场成本实际值 / actual market cost ->
mkt_cost_actual
- 市场成本预测值 / forecast market cost ->
mkt_cost_forecast
- 市场成本目标值 / KPI/target market cost ->
mkt_cost_kpi
- 实际收入 / actual gross revenue ->
gross_revenue_actual
- 预测收入 / forecast gross revenue ->
gross_revenue_forecast
- 收入目标 / revenue KPI ->
gross_revenue_kpi
- 实际利润 / actual net profit ->
net_profit_actual
- 预测利润 / forecast net profit ->
net_profit_forecast
- 利润目标 / profit KPI ->
net_profit_kpi
- 盈余/赤字 / profit surplus or deficit ->
net_profit_profit_loss
- 实际研发成本 / actual development cost ->
total_dev_costs_actual
- 预估总研发成本 / estimated total dev cost ->
estimated_total_dev_cost
- 批准总研发成本 / approved total dev cost ->
approved_total_dev_cost
- 市场预算申请 / marketing budget application ->
mkt_budget_application
- 正职人力 / regular employee headcount ->
headcount_regular
- Do not query
gross_revenue_profit_loss or net_profit_profit_loss unless the user explicitly asks surplus/deficit/盈余/赤字.
- Ratio/rate metrics and absolute-value metrics are not interchangeable.
- Requested metric unavailable / substitute metric rule:
- If the user asks for a metric that is not present in the MGMT metric map, do not silently substitute or rename another metric as if it were the requested one.
- You may use the closest available metric_code to satisfy the user's intent, but the final answer must follow this order:
- (A) 指标差异提示: state the requested metric is unavailable in MGMT, name the substitute metric actually queried, and explain the semantic difference. Explicitly identify whether this changes a ratio/rate/percentage (%) metric into an absolute value (amount/count/value) metric.
- (B) 数据展示: only after (A), show the tool-returned data.
- In tables/charts, column headers must use the actual substitute metric name/code, not the unavailable requested metric.
- If the user asks for TopN/ranking by an unavailable metric and you use a substitute metric, (A) must explicitly say the TopN is ranked by the substitute metric, not by the requested metric.
- The title must be
按【替代指标】排序的TopN(替代口径) or equivalent; do not title it as the unavailable original metric ranking.
- If the substitute changes the ranking meaning substantially, state that MGMT cannot answer the original ranking exactly and present the substitute ranking only as a clearly labeled fallback.
- When using a substitute TopN, preserve the order returned by
mgmt_topn_query_tool and do not re-rank by a derived calculation unless the tool itself ranked by that metric.
4.1 MGMT Metric Map From API
Generated from MGMT metric map API. Total metrics: 27.
| metric_code |
metric_name_en |
metric_name_cn |
metric_desc_en |
metric_desc_cn |
value_type |
modules |
granularity |
unit |
| action_note_profit |
|
利润行动与说明 |
|
|
Notes |
all_studio,studio,project |
monthly,yearly |
- |
| action_note_revenue |
|
收入行动与说明 |
|
|
Notes |
all_studio,studio,project |
monthly,yearly |
- |
| approved_total_dev_cost |
|
批准总研发成本(美元) |
|
|
float |
project |
yearly |
usd |
| decision_point |
|
决策清单 |
|
|
Notes |
publishing,project |
monthly,yearly |
- |
| estimated_total_dev_cost |
|
预估总研发成本(美元) |
|
|
float |
project |
yearly |
usd |
| event |
|
事件管理 |
|
|
Notes |
all_studio,studio,project |
monthly,yearly |
- |
| gross_revenue_actual |
|
收入实际值(美元) |
|
|
float |
business,all_studio,studio,publishing,project |
monthly |
usd |
| gross_revenue_forecast |
|
收入预测值(美元) |
|
|
float |
business,all_studio,studio,publishing,project |
yearly |
usd |
| gross_revenue_kpi |
|
收入目标值(美元) |
|
|
float |
business,all_studio,studio,publishing,project |
yearly,monthly |
usd |
| gross_revenue_profit_loss |
|
盈余/赤字 |
|
|
float |
business,all_studio,studio,publishing,project |
yearly |
- |
| headcount_regular |
|
正职人力 |
|
|
numerical |
all_studio,studio,publishing,project |
monthly |
- |
| kpi_avg_headcount |
|
全年目标平均值 |
|
|
Notes |
publishing,project |
yearly |
- |
| mgt_calendar_meeting |
|
董事会治理 |
|
|
Notes |
all_studio,studio |
monthly,yearly |
- |
| milestone_headcount |
|
当前里程碑计划人数 |
|
|
numerical |
project |
monthly |
- |
| mkt_budget_application |
|
市场预算申请 |
|
|
Notes |
project |
monthly |
- |
| mkt_cost_actual |
|
市场成本实际值(美元) |
|
|
float |
publishing,project |
monthly,yearly |
usd |
| mkt_cost_forecast |
|
市场成本预测值 (美元) |
|
|
float |
publishing,project |
yearly |
usd |
| mkt_cost_kpi |
|
市场成本目标值(美元) |
|
|
float |
publishing,project |
yearly |
usd |
| net_profit_actual |
|
利润实际值(美元) |
|
|
float |
business,all_studio,studio,publishing,project |
monthly |
usd |
| net_profit_forecast |
|
利润预测值 (美元) |
|
|
float |
business,all_studio,studio,publishing,project |
yearly |
usd |
| net_profit_kpi |
|
利润目标值(美元) |
|
|
float |
business,all_studio,studio,publishing,project |
yearly,monthly |
usd |
| net_profit_profit_loss |
|
盈余/赤字 |
|
|
float |
business,all_studio,studio,publishing,project |
yearly |
- |
| opportunities_risks_profit |
|
利润机会 & 风险 |
|
|
Notes |
all_studio,studio,project |
monthly,yearly |
- |
| opportunities_risks_revenue |
|
收入机会 & 风险 |
|
|
Notes |
all_studio,studio,project |
monthly,yearly |
- |
| pipeline_calendar |
|
项目管线规划 |
|
|
Notes |
all_studio,studio,project |
monthly,yearly |
- |
| tech_other_cost |
|
技术和其他成本 |
|
|
float |
project |
monthly |
usd |
| total_dev_costs_actual |
|
实际研发成本(美元) |
|
|
float |
project |
monthly |
usd |
5. Time Extraction Rules
- Explicit year/month/range: use the first day and last day of that period.
25年 means 2025.
- If the user does not specify a year, do not assume
2025. Use the current year from the system prompt.
- Lifetime / since-launch range is allowed only when the user explicitly says one of:
截止, 上线至今, 以来, 历史, since launch, all-time.
- If the user does not specify a time range, treat the query as current-year-to-date:
start_date = Jan 1 of the current year, end_date = yesterday.
- Examples:
what is the revenue of IEGG -> current-year-to-date, not 2025 unless current year is 2025.
Fatshark 的流水是多少 -> current-year-to-date.
IEGG 的利润 -> current-year-to-date.
25年/2025年 ... -> 2025-01-01 to 2025-12-31.
- Do not infer
start_date=2000-01-01 from the metric type itself. KPI, target, revenue, R&D cost, and user metrics still use the default YTD rule unless the lifetime keywords are present.
- If a default time range returns empty data, state the searched time range and say no data was found in that range; ask the user to specify another time range.
- If an explicit full-year/range query returns no data, do not automatically retry a narrower range unless the user asked for that narrower range. Report the no-data result for the requested range.
6. TopN / Broad Query Rules
For “各个/每个/所有/全部/重点/核心/头部/top studio/project”:
- Do not query all studios/projects directly with
mgmt_metrics_query_tool.
- First call
mgmt_topn_query_tool with top_num=10.
- Default ranking metric:
gross_revenue_actual, unless the user explicitly names another metric.
- After TopN, call
mgmt_metrics_query_tool once only if the user asks for detailed metrics.
- If the TopN result itself answers the question, do not call
mgmt_metrics_query_tool again.
- Final answer must mention that the result is limited to Top10.
7. Launch Milestone Time Window Rules
For mgmt_milestones_query_tool:
- Explicit user time window -> use it exactly.
- Specific project but no time window ->
start_date=2000-01-01, end_date=today+5y.
- Upcoming / 即将上线 / about to launch without time ->
start_date=today, end_date=today+1y.
- Recently launched / 最近上线 without time ->
start_date=today-1y, end_date=today+1y.
- The tool returns all milestone types. In the final answer, pick the milestone type the user asked about.
- The final answer must repeat the searched
start_date and end_date from tool output.
8. Data/Answer Rules
- Must call tools and answer from returned data. Do not answer MGMT metric questions from memory.
- Do not create custom debug scripts or raw API request scripts to work around MGMT tool limitations. If an MGMT tool or metric cannot satisfy the exact query, explain the limitation and stop.
- Do not call
execute_sandbox_code for simple derived calculations like net_profit / gross_revenue; calculate from the tool output directly in the answer.
- Use tables when presenting multiple rows or metrics.
- Before presenting data, align the user request with the tool output: metric semantics, actual vs forecast, time range/granularity, scope/module, dimensions/filters, and TopN ranking basis.
- If any part is mismatched or unavailable, first state what is mismatched/unavailable, then show only the available substitute data; never present substitute data as the original requested metric.
- Only describe observable facts in tool output. Do not invent conclusions, risks, opportunities, leadership comments, or strategic suggestions.
- Include zero and negative values; never omit them.
- If data is missing/unavailable, explicitly say so and do not infer missing values. If a requested period is partially missing, name the exact missing dates/months/quarters.
- If the query asks for a total/sum over a non-full-year range but the tool returns only partial monthly data plus yearly data, do not convert yearly values into missing months. Label any total as “available monthly subtotal” and list yearly values separately as full-year reference.
- If requested and returned time ranges differ materially, state both ranges and mention MGMT data can lag by about 2 months.
- If using an alternative metric, label table/chart columns with the actual used metric name, not the unavailable requested metric.
- For TopN/ranking with a substitute metric, explicitly say the ranking is by the substitute metric, not the requested metric. If substitute changes ranking meaning substantially, say MGMT cannot answer the original TopN exactly and provide only the substitute TopN as a fallback.
- Keep currency symbols exactly as returned. For charts, use raw numeric values for data series and only format labels/tooltips.
- Do not query
gross_revenue_profit_loss or net_profit_profit_loss unless the user explicitly asks surplus/deficit/盈余/赤字.
- Never output empty text.
9. References
Before calling tools with complex arguments, read the relevant file:
| Tool |
Reference |
mgmt_metrics_query_tool |
reference/mgmt_metrics_query_tool.md |
mgmt_topn_query_tool |
reference/mgmt_topn_query_tool.md |
mgmt_milestones_query_tool |
reference/mgmt_milestones_query_tool.md |
| MGMT metric lookup |
Runtime mgmt_metric_map_tool / context.mgmt_info["metric_by_code"] |
10. Runtime Metric Map
scripts/run_tool.py automatically calls the metric map API before MGMT data tools and stores the current user's available metrics in:
context.mgmt_info["metric_by_code"]
If you need to inspect the current user's metric map before choosing a metric, call:
run_skill_script(
script_path="skills/databrain-mgmt-service/scripts/run_tool.py",
cli_args=["--tool", "mgmt_metric_map_tool", "--user_query", "<user question>", "--max_items", "200"]
)
Use this when the requested metric is not covered by the common mappings above.
1---2name: databrain-mgmt-service3description: Query DataBrain Management (MGMT/管理) data for users with MGMT permission — IEGG / publishing / studio / project commercialization and management metrics including revenue (收入/流水), profit (利润), market cost / 市场成本 / 营销成本 / 市场费用, R&D cost / 研发成本, KPI / 目标, forecast / 预估 / 预测, headcount / HC / 人力, human-resource risk / 人力风险, budget application / 市场预算申请, decision point / 管理决议, risks & opportunities / 风险与机会, project calendar / 项目日历, and milestones (Soft Launch / Global Launch / Early Access).4---5
6# Skill: Management Analytics (MGMT 管理层数据分析)
7
8## Environment Variables (Required)
9
10| 变量名 | 是否必填 | 说明 |
11|--------|----------|------|
12| `DATABRAIN_TOKEN` | 必填 | 认证 token(不含 `Bearer ` 前缀) |
13| `DATABRAIN_HOST` | 必填 | API 主机地址 |
14| `DATABRAIN_DISPLAY_HOST` | 可选 | 系统链接展示域名 |
15
16## 0. Skill Scope
17
18- **This skill** queries MGMT data only: IEGG overall, studio, publishing, project/game management and commercialization metrics.
19- Use for: gross revenue / 收入 / 流水, net profit / 利润, KPI / 目标 / 完成率, forecast / 预估 / 预测, **market cost / 市场成本 / 营销成本 / 市场费用**, R&D cost / 研发成本, headcount / HC / 人力, decision point / 管理决议, project calendar / 项目日历, milestones / 里程碑.
20- **Dashboard permission (`dashboard_white_games`) is unrelated to MGMT.** Use this skill even when the project is missing from `dashboard_white_games`.
21- Do **not** use this skill for Dashboard first-party game-operation drilldowns: DAU, retention, country, zone, channel, platform, feature metrics.
22- **Granularity**: MGMT only supports **monthly** and **yearly** granularity. For **daily-level** revenue/sales queries (e.g. "截止2025-07-17的累计收入", a specific date's revenue), use `databrain-dashboard-service` instead.
23- Never expose internal routing labels or runtime context IDs in user-facing responses unless the tool output itself includes them.
24- **Hard tool constraint for MGMT queries:** only use `run_skill_script` with `skills/databrain-mgmt-service/scripts/run_tool.py` and the MGMT tools exposed there. Do not use `write_file`, `execute_sandbox_code`, custom scripts, raw backend API calls, or sandbox code to work around unsupported MGMT metrics.
25- If a requested MGMT metric is unavailable and you use a substitute metric, the final answer must first include (A) 指标差异提示, and any TopN title must name the substitute metric sorting口径 rather than the unavailable metric.
26
27## Module Mapping
28
29- IEGG overall KPI → `module="business"`
30- Studio overall KPI → `module="all_studio"`
31- Single studio KPI → `module="studio"`
32- Publishing overall KPI → `module="publishing"`
33- Single project/game KPI → `module="project"`
34
35## 1. How to Call Tools
36
37```text
38run_skill_script(
39 script_path="skills/databrain-mgmt-service/scripts/run_tool.py",
40 cli_args=["--tool", "<tool_name>", "--param1", "value1", ...]
41)
42```
43
44Rules:
45- `--tool` is required.
46- Dates must use `YYYY-MM-DD`.
47- List/dict values must be JSON strings.
48- Argument names must exactly match the signatures below; unsupported args are ignored by `run_tool.py`.
49- Do **not** pass `studio_id`, `combine_id`, or other entity IDs manually. MGMT tools read IDs from runtime context.
50- Each failed tool call may be retried at most once. Do not retry permission/auth failures.
51- Always respect explicit user requirements such as exact metrics, granularity, filters, and time range.
52- If argument construction fails, read the corresponding `reference/*.md` before retrying.
53- For MGMT data access, only call `skills/databrain-mgmt-service/scripts/run_tool.py`. Do not write ad-hoc debug scripts, do not call backend APIs directly from generated code, and do not use `write_file`/`run_skill_script` to bypass MGMT tools.
54
55## 2. Tool Inventory & Signatures
56
57### 2.1 `mgmt_metrics_query_tool`
58
59Query MGMT metric values for IEGG/studio/publishing/project management data.
60
61```text
62start_date: str # YYYY-MM-DD
63end_date: str # YYYY-MM-DD
64metrics: list[str] # MGMT metric_code list; source of truth is runtime metric map API
65module: str # business|all_studio|studio|publishing|project
66```
67
68Use for normal metric queries: revenue, profit, KPI, forecast, cost, headcount, decision point.
69
70Critical rules:
71- `metrics` must be valid MGMT `metric_code`. Do not guess or translate metric names into fabricated codes.
72- If unsure, call `mgmt_metric_map_tool` to inspect the current user's API-backed metric map, then read `reference/mgmt_metrics_query_tool.md` for parameter rules.
73- Do not pass IDs. `studio_id` / `combine_id` are auto-injected from context.
74- For TopN follow-up questions, call this tool only once with the correct `module`; IDs from previous TopN are already in context.
75- For management decisions, use `metrics=["decision_point"]`; the tool handles that metric specially.
76
77### 2.2 `mgmt_topn_query_tool`
78
79Rank studios or projects by revenue/profit/KPI/headcount/forecast metrics.
80
81```text
82start_date: str
83end_date: str
84order_metric_obj: dict # {"order_metric":"...", "order_by":"...", "order":"desc|asc"}
85query_metrics: list[str]
86module: str # studio|project only
87top_num: int = 10
88data_source: str|null # only for module=project: studio|publishing|dev
89```
90
91Use for:
92- Top N studios/projects by metric.
93- Broad queries like “各个/每个/所有/全部 studio/project” to narrow scope to Top10 first.
94
95TopN rules:
96- Use the user's requested `top_num` exactly. Do not expand to Top10/Top30 unless the user asked for that size.
97- Leave `data_source` empty unless the user explicitly asks for studio-issued projects, publishing/self-publishing projects, or dev/in-development projects.
98- “Most popular / 最热门 / 最受欢迎 games” without IEGG is usually an intelligence question. Only when the query explicitly says IEGG / IEGG games / IEGG 项目, answer via MGMT as project ranking by `gross_revenue_actual` by default, unless the user specifies another MGMT ranking metric.
99- Revenue YoY / 同比增长率 ranking:
100 - For “实际收入同比增长率排行榜 / revenue YoY ranking”, use `order_metric_obj={"order_metric":"gross_revenue_actual","order_by":"yoy","order":"desc"}`.
101 - Do not rank by `gross_revenue_actual` absolute value and then re-sort only the returned TopN by YoY; that is not a global YoY ranking.
102
103### 2.3 `mgmt_milestones_query_tool`
104
105Query IEGG project milestones such as Soft Launch / Global Launch / Early Access, Gate Review (GR) meetings, Check-in meetings, etc.
106
107```text
108start_date: str # YYYY-MM-DD
109end_date: str # YYYY-MM-DD
110type: str = "all" # "launch" | "gr" | "checkin" | "all"
111```
112
113Use only for IEGG project/game milestone questions. For external/competitor launch dates, do not call this tool.
114
115`type` parameter — choose by user intent:
116- `"launch"` for launch / soft-launch / global-launch / EA / 公测 / 上线时间 / 即将上线 / 最近上线 questions.
117- `"gr"` for Gate Review / 管理层评审 / Go/No-Go / 预算审批 / 阶段评审 / 立项评审 questions (GR meetings where GMs and Michelle make Go/No-Go decisions, approve the next GR's budget, and align on the next GR's deliverables and focus).
118- `"checkin"` for check-in / 项目同步会 / 进展同步会 / mandate 变更 / 项目授权变更 / mandate change questions (Check-in meetings reviewing updates in specific areas and confirming/discussing changes to the project mandate).
119- `"all"` (default) when the user asks broadly without specifying a category.
120
121## 3. Module Selection Rules
122
123Runtime may inject higher-priority MGMT module rules from `agent_context`. If a runtime rule conflicts with the baseline below, follow the runtime rule.
124
125Baseline:
126- IEGG overall KPI -> `module="business"`
127- All studios overall KPI -> `module="all_studio"`
128- Single studio KPI -> `module="studio"`
129- Publishing overall KPI -> `module="publishing"`
130- Single project/game KPI -> `module="project"`
131
132Important:
133- If a project entity is recognized in context, project-level revenue/profit/KPI/forecast queries should use `project`.
134- If a studio/company entity is recognized in context, studio-level metrics should use `studio`.
135- IEGG Central Publishing / Central Publishing / 中央发行 usually uses `project`.
136- Functional Support / 职能支持 usually uses `studio`.
137
138## 4. Metric Selection Rules
139
140- Always use real `metric_code`; do not invent codes.
141- The full metric list below is generated from MGMT metric map API. Do not edit the generated table by hand.
142- Actual metrics are preferred when the user does not specify actual/forecast/KPI.
143- Forecast metrics are used only when the user asks forecast / predicted / 预估 / 预测.
144- KPI metrics are used only when the user asks target / KPI / 目标 / 完成率.
145- Common direct mappings:
146 - 市场成本实际值 / actual market cost -> `mkt_cost_actual`
147 - 市场成本预测值 / forecast market cost -> `mkt_cost_forecast`
148 - 市场成本目标值 / KPI/target market cost -> `mkt_cost_kpi`
149 - 实际收入 / actual gross revenue -> `gross_revenue_actual`
150 - 预测收入 / forecast gross revenue -> `gross_revenue_forecast`
151 - 收入目标 / revenue KPI -> `gross_revenue_kpi`
152 - 实际利润 / actual net profit -> `net_profit_actual`
153 - 预测利润 / forecast net profit -> `net_profit_forecast`
154 - 利润目标 / profit KPI -> `net_profit_kpi`
155 - 盈余/赤字 / profit surplus or deficit -> `net_profit_profit_loss`
156 - 实际研发成本 / actual development cost -> `total_dev_costs_actual`
157 - 预估总研发成本 / estimated total dev cost -> `estimated_total_dev_cost`
158 - 批准总研发成本 / approved total dev cost -> `approved_total_dev_cost`
159 - 市场预算申请 / marketing budget application -> `mkt_budget_application`
160 - 正职人力 / regular employee headcount -> `headcount_regular`
161- Do not query `gross_revenue_profit_loss` or `net_profit_profit_loss` unless the user explicitly asks surplus/deficit/盈余/赤字.
162- Ratio/rate metrics and absolute-value metrics are not interchangeable.
163- Requested metric unavailable / substitute metric rule:
164 - If the user asks for a metric that is not present in the MGMT metric map, do not silently substitute or rename another metric as if it were the requested one.
165 - You may use the closest available metric_code to satisfy the user's intent, but the final answer must follow this order:
166 - **(A) 指标差异提示**: state the requested metric is unavailable in MGMT, name the substitute metric actually queried, and explain the semantic difference. Explicitly identify whether this changes a ratio/rate/percentage (%) metric into an absolute value (amount/count/value) metric.
167 - **(B) 数据展示**: only after (A), show the tool-returned data.
168 - In tables/charts, column headers must use the actual substitute metric name/code, not the unavailable requested metric.
169 - If the user asks for TopN/ranking by an unavailable metric and you use a substitute metric, (A) must explicitly say the TopN is ranked by the substitute metric, not by the requested metric.
170 - The title must be `按【替代指标】排序的TopN(替代口径)` or equivalent; do not title it as the unavailable original metric ranking.
171 - If the substitute changes the ranking meaning substantially, state that MGMT cannot answer the original ranking exactly and present the substitute ranking only as a clearly labeled fallback.
172 - When using a substitute TopN, preserve the order returned by `mgmt_topn_query_tool` and do not re-rank by a derived calculation unless the tool itself ranked by that metric.
173
174### 4.1 MGMT Metric Map From API
175
176<!-- MGMT_METRIC_MAP_START -->
177Generated from MGMT metric map API. Total metrics: 27.
178
179| metric_code | metric_name_en | metric_name_cn | metric_desc_en | metric_desc_cn | value_type | modules | granularity | unit |
180|---|---|---|---|---|---|---|---|---|
181| action_note_profit | | 利润行动与说明 | | | Notes | all_studio,studio,project | monthly,yearly | - |
182| action_note_revenue | | 收入行动与说明 | | | Notes | all_studio,studio,project | monthly,yearly | - |
183| approved_total_dev_cost | | 批准总研发成本(美元) | | | float | project | yearly | usd |
184| decision_point | | 决策清单 | | | Notes | publishing,project | monthly,yearly | - |
185| estimated_total_dev_cost | | 预估总研发成本(美元) | | | float | project | yearly | usd |
186| event | | 事件管理 | | | Notes | all_studio,studio,project | monthly,yearly | - |
187| gross_revenue_actual | | 收入实际值(美元) | | | float | business,all_studio,studio,publishing,project | monthly | usd |
188| gross_revenue_forecast | | 收入预测值(美元) | | | float | business,all_studio,studio,publishing,project | yearly | usd |
189| gross_revenue_kpi | | 收入目标值(美元) | | | float | business,all_studio,studio,publishing,project | yearly,monthly | usd |
190| gross_revenue_profit_loss | | 盈余/赤字 | | | float | business,all_studio,studio,publishing,project | yearly | - |
191| headcount_regular | | 正职人力 | | | numerical | all_studio,studio,publishing,project | monthly | - |
192| kpi_avg_headcount | | 全年目标平均值 | | | Notes | publishing,project | yearly | - |
193| mgt_calendar_meeting | | 董事会治理 | | | Notes | all_studio,studio | monthly,yearly | - |
194| milestone_headcount | | 当前里程碑计划人数 | | | numerical | project | monthly | - |
195| mkt_budget_application | | 市场预算申请 | | | Notes | project | monthly | - |
196| mkt_cost_actual | | 市场成本实际值(美元) | | | float | publishing,project | monthly,yearly | usd |
197| mkt_cost_forecast | | 市场成本预测值 (美元) | | | float | publishing,project | yearly | usd |
198| mkt_cost_kpi | | 市场成本目标值(美元) | | | float | publishing,project | yearly | usd |
199| net_profit_actual | | 利润实际值(美元) | | | float | business,all_studio,studio,publishing,project | monthly | usd |
200| net_profit_forecast | | 利润预测值 (美元) | | | float | business,all_studio,studio,publishing,project | yearly | usd |
201| net_profit_kpi | | 利润目标值(美元) | | | float | business,all_studio,studio,publishing,project | yearly,monthly | usd |
202| net_profit_profit_loss | | 盈余/赤字 | | | float | business,all_studio,studio,publishing,project | yearly | - |
203| opportunities_risks_profit | | 利润机会 & 风险 | | | Notes | all_studio,studio,project | monthly,yearly | - |
204| opportunities_risks_revenue | | 收入机会 & 风险 | | | Notes | all_studio,studio,project | monthly,yearly | - |
205| pipeline_calendar | | 项目管线规划 | | | Notes | all_studio,studio,project | monthly,yearly | - |
206| tech_other_cost | | 技术和其他成本 | | | float | project | monthly | usd |
207| total_dev_costs_actual | | 实际研发成本(美元) | | | float | project | monthly | usd |
208<!-- MGMT_METRIC_MAP_END -->
209
210## 5. Time Extraction Rules
211
212- Explicit year/month/range: use the first day and last day of that period. `25年` means `2025`.
213- If the user does **not** specify a year, do **not** assume `2025`. Use the current year from the system prompt.
214- Lifetime / since-launch range is allowed only when the user explicitly says one of: `截止`, `上线至今`, `以来`, `历史`, `since launch`, `all-time`.
215- If the user does not specify a time range, treat the query as current-year-to-date: `start_date` = Jan 1 of the current year, `end_date` = yesterday.
216- Examples:
217 - `what is the revenue of IEGG` -> current-year-to-date, not 2025 unless current year is 2025.
218 - `Fatshark 的流水是多少` -> current-year-to-date.
219 - `IEGG 的利润` -> current-year-to-date.
220 - `25年/2025年 ...` -> `2025-01-01` to `2025-12-31`.
221- Do not infer `start_date=2000-01-01` from the metric type itself. KPI, target, revenue, R&D cost, and user metrics still use the default YTD rule unless the lifetime keywords are present.
222- If a default time range returns empty data, state the searched time range and say no data was found in that range; ask the user to specify another time range.
223- If an explicit full-year/range query returns no data, do not automatically retry a narrower range unless the user asked for that narrower range. Report the no-data result for the requested range.
224
225## 6. TopN / Broad Query Rules
226
227For “各个/每个/所有/全部/重点/核心/头部/top studio/project”:
228- Do not query all studios/projects directly with `mgmt_metrics_query_tool`.
229- First call `mgmt_topn_query_tool` with `top_num=10`.
230- Default ranking metric: `gross_revenue_actual`, unless the user explicitly names another metric.
231- After TopN, call `mgmt_metrics_query_tool` once only if the user asks for detailed metrics.
232- If the TopN result itself answers the question, do not call `mgmt_metrics_query_tool` again.
233- Final answer must mention that the result is limited to Top10.
234
235## 7. Launch Milestone Time Window Rules
236
237For `mgmt_milestones_query_tool`:
238- Explicit user time window -> use it exactly.
239- Specific project but no time window -> `start_date=2000-01-01`, `end_date=today+5y`.
240- Upcoming / 即将上线 / about to launch without time -> `start_date=today`, `end_date=today+1y`.
241- Recently launched / 最近上线 without time -> `start_date=today-1y`, `end_date=today+1y`.
242- The tool returns all milestone types. In the final answer, pick the milestone type the user asked about.
243- The final answer must repeat the searched `start_date` and `end_date` from tool output.
244
245## 8. Data/Answer Rules
246
247- Must call tools and answer from returned data. Do not answer MGMT metric questions from memory.
248- Do not create custom debug scripts or raw API request scripts to work around MGMT tool limitations. If an MGMT tool or metric cannot satisfy the exact query, explain the limitation and stop.
249- Do not call `execute_sandbox_code` for simple derived calculations like `net_profit / gross_revenue`; calculate from the tool output directly in the answer.
250- Use tables when presenting multiple rows or metrics.
251- Before presenting data, align the user request with the tool output: metric semantics, actual vs forecast, time range/granularity, scope/module, dimensions/filters, and TopN ranking basis.
252- If any part is mismatched or unavailable, first state what is mismatched/unavailable, then show only the available substitute data; never present substitute data as the original requested metric.
253- Only describe observable facts in tool output. Do not invent conclusions, risks, opportunities, leadership comments, or strategic suggestions.
254- Include zero and negative values; never omit them.
255- If data is missing/unavailable, explicitly say so and do not infer missing values. If a requested period is partially missing, name the exact missing dates/months/quarters.
256- If the query asks for a total/sum over a non-full-year range but the tool returns only partial monthly data plus yearly data, do not convert yearly values into missing months. Label any total as “available monthly subtotal” and list yearly values separately as full-year reference.
257- If requested and returned time ranges differ materially, state both ranges and mention MGMT data can lag by about 2 months.
258- If using an alternative metric, label table/chart columns with the actual used metric name, not the unavailable requested metric.
259- For TopN/ranking with a substitute metric, explicitly say the ranking is by the substitute metric, not the requested metric. If substitute changes ranking meaning substantially, say MGMT cannot answer the original TopN exactly and provide only the substitute TopN as a fallback.
260- Keep currency symbols exactly as returned. For charts, use raw numeric values for data series and only format labels/tooltips.
261- Do not query `gross_revenue_profit_loss` or `net_profit_profit_loss` unless the user explicitly asks surplus/deficit/盈余/赤字.
262- Never output empty text.
263
264## 9. References
265
266Before calling tools with complex arguments, read the relevant file:
267
268| Tool | Reference |
269|---|---|
270| `mgmt_metrics_query_tool` | `reference/mgmt_metrics_query_tool.md` |
271| `mgmt_topn_query_tool` | `reference/mgmt_topn_query_tool.md` |
272| `mgmt_milestones_query_tool` | `reference/mgmt_milestones_query_tool.md` |
273| MGMT metric lookup | Runtime `mgmt_metric_map_tool` / `context.mgmt_info["metric_by_code"]` |
274
275## 10. Runtime Metric Map
276
277`scripts/run_tool.py` automatically calls the metric map API before MGMT data tools and stores the current user's available metrics in:
278
279```text
280context.mgmt_info["metric_by_code"]
281```
282
283If you need to inspect the current user's metric map before choosing a metric, call:
284
285```text
286run_skill_script(
287 script_path="skills/databrain-mgmt-service/scripts/run_tool.py",
288 cli_args=["--tool", "mgmt_metric_map_tool", "--user_query", "<user question>", "--max_items", "200"]
289)
290```
291
292Use this when the requested metric is not covered by the common mappings above.