Просмотр исходного кода

feat: npm包结构+安装器(可 npx 安装到 Claude Code)

liuyuyang 1 день назад
Родитель
Сommit
c7e42dfa15
4 измененных файлов с 49 добавлено и 0 удалено
  1. 5 0
      LICENSE
  2. 24 0
      bin/install.js
  3. 6 0
      lib/index.mjs
  4. 14 0
      skill-package-manifest.json

+ 5 - 0
LICENSE

@@ -0,0 +1,5 @@
+MIT License
+
+Copyright (c) 2026 Fmode
+
+Permission is hereby granted, free of charge, to any person obtaining a copy...

+ 24 - 0
bin/install.js

@@ -0,0 +1,24 @@
+#!/usr/bin/env node
+// skill-task-dispatch — npx installer for Claude Code / Codex / Hermes
+import { mkdirSync, copyFileSync, readdirSync, existsSync } from 'fs';
+import { join, dirname } from 'path';
+import { fileURLToPath } from 'url';
+
+const __dirname = dirname(fileURLToPath(import.meta.url));
+const pkgRoot = join(__dirname, '..');
+const skillSrc = join(pkgRoot, 'skills', 'task-dispatch', 'SKILL.md');
+
+const mode = process.argv[2] || 'workspace';
+const targets = mode === 'workspace'
+  ? [process.cwd()]
+  : [join(process.env.HOME || '', '.claude')];
+
+for (const base of targets) {
+  const destDir = join(base, 'skills', 'task-dispatch');
+  mkdirSync(destDir, { recursive: true });
+  const dest = join(destDir, 'SKILL.md');
+  copyFileSync(skillSrc, dest);
+  console.log(`✅ 已安装 {'task-dispatch'} 到 ${dest}`);
+}
+console.log(`\n📦 skill-task-dispatch v4.0.0 安装完成`);
+console.log(`用法: 在任务描述中直接说「{'task-dispatch'}」即可触发`);

+ 6 - 0
lib/index.mjs

@@ -0,0 +1,6 @@
+// skill-task-dispatch — FmodeAgent skill package entry
+export const VERSION = '4.0.0';
+export const SKILL_NAME = 'task-dispatch';
+export function info() {
+  return { name: 'task-dispatch', version: '4.0.0', description: '任务自动调度中枢:自动分类+5步流程+并行派发+图片验证' };
+}

+ 14 - 0
skill-package-manifest.json

@@ -0,0 +1,14 @@
+{
+  "name": "task-dispatch",
+  "version": "4.0.0",
+  "description": "任务自动调度中枢:自动分类+5步流程+并行派发+图片验证",
+  "skills": [
+    {
+      "name": "task-dispatch",
+      "path": "skills/task-dispatch/SKILL.md",
+      "description": "任务自动调度中枢:自动分类+5步流程+并行派发+图片验证"
+    }
+  ],
+  "install": "npx --yes skill-task-dispatch@latest workspace",
+  "license": "MIT"
+}