cavekit-opencode 1.0.0 → 1.1.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 CHANGED
@@ -12,6 +12,21 @@ Spec-driven development commands for OpenCode. Port of [cavekit v4](https://gith
12
12
  | `/ck-build` | Plan-then-execute against spec. Auto-backprops on failure. |
13
13
  | `/ck-check` | Read-only drift report. Lists §V / §I / §T violations. |
14
14
 
15
+ ## Agent
16
+
17
+ `@cavekit` subagent orchestrates the full cycle:
18
+
19
+ ```
20
+ > @cavekit build a CLI that converts markdown to PDF
21
+ → creates SPEC.md
22
+ → shows you the spec
23
+ → asks for approval
24
+ → plans first task
25
+ → shows you the plan
26
+ → implements, verifies, reports
27
+ → repeats until all tasks done
28
+ ```
29
+
15
30
  ## How it works
16
31
 
17
32
  ```
@@ -57,6 +72,7 @@ git clone https://github.com/gggiiia/cavekit-opencode.git
57
72
  cd cavekit-opencode
58
73
  cp commands/ck-*.md ~/.config/opencode/commands/
59
74
  cp -r skills/ck-* ~/.config/opencode/skills/
75
+ cp agents/cavekit.md ~/.config/opencode/agents/
60
76
  cp FORMAT.md /path/to/your/project/
61
77
  ```
62
78
 
@@ -67,6 +83,24 @@ Or use the install script: `bash install.sh [project-path]`
67
83
  - [caveman](https://github.com/JuliusBrussee/caveman) plugin for OpenCode (recommended)
68
84
  - OpenCode >= 1.15
69
85
 
86
+ ## Usage
87
+
88
+ ### `@cavekit` subagent (recommended)
89
+
90
+ ```
91
+ @cavekit build an auth service with JWT tokens
92
+ ```
93
+
94
+ Agent creates SPEC.md, shows you the spec, asks for approval, plans the first task, shows the plan, implements, verifies, and repeats until done.
95
+
96
+ ### Slash commands
97
+
98
+ ```
99
+ /ck-spec "auth service with JWT"
100
+ /ck-build --next
101
+ /ck-check --all
102
+ ```
103
+
70
104
  ## Files
71
105
 
72
106
  ```
@@ -78,6 +112,8 @@ skills/
78
112
  ├── ck-spec/SKILL.md discovery-triggered spec
79
113
  ├── ck-build/SKILL.md discovery-triggered build
80
114
  └── ck-check/SKILL.md discovery-triggered check
115
+ agents/
116
+ └── cavekit.md @cavekit subagent — full cycle orchestrator
81
117
  FORMAT.md SPEC.md schema + caveman encoding rules
82
118
  AGENTS.md always-on backprop protocol + encoding rules
83
119
  install.sh installer
@@ -0,0 +1,54 @@
1
+ ---
2
+ description: >
3
+ Spec-driven development orchestrator. Takes ideas → creates SPEC.md →
4
+ shows plan → executes build cycle with verification. One-stop for
5
+ full feature development with cavekit.
6
+ mode: subagent
7
+ ---
8
+
9
+ # cavekit — spec-driven development agent
10
+
11
+ You orchestrate the full cavekit cycle. User provides idea or feature request. You drive SPEC.md creation, planning, and build execution.
12
+
13
+ ## Workflow
14
+
15
+ ### 1. DISCOVER
16
+ - Read `SPEC.md` if exists → understand current project state.
17
+ - Read `FORMAT.md` at repo root for spec schema.
18
+ - If neither exists, ask: "no spec yet — want me to create one from code or from your idea?"
19
+
20
+ ### 2. SPEC
21
+ - Convert user idea → SPEC.md (§G, §C, §I, §V, §T, §B).
22
+ - Caveman format per FORMAT.md. Preserve identifiers, paths, code verbatim.
23
+ - Show user the full spec. **Wait for explicit approval**: "spec OK? suggestions? or start build?"
24
+
25
+ ### 3. PLAN
26
+ - Read §T. Pick first `.` task (or user-specified task).
27
+ - Plan: which §V invariants apply, which §I interfaces touched, which files change, what tests needed.
28
+ - Show plan. **Wait for explicit OK** before executing.
29
+
30
+ ### 4. BUILD
31
+ - Execute per /ck-build rules:
32
+ 1. Flip task `.` → `~` in SPEC.md.
33
+ 2. Implement code + tests.
34
+ 3. Run verification.
35
+ 4. Pass → flip `~` → `x`. Commit: `T<n>: <goal> | § <cites>`.
36
+ 5. Fail → classify: code bug (fix) or spec wrong (/ck-spec bug: ... then resume).
37
+
38
+ ### 5. REPORT
39
+ - After each task: show updated §T table.
40
+ - Show summary: "T1 done. 5 tasks total, 1 done, 4 pending. Next: T2."
41
+ - Ask: "proceed to next task? or review?"
42
+
43
+ ## Rules
44
+
45
+ - Never skip the plan verification step. User must approve before execution.
46
+ - Never edit SPEC.md except §T status flips during build.
47
+ - Other spec edits via /ck-spec workflow (amend, bug).
48
+ - Caveman output to save tokens. Code/security: write normal.
49
+
50
+ ## Refusals
51
+
52
+ - No SPEC.md and user gives vague idea → ask clarifying questions.
53
+ - Spec > 500 lines → suggest §B compaction.
54
+ - User asks for something outside spec → /ck-spec amend §T first.
package/install.sh CHANGED
@@ -21,8 +21,16 @@ cp -r "$SCRIPT_DIR/skills/ck-spec" "$SKILL_DIR/"
21
21
  cp -r "$SCRIPT_DIR/skills/ck-build" "$SKILL_DIR/"
22
22
  cp -r "$SCRIPT_DIR/skills/ck-check" "$SKILL_DIR/"
23
23
 
24
+ AGENT_DIR="${TARGET}/../agents"
25
+ if [ "$TARGET" = "global" ]; then
26
+ AGENT_DIR="$HOME/.config/opencode/agents"
27
+ else
28
+ AGENT_DIR="$TARGET/.opencode/agents"
29
+ fi
30
+ mkdir -p "$AGENT_DIR"
31
+ cp "$SCRIPT_DIR/agents/cavekit.md" "$AGENT_DIR/"
32
+
24
33
  echo "cavekit installed to:"
25
34
  echo " commands → $CMD_DIR/ck-*.md"
26
35
  echo " skills → $SKILL_DIR/ck-*/"
27
- echo ""
28
- echo "Copy FORMAT.md and/or AGENTS.md to your project root as needed."
36
+ echo " agent → $AGENT_DIR/cavekit.md"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cavekit-opencode",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Spec-driven development commands for OpenCode — compressed spec, plan-execute loop, drift detection.",
5
5
  "type": "module",
6
6
  "main": "plugin.js",
@@ -17,6 +17,7 @@
17
17
  "plugin.js",
18
18
  "commands/",
19
19
  "skills/",
20
+ "agents/",
20
21
  "FORMAT.md",
21
22
  "AGENTS.md",
22
23
  "INSTALL.md",
package/plugin.js CHANGED
@@ -34,6 +34,9 @@ function installFiles() {
34
34
 
35
35
  const skillDir = join(configDir, 'skills');
36
36
  copyDir(join(here, 'skills'), skillDir);
37
+
38
+ const agentDir = join(configDir, 'agents');
39
+ copyDir(join(here, 'agents'), agentDir);
37
40
  }
38
41
 
39
42
  export default async () => {