crushdataai 1.0.0

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 (40) hide show
  1. package/assets/antigravity/data-analyst.md +95 -0
  2. package/assets/claude/SKILL.md +145 -0
  3. package/assets/copilot/data-analyst.prompt.md +40 -0
  4. package/assets/cursor/data-analyst.md +50 -0
  5. package/assets/kiro/data-analyst.md +37 -0
  6. package/assets/shared/charts.csv +31 -0
  7. package/assets/shared/cleaning.csv +21 -0
  8. package/assets/shared/data/charts.csv +31 -0
  9. package/assets/shared/data/cleaning.csv +21 -0
  10. package/assets/shared/data/databases.csv +35 -0
  11. package/assets/shared/data/industries/ecommerce.csv +25 -0
  12. package/assets/shared/data/industries/finance.csv +24 -0
  13. package/assets/shared/data/industries/marketing.csv +25 -0
  14. package/assets/shared/data/industries/saas.csv +24 -0
  15. package/assets/shared/data/metrics.csv +74 -0
  16. package/assets/shared/data/python-patterns.csv +31 -0
  17. package/assets/shared/data/report-ux.csv +26 -0
  18. package/assets/shared/data/sql-patterns.csv +36 -0
  19. package/assets/shared/data/validation.csv +21 -0
  20. package/assets/shared/data/workflows.csv +51 -0
  21. package/assets/shared/databases.csv +35 -0
  22. package/assets/shared/industries/ecommerce.csv +25 -0
  23. package/assets/shared/industries/finance.csv +24 -0
  24. package/assets/shared/industries/marketing.csv +25 -0
  25. package/assets/shared/industries/saas.csv +24 -0
  26. package/assets/shared/metrics.csv +74 -0
  27. package/assets/shared/python-patterns.csv +31 -0
  28. package/assets/shared/report-ux.csv +26 -0
  29. package/assets/shared/scripts/__pycache__/core.cpython-311.pyc +0 -0
  30. package/assets/shared/scripts/core.py +238 -0
  31. package/assets/shared/scripts/search.py +61 -0
  32. package/assets/shared/sql-patterns.csv +36 -0
  33. package/assets/shared/validation.csv +21 -0
  34. package/assets/shared/workflows.csv +51 -0
  35. package/assets/windsurf/data-analyst.md +35 -0
  36. package/dist/commands.d.ts +3 -0
  37. package/dist/commands.js +159 -0
  38. package/dist/index.d.ts +2 -0
  39. package/dist/index.js +31 -0
  40. package/package.json +45 -0
