@neyugn/agent-kits 0.3.1 → 0.3.3
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/README.md +18 -18
- package/README.vi.md +2 -2
- package/README.zh.md +2 -2
- package/dist/cli.js +138 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ Works with **any AI tool** — Claude, Gemini, Codex, Cursor, OpenCode, and more
|
|
|
47
47
|
## 🚀 Quick Start
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
|
-
npx @neyugn/agent-kits
|
|
50
|
+
npx @neyugn/agent-kits@latest
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
That's it! The interactive installer will guide you through:
|
|
@@ -64,7 +64,7 @@ That's it! The interactive installer will guide you through:
|
|
|
64
64
|
### 🎯 One Command, Any Tool
|
|
65
65
|
|
|
66
66
|
```bash
|
|
67
|
-
npx @neyugn/agent-kits
|
|
67
|
+
npx @neyugn/agent-kits@latest
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
```
|
|
@@ -100,14 +100,14 @@ npx @neyugn/agent-kits
|
|
|
100
100
|
|
|
101
101
|
**Global Paths by Tool:**
|
|
102
102
|
|
|
103
|
-
| Tool | Global Path
|
|
104
|
-
| ----------- |
|
|
105
|
-
| Claude Code | `~/.claude/`
|
|
106
|
-
| Gemini CLI | `~/.gemini/`
|
|
107
|
-
| Codex CLI | `~/.codex/`
|
|
108
|
-
| Antigravity | `~/.agent/`
|
|
109
|
-
| OpenCode | `~/.config/opencode/` | `.opencode/`
|
|
110
|
-
| Cursor | `~/.cursor/`
|
|
103
|
+
| Tool | Global Path | Workspace Path |
|
|
104
|
+
| ----------- | --------------------- | -------------- |
|
|
105
|
+
| Claude Code | `~/.claude/` | `.claude/` |
|
|
106
|
+
| Gemini CLI | `~/.gemini/` | `.gemini/` |
|
|
107
|
+
| Codex CLI | `~/.codex/` | `.codex/` |
|
|
108
|
+
| Antigravity | `~/.agent/` | `.agent/` |
|
|
109
|
+
| OpenCode | `~/.config/opencode/` | `.opencode/` |
|
|
110
|
+
| Cursor | `~/.cursor/` | `.cursor/` |
|
|
111
111
|
|
|
112
112
|
> **Note:** On Windows, `~` is replaced with `C:\Users\<username>\`
|
|
113
113
|
|
|
@@ -122,15 +122,15 @@ If the installer detects an existing installation, you'll be prompted:
|
|
|
122
122
|
|
|
123
123
|
### 🔌 Universal Compatibility
|
|
124
124
|
|
|
125
|
-
| Tool | Workspace Path | Global Path
|
|
126
|
-
| ----------- | ----------------- |
|
|
127
|
-
| Antigravity | `.agent/skills/` | `~/.agent/`
|
|
125
|
+
| Tool | Workspace Path | Global Path | Status |
|
|
126
|
+
| ----------- | ----------------- | --------------------- | ------------------ |
|
|
127
|
+
| Antigravity | `.agent/skills/` | `~/.agent/` | ✅ Fully Supported |
|
|
128
128
|
| OpenCode | `.opencode/` | `~/.config/opencode/` | ✅ Fully Supported |
|
|
129
|
-
| Cursor | `.cursor/skills/` | `~/.cursor/`
|
|
130
|
-
| Claude Code | `.claude/skills/` | `~/.claude/`
|
|
131
|
-
| Gemini CLI | `.gemini/skills/` | `~/.gemini/`
|
|
132
|
-
| Codex CLI | `.codex/skills/` | `~/.codex/`
|
|
133
|
-
| Custom | Configurable | `~/.ai/`
|
|
129
|
+
| Cursor | `.cursor/skills/` | `~/.cursor/` | ✅ Fully Supported |
|
|
130
|
+
| Claude Code | `.claude/skills/` | `~/.claude/` | 🔜 Coming Soon |
|
|
131
|
+
| Gemini CLI | `.gemini/skills/` | `~/.gemini/` | 🔜 Coming Soon |
|
|
132
|
+
| Codex CLI | `.codex/skills/` | `~/.codex/` | 🔜 Coming Soon |
|
|
133
|
+
| Custom | Configurable | `~/.ai/` | 🔜 Coming Soon |
|
|
134
134
|
|
|
135
135
|
> **Note:** Tools marked as 🔜 Coming Soon are planned for future releases. The infrastructure is ready, but these tools require additional testing and configuration.
|
|
136
136
|
|
package/README.vi.md
CHANGED
|
@@ -39,7 +39,7 @@ Hoạt động với **mọi công cụ AI** — Claude, Gemini, Codex, Cursor,
|
|
|
39
39
|
## 🚀 Bắt đầu nhanh
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
npx @neyugn/agent-kits
|
|
42
|
+
npx @neyugn/agent-kits@latest
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
Đó là tất cả! Installer tương tác sẽ hướng dẫn bạn:
|
|
@@ -56,7 +56,7 @@ npx @neyugn/agent-kits
|
|
|
56
56
|
### 🎯 Một lệnh, mọi công cụ
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
|
-
npx @neyugn/agent-kits
|
|
59
|
+
npx @neyugn/agent-kits@latest
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
```
|
package/README.zh.md
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
## 🚀 快速开始
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
npx @neyugn/agent-kits
|
|
42
|
+
npx @neyugn/agent-kits@latest
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
就这样!交互式安装程序将引导您:
|
|
@@ -56,7 +56,7 @@ npx @neyugn/agent-kits
|
|
|
56
56
|
### 🎯 一条命令,任何工具
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
|
-
npx @neyugn/agent-kits
|
|
59
|
+
npx @neyugn/agent-kits@latest
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
```
|
package/dist/cli.js
CHANGED
|
@@ -479,6 +479,96 @@ function createCursorWorkflowTransformer() {
|
|
|
479
479
|
return new CursorWorkflowTransformer();
|
|
480
480
|
}
|
|
481
481
|
|
|
482
|
+
// src/transformers/opencode-agent.ts
|
|
483
|
+
var TOOL_NAME_MAP = {
|
|
484
|
+
read: "read",
|
|
485
|
+
write: "write",
|
|
486
|
+
edit: "edit",
|
|
487
|
+
bash: "bash",
|
|
488
|
+
grep: "grep",
|
|
489
|
+
glob: "glob",
|
|
490
|
+
agent: "agent"
|
|
491
|
+
};
|
|
492
|
+
var OpenCodeAgentTransformer = class {
|
|
493
|
+
/**
|
|
494
|
+
* Transform agent content from Agent-Kits format to OpenCode agent format
|
|
495
|
+
*/
|
|
496
|
+
transform(content, context) {
|
|
497
|
+
const parsed = parseFrontmatter(content);
|
|
498
|
+
const originalData = parsed.data;
|
|
499
|
+
const toolsRecord = this.parseToolsToRecord(originalData.tools);
|
|
500
|
+
const opencodeFrontmatter = {
|
|
501
|
+
description: originalData.description,
|
|
502
|
+
...originalData.model && { model: originalData.model },
|
|
503
|
+
...Object.keys(toolsRecord).length > 0 && { tools: toolsRecord }
|
|
504
|
+
};
|
|
505
|
+
const newFrontmatter = this.serializeOpenCodeFrontmatter(opencodeFrontmatter);
|
|
506
|
+
let bodyContent = parsed.content;
|
|
507
|
+
bodyContent = this.transformPaths(bodyContent, context);
|
|
508
|
+
return combineMarkdown(newFrontmatter, bodyContent);
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Parse comma-separated tools string into a record of { toolName: boolean }
|
|
512
|
+
*
|
|
513
|
+
* @example
|
|
514
|
+
* "Read, Grep, Glob, Bash, Edit, Write" →
|
|
515
|
+
* { read: true, grep: true, glob: true, bash: true, edit: true, write: true }
|
|
516
|
+
*/
|
|
517
|
+
parseToolsToRecord(toolsString) {
|
|
518
|
+
if (!toolsString) return {};
|
|
519
|
+
const tools = {};
|
|
520
|
+
const toolNames = toolsString.split(",").map((t) => t.trim().toLowerCase());
|
|
521
|
+
for (const toolName of toolNames) {
|
|
522
|
+
const mappedName = TOOL_NAME_MAP[toolName] || toolName;
|
|
523
|
+
tools[mappedName] = true;
|
|
524
|
+
}
|
|
525
|
+
return tools;
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Custom serializer for OpenCode frontmatter
|
|
529
|
+
*
|
|
530
|
+
* OpenCode expects tools as a nested YAML map:
|
|
531
|
+
* ```yaml
|
|
532
|
+
* tools:
|
|
533
|
+
* read: true
|
|
534
|
+
* write: true
|
|
535
|
+
* ```
|
|
536
|
+
*
|
|
537
|
+
* The standard serializeFrontmatter outputs flat key-value pairs,
|
|
538
|
+
* so we need custom handling for the `tools` field.
|
|
539
|
+
*/
|
|
540
|
+
serializeOpenCodeFrontmatter(data) {
|
|
541
|
+
const lines = ["---"];
|
|
542
|
+
if (data.description) {
|
|
543
|
+
lines.push(`description: ${data.description}`);
|
|
544
|
+
}
|
|
545
|
+
if (data.model) {
|
|
546
|
+
lines.push(`model: ${data.model}`);
|
|
547
|
+
}
|
|
548
|
+
if (data.mode) {
|
|
549
|
+
lines.push(`mode: ${data.mode}`);
|
|
550
|
+
}
|
|
551
|
+
if (data.tools && Object.keys(data.tools).length > 0) {
|
|
552
|
+
lines.push("tools:");
|
|
553
|
+
for (const [tool, enabled] of Object.entries(data.tools)) {
|
|
554
|
+
lines.push(` ${tool}: ${enabled}`);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
lines.push("---");
|
|
558
|
+
return lines.join("\n");
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Replace .agent/ paths with .opencode/
|
|
562
|
+
*/
|
|
563
|
+
transformPaths(content, context) {
|
|
564
|
+
const toolPath = context.aiTool?.path || ".opencode";
|
|
565
|
+
return content.replace(/\.agent\//g, `${toolPath}/`);
|
|
566
|
+
}
|
|
567
|
+
};
|
|
568
|
+
function createOpenCodeAgentTransformer() {
|
|
569
|
+
return new OpenCodeAgentTransformer();
|
|
570
|
+
}
|
|
571
|
+
|
|
482
572
|
// src/transformers/opencode-workflow.ts
|
|
483
573
|
var OpenCodeWorkflowTransformer = class {
|
|
484
574
|
/**
|
|
@@ -713,7 +803,8 @@ import path5 from "path";
|
|
|
713
803
|
var OpenCodeInstaller = class {
|
|
714
804
|
// OpenCode uses "commands" instead of "workflows"
|
|
715
805
|
COMMANDS_FOLDER = "commands";
|
|
716
|
-
//
|
|
806
|
+
// Transformers for OpenCode-specific formats
|
|
807
|
+
agentTransformer = createOpenCodeAgentTransformer();
|
|
717
808
|
workflowTransformer = createOpenCodeWorkflowTransformer();
|
|
718
809
|
async install(options) {
|
|
719
810
|
const { aiTool, kits, targetPath } = options;
|
|
@@ -725,7 +816,12 @@ var OpenCodeInstaller = class {
|
|
|
725
816
|
await copyDirectory(
|
|
726
817
|
kitSourcePath,
|
|
727
818
|
kitTargetPath,
|
|
728
|
-
["rules", "workflows"],
|
|
819
|
+
["rules", "workflows", "agents"],
|
|
820
|
+
aiTool.path
|
|
821
|
+
);
|
|
822
|
+
await this.copyAgentsWithTransform(
|
|
823
|
+
kitSourcePath,
|
|
824
|
+
kitTargetPath,
|
|
729
825
|
aiTool.path
|
|
730
826
|
);
|
|
731
827
|
await this.copyWorkflowsWithTransform(
|
|
@@ -761,6 +857,46 @@ var OpenCodeInstaller = class {
|
|
|
761
857
|
}
|
|
762
858
|
return results;
|
|
763
859
|
}
|
|
860
|
+
/**
|
|
861
|
+
* Copy agents with transformation to OpenCode format
|
|
862
|
+
*
|
|
863
|
+
* This method:
|
|
864
|
+
* 1. Reads each agent file from the kit
|
|
865
|
+
* 2. Replaces tool path references (.agent/ → .opencode/)
|
|
866
|
+
* 3. Transforms the frontmatter `tools` field from string to record
|
|
867
|
+
* 4. Removes unnecessary fields (name, skills, tier)
|
|
868
|
+
* 5. Writes the transformed agent to the target directory
|
|
869
|
+
*/
|
|
870
|
+
async copyAgentsWithTransform(kitSourcePath, kitTargetPath, toolPath) {
|
|
871
|
+
const agentsSource = path5.join(kitSourcePath, "agents");
|
|
872
|
+
const agentsTarget = path5.join(kitTargetPath, "agents");
|
|
873
|
+
try {
|
|
874
|
+
await fs4.access(agentsSource);
|
|
875
|
+
} catch {
|
|
876
|
+
return;
|
|
877
|
+
}
|
|
878
|
+
await fs4.mkdir(agentsTarget, { recursive: true });
|
|
879
|
+
const entries = await fs4.readdir(agentsSource, { withFileTypes: true });
|
|
880
|
+
for (const entry of entries) {
|
|
881
|
+
if (!entry.isFile() || !entry.name.endsWith(".md")) {
|
|
882
|
+
continue;
|
|
883
|
+
}
|
|
884
|
+
const sourcePath = path5.join(agentsSource, entry.name);
|
|
885
|
+
const targetPath = path5.join(agentsTarget, entry.name);
|
|
886
|
+
let content = await fs4.readFile(sourcePath, "utf-8");
|
|
887
|
+
content = replaceToolPaths(content, toolPath);
|
|
888
|
+
const context = {
|
|
889
|
+
aiTool: { path: toolPath },
|
|
890
|
+
sourcePath,
|
|
891
|
+
targetPath
|
|
892
|
+
};
|
|
893
|
+
const transformedContent = this.agentTransformer.transform(
|
|
894
|
+
content,
|
|
895
|
+
context
|
|
896
|
+
);
|
|
897
|
+
await fs4.writeFile(targetPath, transformedContent);
|
|
898
|
+
}
|
|
899
|
+
}
|
|
764
900
|
/**
|
|
765
901
|
* Copy workflows with transformation to OpenCode command format
|
|
766
902
|
*
|