@mclawnet/agent 0.5.9 → 0.6.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.
Files changed (78) hide show
  1. package/cli.js +168 -61
  2. package/dist/__tests__/cli.test.d.ts +2 -0
  3. package/dist/__tests__/cli.test.d.ts.map +1 -0
  4. package/dist/__tests__/service-config.test.d.ts +2 -0
  5. package/dist/__tests__/service-config.test.d.ts.map +1 -0
  6. package/dist/__tests__/service-linux.test.d.ts +2 -0
  7. package/dist/__tests__/service-linux.test.d.ts.map +1 -0
  8. package/dist/__tests__/service-macos.test.d.ts +2 -0
  9. package/dist/__tests__/service-macos.test.d.ts.map +1 -0
  10. package/dist/__tests__/service-windows.test.d.ts +2 -0
  11. package/dist/__tests__/service-windows.test.d.ts.map +1 -0
  12. package/dist/backend-adapter.d.ts +2 -0
  13. package/dist/backend-adapter.d.ts.map +1 -1
  14. package/dist/{chunk-KHPEQTWF.js → chunk-KITKMSBE.js} +166 -90
  15. package/dist/chunk-KITKMSBE.js.map +1 -0
  16. package/dist/chunk-W3LSW4XY.js +95 -0
  17. package/dist/chunk-W3LSW4XY.js.map +1 -0
  18. package/dist/hub-connection.d.ts.map +1 -1
  19. package/dist/index.js +1 -1
  20. package/dist/linux-5KQ4SCAA.js +175 -0
  21. package/dist/linux-5KQ4SCAA.js.map +1 -0
  22. package/dist/macos-FGY546NC.js +173 -0
  23. package/dist/macos-FGY546NC.js.map +1 -0
  24. package/dist/service/config.d.ts +19 -0
  25. package/dist/service/config.d.ts.map +1 -0
  26. package/dist/service/index.d.ts +6 -0
  27. package/dist/service/index.d.ts.map +1 -0
  28. package/dist/service/index.js +46 -0
  29. package/dist/service/index.js.map +1 -0
  30. package/dist/service/linux.d.ts +18 -0
  31. package/dist/service/linux.d.ts.map +1 -0
  32. package/dist/service/macos.d.ts +18 -0
  33. package/dist/service/macos.d.ts.map +1 -0
  34. package/dist/service/types.d.ts +19 -0
  35. package/dist/service/types.d.ts.map +1 -0
  36. package/dist/service/windows.d.ts +18 -0
  37. package/dist/service/windows.d.ts.map +1 -0
  38. package/dist/session-manager.d.ts +4 -7
  39. package/dist/session-manager.d.ts.map +1 -1
  40. package/dist/skill-loader.d.ts +8 -0
  41. package/dist/skill-loader.d.ts.map +1 -0
  42. package/dist/start.d.ts.map +1 -1
  43. package/dist/start.js +1 -1
  44. package/dist/windows-PIJ4CMWX.js +164 -0
  45. package/dist/windows-PIJ4CMWX.js.map +1 -0
  46. package/package.json +8 -6
  47. package/skills/academic-search/SKILL.md +147 -0
  48. package/skills/architecture/SKILL.md +294 -0
  49. package/skills/changelog-generator/SKILL.md +112 -0
  50. package/skills/chart-visualization/SKILL.md +183 -0
  51. package/skills/code-review/SKILL.md +304 -0
  52. package/skills/codebase-health/SKILL.md +281 -0
  53. package/skills/consulting-analysis/SKILL.md +584 -0
  54. package/skills/content-research-writer/SKILL.md +546 -0
  55. package/skills/data-analysis/SKILL.md +194 -0
  56. package/skills/deep-research/SKILL.md +198 -0
  57. package/skills/docx/SKILL.md +211 -0
  58. package/skills/github-deep-research/SKILL.md +207 -0
  59. package/skills/image-generation/SKILL.md +209 -0
  60. package/skills/lead-research-assistant/SKILL.md +207 -0
  61. package/skills/mcp-builder/SKILL.md +304 -0
  62. package/skills/meeting-insights-analyzer/SKILL.md +335 -0
  63. package/skills/pair-programming/SKILL.md +196 -0
  64. package/skills/pdf/SKILL.md +309 -0
  65. package/skills/performance-analysis/SKILL.md +261 -0
  66. package/skills/podcast-generation/SKILL.md +224 -0
  67. package/skills/pptx/SKILL.md +497 -0
  68. package/skills/project-learnings/SKILL.md +280 -0
  69. package/skills/security-audit/SKILL.md +211 -0
  70. package/skills/skill-creator/SKILL.md +200 -0
  71. package/skills/technical-writing/SKILL.md +286 -0
  72. package/skills/testing/SKILL.md +363 -0
  73. package/skills/video-generation/SKILL.md +247 -0
  74. package/skills/web-design-guidelines/SKILL.md +203 -0
  75. package/skills/webapp-testing/SKILL.md +162 -0
  76. package/skills/workflow-automation/SKILL.md +299 -0
  77. package/skills/xlsx/SKILL.md +305 -0
  78. package/dist/chunk-KHPEQTWF.js.map +0 -1
