@r_masseater/kogane 0.0.0 → 0.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/.claude-plugin/plugin.json +12 -0
- package/LICENSE +661 -0
- package/README.md +48 -1
- package/dist/main.mjs +77148 -0
- package/hooks/hooks.json +17 -0
- package/package.json +47 -6
- package/skills/suggest-workspaces/SKILL.md +50 -0
package/README.md
CHANGED
|
@@ -1,3 +1,50 @@
|
|
|
1
1
|
# @r_masseater/kogane
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A Claude Code plugin that tells the agent which workspaces of the current pnpm monorepo may already do what a prompt asks for. It exists because agents keep rebuilding tools that are already in the repository, or say a tool does not exist after searching only npm.
|
|
4
|
+
|
|
5
|
+
On every prompt, the `UserPromptSubmit` hook compares the prompt with the `description` of each workspace and adds the close matches to the context:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
kogane: these existing workspaces may already do what this prompt needs. Read their AGENTS.md or README before building something new or saying it does not exist.
|
|
9
|
+
- @masseater.dev/effect2rs (<repository>/libs/effect2rs): Generates serde Rust types from Effect Schema by walking SchemaRepresentation.
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Nothing leaves the machine. The prompt and the descriptions are embedded with [EmbeddingGemma 2](https://huggingface.co/onnx-community/embeddinggemma-2-ONNX) (q4, pinned revision) on the CPU.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
The plugin is listed in the marketplace of [masseater/masseater.dev](https://github.com/masseater/masseater.dev):
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
claude plugin marketplace add masseater/masseater.dev
|
|
20
|
+
claude plugin install kogane@masseater-dev
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Agent skills
|
|
24
|
+
|
|
25
|
+
Guidance for agents ships in the package as TanStack Intent skills. Load one with `vp exec intent load @r_masseater/kogane#<skill>`.
|
|
26
|
+
|
|
27
|
+
| Skill | When to use |
|
|
28
|
+
| -------------------- | ------------------------------------------------------------------------------------------ |
|
|
29
|
+
| `suggest-workspaces` | Acting on a `kogane:` suggestion, installing the plugin, or writing workspace descriptions |
|
|
30
|
+
|
|
31
|
+
## How it behaves
|
|
32
|
+
|
|
33
|
+
- Workspaces come from `pnpm-workspace.yaml` of the monorepo that contains the session's working directory. When the working directory is not inside one, every direct subdirectory that is a pnpm monorepo is used, which covers sessions that hold several repositories.
|
|
34
|
+
- Only workspaces with a non-empty `description` in `package.json` are considered.
|
|
35
|
+
- At most three workspaces are suggested, and only those scoring at least 0.69 and within 0.06 of the best match. Most prompts get no suggestion.
|
|
36
|
+
- The first prompt starts a background server (`kogane serve`) and gets no suggestion. The server keeps the model loaded, which takes about 1 GB of memory, and exits after 30 minutes without prompts. The first download of the model is about 200 MB.
|
|
37
|
+
- The hook gives up after 3 seconds, so a slow answer never blocks the prompt.
|
|
38
|
+
- Data and the model cache go to `$CLAUDE_PLUGIN_DATA`, or `~/.cache/kogane` outside the plugin.
|
|
39
|
+
|
|
40
|
+
## Commands
|
|
41
|
+
|
|
42
|
+
| Command | What it does |
|
|
43
|
+
| ---------------------------------- | ---------------------------------------------------------------------- |
|
|
44
|
+
| `kogane hook` | Runs as the `UserPromptSubmit` hook (reads the hook input from stdin). |
|
|
45
|
+
| `kogane serve --data <dir>` | Runs the background server. The hook starts it. |
|
|
46
|
+
| `kogane index [--directory <dir>]` | Prints every workspace with its description as Markdown. |
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
MIT
|