opencode-leetcode-realworld 0.2.0 → 0.2.1

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 (2) hide show
  1. package/README.md +51 -17
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # opencode-leetcode-realworld
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/opencode-leetcode-realworld.svg)](https://www.npmjs.com/package/opencode-leetcode-realworld)
4
+
3
5
  An [opencode](https://opencode.ai) plugin that turns a LeetCode problem into a
4
6
  **realistic software-engineering assignment**.
5
7
 
@@ -15,6 +17,49 @@ and a test suite. The original problem is never shown to you.
15
17
  /practice medium dynamic-programming python
16
18
  ```
17
19
 
20
+ ## Install
21
+
22
+ Add the plugin to your `opencode.json` and restart opencode:
23
+
24
+ ```jsonc
25
+ {
26
+ "$schema": "https://opencode.ai/config.json",
27
+ "plugin": ["opencode-leetcode-realworld"]
28
+ }
29
+ ```
30
+
31
+ That's all you have to do. **You do not run `npm install` yourself** — opencode
32
+ reads the `plugin` list on startup and installs the package automatically with
33
+ Bun (cached in `~/.cache/opencode/node_modules/`). Just naming it in the config is
34
+ enough; the plugin then registers the `/practice` command on its own.
35
+
36
+ Prefer not to edit the file by hand? Let opencode do it:
37
+
38
+ ```bash
39
+ opencode plugin opencode-leetcode-realworld
40
+ ```
41
+
42
+ Use the project `opencode.json` to enable it for one repo, or
43
+ `~/.config/opencode/opencode.json` to enable it everywhere.
44
+
45
+ Confirm it loaded:
46
+
47
+ ```bash
48
+ opencode debug config # look for a "practice" command
49
+ ```
50
+
51
+ ### Requirements
52
+
53
+ - [opencode](https://opencode.ai) 1.x
54
+ - Node.js 18+ — the test runner uses Node no matter which language you pick
55
+ - The toolchain for your chosen language (see [Supported languages](#supported-languages))
56
+
57
+ Then, in opencode:
58
+
59
+ ```
60
+ /practice
61
+ ```
62
+
18
63
  ## Usage
19
64
 
20
65
  ```
@@ -104,6 +149,8 @@ they tend to produce:
104
149
 
105
150
  ```
106
151
  /practice
152
+ │
153
+ ├─ (agent) if language/difficulty are missing, ask you via the `question` tool
107
154
  │
108
155
  ├─ leetcode_fetch fetch a problem from the LeetCode API (private reasoning input)
109
156
  │
@@ -135,24 +182,11 @@ node tests/runner.mjs # all cases
135
182
  node tests/runner.mjs --public # visible cases only
136
183
  ```
137
184
 
138
- ## Install
139
-
140
- ### Local (development)
141
-
142
- Clone/copy this repo, then open opencode inside it. Files under
143
- `.opencode/plugins/` and `.opencode/commands/` are auto-loaded.
144
-
145
- ### From npm (once published)
146
-
147
- ```jsonc
148
- // opencode.json
149
- {
150
- "$schema": "https://opencode.ai/config.json",
151
- "plugin": ["opencode-leetcode-realworld"]
152
- }
153
- ```
185
+ ## Running from source
154
186
 
155
- The plugin registers the `/practice` command itself, so no extra config is needed.
187
+ For plugin development, clone the repo and open opencode inside it — files under
188
+ `.opencode/plugins/` are auto-loaded. See [Development](#development) for the test
189
+ and typecheck commands.
156
190
 
157
191
  ## Tools
158
192
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-leetcode-realworld",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "OpenCode plugin that turns a LeetCode problem into a realistic software-engineering assignment, so you practice applying the underlying algorithm instead of solving the puzzle.",
5
5
  "type": "module",
6
6
  "license": "MIT",