@@ -0,0 +1,584 @@
1
+ ---
2
+ name: consulting-analysis
3
+ description: Generate professional consulting-grade research reports with structured analysis frameworks and strategic insights. Use when creating market analysis, consumer insights, brand strategy, financial analysis, industry research, competitive intelligence, or investment due diligence reports.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Professional Research Report Skill
8
+
9
+ ## Overview
10
+
11
+ This skill produces professional, consulting-grade research reports in Markdown format, covering domains such as **market analysis, consumer insights, brand strategy, financial analysis, industry research, competitive intelligence, investment research, and macroeconomic analysis**. It operates across two distinct phases:
12
+
13
+ 1. **Phase 1 — Analysis Framework Generation**: Given a research subject, produce a rigorous analysis framework including chapter skeleton, per-chapter data requirements, analysis logic, and visualization plan.
14
+ 2. **Phase 2 — Report Generation**: After data has been collected by other skills, synthesize all inputs into a final polished report.
15
+
16
+ The output adheres to McKinsey/BCG consulting voice standards. The report language follows the `output_locale` setting (default: `zh_CN` for Chinese).
17
+
18
+ ## Data Authenticity Protocol
19
+
20
+ **Strict Adherence Rule**: All data presented in the report and visualized in charts MUST be derived directly from the provided **Data Summary** or **External Search Findings**.
21
+ - **NO Hallucinations**: Do not invent, estimate, or simulate data. If data is missing, state "Data not available" rather than fabricating numbers.
22
+ - **Traceable Sources**: Every major claim and chart must be traceable back to the input data package.
23
+
24
+ ## Core Capabilities
25
+
26
+ - **Design analysis frameworks** from scratch given only a research subject and scope
27
+ - Transform raw data into structured, high-depth research reports
28
+ - Follow the **"Visual Anchor → Data Contrast → Integrated Analysis"** flow per sub-chapter
29
+ - Produce insights following the **"Data → User Psychology → Strategy Implication"** chain
30
+ - Embed pre-generated charts and construct comparison tables
31
+ - Generate inline citations formatted per **GB/T 7714-2015** standards
32
+ - Output reports in the language specified by `output_locale` with professional consulting tone
33
+ - Adapt analytical depth and structure to domain (marketing, finance, industry, etc.)
34
+
35
+ ## When to Use This Skill
36
+
37
+ **Always load this skill when:**
38
+
39
+ - User asks for a market analysis, consumer insight report, financial analysis, industry research, or any consulting-grade analytical report
40
+ - User provides a research subject and needs a structured analysis framework before data collection
41
+ - User provides data summaries, analysis frameworks, or chart files to be synthesized into a report
42
+ - User needs a professional consulting-style research report
43
+ - The task involves transforming research findings into structured strategic narratives
44
+
45
+ ## When NOT to Use
46
+
47
+ - **Quick data lookups** — use `deep-research` for simple factual questions
48
+ - **Academic literature review** — use `academic-search` skill
49
+ - **Technical documentation** — use `technical-writing` skill
50
+ - **Data exploration or one-off analysis** — use `data-analysis` skill
51
+ - **Blog posts or marketing copy** — use `content-research-writer` skill
52
+
53
+ ---
54
+
55
+ # Phase 1: Analysis Framework Generation
56
+
57
+ ## Purpose
58
+
59
+ Given a **research subject** (e.g., "Gen-Z Skincare Market Analysis", "NEV Industry Competitive Landscape", "Brand X Consumer Profiling"), produce a complete **analysis framework** that serves as the blueprint for downstream data collection and final report generation.
60
+
61
+ ## Phase 1 Inputs
62
+
63
+ | Input | Description | Required |
64
+ |-------|-------------|----------|
65
+ | **Research Subject** | The topic or question to be analyzed | Yes |
66
+ | **Scope / Constraints** | Geographic scope, time range, industry segment, target audience, etc. | Optional |
67
+ | **Specific Angles** | Any particular angles or hypotheses the user wants explored | Optional |
68
+ | **Domain** | The analytical domain: market, finance, industry, brand, consumer, investment, etc. | Inferred |
69
+
70
+ ## Phase 1 Workflow
71
+
72
+ ### Step 1.1: Understand the Research Subject
73
+
74
+ - Parse the research subject to identify the **core entity** (market, brand, product, industry, consumer segment, financial instrument, etc.)
75
+ - Identify the **analytical domain** (marketing, finance, industry, competitive, consumer, investment, macro, etc.)
76
+ - Determine the **natural analytical dimensions** based on domain:
77
+
78
+ | Domain | Typical Dimensions |
79
+ |--------|--------------------|
80
+ | Market Analysis | Market size, growth trends, market segmentation, growth drivers, competitive landscape, consumer profiling |
81
+ | Brand Analysis | Brand positioning, market share, consumer perception, marketing strategy, competitor comparison |
82
+ | Consumer Insights | Demographic profiling, purchase behavior, decision journey, pain points, scenario analysis |
83
+ | Financial Analysis | Macro environment, industry trends, company fundamentals, financial metrics, valuation, risk assessment |
84
+ | Industry Research | Value chain analysis, market size, competitive landscape, policy environment, technology trends, entry barriers |
85
+ | Investment Due Diligence | Business model, financial health, management assessment, market opportunity, risk factors, exit pathways |
86
+ | Competitive Intelligence | Competitor identification, strategic comparison, SWOT analysis, differentiated positioning, market dynamics |
87
+
88
+ ### Step 1.2: Select Analysis Frameworks & Models
89
+
90
+ Based on the identified domain and research subject, select **one or more** professional analysis frameworks to structure the reasoning in each chapter. The chosen frameworks guide the **Analysis Logic** in the chapter skeleton (Step 1.3).
91
+
92
+ #### Framework Toolkit by Category
93
+
94
+ **Strategic & Environmental:** SWOT, PEST/PESTEL, Porter's Five Forces, Porter's Diamond, VRIO
95
+
96
+ **Market & Growth:** STP, BCG Matrix, Ansoff Matrix, Product Life Cycle, TAM-SAM-SOM, Technology Adoption Lifecycle
97
+
98
+ **Consumer & Behavioral:** Consumer Decision Journey, AARRR Funnel, RFM Model, Maslow's Hierarchy, Jobs-to-be-Done
99
+
100
+ **Financial & Valuation:** DuPont Analysis, DCF, Comparable Company Analysis, EVA
101
+
102
+ **Competitive & Strategic:** Benchmarking, Strategic Group Mapping, Value Chain Analysis, Blue Ocean Strategy, Perceptual Mapping
103
+
104
+ **Industry & Supply Chain:** Industry Value Chain, Gartner Hype Cycle, GE-McKinsey Matrix
105
+
106
+ #### Selection Principles
107
+
108
+ 1. **Domain-First**: Based on the domain identified in Step 1.1, select **2-4** most relevant frameworks from the toolkit above
109
+ 2. **Complementary**: Choose complementary rather than overlapping frameworks (e.g., macro-level with PESTEL + micro-level with Porter's Five Forces)
110
+ 3. **Depth over Breadth**: Better to deeply apply 2 frameworks than superficially stack 6
111
+ 4. **Data-Feasible**: Selected frameworks must be supportable by downstream data collection skills — if the data required by a framework cannot be reasonably obtained, downgrade or substitute
112
+ 5. **Explicit Mapping**: In the chapter skeleton, explicitly annotate which framework each chapter uses and how it is applied
113
+
114
+ #### Framework Selection Output Format
115
+
116
+ ```markdown
117
+ ## Framework Selection
118
+
119
+ | Chapter | Selected Framework(s) | Application |
120
+ |---------|----------------------|-------------|
121
+ | Market Size & Growth Trends | TAM-SAM-SOM + Product Life Cycle | TAM-SAM-SOM to quantify market space, PLC to determine market stage |
122
+ | Competitive Landscape Assessment | Porter's Five Forces + Strategic Group Mapping | Five Forces to assess industry competition intensity, Group Mapping to visualize competitive positioning |
123
+ | Consumer Profiling | RFM + Consumer Decision Journey | RFM to segment customer value, Decision Journey to identify key conversion nodes |
124
+ | Brand Strategy Recommendations | SWOT + Blue Ocean Strategy | SWOT to summarize overall landscape, Blue Ocean to guide differentiation direction |
125
+ ```
126
+
127
+ ### Step 1.3: Design Chapter Skeleton
128
+
129
+ Produce a hierarchical chapter structure. Each chapter must include:
130
+
131
+ 1. **Chapter Title** — Professional, concise, subject-based (follow titling constraints in Formatting section)
132
+ 2. **Analysis Objective** — What this chapter aims to reveal
133
+ 3. **Analysis Logic** — The reasoning chain or framework (must reference the frameworks selected in Step 1.2)
134
+ 4. **Core Hypothesis** — Preliminary hypotheses to be validated or refuted by data
135
+
136
+ #### Chapter Skeleton Output Format
137
+
138
+ ```markdown
139
+ ## Analysis Framework
140
+
141
+ ### Chapter 1: [Title]
142
+ - **Analysis Objective**: [This chapter aims to...]
143
+ - **Analysis Logic**: [Framework or reasoning chain used]
144
+ - **Core Hypothesis**: [Hypotheses to validate]
145
+ - **Data Requirements**: (see Step 1.4)
146
+ - **Visualization Plan**: (see Step 1.5)
147
+
148
+ ### Chapter 2: [Title]
149
+ ...
150
+ ```
151
+
152
+ ### Step 1.4: Define Data Query Requirements Per Chapter
153
+
154
+ For each chapter, specify **exactly what data needs to be collected**. This is the bridge to downstream data collection skills.
155
+
156
+ Each data requirement entry must include:
157
+
158
+ | Field | Description |
159
+ |-------|-------------|
160
+ | **Data Metric** | The specific metric or data point needed (e.g., "China skincare market size 2020-2025 (in billion CNY)") |
161
+ | **Data Type** | Quantitative, Qualitative, or Mixed |
162
+ | **Suggested Sources** | Suggested source categories: Industry reports, financial statements, government statistics, social media, e-commerce platforms, survey data, news |
163
+ | **Search Keywords** | Suggested search queries for data collection agents |
164
+ | **Priority** | P0 (Required) / P1 (Important) / P2 (Supplementary) |
165
+ | **Time Range** | The time period the data should cover |
166
+
167
+ #### Data Requirements Output Format (per chapter)
168
+
169
+ ```markdown
170
+ #### Data Requirements
171
+
172
+ | # | Data Metric | Data Type | Suggested Sources | Search Keywords | Priority | Time Range |
173
+ |---|-------------|-----------|-------------------|-----------------|----------|------------|
174
+ | 1 | Market size (billion CNY) | Quantitative | Industry reports, government statistics | "China skincare market size 2024" | P0 | 2020-2025 |
175
+ | 2 | CAGR | Quantitative | Industry reports | "skincare CAGR growth rate" | P0 | 2020-2025 |
176
+ | 3 | Sub-category share | Quantitative | E-commerce platforms, industry reports | "skincare category share cream serum sunscreen" | P1 | Latest |
177
+ | 4 | Policy & regulatory updates | Qualitative | Government announcements, news | "cosmetics regulation 2024" | P2 | Past 1 year |
178
+ ```
179
+
180
+ ### Step 1.5: Define Visualization & Content Structure Per Chapter
181
+
182
+ For each chapter, specify the **planned visualization** and **content structure** for the final report:
183
+
184
+ | Field | Description |
185
+ |-------|-------------|
186
+ | **Visualization Type** | Chart type: Line chart, bar chart, pie chart, scatter plot, radar chart, heatmap, Sankey diagram, comparison table, etc. |
187
+ | **Visualization Title** | Descriptive title for the chart |
188
+ | **Visualization Data Mapping** | Which data indicators map to X/Y axes or segments |
189
+ | **Comparison Table Design** | Column headers and comparison dimensions for the data contrast table |
190
+ | **Argument Structure** | The planned "What → Why → So What" narrative outline |
191
+
192
+ #### Visualization Plan Output Format (per chapter)
193
+
194
+ ```markdown
195
+ #### Visualization & Content Plan
196
+
197
+ **Chart 1**: [Type] — [Title]
198
+ - X-axis: [Dimension], Y-axis: [Metric]
199
+ - Data source: Corresponds to Data Requirement #1, #2
200
+
201
+ **Comparison Table**:
202
+ | Dimension | Item A | Item B | Item C |
203
+ |-----------|--------|--------|--------|
204
+
205
+ **Argument Structure**:
206
+ 1. **Observation (What)**: [Surface phenomenon revealed by data]
207
+ 2. **Attribution (Why)**: [Driving factors or underlying causes]
208
+ 3. **Implication (So What)**: [Strategic implications or recommended actions]
209
+ ```
210
+
211
+ ### Step 1.6: Output Complete Analysis Framework
212
+
213
+ Assemble all outputs into a single, structured **Analysis Framework Document**:
214
+
215
+ ```markdown
216
+ # [Research Subject] Analysis Framework
217
+
218
+ ## Research Overview
219
+ - **Research Subject**: [...]
220
+ - **Scope**: [Geography, time range, industry segment]
221
+ - **Analysis Domain**: [Market / Finance / Industry / Brand / Consumer / ...]
222
+ - **Core Research Questions**: [1-3 key questions]
223
+
224
+ ## Framework Selection
225
+
226
+ | Chapter | Selected Framework(s) | Application |
227
+ |---------|----------------------|-------------|
228
+ | ... | ... | ... |
229
+
230
+ ## Chapter Skeleton
231
+
232
+ ### 1. [Chapter Title]
233
+ - **Analysis Objective**: [...]
234
+ - **Analysis Logic**: [...]
235
+ - **Core Hypothesis**: [...]
236
+
237
+ #### Data Requirements
238
+ | # | Data Metric | Data Type | Suggested Sources | Search Keywords | Priority | Time Range |
239
+ |---|-------------|-----------|-------------------|-----------------|----------|------------|
240
+ | ... | ... | ... | ... | ... | ... | ... |
241
+
242
+ #### Visualization & Content Plan
243
+ [Chart plan + Comparison table design + Argument structure]
244
+
245
+ ### 2. [Chapter Title]
246
+ ...
247
+
248
+ ### N. [Chapter Title]
249
+ ...
250
+
251
+ ## Data Collection Task List
252
+ [Consolidate all P0/P1 data requirements across chapters into a structured task list for downstream data collection skills to execute]
253
+ ```
254
+
255
+ ## Phase 1 Quality Checklist
256
+
257
+ - [ ] Analysis framework covers all natural dimensions for the identified domain
258
+ - [ ] 2-4 professional analysis frameworks are selected and explicitly mapped to chapters
259
+ - [ ] Selected frameworks are complementary (not overlapping) and data-feasible
260
+ - [ ] Each chapter has clear Analysis Objective, Analysis Logic (referencing chosen framework), and Core Hypothesis
261
+ - [ ] Data requirements are specific, measurable, and include search keywords
262
+ - [ ] Every chapter has at least one visualization plan
263
+ - [ ] Data priorities (P0/P1/P2) are assigned realistically
264
+ - [ ] The framework is actionable — a data collection agent can execute on the Search Keywords directly
265
+ - [ ] Data Collection Task List is comprehensive and deduplicated
266
+
267
+ ---
268
+
269
+ # Phase 1→2 Handoff: Data Collection & Chart Generation
270
+
271
+ After the analysis framework is generated, it is handed off to **other data collection skills** (e.g., deep-research, data-analysis, web search agents) to:
272
+
273
+ 1. Execute the **Search Keywords** from each chapter's data requirements
274
+ 2. Collect quantitative data, qualitative insights, and source URLs
275
+ 3. Generate charts based on the **Visualization & Content Plan**
276
+ 4. Return a **Data Package** containing:
277
+ - **Data Summary**: Raw numbers, metrics, and qualitative findings per chapter
278
+ - **Chart Files**: Generated chart images with local file paths
279
+ - **External Search Findings**: Source URLs and summaries for citations
280
+
281
+ > **This skill does NOT perform data collection.** It only produces the framework (Phase 1) and the final report (Phase 2).
282
+ >
283
+ > **Chart Generation**: If a visualization/charting skill is available (e.g., data-analysis, image-generation), chart generation can be deferred to the beginning of Phase 2 — see Step 2.3.
284
+
285
+ ---
286
+
287
+ # Phase 2: Report Generation
288
+
289
+ ## Purpose
290
+
291
+ Receive the completed **Analysis Framework** and **Data Package** from upstream, and synthesize them into a final consulting-grade report.
292
+
293
+ ## Phase 2 Inputs
294
+
295
+ | Input | Description | Required |
296
+ |-------|-------------|----------|
297
+ | **Analysis Framework** | The framework document produced in Phase 1 | Yes |
298
+ | **Data Summary** | Collected data organized per chapter from the data collection phase | Yes |
299
+ | **Chart Files** | Local file paths for generated chart images. If not provided, will be generated in Step 2.3 using available visualization skills | Optional |
300
+ | **External Search Findings** | URLs and summaries for inline citations | Optional |
301
+
302
+ ## Phase 2 Workflow
303
+
304
+ ### Step 2.1: Receive and Validate Inputs
305
+
306
+ Verify that all required inputs are present:
307
+
308
+ 1. **Analysis Framework** — Confirm it contains chapter skeleton, data requirements, and visualization plans
309
+ 2. **Data Summary** — Confirm it contains data organized per chapter, cross-reference against P0 requirements
310
+ 3. **Chart Files** — Confirm file paths are valid local paths
311
+
312
+ If any P0 data is missing, note it in the report and flag for the user.
313
+
314
+ ### Step 2.2: Map Report Structure
315
+
316
+ Map the final report structure from the Analysis Framework:
317
+
318
+ 1. **Abstract** — Executive summary with key takeaways
319
+ 2. **Introduction** — Background, objectives, methodology
320
+ 3. **Main Body Chapters (2...N)** — Mapped from the Framework's chapter skeleton
321
+ 4. **Conclusion** — Pure, objective synthesis
322
+ 5. **References** — GB/T 7714-2015 formatted references
323
+
324
+ ### Step 2.3: Generate Chapter Charts (Pre-Report Visualization)
325
+
326
+ Before writing the report, generate all planned charts from the Analysis Framework's **Visualization & Content Plan**. This step ensures every sub-chapter has its "Visual Anchor" ready before narrative writing begins.
327
+
328
+ #### When to Execute This Step
329
+
330
+ - **Chart Files already provided**: Skip this step — proceed directly to Step 2.4.
331
+ - **Chart Files NOT provided but a visualization skill is available**: Execute this step to generate all charts first.
332
+ - **No Chart Files and no visualization skill available**: Skip this step — use comparison tables as the primary visual anchor in Step 2.4, and note the absence of charts.
333
+
334
+ #### Chart Generation Workflow
335
+
336
+ 1. **Extract Chart Tasks**: Parse all `Visualization & Content Plan` entries from the Analysis Framework to build a chart generation task list:
337
+
338
+ | # | Chapter | Chart Type | Chart Title | Data Mapping | Data Source |
339
+ |---|---------|------------|-------------|--------------|-------------|
340
+ | 1 | 2.1 | Line chart | Market Size Trend 2020-2025 | X: Year, Y: Market Size (billion CNY) | Data Requirement #1, #2 |
341
+ | 2 | 3.1 | Pie chart | Consumer Age Distribution | Segments: Age groups, Values: Share % | Data Requirement #5 |
342
+ | ... | ... | ... | ... | ... | ... |
343
+
344
+ 2. **Prepare Chart Data**: For each chart task, extract the corresponding data points from the **Data Summary**.
345
+ > **CRITICAL**: Use ONLY the numbers provided in the Data Summary. Do NOT invent or "smooth" data to make charts look better. If data points are missing, the chart must reflect that reality (e.g., broken line or missing bar), or the chart type must be adjusted.
346
+
347
+ 3. **Delegate to Visualization Skill**: Invoke the available visualization/charting skill (e.g., `data-analysis`) for each chart task with:
348
+ - Chart type and title
349
+ - Structured data
350
+ - Axis labels and formatting preferences
351
+ - Output file path convention: `charts/chapter_{N}_{chart_index}.png`
352
+
353
+ 4. **Collect Chart File Paths**: Record all generated chart file paths for embedding in Step 2.4:
354
+
355
+ ```markdown
356
+ ## Generated Charts
357
+ | # | Chapter | Chart Title | File Path |
358
+ |---|---------|-------------|-----------|
359
+ | 1 | 2.1 | Market Size Trend 2020-2025 | charts/chapter_2_1.png |
360
+ | 2 | 3.1 | Consumer Age Distribution | charts/chapter_3_1.png |
361
+ ```
362
+
363
+ 5. **Validate**: Confirm all P0-priority charts have been generated. If any chart generation fails, note it and fall back to comparison tables for that sub-chapter.
364
+
365
+ > **Principle**: Complete ALL chart generation before starting report writing. This ensures a consistent visual narrative and avoids interleaving generation with writing.
366
+
367
+ ### Step 2.4: Write the Report
368
+
369
+ For each sub-chapter, follow the **"Visual Anchor → Data Contrast → Integrated Analysis"** flow:
370
+
371
+ 1. **Visual Evidence Block**: Embed charts using `![Image Description](Actual_File_Path)` — use the file paths collected in Step 2.3
372
+ 2. **Data Contrast Table**: Create a Markdown comparison table for key metrics
373
+ > **Source Rule**: Every number in the table must come from the Data Summary. No hallucinations.
374
+ 3. **Integrated Narrative Analysis**: Write analytical text following "What → Why → So What"
375
+ > **Narrative Rule**: Narrative must explain the *provided* data. Do not make claims unsupported by the inputs.
376
+
377
+ Each sub-chapter must end with a robust analytical paragraph (min. 200 words) that:
378
+ - Synthesizes conflicting or reinforcing data points
379
+ - Reveals the underlying user tension or opportunity
380
+ - Optionally ends with a punchy "One-Liner Truth" in a blockquote (`>`)
381
+
382
+ ### Step 2.5: Final Structure Self-Check
383
+
384
+ Before outputting, confirm the report contains **all sections in order**:
385
+
386
+ ```
387
+ Abstract → 1. Introduction → 2...N. Body Chapters → N+1. Conclusion → N+2. References
388
+ ```
389
+
390
+ Additionally verify:
391
+ - All charts generated in Step 2.3 are embedded in the correct sub-chapters
392
+ - Chart file paths in `![](path)` references are valid
393
+ - Sub-chapters without charts have comparison tables as visual anchors
394
+
395
+ The report **MUST NOT** stop after the Conclusion — it **MUST** include References as the final section.
396
+
397
+ ## Formatting & Tone Standards
398
+
399
+ ### Consulting Voice
400
+ - **Tone**: McKinsey/BCG — Authoritative, Objective, Professional
401
+ - **Language**: All headings and content in the language specified by `output_locale`
402
+ - **Number Formatting**: Use English commas for thousands separators (`1,000` not `1,000`)
403
+ - **Data emphasis**: **Bold** important viewpoints and key numbers
404
+
405
+ ### Titling Constraints
406
+ - **Numbering**: Use standard numbering (`1.`, `1.1`) directly followed by the title
407
+ - **Forbidden Prefixes**: Do NOT use "Chapter", "Part", "Section" as prefixes
408
+ - **Allowed Tone Words**: Analysis, Profiling, Overview, Insights, Assessment
409
+ - **Forbidden Words**: "Decoding", "DNA", "Secrets", "Mindscape", "Solar System", "Unlocking"
410
+
411
+ ### Sub-Chapter Conclusions
412
+ - **Requirement**: End each sub-chapter with a robust analytical paragraph (min. 200 words).
413
+ - **Narrative Flow**: This paragraph must look like a natural continuation of the text. It must synthesize the section's findings into a strategic judgment.
414
+ - **Content Logic**:
415
+ 1. Synthesize the conflicting or reinforcing data points above.
416
+ 2. Reveal the *underlying* user tension or opportunity.
417
+ 3. Key Insight: **Optional**: Only if you have a concise, punchy "One-Liner Truth", place it at the very end using a **Blockquote** (`>`) to anchor the section.
418
+
419
+ ### Insight Depth (The "So What" Chain)
420
+
421
+ Every insight must connect **Data → User Psychology → Strategy Implication**:
422
+
423
+ ```
424
+ ❌ Bad: "Females are 60%. Strategy: Target females."
425
+
426
+ ✅ Good: "Females constitute 60% with a high TGI of 180. **This suggests**
427
+ the purchase decision is driven by aesthetic and social validation
428
+ rather than pure utility. **Consequently**, media spend should pivot
429
+ towards visual-heavy platforms (e.g., RED/Instagram) to maximize CTR,
430
+ treating male audiences only as a secondary gift-giving segment."
431
+ ```
432
+
433
+ ### References
434
+ - **Inline**: Use markdown links for sources (e.g. `[Source Title](URL)`) when using External Search Findings
435
+ - **References section**: Formatted strictly per **GB/T 7714-2015**
436
+
437
+ ### Markdown Rules
438
+ - **Immediate Start**: Begin directly with `# Report Title` — no introductory text
439
+ - **No Separators**: Do NOT use horizontal rules (`---`)
440
+
441
+ ## Report Structure Template
442
+
443
+ ```markdown
444
+ # [Report Title]
445
+
446
+ ## Abstract
447
+ [Executive summary with key takeaways]
448
+
449
+ ## 1. Introduction
450
+ [Background, objectives, methodology]
451
+
452
+ ## 2. [Body Chapter Title]
453
+ ### 2.1 [Sub-chapter Title]
454
+ ![Chart Description](chart_file_path)
455
+
456
+ | Metric | Brand A | Brand B |
457
+ |--------|---------|--------|
458
+ | ... | ... | ... |
459
+
460
+ [Integrated narrative analysis: What → Why → So What, min. 200 words]
461
+
462
+ > [Optional: One-liner strategic truth]
463
+
464
+ ### 2.2 [Sub-chapter Title]
465
+ ...
466
+
467
+ ## N+1. Conclusion
468
+ [Pure objective synthesis, NO bullet points, neutral tone]
469
+ [Para 1: The fundamental nature of the group/market]
470
+ [Para 2: Core tension or behavior pattern]
471
+ [Final: One or two sentences stating the objective truth]
472
+
473
+ ## N+2. References
474
+ [1] Author. Title[EB/OL]. URL, Date.
475
+ [2] ...
476
+ ```
477
+
478
+ ## Complete Example
479
+
480
+ ### Phase 1 Example: Framework Generation
481
+
482
+ User provides: Research subject "Gen-Z Skincare Market Analysis"
483
+
484
+ **Phase 1 output (Analysis Framework):**
485
+
486
+ ```markdown
487
+ # Gen-Z Skincare Market Analysis Framework
488
+
489
+ ## Research Overview
490
+ - **Research Subject**: Gen-Z Skincare Market Deep Analysis
491
+ - **Scope**: China market, 2020-2025, consumers aged 18-27
492
+ - **Analysis Domain**: Market Analysis + Consumer Insights
493
+ - **Core Research Questions**:
494
+ 1. What is the size and growth momentum of the Gen-Z skincare market?
495
+ 2. What is unique about Gen-Z consumer skincare behavior patterns?
496
+ 3. How can brands effectively reach and convert Gen-Z consumers?
497
+
498
+ ## Chapter Skeleton
499
+
500
+ ### 1. Market Size & Growth Trends
501
+ - **Analysis Objective**: Quantify Gen-Z skincare market size and identify growth drivers
502
+ - **Analysis Logic**: Total market → Segmentation → Growth rate → Driver decomposition
503
+ - **Core Hypothesis**: Gen-Z is becoming the core engine of skincare consumption growth
504
+
505
+ #### Data Requirements
506
+ | # | Data Metric | Data Type | Suggested Sources | Search Keywords | Priority | Time Range |
507
+ |---|-------------|-----------|-------------------|-----------------|----------|------------|
508
+ | 1 | China skincare market total size | Quantitative | Industry reports | "China skincare market size 2024 2025" | P0 | 2020-2025 |
509
+ | 2 | Gen-Z skincare spending share | Quantitative | Industry reports, e-commerce platforms | "Gen-Z skincare spending share youth" | P0 | Latest |
510
+
511
+ #### Visualization & Content Plan
512
+ **Chart 1**: Line chart — China Skincare Market Size Trend 2020-2025
513
+ **Argument Structure**:
514
+ 1. What: Quantified status of market size and Gen-Z share
515
+ 2. Why: Consumption upgrade, ingredient-conscious consumers, social media driven
516
+ 3. So What: Brands should prioritize building youth-oriented product lines
517
+
518
+ ### 2. Consumer Profiling & Behavioral Insights
519
+ ...
520
+
521
+ ## Data Collection Task List
522
+ [Consolidated P0/P1 tasks]
523
+ ```
524
+
525
+ ### Phase 2 Example: Report Generation
526
+
527
+ After data collection, the user provides the Analysis Framework + Data Summary + chart file paths. Phase 2 synthesizes these into the final report following the structure: Abstract → Introduction → Body Chapters → Conclusion → References.
528
+
529
+ ---
530
+
531
+ ## Quality Checklists
532
+
533
+ ### Phase 1 Quality Checklist (Analysis Framework)
534
+
535
+ - [ ] Framework covers all natural analytical dimensions for the identified domain
536
+ - [ ] Each chapter has clear Analysis Objective, Analysis Logic, and Core Hypothesis
537
+ - [ ] Data requirements are specific, measurable, and include actionable Search Keywords
538
+ - [ ] Every chapter has at least one visualization plan with chart type and data mapping
539
+ - [ ] Data priorities (P0/P1/P2) are assigned — P0 items are essential for core arguments
540
+ - [ ] Data Collection Task List is comprehensive, deduplicated, and ready for downstream execution
541
+ - [ ] Framework adapts to the correct domain (market/finance/industry/consumer/etc.)
542
+
543
+ ### Phase 2 Quality Checklist (Final Report)
544
+
545
+ - [ ] **NO HALLUCINATION**: All numbers and charts are verified against the input Data Summary
546
+ - [ ] All planned charts generated before report writing (Step 2.3 completed first)
547
+ - [ ] All sections present in correct order (Abstract → Introduction → Body → Conclusion → References)
548
+ - [ ] Every sub-chapter follows "Visual Anchor → Data Contrast → Integrated Analysis"
549
+ - [ ] Every sub-chapter ends with a min. 200-word analytical paragraph
550
+ - [ ] All insights follow the "Data → User Psychology → Strategy Implication" chain
551
+ - [ ] All headings use proper numbering (no "Chapter/Part/Section" prefixes)
552
+ - [ ] Charts are embedded with `![Description](path)` syntax
553
+ - [ ] Numbers use English commas for thousands separators
554
+ - [ ] Inline references use markdown links where applicable
555
+ - [ ] References section follows GB/T 7714-2015
556
+ - [ ] No horizontal rules (`---`) in the document
557
+ - [ ] Conclusion uses flowing prose — no bullet points
558
+ - [ ] Report starts directly with `#` title — no preamble
559
+ - [ ] Missing P0 data is explicitly flagged in the report
560
+
561
+ ## Output Format
562
+
563
+ - **Phase 1**: Output the complete Analysis Framework in **Markdown** format
564
+ - **Phase 2**: Output the complete Report in **Markdown** format
565
+
566
+ ## Settings
567
+
568
+ ```
569
+ output_locale = zh_CN # configurable per user request
570
+ reasoning_locale = en
571
+ ```
572
+
573
+ ## Notes
574
+
575
+ - This skill operates in **two phases** of a multi-step agentic workflow:
576
+ - **Phase 1** produces the analysis framework and data collection requirements
577
+ - **Data collection** is performed by other skills (deep-research, data-analysis, etc.)
578
+ - **Phase 2** receives the collected data and produces the final report
579
+ - Dynamic titling: **Rewrite** topics from the Framework into professional, concise subject-based headers
580
+ - The Conclusion section must contain **NO** detailed recommendations — those belong in the preceding body chapters
581
+ - **ZERO HALLUCINATION POLICY**: Each statement, chart, and number in the report must be supported by data points from the input Data Summary. If data is missing, admit it.
582
+ - **Traceability**: If requested, you must be able to point to the specific line in the Data Summary or External Search Findings that supports a claim.
583
+ - The framework should adapt its analytical dimensions and depth to the specific domain (financial analysis uses different frameworks than consumer insights)
584
+ - When the research subject is ambiguous, default to the broadest reasonable scope and note assumptions