@specd/plugin-agent-opencode
Advanced tools
+3
-2
@@ -1,2 +0,2 @@ | ||
| import { AgentPlugin } from '@specd/plugin-manager'; | ||
| import { PluginLoaderOptions, AgentPlugin } from '@specd/plugin-manager'; | ||
@@ -6,6 +6,7 @@ /** | ||
| * | ||
| * @param _options - Loader options. | ||
| * @returns Configured OpenCodeAgentPlugin instance. | ||
| */ | ||
| declare function create(): Promise<AgentPlugin>; | ||
| declare function create(_options: PluginLoaderOptions): Promise<AgentPlugin>; | ||
| export { create }; |
+28
-24
@@ -53,11 +53,12 @@ // src/index.ts | ||
| * | ||
| * @param projectRoot - Absolute project root. | ||
| * @param config - Project configuration. | ||
| * @param options - Install options. | ||
| * @returns Install summary. | ||
| */ | ||
| async execute(projectRoot, options) { | ||
| async execute(config, options) { | ||
| const repository = createSkillRepository(); | ||
| const availableSkills = repository.list(); | ||
| const requestedSkills = options?.skills !== void 0 && options.skills.length > 0 ? options.skills : availableSkills.map((skill) => skill.name); | ||
| const targetDir = path.join(projectRoot, ".opencode", "skills"); | ||
| const targetDir = path.join(config.projectRoot, ".opencode", "skills"); | ||
| const sharedDir = path.join(targetDir, "_specd-shared"); | ||
| await mkdir(targetDir, { recursive: true }); | ||
@@ -72,3 +73,3 @@ const installed = []; | ||
| } | ||
| const bundle = repository.getBundle(skillName, options?.variables); | ||
| const bundle = repository.getBundle(skillName, options?.variables, config); | ||
| if (bundle.files.length === 0) { | ||
@@ -84,4 +85,6 @@ skipped.push({ skill: skillName, reason: "bundle has no files" }); | ||
| for (const file of bundle.files) { | ||
| const outputPath = path.join(skillDir, file.filename); | ||
| const content = file.filename.endsWith(".md") ? renderFrontmatter(frontmatter, file.content) : file.content; | ||
| const baseDir = file.shared === true ? sharedDir : skillDir; | ||
| const outputPath = path.join(baseDir, file.filename); | ||
| await mkdir(path.dirname(outputPath), { recursive: true }); | ||
| const content = file.filename.endsWith(".md") && file.shared !== true ? renderFrontmatter(frontmatter, file.content) : file.content; | ||
| await writeFile(outputPath, content, "utf8"); | ||
@@ -114,4 +117,4 @@ } | ||
| import { rm as rm2 } from "fs/promises"; | ||
| import { createSkillRepository as createSkillRepository2 } from "@specd/skills"; | ||
| import path2 from "path"; | ||
| import { createSkillRepository as createSkillRepository2 } from "@specd/skills"; | ||
| var UninstallSkills = class { | ||
@@ -121,8 +124,8 @@ /** | ||
| * | ||
| * @param projectRoot - Absolute project root. | ||
| * @param config - Project configuration. | ||
| * @param options - Uninstall options. | ||
| * @returns A promise that resolves when uninstall finishes. | ||
| */ | ||
| async execute(projectRoot, options) { | ||
| const targetDir = path2.join(projectRoot, ".opencode", "skills"); | ||
| async execute(config, options) { | ||
| const targetDir = path2.join(config.projectRoot, ".opencode", "skills"); | ||
| if (options?.skills !== void 0 && options.skills.length > 0) { | ||
@@ -135,7 +138,8 @@ for (const skill of options.skills) { | ||
| } | ||
| const repository = createSkillRepository2(); | ||
| for (const skill of repository.list()) { | ||
| await rm2(path2.join(targetDir, skill.name), { recursive: true, force: true }); | ||
| await rm2(path2.join(targetDir, `${skill.name}.md`), { force: true }); | ||
| const managedSkills = createSkillRepository2().list().map((skill) => skill.name); | ||
| for (const skill of managedSkills) { | ||
| await rm2(path2.join(targetDir, skill), { recursive: true, force: true }); | ||
| await rm2(path2.join(targetDir, `${skill}.md`), { force: true }); | ||
| } | ||
| await rm2(path2.join(targetDir, "_specd-shared"), { recursive: true, force: true }); | ||
| } | ||
@@ -202,8 +206,8 @@ }; | ||
| * | ||
| * @param projectRoot - Absolute project root. | ||
| * @param config - Project configuration. | ||
| * @param options - Install options. | ||
| * @returns Install summary. | ||
| */ | ||
| async install(projectRoot, options) { | ||
| return this.runInstall(projectRoot, options); | ||
| async install(config, options) { | ||
| return this.runInstall(config, options); | ||
| } | ||
@@ -213,8 +217,8 @@ /** | ||
| * | ||
| * @param projectRoot - Absolute project root. | ||
| * @param config - Project configuration. | ||
| * @param options - Optional skill filter. | ||
| * @returns A promise that resolves when uninstall finishes. | ||
| * @returns A promise that resolves when uninstall completes. | ||
| */ | ||
| async uninstall(projectRoot, options) { | ||
| return this.runUninstall(projectRoot, options); | ||
| async uninstall(config, options) { | ||
| return this.runUninstall(config, options); | ||
| } | ||
@@ -241,3 +245,3 @@ }; | ||
| } | ||
| async function create() { | ||
| async function create(_options) { | ||
| const { name, version } = await readManifest(); | ||
@@ -249,4 +253,4 @@ const installSkills = new InstallSkills(); | ||
| version, | ||
| (projectRoot, options) => installSkills.execute(projectRoot, options), | ||
| (projectRoot, options) => uninstallSkills.execute(projectRoot, options) | ||
| (targetConfig, installOptions) => installSkills.execute(targetConfig, installOptions), | ||
| (targetConfig, uninstallOptions) => uninstallSkills.execute(targetConfig, uninstallOptions) | ||
| ); | ||
@@ -253,0 +257,0 @@ } |
+6
-4
| { | ||
| "name": "@specd/plugin-agent-opencode", | ||
| "version": "0.0.2", | ||
| "version": "0.0.3", | ||
| "license": "MIT", | ||
| "private": false, | ||
| "repository": "https://github.com/specd-sdd/specd", | ||
| "repository": "https://github.com/specd-sdd/SpecD", | ||
| "homepage": "https://getspecd.dev", | ||
| "files": [ | ||
@@ -19,4 +20,5 @@ "dist/", | ||
| "dependencies": { | ||
| "@specd/skills": "0.1.0", | ||
| "@specd/plugin-manager": "0.1.0" | ||
| "@specd/plugin-manager": "0.2.0", | ||
| "@specd/skills": "0.2.0", | ||
| "@specd/core": "^0.2.0" | ||
| }, | ||
@@ -23,0 +25,0 @@ "scripts": { |
+8
-2
| # @specd/plugin-agent-opencode | ||
| Open Code agent plugin for specd. Installs specd skills into `.opencode/skills/` with Open Code-specific YAML frontmatter. | ||
| Open Code agent plugin for [specd](https://github.com/specd-sdd/SpecD). For more information, visit [getspecd.dev](https://getspecd.dev). Installs specd skills into `.opencode/skills/` with Open Code-specific YAML frontmatter. | ||
@@ -23,6 +23,12 @@ ## Install | ||
| Skills are written to `.opencode/skills/<skill-name>/` under the project root. | ||
| Skill-local files are written to `.opencode/skills/<skill-name>/` under the project root. | ||
| Files marked as shared are written once to `.opencode/skills/_specd-shared/`. | ||
| ## Uninstall behavior | ||
| - `specd plugins uninstall @specd/plugin-agent-opencode --skills <name>` removes only selected skill directories and keeps `_specd-shared/`. | ||
| - `specd plugins uninstall @specd/plugin-agent-opencode` removes `.opencode/skills/` completely, including `_specd-shared/`. | ||
| ## License | ||
| MIT |
| { | ||
| "schemaVersion": 1, | ||
| "name": "@specd/plugin-agent-opencode", | ||
| "version": "0.0.2", | ||
| "version": "0.0.3", | ||
| "description": "Open Code agent plugin for specd skills installation", | ||
@@ -6,0 +6,0 @@ "pluginType": "agent", |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
11957
9%261
1.95%1
-50%34
21.43%3
50%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
Updated
Updated