natureco-cli 5.20.3 → 5.21.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.
- package/CHANGELOG.md +779 -750
- package/README.md +608 -608
- package/bin/natureco.js +1099 -1095
- package/package.json +95 -94
- package/scripts/generate-qr.js +21 -0
- package/scripts/import-curated-skills-log.json +5 -0
- package/scripts/import-curated-skills.js +262 -0
- package/scripts/import-skills-log.json +167 -0
- package/scripts/import-skills.js +261 -0
- package/scripts/postinstall.js +125 -0
- package/src/commands/agent.js +280 -280
- package/src/commands/ask.js +4 -2
- package/src/commands/naturehub.js +206 -282
- package/src/commands/repl.js +1594 -1580
- package/src/providers/mem0-memory.js +121 -121
- package/src/providers/supermemory-memory.js +117 -117
- package/src/tools/llm_task.js +150 -150
- package/src/tools/mac_alarm.js +199 -199
- package/src/tools/workflow.js +424 -424
- package/src/utils/api.js +1211 -1188
- package/src/utils/cost-tracker.js +361 -360
- package/src/utils/inquirer-wrapper.js +43 -31
- package/src/utils/paste-safe-input.js +346 -334
- package/src/utils/process-errors.js +129 -115
- package/src/utils/provider-detect.js +76 -72
- package/src/utils/skills.js +1 -1
- package/src/utils/system-prompt.js +136 -136
- package/src/utils/tools.js +324 -324
- package/README.md.bak +0 -565
- package/src/tools/http.js +0 -78
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
{
|
|
2
|
+
"success": [
|
|
3
|
+
"hyperframes",
|
|
4
|
+
"hyperframes-animation",
|
|
5
|
+
"hyperframes-core",
|
|
6
|
+
"hyperframes-media",
|
|
7
|
+
"hyperframes-cli",
|
|
8
|
+
"hyperframes-creative",
|
|
9
|
+
"motion-graphics",
|
|
10
|
+
"general-video",
|
|
11
|
+
"website-to-video",
|
|
12
|
+
"product-launch-video",
|
|
13
|
+
"faceless-explainer",
|
|
14
|
+
"music-to-video",
|
|
15
|
+
"pr-to-video",
|
|
16
|
+
"talking-head-recut",
|
|
17
|
+
"simple",
|
|
18
|
+
"lark-doc",
|
|
19
|
+
"lark-base",
|
|
20
|
+
"lark-shared",
|
|
21
|
+
"lark-approval",
|
|
22
|
+
"lark-workflow-meeting-summary"
|
|
23
|
+
],
|
|
24
|
+
"skipped": [
|
|
25
|
+
"algorithmic-art",
|
|
26
|
+
"brand-guidelines",
|
|
27
|
+
"canvas-design",
|
|
28
|
+
"claude-api",
|
|
29
|
+
"doc-coauthoring",
|
|
30
|
+
"docx",
|
|
31
|
+
"frontend-design",
|
|
32
|
+
"internal-comms",
|
|
33
|
+
"mcp-builder",
|
|
34
|
+
"pdf",
|
|
35
|
+
"pptx",
|
|
36
|
+
"skill-creator",
|
|
37
|
+
"slack-gif-creator",
|
|
38
|
+
"theme-factory",
|
|
39
|
+
"web-artifacts-builder",
|
|
40
|
+
"webapp-testing",
|
|
41
|
+
"xlsx",
|
|
42
|
+
"design-an-interface",
|
|
43
|
+
"qa",
|
|
44
|
+
"request-refactor-plan",
|
|
45
|
+
"ubiquitous-language",
|
|
46
|
+
"grill-me",
|
|
47
|
+
"grilling",
|
|
48
|
+
"handoff",
|
|
49
|
+
"teach",
|
|
50
|
+
"writing-great-skills",
|
|
51
|
+
"implement",
|
|
52
|
+
"resolving-merge-conflicts",
|
|
53
|
+
"tdd",
|
|
54
|
+
"to-prd",
|
|
55
|
+
"decision-mapping",
|
|
56
|
+
"loop-me",
|
|
57
|
+
"writing-beats",
|
|
58
|
+
"writing-fragments",
|
|
59
|
+
"writing-shape",
|
|
60
|
+
"git-guardrails-claude-code",
|
|
61
|
+
"migrate-to-shoehorn",
|
|
62
|
+
"scaffold-exercises",
|
|
63
|
+
"setup-pre-commit",
|
|
64
|
+
"edit-article",
|
|
65
|
+
"obsidian-vault",
|
|
66
|
+
"github-actions-docs",
|
|
67
|
+
"use-my-browser",
|
|
68
|
+
"readme-i18n",
|
|
69
|
+
"secure-linux-web-hosting",
|
|
70
|
+
"develop-userscripts",
|
|
71
|
+
"openclaw-secure-linux-cloud",
|
|
72
|
+
"opensource-guide-coach",
|
|
73
|
+
"running-claude-code-via-litellm-copilot",
|
|
74
|
+
"skills-cli",
|
|
75
|
+
"tzst",
|
|
76
|
+
"xdrop",
|
|
77
|
+
"xget",
|
|
78
|
+
"composition-patterns",
|
|
79
|
+
"deploy-to-vercel",
|
|
80
|
+
"react-best-practices",
|
|
81
|
+
"react-native-skills",
|
|
82
|
+
"react-view-transitions",
|
|
83
|
+
"vercel-cli-with-tokens",
|
|
84
|
+
"vercel-optimize",
|
|
85
|
+
"web-design-guidelines",
|
|
86
|
+
"writing-guidelines",
|
|
87
|
+
"supabase-postgres-best-practices",
|
|
88
|
+
"supabase",
|
|
89
|
+
"brainstorming",
|
|
90
|
+
"systematic-debugging",
|
|
91
|
+
"writing-plans",
|
|
92
|
+
"using-superpowers",
|
|
93
|
+
"test-driven-development",
|
|
94
|
+
"caveman",
|
|
95
|
+
"caveman-review",
|
|
96
|
+
"caveman-commit",
|
|
97
|
+
"caveman-compress",
|
|
98
|
+
"cavecrew",
|
|
99
|
+
"caveman-stats",
|
|
100
|
+
"caveman-help",
|
|
101
|
+
"microsoft-foundry",
|
|
102
|
+
"azure-ai",
|
|
103
|
+
"airunway-aks-setup",
|
|
104
|
+
"appinsights-instrumentation",
|
|
105
|
+
"azure-aigateway",
|
|
106
|
+
"azure-cloud-migrate",
|
|
107
|
+
"azure-compliance",
|
|
108
|
+
"azure-compute",
|
|
109
|
+
"azure-cost",
|
|
110
|
+
"azure-deploy",
|
|
111
|
+
"azure-diagnostics",
|
|
112
|
+
"azure-enterprise-infra-planner",
|
|
113
|
+
"azure-hosted-copilot-sdk",
|
|
114
|
+
"azure-kubernetes",
|
|
115
|
+
"azure-kusto",
|
|
116
|
+
"azure-messaging",
|
|
117
|
+
"azure-prepare",
|
|
118
|
+
"azure-quotas",
|
|
119
|
+
"azure-rbac",
|
|
120
|
+
"azure-reliability",
|
|
121
|
+
"azure-resource-lookup",
|
|
122
|
+
"azure-resource-visualizer",
|
|
123
|
+
"azure-storage",
|
|
124
|
+
"azure-upgrade",
|
|
125
|
+
"azure-validate",
|
|
126
|
+
"entra-agent-id",
|
|
127
|
+
"entra-app-registration",
|
|
128
|
+
"python-appservice-deploy",
|
|
129
|
+
"brandkit",
|
|
130
|
+
"brutalist-skill",
|
|
131
|
+
"gpt-tasteskill",
|
|
132
|
+
"image-to-code-skill",
|
|
133
|
+
"imagegen-frontend-mobile",
|
|
134
|
+
"imagegen-frontend-web",
|
|
135
|
+
"minimalist-skill",
|
|
136
|
+
"output-skill",
|
|
137
|
+
"redesign-skill",
|
|
138
|
+
"soft-skill",
|
|
139
|
+
"stitch-skill",
|
|
140
|
+
"taste-skill-v1",
|
|
141
|
+
"taste-skill",
|
|
142
|
+
"remotion",
|
|
143
|
+
"fastify",
|
|
144
|
+
"documentation",
|
|
145
|
+
"init",
|
|
146
|
+
"linting-neostandard-eslint9",
|
|
147
|
+
"node",
|
|
148
|
+
"nodejs-core",
|
|
149
|
+
"oauth",
|
|
150
|
+
"octocat",
|
|
151
|
+
"skill-optimizer",
|
|
152
|
+
"snipgrapher",
|
|
153
|
+
"typescript-magician",
|
|
154
|
+
"design-doc-mermaid",
|
|
155
|
+
"viral-short-form-ideas",
|
|
156
|
+
"viral-short-form",
|
|
157
|
+
"viral-instagram-reels",
|
|
158
|
+
"viral-tiktok-content"
|
|
159
|
+
],
|
|
160
|
+
"failed": [
|
|
161
|
+
"lark-workflow-project-summary",
|
|
162
|
+
"lark-workflow-chat-summary",
|
|
163
|
+
"remotion-render",
|
|
164
|
+
"landing-page-design"
|
|
165
|
+
],
|
|
166
|
+
"totalAttempted": 158
|
|
167
|
+
}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
const https = require('https');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
const SKILLS_DIR = path.resolve(__dirname, '..', 'skills');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Each entry: { owner, repo, skills: [{ name, subpath }] }
|
|
9
|
+
* subpath is the relative path under the repo's root where SKILL.md lives.
|
|
10
|
+
* For flat: subpath = `skills/${name}`
|
|
11
|
+
* For nested (mattpocock): subpath = `skills/category/${name}`
|
|
12
|
+
*/
|
|
13
|
+
const ENTRIES = [
|
|
14
|
+
// --- anthropics/skills (flat) ---
|
|
15
|
+
{ owner: 'anthropics', repo: 'skills', skills: [
|
|
16
|
+
'algorithmic-art', 'brand-guidelines', 'canvas-design', 'claude-api',
|
|
17
|
+
'doc-coauthoring', 'docx', 'frontend-design', 'internal-comms',
|
|
18
|
+
'mcp-builder', 'pdf', 'pptx', 'skill-creator', 'slack-gif-creator',
|
|
19
|
+
'theme-factory', 'web-artifacts-builder', 'webapp-testing', 'xlsx',
|
|
20
|
+
].map(n => ({ name: n, subpath: `skills/${n}` })) },
|
|
21
|
+
|
|
22
|
+
// --- mattpocock/skills (nested under categories) ---
|
|
23
|
+
{ owner: 'mattpocock', repo: 'skills', skills: [
|
|
24
|
+
// deprecated
|
|
25
|
+
'design-an-interface', 'qa', 'request-refactor-plan', 'ubiquitous-language',
|
|
26
|
+
// productivity
|
|
27
|
+
'grill-me', 'grilling', 'handoff', 'teach', 'writing-great-skills',
|
|
28
|
+
// engineering
|
|
29
|
+
'implement', 'resolving-merge-conflicts', 'tdd', 'to-prd',
|
|
30
|
+
// in-progress
|
|
31
|
+
'decision-mapping', 'loop-me', 'writing-beats', 'writing-fragments', 'writing-shape',
|
|
32
|
+
// misc
|
|
33
|
+
'git-guardrails-claude-code', 'migrate-to-shoehorn', 'scaffold-exercises', 'setup-pre-commit',
|
|
34
|
+
// personal
|
|
35
|
+
'edit-article', 'obsidian-vault',
|
|
36
|
+
].map(n => ({ name: n, subpath: `skills/${getCategory(n)}/${n}` })) },
|
|
37
|
+
|
|
38
|
+
// --- xixu-me/skills (flat) ---
|
|
39
|
+
{ owner: 'xixu-me', repo: 'skills', skills: [
|
|
40
|
+
'github-actions-docs', 'use-my-browser', 'readme-i18n',
|
|
41
|
+
'secure-linux-web-hosting', 'develop-userscripts',
|
|
42
|
+
'openclaw-secure-linux-cloud', 'opensource-guide-coach',
|
|
43
|
+
'running-claude-code-via-litellm-copilot', 'skills-cli', 'tzst', 'xdrop', 'xget',
|
|
44
|
+
].map(n => ({ name: n, subpath: `skills/${n}` })) },
|
|
45
|
+
|
|
46
|
+
// --- vercel-labs/agent-skills (flat) ---
|
|
47
|
+
{ owner: 'vercel-labs', repo: 'agent-skills', skills: [
|
|
48
|
+
'composition-patterns', 'deploy-to-vercel', 'react-best-practices',
|
|
49
|
+
'react-native-skills', 'react-view-transitions', 'vercel-cli-with-tokens',
|
|
50
|
+
'vercel-optimize', 'web-design-guidelines', 'writing-guidelines',
|
|
51
|
+
].map(n => ({ name: n, subpath: `skills/${n}` })) },
|
|
52
|
+
|
|
53
|
+
// --- supabase/agent-skills (flat) ---
|
|
54
|
+
{ owner: 'supabase', repo: 'agent-skills', skills: [
|
|
55
|
+
'supabase-postgres-best-practices', 'supabase',
|
|
56
|
+
].map(n => ({ name: n, subpath: `skills/${n}` })) },
|
|
57
|
+
|
|
58
|
+
// --- obra/superpowers (flat) ---
|
|
59
|
+
{ owner: 'obra', repo: 'superpowers', skills: [
|
|
60
|
+
'brainstorming', 'systematic-debugging', 'writing-plans',
|
|
61
|
+
'using-superpowers', 'test-driven-development',
|
|
62
|
+
].map(n => ({ name: n, subpath: `skills/${n}` })) },
|
|
63
|
+
|
|
64
|
+
// --- juliusbrussee/caveman (flat) ---
|
|
65
|
+
{ owner: 'juliusbrussee', repo: 'caveman', skills: [
|
|
66
|
+
'caveman', 'caveman-review', 'caveman-commit', 'caveman-compress',
|
|
67
|
+
'cavecrew', 'caveman-stats', 'caveman-help',
|
|
68
|
+
].map(n => ({ name: n, subpath: `skills/${n}` })) },
|
|
69
|
+
|
|
70
|
+
// --- microsoft/azure-skills (flat) ---
|
|
71
|
+
{ owner: 'microsoft', repo: 'azure-skills', skills: [
|
|
72
|
+
'microsoft-foundry', 'azure-ai', 'airunway-aks-setup',
|
|
73
|
+
'appinsights-instrumentation', 'azure-aigateway', 'azure-cloud-migrate',
|
|
74
|
+
'azure-compliance', 'azure-compute', 'azure-cost', 'azure-deploy',
|
|
75
|
+
'azure-diagnostics', 'azure-enterprise-infra-planner',
|
|
76
|
+
'azure-hosted-copilot-sdk', 'azure-kubernetes', 'azure-kusto',
|
|
77
|
+
'azure-messaging', 'azure-prepare', 'azure-quotas', 'azure-rbac',
|
|
78
|
+
'azure-reliability', 'azure-resource-lookup', 'azure-resource-visualizer',
|
|
79
|
+
'azure-storage', 'azure-upgrade', 'azure-validate', 'entra-agent-id',
|
|
80
|
+
'entra-app-registration', 'python-appservice-deploy',
|
|
81
|
+
].map(n => ({ name: n, subpath: `skills/${n}` })) },
|
|
82
|
+
|
|
83
|
+
// --- leonxlnx/taste-skill (flat) ---
|
|
84
|
+
{ owner: 'leonxlnx', repo: 'taste-skill', skills: [
|
|
85
|
+
'brandkit', 'brutalist-skill', 'gpt-tasteskill', 'image-to-code-skill',
|
|
86
|
+
'imagegen-frontend-mobile', 'imagegen-frontend-web', 'minimalist-skill',
|
|
87
|
+
'output-skill', 'redesign-skill', 'soft-skill', 'stitch-skill',
|
|
88
|
+
'taste-skill-v1', 'taste-skill',
|
|
89
|
+
].map(n => ({ name: n, subpath: `skills/${n}` })) },
|
|
90
|
+
|
|
91
|
+
// --- remotion-dev/skills (flat) ---
|
|
92
|
+
{ owner: 'remotion-dev', repo: 'skills', skills: [
|
|
93
|
+
'remotion',
|
|
94
|
+
].map(n => ({ name: n, subpath: `skills/${n}` })) },
|
|
95
|
+
|
|
96
|
+
// --- mcollina/skills (flat) ---
|
|
97
|
+
{ owner: 'mcollina', repo: 'skills', skills: [
|
|
98
|
+
'fastify', 'documentation', 'init', 'linting-neostandard-eslint9',
|
|
99
|
+
'node', 'nodejs-core', 'oauth', 'octocat', 'skill-optimizer',
|
|
100
|
+
'snipgrapher', 'typescript-magician',
|
|
101
|
+
].map(n => ({ name: n, subpath: `skills/${n}` })) },
|
|
102
|
+
|
|
103
|
+
// --- spillwavesolutions/design-doc-mermaid (flat) ---
|
|
104
|
+
{ owner: 'spillwavesolutions', repo: 'design-doc-mermaid', skills: [
|
|
105
|
+
'design-doc-mermaid',
|
|
106
|
+
].map(n => ({ name: n, subpath: `skills/${n}` })) },
|
|
107
|
+
|
|
108
|
+
// --- vyralcontent/content-skills (flat) ---
|
|
109
|
+
{ owner: 'vyralcontent', repo: 'content-skills', skills: [
|
|
110
|
+
'viral-short-form-ideas', 'viral-short-form', 'viral-instagram-reels',
|
|
111
|
+
'viral-tiktok-content',
|
|
112
|
+
].map(n => ({ name: n, subpath: `skills/${n}` })) },
|
|
113
|
+
|
|
114
|
+
// --- heygen-com/hyperframes (flat) ---
|
|
115
|
+
{ owner: 'heygen-com', repo: 'hyperframes', skills: [
|
|
116
|
+
'hyperframes', 'hyperframes-animation', 'hyperframes-core',
|
|
117
|
+
'hyperframes-media', 'hyperframes-cli', 'hyperframes-creative',
|
|
118
|
+
'motion-graphics', 'general-video', 'website-to-video',
|
|
119
|
+
'product-launch-video', 'faceless-explainer', 'music-to-video',
|
|
120
|
+
'pr-to-video', 'talking-head-recut',
|
|
121
|
+
].map(n => ({ name: n, subpath: `skills/${n}` })) },
|
|
122
|
+
|
|
123
|
+
// --- roin-orca/skills ---
|
|
124
|
+
{ owner: 'roin-orca', repo: 'skills', skills: [
|
|
125
|
+
'simple',
|
|
126
|
+
].map(n => ({ name: n, subpath: `skills/${n}` })) },
|
|
127
|
+
|
|
128
|
+
// --- larksuite/cli ---
|
|
129
|
+
{ owner: 'larksuite', repo: 'cli', skills: [
|
|
130
|
+
'lark-doc', 'lark-base', 'lark-shared', 'lark-approval',
|
|
131
|
+
'lark-workflow-meeting-summary', 'lark-workflow-project-summary',
|
|
132
|
+
'lark-workflow-chat-summary',
|
|
133
|
+
].map(n => ({ name: n, subpath: `skills/${n}` })) },
|
|
134
|
+
|
|
135
|
+
// --- halt-catch-fire/skills ---
|
|
136
|
+
{ owner: 'halt-catch-fire', repo: 'skills', skills: [
|
|
137
|
+
'remotion-render', 'landing-page-design',
|
|
138
|
+
].map(n => ({ name: n, subpath: `skills/${n}` })) },
|
|
139
|
+
];
|
|
140
|
+
|
|
141
|
+
function getCategory(skillName) {
|
|
142
|
+
const cats = {
|
|
143
|
+
'design-an-interface': 'deprecated', 'qa': 'deprecated',
|
|
144
|
+
'request-refactor-plan': 'deprecated', 'ubiquitous-language': 'deprecated',
|
|
145
|
+
'grill-me': 'productivity', 'grilling': 'productivity',
|
|
146
|
+
'handoff': 'productivity', 'teach': 'productivity',
|
|
147
|
+
'writing-great-skills': 'productivity',
|
|
148
|
+
'implement': 'engineering', 'resolving-merge-conflicts': 'engineering',
|
|
149
|
+
'tdd': 'engineering', 'to-prd': 'engineering',
|
|
150
|
+
'decision-mapping': 'in-progress', 'loop-me': 'in-progress',
|
|
151
|
+
'writing-beats': 'in-progress', 'writing-fragments': 'in-progress',
|
|
152
|
+
'writing-shape': 'in-progress',
|
|
153
|
+
'git-guardrails-claude-code': 'misc', 'migrate-to-shoehorn': 'misc',
|
|
154
|
+
'scaffold-exercises': 'misc', 'setup-pre-commit': 'misc',
|
|
155
|
+
'edit-article': 'personal', 'obsidian-vault': 'personal',
|
|
156
|
+
};
|
|
157
|
+
return cats[skillName] || 'misc';
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function fetchUrl(url) {
|
|
161
|
+
return new Promise((resolve, reject) => {
|
|
162
|
+
const opts = {
|
|
163
|
+
headers: { 'User-Agent': 'natureco-skill-importer/1.0' },
|
|
164
|
+
timeout: 15000,
|
|
165
|
+
};
|
|
166
|
+
https.get(url, opts, (res) => {
|
|
167
|
+
if (res.statusCode === 302 || res.statusCode === 301) {
|
|
168
|
+
fetchUrl(res.headers.location).then(resolve).catch(reject);
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (res.statusCode !== 200) {
|
|
172
|
+
reject(new Error(`HTTP ${res.statusCode}`));
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
let data = '';
|
|
176
|
+
res.on('data', chunk => data += chunk);
|
|
177
|
+
res.on('end', () => resolve(data));
|
|
178
|
+
}).on('error', reject);
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function parseFrontmatter(content) {
|
|
183
|
+
const match = content.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);
|
|
184
|
+
if (!match) return null;
|
|
185
|
+
const frontmatter = {};
|
|
186
|
+
for (const line of match[1].split('\n')) {
|
|
187
|
+
const kv = line.match(/^(\w+):\s*(.+)$/);
|
|
188
|
+
if (kv) frontmatter[kv[1]] = kv[2].trim();
|
|
189
|
+
}
|
|
190
|
+
return { attrs: frontmatter, body: match[2] };
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
async function main() {
|
|
194
|
+
console.log('=== Natureco CLI — Skill Importer ===\n');
|
|
195
|
+
console.log(`Target: ${SKILLS_DIR}\n`);
|
|
196
|
+
|
|
197
|
+
if (!fs.existsSync(SKILLS_DIR)) fs.mkdirSync(SKILLS_DIR, { recursive: true });
|
|
198
|
+
|
|
199
|
+
const results = { success: [], skipped: [], failed: [], totalAttempted: 0 };
|
|
200
|
+
const seen = new Set();
|
|
201
|
+
|
|
202
|
+
for (const entry of ENTRIES) {
|
|
203
|
+
console.log(`\n--- ${entry.owner}/${entry.repo} ---`);
|
|
204
|
+
for (const skill of entry.skills) {
|
|
205
|
+
if (seen.has(skill.name)) continue;
|
|
206
|
+
seen.add(skill.name);
|
|
207
|
+
results.totalAttempted++;
|
|
208
|
+
|
|
209
|
+
const skillDir = path.join(SKILLS_DIR, skill.name);
|
|
210
|
+
const skillFile = path.join(skillDir, 'SKILL.md');
|
|
211
|
+
|
|
212
|
+
if (fs.existsSync(skillFile)) {
|
|
213
|
+
results.skipped.push(skill.name);
|
|
214
|
+
console.log(` \u23ED ${skill.name} (already exists)`);
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const url = `https://raw.githubusercontent.com/${entry.owner}/${entry.repo}/main/${skill.subpath}/SKILL.md`;
|
|
219
|
+
|
|
220
|
+
try {
|
|
221
|
+
const content = await fetchUrl(url);
|
|
222
|
+
fs.mkdirSync(skillDir, { recursive: true });
|
|
223
|
+
|
|
224
|
+
let finalContent = content;
|
|
225
|
+
const parsed = parseFrontmatter(content);
|
|
226
|
+
if (!parsed) {
|
|
227
|
+
finalContent = `---\nname: ${skill.name}\ndescription: ${skill.name} skill from ${entry.owner}/${entry.repo}\n---\n\n${content}`;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
fs.writeFileSync(skillFile, finalContent);
|
|
231
|
+
results.success.push(skill.name);
|
|
232
|
+
console.log(` \u2705 ${skill.name}`);
|
|
233
|
+
} catch (err) {
|
|
234
|
+
results.failed.push(skill.name);
|
|
235
|
+
console.log(` \u274C ${skill.name}: ${err.message}`);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
console.log('\n\n=== Summary ===');
|
|
241
|
+
console.log(`Total skills attempted: ${results.totalAttempted}`);
|
|
242
|
+
console.log(`Successfully downloaded: ${results.success.length}`);
|
|
243
|
+
console.log(`Already existed/skipped: ${results.skipped.length}`);
|
|
244
|
+
console.log(`Failed: ${results.failed.length}`);
|
|
245
|
+
|
|
246
|
+
if (results.failed.length > 0) {
|
|
247
|
+
console.log('\nFailed skills:');
|
|
248
|
+
for (const f of results.failed) {
|
|
249
|
+
console.log(` - ${f}`);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
const skillDirs = fs.readdirSync(SKILLS_DIR).filter(f => fs.statSync(path.join(SKILLS_DIR, f)).isDirectory());
|
|
254
|
+
console.log(`\nSkills directory now has ${skillDirs.length} skill directories.`);
|
|
255
|
+
|
|
256
|
+
const logPath = path.resolve(__dirname, 'import-skills-log.json');
|
|
257
|
+
fs.writeFileSync(logPath, JSON.stringify(results, null, 2));
|
|
258
|
+
console.log(`\nLog: ${logPath}`);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
main().catch(console.error);
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* NatureCo CLI - Post-install script (v5.6.0)
|
|
4
|
+
*
|
|
5
|
+
* Bu script npm install sirasinda otomatik calisir.
|
|
6
|
+
* Hatalari onceden duzeltir:
|
|
7
|
+
* - chalk v5 (ESM) yerine chalk@4 (CJS) kur
|
|
8
|
+
* - Doctor calistir
|
|
9
|
+
* - Soul dosyalarini generic yap (Personal yoksa)
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const { execSync } = require('child_process');
|
|
13
|
+
const fs = require('fs');
|
|
14
|
+
const path = require('path');
|
|
15
|
+
const os = require('os');
|
|
16
|
+
|
|
17
|
+
const log = (msg, color = '\x1b[36m') => {
|
|
18
|
+
console.log(color + msg + '\x1b[0m');
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const success = (msg) => log(' \u2713 ' + msg, '\x1b[32m');
|
|
22
|
+
const warn = (msg) => log(' \u26a0 ' + msg, '\x1b[33m');
|
|
23
|
+
const error = (msg) => log(' \u2717 ' + msg, '\x1b[31m');
|
|
24
|
+
|
|
25
|
+
function run(cmd) {
|
|
26
|
+
try {
|
|
27
|
+
return execSync(cmd, { stdio: 'pipe', encoding: 'utf8' });
|
|
28
|
+
} catch (e) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function fixChalk() {
|
|
34
|
+
log('\n[1/4] chalk kontrol...');
|
|
35
|
+
try {
|
|
36
|
+
const chalkPkg = require('chalk/package.json');
|
|
37
|
+
const major = parseInt(chalkPkg.version.split('.')[0]);
|
|
38
|
+
if (major >= 5) {
|
|
39
|
+
warn('chalk v' + chalkPkg.version + ' ESM (CJS uyumsuz)');
|
|
40
|
+
const result = run('npm install chalk@4 --no-save');
|
|
41
|
+
if (result !== null) {
|
|
42
|
+
success('chalk v4 kuruldu');
|
|
43
|
+
} else {
|
|
44
|
+
warn('chalk@4 kurulamadi - manual: npm install -g chalk@4');
|
|
45
|
+
}
|
|
46
|
+
} else {
|
|
47
|
+
success('chalk v' + chalkPkg.version + ' (OK)');
|
|
48
|
+
}
|
|
49
|
+
} catch (e) {
|
|
50
|
+
warn('chalk kontrol edilemedi: ' + e.message);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function ensureHomeNatureco() {
|
|
55
|
+
log('\n[2/4] NatureCo dizinleri...');
|
|
56
|
+
const home = os.homedir();
|
|
57
|
+
const dirs = [
|
|
58
|
+
path.join(home, '.natureco'),
|
|
59
|
+
path.join(home, '.natureco', 'memory'),
|
|
60
|
+
path.join(home, '.natureco', 'soul'),
|
|
61
|
+
path.join(home, '.natureco', 'sessions'),
|
|
62
|
+
path.join(home, '.natureco', 'personal'),
|
|
63
|
+
];
|
|
64
|
+
for (const d of dirs) {
|
|
65
|
+
if (!fs.existsSync(d)) {
|
|
66
|
+
fs.mkdirSync(d, { recursive: true });
|
|
67
|
+
success('Olusturuldu: ' + d);
|
|
68
|
+
} else {
|
|
69
|
+
success('Mevcut: ' + d);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function checkHomebrewConflict() {
|
|
75
|
+
log('\n[3/4] Binary kontrol...');
|
|
76
|
+
if (process.platform !== 'darwin' && process.platform !== 'linux') {
|
|
77
|
+
success('Mac degil, Homebrew sorunu yok');
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const homebrewCli = '/opt/homebrew/lib/node_modules/natureco-cli';
|
|
82
|
+
const usrLocalCli = '/usr/local/lib/node_modules/natureco-cli';
|
|
83
|
+
|
|
84
|
+
if (fs.existsSync(homebrewCli) && fs.existsSync(usrLocalCli)) {
|
|
85
|
+
warn('Hem /opt/homebrew hem /usr/local var!');
|
|
86
|
+
warn('Cakisma var. Manuel: rm -rf ' + homebrewCli);
|
|
87
|
+
} else {
|
|
88
|
+
success('Binary cakismasi yok');
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function runDoctor() {
|
|
93
|
+
log('\n[4/4] Sistem kontrolu...');
|
|
94
|
+
const result = run('node ' + path.join(__dirname, '..', 'bin', 'natureco.js') + ' doctor');
|
|
95
|
+
if (result !== null) {
|
|
96
|
+
const ok = result.includes('saglikli') || result.includes('geçti');
|
|
97
|
+
if (ok) {
|
|
98
|
+
success('Tum kontroller gecti');
|
|
99
|
+
} else {
|
|
100
|
+
warn('Bazi kontroller basarisiz. Detay: natureco doctor');
|
|
101
|
+
}
|
|
102
|
+
} else {
|
|
103
|
+
warn('Doctor calistirilamadi');
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function main() {
|
|
108
|
+
// CI'da atla \u2014 hiz + log gurultusu (kurulumun kendisi zaten test ediliyor)
|
|
109
|
+
if (process.env.CI || process.env.NATURECO_SKIP_POSTINSTALL) return;
|
|
110
|
+
log('\n\u{1F33F} NatureCo CLI - Post-install\n', '\x1b[35m');
|
|
111
|
+
fixChalk();
|
|
112
|
+
ensureHomeNatureco();
|
|
113
|
+
checkHomebrewConflict();
|
|
114
|
+
runDoctor();
|
|
115
|
+
log('\n\u2705 Tamamlandi!\n Simdi: natureco setup\n', '\x1b[32m');
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Post-install KURULUMU ASLA KIRMAMALI \u2014 eski `|| true` cmd.exe'de calismiyordu
|
|
119
|
+
try {
|
|
120
|
+
main();
|
|
121
|
+
} catch (e) {
|
|
122
|
+
warn('Post-install tamamlanamadi: ' + e.message);
|
|
123
|
+
warn('Kurulum yine de basarili. Sonra `natureco doctor` calistirin.');
|
|
124
|
+
}
|
|
125
|
+
process.exit(0);
|