KcDAI is a TypeScript skill-based analysis pipeline for multi-platform gaming analytics.
It supports Steam, iOS, and Android platforms, fetching game metadata, marketing analytics, attribution data, and generating comprehensive reports with cross-platform insights.
- What This Repository Does
- Quick Start
- Architecture Overview
- Repository Structure
- Skills (Detailed)
- Planner as an Agent
- Execution Flow Example
- Configuration
- Example Output (Shape)
- Roadmap
- Contributing
- License
Given a game name and platform (for example, Hades on Steam or Jurassic World Alive on iOS), this project:
- Resolves the Steam app ID
- Fetches Steam app details
- Fetches recent Steam user reviews
- Infers marketing/pricing strategy
- Computes sentiment statistics from review text
- Fetches attribution data from AppsFlyer
- Retrieves campaign performance from Meta Ads
- Analyzes Unity Ads monetization and ROAS
- Processes SKAdNetwork postbacks (iOS)
- Performs cross-platform attribution analysis
- Generates marketing optimization recommendations
- Compares performance across platforms
- Analyzes attribution overlap
- Optimizes budget allocation
- Provides actionable marketing insights
- Produces a comprehensive JSON report with platform-specific recommendations
- Node.js 18+ (or newer)
- npm
npm install# Steam game analysis
npm run dev -- "Hades"
# iOS game marketing analysis
npm run dev -- "Jurassic World Alive sur ios"
# Android attribution analysis
npm run dev -- "Pokemon GO attribution sur android"
# Cross-platform marketing report
npm run dev -- "Clash Royale market analysis sur ios attribution_analysis"If no game is provided, the app defaults to Hades on Steam.
The project uses a lightweight agent-like pipeline:
- Planner (
src/planner.ts): produces a plan (ordered skill steps).- Uses an LLM-based planner if
OPENAI_API_KEYis available. - Falls back to a safe default deterministic plan.
- Sanitizes LLM output against an allowlist of skills.
- Uses an LLM-based planner if
- Executor (
src/executor.ts): runs the plan asynchronously step by step.- Merges each skill output into a shared context object.
- Logs start/success/failure with timings per skill.
- Registry (
src/registry.ts): stores available skills and resolves them by name. - Skills (
src/skills/*.ts): concrete handlers that do the actual work.
In short: createPlan(...) -> executePlan(...) -> final report.
flowchart TD
%% Input and Planning
CLI[CLI Input: game name] --> Planner[Planner: createPlan]
Planner -->|LLM or Default| Executor[Executor: executePlan]
%% Skill Execution Flow
Executor --> AppID[fetch_steam_app_id]
AppID -->|appId| Details[fetch_steam_details]
AppID -->|appId| Reviews[fetch_steam_reviews]
Details -->|details| Marketing[analyze_marketing]
Reviews -->|steamReviews| Sentiment[analyze_review_sentiment]
Marketing -->|marketing| Report[generate_report]
Sentiment -->|reviewSentiment| Report
Details -->|details| Report
AppID -->|appId| Report
Report -->|report| Format[format_response]
Format -->|responseText| Output[Final JSON Output]
%% Context Flow
Context[Shared Execution Context] -.->|merges results| AppID
Context -.->|merges results| Details
Context -.->|merges results| Reviews
Context -.->|merges results| Marketing
Context -.->|merges results| Sentiment
Context -.->|merges results| Report
Context -.->|merges results| Format
%% Styling
classDef input fill:#e1f5fe
classDef planning fill:#f3e5f5
classDef execution fill:#e8f5e8
classDef steam fill:#fff3e0
classDef analysis fill:#fce4ec
classDef output fill:#f1f8e9
class CLI input
class Planner,Executor planning
class AppID,Details,Reviews execution
class Marketing,Sentiment analysis
class Report,Format,Output output
src/index.ts- entrypoint, loads skills, calls planner + executorsrc/planner.ts- LLM-backed plan generation + fallback + validationsrc/executor.ts- async pipeline execution with loggingsrc/registry.ts- skill registration and lookupsrc/types.ts- core plan/step typessrc/nlp.ts- natural language processing for platform/intent detectionsrc/dag.ts- DAG representation of skill dependencies and execution flowsrc/skills/steam.ts- Steam data fetching skillssrc/skills/analysis.ts- marketing + sentiment + report skillssrc/skills/marketing-analytics.ts- AppsFlyer, Meta, Unity, SKAdNetwork skillssrc/skills/cross-platform.ts- Cross-platform analysis and optimization
-
fetch_steam_app_id- Input:
{ game, platform } - Output:
{ appId } - Note: currently uses a small hardcoded mapping (extend as needed).
- Input:
-
fetch_steam_details- Input:
{ appId } - Calls:
https://store.steampowered.com/api/appdetails - Output:
{ details }
- Input:
-
fetch_steam_reviews- Input:
{ appId } - Calls:
https://store.steampowered.com/appreviews/{appId} - Params include
json=1,filter=recent,language=english,num_per_page=50 - Output:
steamReviews.query_summarysteamReviews.reviewsas{ text, voted_up }[]
- Input:
-
fetch_appsflyer_conversions- Input:
{ game, platform } - Output:
{ appsflyerConversions }with install data - Requires:
APPSFLYER_API_KEY,APPSFLYER_APP_ID
- Input:
-
fetch_appsflyer_campaigns- Input:
{ game, platform } - Output:
{ appsflyerCampaigns }with performance metrics - Requires:
APPSFLYER_API_KEY,APPSFLYER_APP_ID
- Input:
-
fetch_meta_campaigns- Input:
{ game, platform } - Output:
{ metaCampaigns }with campaign data - Requires:
META_ACCESS_TOKEN,META_AD_ACCOUNT_ID
- Input:
-
fetch_meta_ad_performance- Input:
{ metaCampaigns } - Output:
{ metaAdPerformance }with insights and metrics
- Input:
-
fetch_unity_monetization_stats- Input:
{ game, platform } - Output:
{ unityMonetization }with revenue data - Requires:
UNITY_API_KEY,UNITY_ORGANIZATION_ID
- Input:
-
analyze_unity_roas- Input:
{ unityMonetization, appsflyerCampaigns } - Output:
{ unityRoasAnalysis }with ROI calculations
- Input:
-
fetch_skadnetwork_postbacks- Input:
{ game, platform } - Output:
{ skadnetworkPostbacks }with attribution data
- Input:
-
analyze_skadnetwork_conversion_value- Input:
{ skadnetworkPostbacks } - Output:
{ skadnetworkAnalysis }with engagement insights
- Input:
-
compare_platform_performance- Input: Multiple platform data sources
- Output:
{ platformComparison }with cross-platform metrics
-
analyze_attribution_overlap- Input: Attribution data from multiple sources
- Output:
{ attributionOverlap }with deduplication insights
-
optimize_cross_platform_roi- Input: Performance and attribution data
- Output:
{ crossPlatformOptimization }with budget recommendations
-
generate_marketing_report- Input: All marketing analytics data
- Output:
{ marketingReport }with comprehensive insights
-
analyze_marketing- Input:
{ details } - Logic: inspects price and discount
- Output:
marketingobject (pricing_strategy,price)
- Input:
-
analyze_review_sentiment- Input:
{ steamReviews } - Uses
sentiment - Output:
reviewSentiment.avgScorereviewSentiment.distribution(positive,negative,neutral)reviewSentiment.agreementWithVotesreviewSentiment.sample_size
- Input:
-
generate_report- Input: context built by prior steps
- Output: final
reportobject with platform-specific insights
src/planner.ts acts like a planning agent:
- It asks an LLM to produce JSON plan steps.
- It accepts only allowed skill names.
- It enforces required constraints:
fetch_steam_app_idincluded first (with{ game })generate_reportincluded as final output step
- If LLM output is invalid or unavailable, it falls back to the default static plan.
This gives flexibility without sacrificing reliability.
Default plan order:
fetch_steam_app_idfetch_steam_detailsfetch_steam_reviewsanalyze_marketinganalyze_review_sentimentgenerate_report
Each step receives the current context and returns partial results that are merged into context.
OPENAI_API_KEY- required to enable LLM planningPLANNER_MODEL- optional (default:gpt-4o-mini)
If OPENAI_API_KEY is missing, planning remains deterministic.
APPSFLYER_API_KEY- AppsFlyer API keyAPPSFLYER_APP_ID- Your app ID
META_ACCESS_TOKEN- Facebook Graph API access tokenMETA_AD_ACCOUNT_ID- Your ad account ID
UNITY_API_KEY- Unity Cloud API keyUNITY_ORGANIZATION_ID- Your Unity organization ID
# LLM Planning
$env:OPENAI_API_KEY="your_key_here"
$env:PLANNER_MODEL="gpt-4o-mini"
# Marketing APIs
$env:APPSFLYER_API_KEY="your_appsflyer_key"
$env:APPSFLYER_APP_ID="your_app_id"
$env:META_ACCESS_TOKEN="your_meta_token"
$env:META_AD_ACCOUNT_ID="your_ad_account_id"
$env:UNITY_API_KEY="your_unity_key"
$env:UNITY_ORGANIZATION_ID="your_org_id"
npm run dev -- "Jurassic World Alive sur ios attribution_analysis"The final JSON includes keys like:
gameplatformappIddetailssteamReviewsmarketingreviewSentimentreport
For mobile platforms, additional keys include:
appsflyerConversionsappsflyerCampaignsmetaCampaignsmetaAdPerformanceunityMonetizationunityRoasAnalysisskadnetworkPostbacksskadnetworkAnalysisplatformComparisonattributionOverlapcrossPlatformOptimizationmarketingReport
report is the concise, user-facing summary of the analysis, while marketingReport provides comprehensive marketing insights for mobile platforms.
- Replace hardcoded game -> appId mapping with Steam search lookup
- Add review pagination support for larger sentiment samples
- Provide output filtering to avoid printing very large
detailsblobs
- Add App Store and Google Play Store API integration
- Implement real-time SKAdNetwork postback processing
- Add more ad networks (AdMob, ironSource, etc.)
- Add unified dashboard for multi-platform monitoring
- Implement predictive analytics for campaign optimization
- Add automated budget allocation recommendations
- Add tests for planner sanitization and skill outputs
- Add optional structured logger transport (JSON logs)
- Implement caching for API responses
- Add rate limiting and retry logic for external APIs
Contributions are welcome.
- Fork the repo
- Create a branch (
feat/your-feature) - Commit your changes
- Open a pull request with a clear description and test notes
If you add a new skill, please update:
src/skills/*with registration- planner allowlist/default plan in
src/planner.ts - DAG dependencies in
src/dag.ts - this README skill list
When adding new marketing platforms:
- Create API integration skills in
src/skills/marketing-analytics.ts - Add platform-specific analysis in
src/skills/cross-platform.ts - Update NLP parsing in
src/nlp.tsfor platform detection - Add environment variables documentation to Configuration section
- Update DAG with new dependencies
This project is licensed under the MIT License. See the LICENSE file for details.