@boyingliu01/opencode-plugin 0.8.4

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.
Files changed (51) hide show
  1. package/README.md +38 -0
  2. package/index.ts +85 -0
  3. package/package.json +42 -0
  4. package/skills/admin-template-guidelines/SKILL.md +904 -0
  5. package/skills/delphi-review/.delphi-config.json.example +45 -0
  6. package/skills/delphi-review/AGENTS.md +66 -0
  7. package/skills/delphi-review/INSTALL.md +152 -0
  8. package/skills/delphi-review/SKILL.md +454 -0
  9. package/skills/delphi-review/opencode.json.delphi.example +56 -0
  10. package/skills/delphi-review/references/code-walkthrough.md +486 -0
  11. package/skills/improve-codebase-architecture/SKILL.md +156 -0
  12. package/skills/ralph-loop/SKILL.md +539 -0
  13. package/skills/ralph-loop/references/components/memory.md +55 -0
  14. package/skills/ralph-loop/references/components/middleware.md +54 -0
  15. package/skills/ralph-loop/references/components/skill-invocations.md +39 -0
  16. package/skills/ralph-loop/references/components/system-prompt.md +24 -0
  17. package/skills/ralph-loop/references/components/tool-descriptions.md +32 -0
  18. package/skills/ralph-loop/references/phase-2-build-ralph.md +89 -0
  19. package/skills/ralph-loop/templates/progress-log.md +36 -0
  20. package/skills/sprint-flow/AGENTS.md +68 -0
  21. package/skills/sprint-flow/SKILL.md +1422 -0
  22. package/skills/sprint-flow/references/components/memory.md +87 -0
  23. package/skills/sprint-flow/references/components/middleware.md +72 -0
  24. package/skills/sprint-flow/references/components/skill-invocations.md +104 -0
  25. package/skills/sprint-flow/references/components/system-prompt.md +27 -0
  26. package/skills/sprint-flow/references/components/tool-descriptions.md +96 -0
  27. package/skills/sprint-flow/references/force-levels.md +203 -0
  28. package/skills/sprint-flow/references/phase-0-think.md +115 -0
  29. package/skills/sprint-flow/references/phase-1-plan.md +178 -0
  30. package/skills/sprint-flow/references/phase-2-build.md +198 -0
  31. package/skills/sprint-flow/references/phase-3-review.md +213 -0
  32. package/skills/sprint-flow/references/phase-4-uat.md +125 -0
  33. package/skills/sprint-flow/references/phase-5-feedback.md +100 -0
  34. package/skills/sprint-flow/references/phase-6-ship.md +193 -0
  35. package/skills/sprint-flow/references/phase-7-land.md +140 -0
  36. package/skills/sprint-flow/references/phase-8-cleanup.md +192 -0
  37. package/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +257 -0
  38. package/skills/sprint-flow/templates/auto-estimate-learning-log.md +136 -0
  39. package/skills/sprint-flow/templates/auto-estimate-output-template.md +132 -0
  40. package/skills/sprint-flow/templates/emergent-issues-template.md +120 -0
  41. package/skills/sprint-flow/templates/pain-document-template.md +115 -0
  42. package/skills/sprint-flow/templates/sprint-progress-template.md +151 -0
  43. package/skills/sprint-flow/templates/sprint-summary-template.md +120 -0
  44. package/skills/test-driven-development/SKILL.md +71 -0
  45. package/skills/test-specification-alignment/AGENTS.md +56 -0
  46. package/skills/test-specification-alignment/SKILL.md +702 -0
  47. package/skills/test-specification-alignment/references/alignment-verification-algorithm.md +493 -0
  48. package/skills/test-specification-alignment/references/phase2-constraint-enforcement.md +431 -0
  49. package/skills/test-specification-alignment/references/specification-format.md +348 -0
  50. package/skills/to-issues/SKILL.md +277 -0
  51. package/tsconfig.json +15 -0
