opencodekit 0.20.3 → 0.20.5

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 (32) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/template/.opencode/AGENTS.md +14 -9
  3. package/dist/template/.opencode/agent/build.md +0 -32
  4. package/dist/template/.opencode/agent/plan.md +0 -14
  5. package/dist/template/.opencode/agent/review.md +0 -40
  6. package/dist/template/.opencode/command/create.md +11 -61
  7. package/dist/template/.opencode/command/plan.md +11 -12
  8. package/dist/template/.opencode/command/pr.md +4 -16
  9. package/dist/template/.opencode/command/research.md +7 -16
  10. package/dist/template/.opencode/command/resume.md +2 -11
  11. package/dist/template/.opencode/command/review-codebase.md +9 -15
  12. package/dist/template/.opencode/command/ship.md +12 -53
  13. package/dist/template/.opencode/memory/project/user.md +7 -0
  14. package/dist/template/.opencode/memory.db +0 -0
  15. package/dist/template/.opencode/memory.db-shm +0 -0
  16. package/dist/template/.opencode/memory.db-wal +0 -0
  17. package/dist/template/.opencode/opencode.json +54 -67
  18. package/dist/template/.opencode/package.json +1 -1
  19. package/dist/template/.opencode/plugin/README.md +1 -1
  20. package/dist/template/.opencode/plugin/lib/compact.ts +194 -0
  21. package/dist/template/.opencode/plugin/lib/db/graph.ts +253 -0
  22. package/dist/template/.opencode/plugin/lib/db/observations.ts +8 -3
  23. package/dist/template/.opencode/plugin/lib/db/schema.ts +96 -5
  24. package/dist/template/.opencode/plugin/lib/db/types.ts +73 -0
  25. package/dist/template/.opencode/plugin/lib/memory-admin-tools.ts +36 -3
  26. package/dist/template/.opencode/plugin/lib/memory-db.ts +12 -1
  27. package/dist/template/.opencode/plugin/lib/memory-tools.ts +137 -1
  28. package/dist/template/.opencode/plugin/memory.ts +2 -1
  29. package/dist/template/.opencode/skill/memory-grounding/SKILL.md +68 -0
  30. package/dist/template/.opencode/skill/verification-gates/SKILL.md +63 -0
  31. package/dist/template/.opencode/skill/workspace-setup/SKILL.md +76 -0
  32. package/package.json +1 -1
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: memory-grounding
3
+ description: >
4
+ Use at the start of any command that needs prior context — searches memory for decisions, patterns, and handoffs before execution to avoid re-solving solved problems.
5
+ version: 1.0.0
6
+ tags: [memory, grounding, pre-flight]
7
+ ---
8
+
9
+ # Memory Grounding
10
+
11
+ Search institutional memory before executing any command that modifies state or makes decisions.
12
+
13
+ ## When to Use
14
+
15
+ - At the start of `/ship`, `/plan`, `/create`, `/pr`, `/research`, `/resume`
16
+ - Before any command that benefits from prior context
17
+ - When you need to check if work was already done or decisions already made
18
+
19
+ ## When NOT to Use
20
+
21
+ - Read-only commands that don't need historical context (e.g., `/status`)
22
+ - Commands that explicitly skip grounding (e.g., `--no-memory` flag)
23
+
24
+ ## Protocol
25
+
26
+ ### Step 1: Search for relevant context
27
+
28
+ ```typescript
29
+ // Primary: search by bead ID or topic
30
+ memory-search({ query: "$ARGUMENTS" });
31
+
32
+ // Secondary: search by keywords with limit
33
+ memory-search({ query: "<feature or topic keywords>", limit: 5 });
34
+
35
+ // Optional: filter by type for specific needs
36
+ memory-search({ query: "<keywords>", type: "decision" }); // Past decisions
37
+ memory-search({ query: "<keywords>", type: "bugfix" }); // Known issues
38
+ ```
39
+
40
+ ### Step 2: Check last session handoff
41
+
42
+ ```typescript
43
+ memory-read({ file: "handoffs/last" });
44
+ ```
45
+
46
+ ### Step 3: Check session history (if resuming work)
47
+
48
+ ```typescript
49
+ find_sessions({ query: "$ARGUMENTS", limit: 3 });
50
+ ```
51
+
52
+ ### Step 4: Apply findings
53
+
54
+ - **If relevant findings exist:** Incorporate them directly. Don't re-solve solved problems.
55
+ - **If prior decisions found:** Follow them unless there's a clear reason to diverge (document the divergence).
56
+ - **If known issues found:** Account for them in the current approach.
57
+ - **If nothing found:** Proceed normally — absence of memory is not a blocker.
58
+
59
+ ## Command-Specific Variations
60
+
61
+ | Command | Extra Focus |
62
+ | ----------- | ------------------------------------------------------ |
63
+ | `/plan` | Search bugfixes; check for existing plans to overwrite |
64
+ | `/ship` | Search for failed approaches to avoid repeating |
65
+ | `/create` | Search for duplicate beads before creating |
66
+ | `/pr` | Include findings in PR description |
67
+ | `/research` | Search before spawning agents; narrow scope to gaps |
68
+ | `/resume` | Read handoff file by bead ID; check session history |
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: verification-gates
3
+ description: >
4
+ Use when running pre-merge or pre-PR verification checks. Detects project type and runs appropriate build, test, lint, and typecheck commands.
5
+ version: 1.0.0
6
+ tags: [verification, testing, lint, typecheck, ci]
7
+ ---
8
+
9
+ # Verification Gates
10
+
11
+ Detect project type and run the appropriate verification commands before merging or creating PRs.
12
+
13
+ ## When to Use
14
+
15
+ - In `/pr` before creating a pull request
16
+ - In `/review-codebase` during automated checks phase
17
+ - In `/ship` during final verification
18
+ - Any command that needs to verify code quality before completion
19
+
20
+ ## When NOT to Use
21
+
22
+ - For incremental checks during development (just run the specific tool)
23
+ - When only one check type is needed (e.g., lint-only)
24
+
25
+ ## Project Type Detection
26
+
27
+ | Project Type | Detect Via | Build | Test | Lint | Typecheck |
28
+ | --------------- | ----------------------------- | ---------------- | --------------- | ----------------------------- | ------------------------------------- |
29
+ | Node/TypeScript | `package.json` | `npm run build` | `npm test` | `npm run lint` | `npm run typecheck` or `tsc --noEmit` |
30
+ | Rust | `Cargo.toml` | `cargo build` | `cargo test` | `cargo clippy -- -D warnings` | (included in build) |
31
+ | Python | `pyproject.toml` / `setup.py` | — | `pytest` | `ruff check .` | `mypy .` |
32
+ | Go | `go.mod` | `go build ./...` | `go test ./...` | `golangci-lint run` | (included in build) |
33
+
34
+ ## Protocol
35
+
36
+ ### Step 1: Detect project type
37
+
38
+ Check for indicator files in the project root. Multiple types may coexist (e.g., Node + Python monorepo).
39
+
40
+ ### Step 2: Run checks in parallel where possible
41
+
42
+ ```bash
43
+ # Run typecheck and lint in parallel
44
+ npm run typecheck &
45
+ npm run lint &
46
+ wait
47
+
48
+ # Then run tests (may depend on build)
49
+ npm test
50
+ ```
51
+
52
+ ### Step 3: Report results
53
+
54
+ For each check, report:
55
+
56
+ - **Pass/Fail** status
57
+ - **Error count** (if failed)
58
+ - **Key error messages** (first 5)
59
+
60
+ ### Step 4: Gate decision
61
+
62
+ - **All pass:** Proceed with the command
63
+ - **Any fail:** Stop and report. Let the user decide whether to proceed or fix.
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: workspace-setup
3
+ description: >
4
+ Use when a command needs to create a feature branch or set up a workspace for bead work. Shared by /create and /ship.
5
+ version: 1.0.0
6
+ tags: [git, workspace, branch, setup]
7
+ ---
8
+
9
+ # Workspace Setup
10
+
11
+ Set up a git workspace (branch or worktree) for bead-based work.
12
+
13
+ ## When to Use
14
+
15
+ - In `/create` after bead creation, before task conversion
16
+ - In `/ship` when auto-claiming an unclaimed bead
17
+ - Any command that needs to transition from "no workspace" to "active workspace"
18
+
19
+ ## When NOT to Use
20
+
21
+ - If bead is already `in_progress` with an existing branch
22
+ - If user explicitly chose "Use current branch"
23
+
24
+ ## Protocol
25
+
26
+ ### Step 1: Ask the user
27
+
28
+ ```typescript
29
+ question({
30
+ questions: [
31
+ {
32
+ header: "Workspace",
33
+ question: "How do you want to set up the workspace?",
34
+ options: [
35
+ {
36
+ label: "Create feature branch (Recommended)",
37
+ description: "git checkout -b <prefix>/<bead-id>-<title>",
38
+ },
39
+ {
40
+ label: "Use current branch",
41
+ description: "Work on current branch without creating a new one",
42
+ },
43
+ ],
44
+ },
45
+ ],
46
+ });
47
+ ```
48
+
49
+ > **Note:** `/create` may additionally offer a "Create worktree" option using `skill({ name: "using-git-worktrees" })`.
50
+
51
+ ### Step 2: Create branch (if selected)
52
+
53
+ Map bead type to branch prefix:
54
+
55
+ | Bead Type | Branch Prefix |
56
+ | --------- | ------------- |
57
+ | feature | feat |
58
+ | bug | fix |
59
+ | task | task |
60
+ | epic | epic |
61
+
62
+ Create the branch:
63
+
64
+ ```bash
65
+ git checkout -b $PREFIX/$BEAD_ID-$TITLE_SLUG
66
+ ```
67
+
68
+ Where `$TITLE_SLUG` is the bead title lowercased with spaces replaced by hyphens, truncated to ~50 chars.
69
+
70
+ ### Step 3: Confirm
71
+
72
+ ```bash
73
+ git branch --show-current
74
+ ```
75
+
76
+ Verify you're on the new branch before proceeding.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencodekit",
3
- "version": "0.20.3",
3
+ "version": "0.20.5",
4
4
  "description": "CLI tool for bootstrapping and managing OpenCodeKit projects",
5
5
  "keywords": [
6
6
  "agents",