@danieldeusing/seedr 0.1.80

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.
@@ -0,0 +1,128 @@
1
+ import { ComponentType, CodingAgent, RegistryItem, RegistryManifest } from '@seedr/shared';
2
+ export { CodingAgent, ComponentType, RegistryItem, RegistryManifest } from '@seedr/shared';
3
+
4
+ type InstallScope = "project" | "user" | "local";
5
+ type InstallMethod = "symlink" | "copy";
6
+ type ContentStructure = "directory" | "file" | "json-merge" | "plugin";
7
+ interface ContentTypeConfig {
8
+ /** Relative path from agent root (e.g., "skills", "agents") */
9
+ path: string;
10
+ /** File extension (e.g., ".md") */
11
+ extension: string;
12
+ /** How content is installed */
13
+ structure: ContentStructure;
14
+ /** Main file for directories (e.g., "SKILL.md") */
15
+ mainFile?: string;
16
+ /** For json-merge: target file to merge into */
17
+ mergeTarget?: string;
18
+ /** For json-merge: field to merge into (e.g., "hooks", "mcpServers") */
19
+ mergeField?: string;
20
+ }
21
+ interface CodingAgentConfig {
22
+ /** Display name (e.g., "Claude Code") */
23
+ name: string;
24
+ /** Short identifier (e.g., "claude") */
25
+ shortName: string;
26
+ /** Project root directory (e.g., ".claude") */
27
+ projectRoot: string;
28
+ /** User root directory (e.g., "~/.claude") */
29
+ userRoot: string;
30
+ /** Content type configurations */
31
+ contentTypes: Partial<Record<ComponentType, ContentTypeConfig>>;
32
+ }
33
+ interface InstallOptions {
34
+ skill?: string;
35
+ agents?: string[] | "all";
36
+ scope?: InstallScope;
37
+ method?: InstallMethod;
38
+ yes?: boolean;
39
+ force?: boolean;
40
+ }
41
+ interface InstalledItem {
42
+ slug: string;
43
+ type: string;
44
+ agent: string;
45
+ scope: InstallScope;
46
+ method: InstallMethod;
47
+ path: string;
48
+ installedAt: string;
49
+ }
50
+
51
+ declare const CODING_AGENTS: Record<CodingAgent, CodingAgentConfig>;
52
+ declare const ALL_AGENTS: CodingAgent[];
53
+ declare function getAgentConfig(agent: CodingAgent): CodingAgentConfig;
54
+ declare function getAgentPath(agent: CodingAgent, scope: "project" | "user", cwd?: string): string;
55
+
56
+ declare function loadManifest(): Promise<RegistryManifest>;
57
+ declare function getItem(slug: string, type?: ComponentType): Promise<RegistryItem | undefined>;
58
+ declare function listItems(type?: ComponentType): Promise<RegistryItem[]>;
59
+ declare function searchItems(query: string): Promise<RegistryItem[]>;
60
+ /**
61
+ * Fetch the main content file for an item (e.g., SKILL.md).
62
+ */
63
+ declare function getItemContent(item: RegistryItem): Promise<string>;
64
+
65
+ interface InstallResult {
66
+ agent: CodingAgent;
67
+ success: boolean;
68
+ path: string;
69
+ error?: string;
70
+ }
71
+
72
+ declare function installSkill(item: RegistryItem, agents: CodingAgent[], scope: InstallScope, method: InstallMethod, cwd?: string): Promise<InstallResult[]>;
73
+ declare function uninstallSkill(slug: string, agent: CodingAgent, scope: InstallScope, cwd?: string): Promise<boolean>;
74
+ declare function getInstalledSkills(agent: CodingAgent, scope: InstallScope, cwd?: string): Promise<string[]>;
75
+
76
+ /**
77
+ * Strategy pattern interfaces for skill conversion.
78
+ *
79
+ * Each AI tool has a converter that transforms the canonical (Claude) format
80
+ * to the tool-specific format.
81
+ */
82
+ interface SkillFrontmatter {
83
+ name?: string;
84
+ description?: string;
85
+ "allowed-tools"?: string[];
86
+ [key: string]: unknown;
87
+ }
88
+ interface ParsedSkill {
89
+ frontmatter: SkillFrontmatter;
90
+ body: string;
91
+ raw: string;
92
+ }
93
+
94
+ /**
95
+ * Skill Converter Registry
96
+ *
97
+ * Strategy pattern implementation for converting skills between AI tool formats.
98
+ * The canonical format is Claude Code's markdown with YAML frontmatter.
99
+ *
100
+ * To add a new tool:
101
+ * 1. Create a new converter file (e.g., newtool.ts)
102
+ * 2. Implement the SkillConverter interface
103
+ * 3. Add it to the converters registry below
104
+ */
105
+
106
+ /**
107
+ * Parse skill markdown content into frontmatter and body.
108
+ */
109
+ declare function parseSkillMarkdown(content: string): ParsedSkill;
110
+ /**
111
+ * Convert skill content to a specific tool format using the Strategy pattern.
112
+ *
113
+ * @param content - Raw skill content in canonical (Claude) format
114
+ * @param targetTool - The AI tool to convert for
115
+ * @returns Converted content string
116
+ */
117
+ declare function convertSkillToTool(content: string, targetTool: CodingAgent): string;
118
+
119
+ interface DetectedAgent {
120
+ agent: CodingAgent;
121
+ scope: InstallScope;
122
+ path: string;
123
+ }
124
+ declare function detectInstalledAgents(cwd?: string): Promise<DetectedAgent[]>;
125
+ declare function detectProjectAgents(cwd?: string): Promise<CodingAgent[]>;
126
+ declare function isAgentInstalled(agent: CodingAgent, scope: InstallScope, cwd?: string): Promise<boolean>;
127
+
128
+ export { ALL_AGENTS, CODING_AGENTS, type CodingAgentConfig, type InstallMethod, type InstallOptions, type InstallScope, type InstalledItem, convertSkillToTool, detectInstalledAgents, detectProjectAgents, getAgentConfig, getAgentPath, getInstalledSkills, getItem, getItemContent, installSkill, isAgentInstalled, listItems, loadManifest, parseSkillMarkdown, searchItems, uninstallSkill };
package/dist/index.js ADDED
@@ -0,0 +1,140 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ ALL_AGENTS,
4
+ CODING_AGENTS,
5
+ detectInstalledAgents,
6
+ detectProjectAgents,
7
+ getAgentConfig,
8
+ getAgentPath,
9
+ getInstalledSkills,
10
+ getItem,
11
+ getItemContent,
12
+ installSkill,
13
+ isAgentInstalled,
14
+ listItems,
15
+ loadManifest,
16
+ searchItems,
17
+ uninstallSkill
18
+ } from "./chunk-5XFKC3T7.js";
19
+
20
+ // src/converters/index.ts
21
+ import matter from "gray-matter";
22
+
23
+ // src/converters/claude.ts
24
+ var claudeConverter = {
25
+ convert(skill) {
26
+ return skill.raw;
27
+ }
28
+ };
29
+
30
+ // src/converters/copilot.ts
31
+ var copilotConverter = {
32
+ convert(skill) {
33
+ const { frontmatter, body } = skill;
34
+ const lines = [];
35
+ if (frontmatter.name) {
36
+ lines.push(`# ${frontmatter.name}`, "");
37
+ }
38
+ if (frontmatter.description) {
39
+ lines.push(frontmatter.description, "");
40
+ }
41
+ lines.push(body);
42
+ return lines.join("\n");
43
+ }
44
+ };
45
+
46
+ // src/converters/gemini.ts
47
+ var geminiConverter = {
48
+ convert(skill) {
49
+ const { frontmatter, body } = skill;
50
+ const lines = [];
51
+ if (frontmatter.name) {
52
+ lines.push(`# ${frontmatter.name}`, "");
53
+ }
54
+ if (frontmatter.description) {
55
+ lines.push(`> ${frontmatter.description}`, "");
56
+ }
57
+ lines.push("## Instructions", "", body);
58
+ return lines.join("\n");
59
+ }
60
+ };
61
+
62
+ // src/converters/codex.ts
63
+ var codexConverter = {
64
+ convert(skill) {
65
+ const { frontmatter, body } = skill;
66
+ const lines = [];
67
+ lines.push("# Agent Instructions", "");
68
+ if (frontmatter.name) {
69
+ lines.push(`**Name:** ${frontmatter.name}`);
70
+ }
71
+ if (frontmatter.description) {
72
+ lines.push(`**Description:** ${frontmatter.description}`);
73
+ }
74
+ if (frontmatter.name || frontmatter.description) {
75
+ lines.push("");
76
+ }
77
+ lines.push("## Behavior", "", body);
78
+ return lines.join("\n");
79
+ }
80
+ };
81
+
82
+ // src/converters/opencode.ts
83
+ var opencodeConverter = {
84
+ convert(skill) {
85
+ const { frontmatter, body } = skill;
86
+ const lines = [];
87
+ if (frontmatter.name) {
88
+ lines.push(`# ${frontmatter.name}`, "");
89
+ }
90
+ if (frontmatter.description) {
91
+ lines.push(frontmatter.description, "");
92
+ }
93
+ lines.push("---", "", body);
94
+ return lines.join("\n");
95
+ }
96
+ };
97
+
98
+ // src/converters/index.ts
99
+ var converters = {
100
+ claude: claudeConverter,
101
+ copilot: copilotConverter,
102
+ gemini: geminiConverter,
103
+ codex: codexConverter,
104
+ opencode: opencodeConverter
105
+ };
106
+ function parseSkillMarkdown(content) {
107
+ const { data, content: body } = matter(content);
108
+ return {
109
+ frontmatter: data,
110
+ body: body.trim(),
111
+ raw: content
112
+ };
113
+ }
114
+ function convertSkillToTool(content, targetTool) {
115
+ const converter = converters[targetTool];
116
+ if (!converter) {
117
+ return content;
118
+ }
119
+ const skill = parseSkillMarkdown(content);
120
+ return converter.convert(skill);
121
+ }
122
+ export {
123
+ ALL_AGENTS,
124
+ CODING_AGENTS,
125
+ convertSkillToTool,
126
+ detectInstalledAgents,
127
+ detectProjectAgents,
128
+ getAgentConfig,
129
+ getAgentPath,
130
+ getInstalledSkills,
131
+ getItem,
132
+ getItemContent,
133
+ installSkill,
134
+ isAgentInstalled,
135
+ listItems,
136
+ loadManifest,
137
+ parseSkillMarkdown,
138
+ searchItems,
139
+ uninstallSkill
140
+ };
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "@danieldeusing/seedr",
3
+ "version": "0.1.80",
4
+ "description": "Seed your projects with AI configurations",
5
+ "type": "module",
6
+ "bin": {
7
+ "seedr": "./dist/cli.js"
8
+ },
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsup",
20
+ "dev": "tsx src/cli.ts",
21
+ "typecheck": "tsc --noEmit",
22
+ "lint": "eslint src/",
23
+ "lint:fix": "eslint src/ --fix",
24
+ "clean": "rm -rf dist",
25
+ "test": "vitest run",
26
+ "test:watch": "vitest",
27
+ "test:coverage": "vitest run --coverage"
28
+ },
29
+ "dependencies": {
30
+ "@clack/prompts": "^1.0.1",
31
+ "chalk": "^5.3.0",
32
+ "commander": "^14.0.0",
33
+ "fs-extra": "^11.2.0",
34
+ "gray-matter": "^4.0.3",
35
+ "inquirer": "^13.0.0",
36
+ "ora": "^9.0.0",
37
+ "simple-git": "^3.32.3"
38
+ },
39
+ "devDependencies": {
40
+ "@seedr/shared": "workspace:*",
41
+ "@types/fs-extra": "^11.0.4",
42
+ "@types/inquirer": "^9.0.7",
43
+ "@types/node": "^25.0.0",
44
+ "@vitest/coverage-v8": "^4.0.0",
45
+ "memfs": "^4.14.0",
46
+ "tsup": "^8.3.0",
47
+ "tsx": "^4.19.0",
48
+ "typescript": "^5.7.0",
49
+ "vitest": "^4.0.0"
50
+ },
51
+ "keywords": [
52
+ "ai",
53
+ "claude",
54
+ "copilot",
55
+ "gemini",
56
+ "codex",
57
+ "opencode",
58
+ "configuration",
59
+ "seeder"
60
+ ],
61
+ "repository": {
62
+ "type": "git",
63
+ "url": "https://github.com/danieldeusing/seedr.git"
64
+ },
65
+ "homepage": "https://seedr.danieldeusing.de",
66
+ "bugs": {
67
+ "url": "https://github.com/danieldeusing/seedr/issues"
68
+ },
69
+ "license": "MIT"
70
+ }