package/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # XP-Gate OpenCode Plugin
2
+
3
+ OpenCode plugin exposing xp-gate quality gates and AI workflow skills.
4
+
5
+ ## Tools
6
+
7
+ - **gate-check**: Run all 6 quality gates on a file/directory
8
+ - **gate-principles**: Run Clean Code + SOLID principles checker
9
+ - **gate-arch**: Run architecture validation
10
+
11
+ ## Installation
12
+
13
+ In your `opencode.json`:
14
+
15
+ ```json
16
+ {
17
+ "plugin": ["@boyingliu01/opencode-plugin"]
18
+ }
19
+ ```
20
+
21
+ Or via local path (development):
22
+
23
+ ```json
24
+ {
25
+ "plugin": ["./plugins/opencode"]
26
+ }
27
+ ```
28
+
29
+ ## Requirements
30
+
31
+ - OpenCode v0.11+
32
+ - xp-gate npm package installed globally (for `gate-check` tool)
33
+ - Repository with `src/principles/index.ts` (for `gate-principles` tool)
34
+ - `architecture.yaml` in repo root (for `gate-arch` tool)
35
+
36
+ ## Graceful Degradation
37
+
38
+ If xp-gate CLI is unavailable, tools return helpful install instructions instead of failing.
package/index.ts ADDED
@@ -0,0 +1,85 @@
1
+ /**
2
+ * XP-Gate OpenCode Plugin
3
+ *
4
+ * Exposes 3 custom tools for OpenCode users:
5
+ * - gate-check: Run all xp-gate quality checks on a file or directory
6
+ * - gate-principles: Run Clean Code + SOLID principles checker
7
+ * - gate-arch: Run architecture validation
8
+ *
9
+ * Graceful degradation: if xp-gate CLI not installed, tools return install instructions.
10
+ */
11
+ import type { Plugin, PluginModule } from "@opencode-ai/plugin"
12
+ import { tool } from "@opencode-ai/plugin"
13
+ import { z } from "zod"
14
+
15
+ export const XpGatePlugin: Plugin = async (input) => {
16
+ const { directory, $ } = input
17
+
18
+ return {
19
+ tool: {
20
+ "gate-check": tool({
21
+ description:
22
+ "Run xp-gate quality checks on a file or directory. Requires xp-gate CLI installed globally.",
23
+ args: {
24
+ path: z.string().describe("File or directory path (absolute or relative to workspace)"),
25
+ gates: z.array(z.string()).optional().describe("Optional gate subset (e.g. ['principles', 'tests'])"),
26
+ },
27
+ async execute(args, ctx) {
28
+ const cwd = ctx.directory || directory
29
+ const target = args.path.startsWith("/") ? args.path : `${cwd}/${args.path}`
30
+ const gates = args.gates?.length ? ` --gates ${args.gates.join(",")}` : ""
31
+ try {
32
+ const result = await $`bash -c ${`cd "${cwd}" && command -v xp-gate >/dev/null 2>&1 && xp-gate check "${target}"${gates}`}`
33
+ const text = await result.text()
34
+ return text || "[XP-Gate] Check complete."
35
+ } catch (err: unknown) {
36
+ return `[XP-Gate] xp-gate CLI not found.\nInstall: npm install -g @boyingliu01/xp-gate\n${err instanceof Error ? err.message : ""}`
37
+ }
38
+ },
39
+ }),
40
+ "gate-principles": tool({
41
+ description:
42
+ "Run Clean Code + SOLID principles checker on a file.",
43
+ args: {
44
+ path: z.string().describe("Source file path to check"),
45
+ },
46
+ async execute(args, ctx) {
47
+ const cwd = ctx.directory || directory
48
+ const target = args.path.startsWith("/") ? args.path : `${cwd}/${args.path}`
49
+ const cmd = `cd "${cwd}" && npx -y tsx src/principles/index.ts --files "${target}" --format console`
50
+ try {
51
+ const result = await $`bash -c ${cmd}`
52
+ const text = await result.text()
53
+ return text || "[XP-Gate] Principles check complete."
54
+ } catch (err: unknown) {
55
+ return `[XP-Gate] Principles checker failed.\nEnsure src/principles/index.ts exists.\n${err instanceof Error ? err.message : ""}`
56
+ }
57
+ },
58
+ }),
59
+ "gate-arch": tool({
60
+ description:
61
+ "Run architecture validation (layer boundary checks) on the repository.",
62
+ args: {
63
+ config: z.string().describe("Path to architecture config file").default("architecture.yaml"),
64
+ },
65
+ async execute(args, ctx) {
66
+ const cwd = ctx.directory || directory
67
+ try {
68
+ const result = await $`bash -c ${`cd "${cwd}" && npx archlint check --config ${args.config}`}`
69
+ const text = await result.text()
70
+ return text || "[XP-Gate] Architecture check complete."
71
+ } catch (err: unknown) {
72
+ return `[XP-Gate] Architecture validation requires archlint + ${args.config}.\n${err instanceof Error ? err.message : ""}`
73
+ }
74
+ },
75
+ }),
76
+ },
77
+ }
78
+ }
79
+
80
+ const pluginModule: PluginModule = {
81
+ id: "xp-gate",
82
+ server: XpGatePlugin,
83
+ }
84
+
85
+ export default pluginModule
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@boyingliu01/opencode-plugin",
3
+ "version": "0.8.4",
4
+ "type": "module",
5
+ "main": "index.ts",
6
+ "description": "XP-Gate quality gates + AI workflow skills for OpenCode",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/boyingliu01/xp-gate",
10
+ "directory": "plugins/opencode"
11
+ },
12
+ "publishConfig": {
13
+ "registry": "https://registry.npmjs.org",
14
+ "access": "public"
15
+ },
16
+ "files": [
17
+ "index.ts",
18
+ "skills/",
19
+ "tsconfig.json",
20
+ "README.md"
21
+ ],
22
+ "scripts": {
23
+ "prepack": "node scripts/prepack.cjs",
24
+ "check": "tsc --noEmit"
25
+ },
26
+ "dependencies": {
27
+ "@opencode-ai/plugin": "^1.15.0"
28
+ },
29
+ "devDependencies": {
30
+ "typescript": "^5.4.0"
31
+ },
32
+ "keywords": [
33
+ "opencode",
34
+ "plugin",
35
+ "xp-gate",
36
+ "quality-gates",
37
+ "code-review",
38
+ "sprint-flow"
39
+ ],
40
+ "author": "boyingliu01",
41
+ "license": "MIT"
42
+ }