@divaltor/academy 0.5.0 → 0.6.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/package.json +1 -1
- package/src/index.ts +3 -0
- package/src/session-guidance.ts +24 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@divaltor/academy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "An OpenCode plugin that trains a Tracen Academy roster of specialist coding agents to research, build, and review.",
|
|
5
5
|
"homepage": "https://github.com/divaltor/academy#readme",
|
|
6
6
|
"bugs": {
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { Config, Effect, Option, Redacted, Schema } from "effect";
|
|
|
4
4
|
import { agents, rudolfCommunicationPrompt } from "./agents";
|
|
5
5
|
import { FffTools } from "./fff-tools";
|
|
6
6
|
import { SessionCommunication } from "./session-communication";
|
|
7
|
+
import { SessionGuidance } from "./session-guidance";
|
|
7
8
|
|
|
8
9
|
const ModelReference = Schema.NonEmptyString.check(
|
|
9
10
|
Schema.isPattern(/^[^/#]+\/[^#]+(?:#[^#]+)?$/u)
|
|
@@ -89,6 +90,8 @@ const setup = Effect.fn("Academy.setup")(function* setup(ctx: Plugin.Context) {
|
|
|
89
90
|
yield* FffTools.register(ctx);
|
|
90
91
|
}
|
|
91
92
|
|
|
93
|
+
yield* SessionGuidance.register(ctx);
|
|
94
|
+
|
|
92
95
|
yield* ctx.agent.transform((editor) => {
|
|
93
96
|
for (const id of ["build", "plan", "explore", "general"]) {
|
|
94
97
|
editor.update(id, (agent) => {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Plugin } from "@opencode/plugin/effect";
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
|
|
4
|
+
export namespace SessionGuidance {
|
|
5
|
+
const anthropicRule = [
|
|
6
|
+
"Search and edit rules: never run shell `grep` or `sed`, including piped segments (`| grep`, `| sed`).",
|
|
7
|
+
'- Search: use the `grep` tool first; in shell use only `rg` (`rg -n "pattern" path`, `-F` literal, `-i` case-insensitive, `-v` invert, `-l`/`-c` files/count, `-A`/`-B`/`-C` context, `--replace` for substitutions).',
|
|
8
|
+
"- Edit/view: use Edit (or Write for new files) and Read with offset/limit instead of `sed -i`, `sed -n 'A,Bp'`, or `/pat/d`.",
|
|
9
|
+
"- `rg` is not `grep`-compatible: it recurses, respects .gitignore, and skips hidden files; add `--hidden --no-ignore` only when hidden or ignored files are explicitly required.",
|
|
10
|
+
].join("\n");
|
|
11
|
+
|
|
12
|
+
export const register = Effect.fn("SessionGuidance.register")(
|
|
13
|
+
function* register(ctx: Plugin.Context) {
|
|
14
|
+
yield* ctx.session.hook(
|
|
15
|
+
"context",
|
|
16
|
+
(input) =>
|
|
17
|
+
Effect.sync(() => {
|
|
18
|
+
input.system.push({ text: anthropicRule, type: "text" as const });
|
|
19
|
+
}),
|
|
20
|
+
{ providerID: "anthropic" }
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|