@bfirestone45/opencode-slop-review 0.5.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/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # slop-review for OpenCode
2
+
3
+ OpenCode port of the `slop-review` plugin.
4
+
5
+ ## Included Runtime Files
6
+
7
+ - `skills/ai-slop-review/SKILL.md`
8
+ - `skills/ai-slop-review/references/`
9
+ - `commands/slop-review-review.md`
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ opencode plugin @bfirestone45/opencode-slop-review@latest
15
+ ```
16
+
17
+ This registers the package in your OpenCode config; OpenCode installs it automatically with
18
+ Bun on next start.
19
+
20
+ ## OpenCode Surface
21
+
22
+ - Skill: `ai-slop-review`
23
+ - Command: `/slop-review-review`
@@ -0,0 +1,9 @@
1
+ ---
2
+ description: Run an AI slop review on files, directories, PRs, or current changes
3
+ ---
4
+
5
+ Load the `ai-slop-review` skill and use it to review this scope: `$ARGUMENTS`.
6
+
7
+ If no arguments are provided, default to reviewing the current git diff.
8
+
9
+ Treat `PR` or `#<number>` as a pull request review request.
package/index.js ADDED
@@ -0,0 +1,57 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+
5
+ const pluginRoot = path.dirname(fileURLToPath(import.meta.url));
6
+
7
+ function readMarkdownAsset(assetPath) {
8
+ const content = fs.readFileSync(assetPath, "utf8");
9
+ const match = content.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);
10
+ if (!match) {
11
+ return { frontmatter: {}, body: content.trim() };
12
+ }
13
+ return {
14
+ frontmatter: parseFrontmatter(match[1]),
15
+ body: match[2].trim(),
16
+ };
17
+ }
18
+
19
+ function parseFrontmatter(source) {
20
+ const result = {};
21
+
22
+ for (const line of source.split("\n")) {
23
+ const entry = line.match(/^([^:]+):\s*(.*)$/);
24
+ if (!entry) {
25
+ continue;
26
+ }
27
+
28
+ result[entry[1].trim()] = entry[2].trim();
29
+ }
30
+
31
+ return result;
32
+ }
33
+
34
+ function loadCommand(name) {
35
+ const { frontmatter, body } = readMarkdownAsset(path.join(pluginRoot, "commands", `${name}.md`));
36
+ return {
37
+ ...frontmatter,
38
+ template: body,
39
+ };
40
+ }
41
+
42
+ export const SlopReviewPlugin = async () => ({
43
+ config: async (config) => {
44
+ config.command ??= {};
45
+ config.skills ??= {};
46
+ config.skills.paths ??= [];
47
+
48
+ config.command["slop-review-review"] ??= loadCommand("slop-review-review");
49
+
50
+ const skillsPath = path.join(pluginRoot, "skills");
51
+ if (!config.skills.paths.includes(skillsPath)) {
52
+ config.skills.paths.push(skillsPath);
53
+ }
54
+ },
55
+ });
56
+
57
+ export default SlopReviewPlugin;
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@bfirestone45/opencode-slop-review",
3
+ "version": "0.5.0",
4
+ "description": "Official OpenCode plugin package for AI slop review workflows.",
5
+ "type": "module",
6
+ "main": "./index.js",
7
+ "module": "./index.js",
8
+ "exports": {
9
+ ".": "./index.js"
10
+ },
11
+ "files": [
12
+ "index.js",
13
+ "commands",
14
+ "skills",
15
+ "README.md",
16
+ "CHANGELOG.md",
17
+ "version.txt"
18
+ ],
19
+ "scripts": {
20
+ "test": "node --test index.test.mjs",
21
+ "pack:dry-run": "npm pack --dry-run",
22
+ "prepublishOnly": "npm test && npm run pack:dry-run"
23
+ },
24
+ "keywords": [
25
+ "opencode",
26
+ "opencode-plugin",
27
+ "slop-review",
28
+ "ai-code-review"
29
+ ],
30
+ "license": "MIT",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/bfirestone/agent-marketplace",
34
+ "directory": "opencode-marketplace/plugins/slop-review"
35
+ },
36
+ "peerDependencies": {
37
+ "@opencode-ai/plugin": "*"
38
+ },
39
+ "publishConfig": {
40
+ "access": "public"
41
+ }
42
+ }