@@ -0,0 +1,35 @@
1
+ # CrushData AI - Data Analyst Workflow
2
+
3
+ A data analyst intelligence workflow for structured, professional data analysis.
4
+
5
+ ## Trigger
6
+ Activate when user requests: data analysis, dashboards, metrics, EDA, cohort, funnel, or A/B tests.
7
+
8
+ ## Workflow
9
+
10
+ ### 1. Discovery (MANDATORY)
11
+ Ask before coding:
12
+ - Business question this analysis should answer
13
+ - Which tables/databases contain the data
14
+ - Company-specific metric definitions
15
+
16
+ ### 2. Search Knowledge
17
+ ```bash
18
+ python3 .windsurf/workflows/../.shared/data-analyst/scripts/search.py "<query>" --domain <domain>
19
+ ```
20
+
21
+ Domains: `workflow`, `metric`, `chart`, `sql`, `python`, `database`, `validation`
22
+
23
+ Industry: `--industry saas|ecommerce|finance|marketing`
24
+
25
+ ### 3. Profile Data (MANDATORY)
26
+ Run profiling before any analysis:
27
+ ```python
28
+ print(f"Shape: {df.shape}, Dates: {df['date'].min()} to {df['date'].max()}")
29
+ ```
30
+
31
+ ### 4. Validate
32
+ - Verify JOINs don't multiply rows
33
+ - Check totals are reasonable
34
+ - Compare to benchmarks
35
+ - Present for user validation
@@ -0,0 +1,3 @@
1
+ export declare function init(aiType: string, force: boolean): void;
2
+ export declare function update(): void;
3
+ export declare function versions(): void;
@@ -0,0 +1,159 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.init = init;
37
+ exports.update = update;
38
+ exports.versions = versions;
39
+ const fs = __importStar(require("fs-extra"));
40
+ const path = __importStar(require("path"));
41
+ const AI_TYPES = ['claude', 'cursor', 'windsurf', 'antigravity', 'copilot', 'kiro'];
42
+ const AI_PATHS = {
43
+ claude: {
44
+ dir: '.claude/skills/data-analyst',
45
+ files: ['SKILL.md']
46
+ },
47
+ cursor: {
48
+ dir: '.cursor/commands',
49
+ files: ['data-analyst.md']
50
+ },
51
+ windsurf: {
52
+ dir: '.windsurf/workflows',
53
+ files: ['data-analyst.md']
54
+ },
55
+ antigravity: {
56
+ dir: '.agent/workflows',
57
+ files: ['data-analyst.md']
58
+ },
59
+ copilot: {
60
+ dir: '.github/prompts',
61
+ files: ['data-analyst.prompt.md']
62
+ },
63
+ kiro: {
64
+ dir: '.kiro/steering',
65
+ files: ['data-analyst.md']
66
+ }
67
+ };
68
+ const SHARED_DIR = '.shared/data-analyst';
69
+ function getAssetsDir() {
70
+ // In npm package, assets are in the package directory
71
+ return path.join(__dirname, '..', 'assets');
72
+ }
73
+ function copySharedFiles(targetDir, force) {
74
+ const sharedSource = path.join(getAssetsDir(), 'shared');
75
+ const sharedTarget = path.join(targetDir, SHARED_DIR);
76
+ if (fs.existsSync(sharedTarget) && !force) {
77
+ console.log(` ⏭️ ${SHARED_DIR} already exists (use --force to overwrite)`);
78
+ return;
79
+ }
80
+ fs.copySync(sharedSource, sharedTarget, { overwrite: force });
81
+ console.log(` ✅ Created ${SHARED_DIR}/`);
82
+ }
83
+ function copyAIFiles(aiType, targetDir, force) {
84
+ const config = AI_PATHS[aiType];
85
+ const sourceDir = path.join(getAssetsDir(), aiType);
86
+ const targetPath = path.join(targetDir, config.dir);
87
+ // Ensure directory exists
88
+ fs.ensureDirSync(targetPath);
89
+ for (const file of config.files) {
90
+ const sourcePath = path.join(sourceDir, file);
91
+ const destPath = path.join(targetPath, file);
92
+ if (fs.existsSync(destPath) && !force) {
93
+ console.log(` ⏭️ ${config.dir}/${file} already exists`);
94
+ continue;
95
+ }
96
+ if (fs.existsSync(sourcePath)) {
97
+ fs.copyFileSync(sourcePath, destPath);
98
+ console.log(` ✅ Created ${config.dir}/${file}`);
99
+ }
100
+ }
101
+ // For Claude, also create symlinks to shared scripts and data
102
+ if (aiType === 'claude') {
103
+ const scriptsLink = path.join(targetPath, 'scripts');
104
+ const dataLink = path.join(targetPath, 'data');
105
+ const sharedScripts = path.relative(targetPath, path.join(targetDir, SHARED_DIR, 'scripts'));
106
+ const sharedData = path.relative(targetPath, path.join(targetDir, SHARED_DIR, 'data'));
107
+ // Note: Symlinks may require admin on Windows. Copy as fallback.
108
+ try {
109
+ if (!fs.existsSync(scriptsLink)) {
110
+ fs.copySync(path.join(targetDir, SHARED_DIR, 'scripts'), scriptsLink);
111
+ console.log(` ✅ Copied scripts to ${config.dir}/scripts/`);
112
+ }
113
+ if (!fs.existsSync(dataLink)) {
114
+ fs.copySync(path.join(targetDir, SHARED_DIR, 'data'), dataLink);
115
+ console.log(` ✅ Copied data to ${config.dir}/data/`);
116
+ }
117
+ }
118
+ catch (err) {
119
+ console.log(` ⚠️ Could not copy scripts/data. Use shared directory directly.`);
120
+ }
121
+ }
122
+ }
123
+ function init(aiType, force) {
124
+ const targetDir = process.cwd();
125
+ console.log(`\n🚀 Initializing CrushData AI in ${targetDir}\n`);
126
+ // Copy shared files first
127
+ copySharedFiles(targetDir, force);
128
+ // Handle 'all' or specific AI type
129
+ if (aiType === 'all') {
130
+ for (const ai of AI_TYPES) {
131
+ console.log(`\n📦 Setting up ${ai}...`);
132
+ copyAIFiles(ai, targetDir, force);
133
+ }
134
+ }
135
+ else if (AI_TYPES.includes(aiType)) {
136
+ console.log(`\n📦 Setting up ${aiType}...`);
137
+ copyAIFiles(aiType, targetDir, force);
138
+ }
139
+ else {
140
+ console.error(`❌ Unknown AI type: ${aiType}`);
141
+ console.error(` Available: ${AI_TYPES.join(', ')}, all`);
142
+ process.exit(1);
143
+ }
144
+ console.log(`\n✨ CrushData AI installed successfully!`);
145
+ console.log(`\n📖 Usage:`);
146
+ console.log(` - Claude Code: Uses skill automatically for data analysis requests`);
147
+ console.log(` - Cursor/Windsurf/Antigravity: Use /data-analyst command`);
148
+ console.log(` - Search: python3 .shared/data-analyst/scripts/search.py "<query>" --domain <domain>\n`);
149
+ }
150
+ function update() {
151
+ console.log('\n🔄 Checking for updates...');
152
+ console.log(' Run: npm update -g crushdataai');
153
+ console.log(' Then: crushdataai init --force\n');
154
+ }
155
+ function versions() {
156
+ console.log('\n📦 CrushData AI Versions');
157
+ console.log(' Installed: 1.0.0');
158
+ console.log(' Latest: Check npm: npm show crushdataai version\n');
159
+ }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const commander_1 = require("commander");
5
+ const commands_1 = require("./commands");
6
+ const program = new commander_1.Command();
7
+ program
8
+ .name('crushdataai')
9
+ .description('CLI to install CrushData AI data analyst skill for AI coding assistants')
10
+ .version('1.0.0');
11
+ program
12
+ .command('init')
13
+ .description('Initialize CrushData AI skill in current project')
14
+ .option('--ai <type>', 'AI assistant type (claude, cursor, windsurf, antigravity, copilot, kiro, all)', 'all')
15
+ .option('--force', 'Overwrite existing files', false)
16
+ .action((options) => {
17
+ (0, commands_1.init)(options.ai, options.force);
18
+ });
19
+ program
20
+ .command('update')
21
+ .description('Update CrushData AI skill to latest version')
22
+ .action(() => {
23
+ (0, commands_1.update)();
24
+ });
25
+ program
26
+ .command('versions')
27
+ .description('Show installed and latest versions')
28
+ .action(() => {
29
+ (0, commands_1.versions)();
30
+ });
31
+ program.parse();
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "crushdataai",
3
+ "version": "1.0.0",
4
+ "description": "CLI to install CrushData AI data analyst skill for AI coding assistants",
5
+ "main": "dist/index.js",
6
+ "bin": {
7
+ "crushdataai": "./dist/index.js"
8
+ },
9
+ "scripts": {
10
+ "build": "tsc",
11
+ "dev": "ts-node src/index.ts",
12
+ "prepublishOnly": "npm run build"
13
+ },
14
+ "keywords": [
15
+ "data-analyst",
16
+ "ai-skill",
17
+ "claude",
18
+ "cursor",
19
+ "windsurf",
20
+ "antigravity",
21
+ "copilot"
22
+ ],
23
+ "author": "",
24
+ "license": "Apache-2.0",
25
+ "devDependencies": {
26
+ "@types/fs-extra": "^11.0.4",
27
+ "@types/node": "^20.10.0",
28
+ "typescript": "^5.3.0"
29
+ },
30
+ "dependencies": {
31
+ "commander": "^11.1.0",
32
+ "fs-extra": "^11.2.0"
33
+ },
34
+ "engines": {
35
+ "node": ">=18.0.0"
36
+ },
37
+ "files": [
38
+ "dist",
39
+ "assets"
40
+ ],
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "git+https://github.com/SankaiAI/crushdataai-agent.git"
44
+ }
45
+ }