@ryodeushii/ai-product-team-agents 0.1.2 → 0.1.3
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 +18 -6
- package/package.json +1 -1
- package/src/setup/index.ts +15 -1
- package/templates/opencode-plugin.ts +1 -1
package/README.md
CHANGED
|
@@ -45,15 +45,19 @@ This creates:
|
|
|
45
45
|
- `AGENTS.md` — team context loaded by Claude Code / OpenCode
|
|
46
46
|
- `CLAUDE.md` — one-liner that imports AGENTS.md (Claude Code)
|
|
47
47
|
- `.agents.yml` — project config (edit this)
|
|
48
|
-
- `.claude/agents/`
|
|
49
|
-
- `.opencode/agents/`
|
|
48
|
+
- `.claude/agents/` — role files with resolved models injected (Claude Code)
|
|
49
|
+
- `.opencode/agents/` — role files with resolved models injected (OpenCode)
|
|
50
|
+
- `.opencode/plugins/agents-auto-update.ts` — OpenCode session hook (install only)
|
|
51
|
+
- `.claude/settings.json` — `SessionStart` hook for auto-update (Claude Code)
|
|
50
52
|
|
|
51
|
-
**Update** an existing installation (re-
|
|
53
|
+
**Update** an existing installation (re-injects resolved models into role files, migrates the Claude hook):
|
|
52
54
|
|
|
53
55
|
```bash
|
|
54
56
|
bunx @ryodeushii/ai-product-team-agents --update
|
|
55
57
|
```
|
|
56
58
|
|
|
59
|
+
> `--update` deliberately does **not** overwrite `.agents.yml` (user config) or the OpenCode plugin. To reinstall those, re-run the install command.
|
|
60
|
+
|
|
57
61
|
**Remove** the framework from a project:
|
|
58
62
|
|
|
59
63
|
```bash
|
|
@@ -181,14 +185,20 @@ The hook looks like this in `.claude/settings.json`:
|
|
|
181
185
|
"SessionStart": [
|
|
182
186
|
{
|
|
183
187
|
"matcher": "startup",
|
|
184
|
-
"hooks": [{ "type": "command", "command": "bunx --bun @ryodeushii/ai-product-team-agents --update 2>/dev/null; true" }]
|
|
188
|
+
"hooks": [{ "type": "command", "command": "bunx --bun @ryodeushii/ai-product-team-agents@latest --update 2>/dev/null; true" }]
|
|
185
189
|
}
|
|
186
190
|
]
|
|
187
191
|
}
|
|
188
192
|
}
|
|
189
193
|
```
|
|
190
194
|
|
|
191
|
-
|
|
195
|
+
The `@latest` tag ensures the session hook always runs the newest published version, not a locally cached one. If you upgrade the package and the hook command changes, re-running the install will migrate the hook automatically.
|
|
196
|
+
|
|
197
|
+
**OpenCode** uses a local plugin instead. The setup script writes `.opencode/plugins/agents-auto-update.ts` on first install (never overwritten by `--update`). It runs `--update` automatically at the start of every OpenCode session. If the plugin template changes in a new release, re-run the install command to update it:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
bunx @ryodeushii/ai-product-team-agents@latest <project-name>
|
|
201
|
+
```
|
|
192
202
|
|
|
193
203
|
---
|
|
194
204
|
|
|
@@ -294,5 +304,7 @@ Biome handles formatting and linting. Run `bun run check` before committing. CI
|
|
|
294
304
|
|
|
295
305
|
- Agent definitions are **markdown files with frontmatter** — compatible with both Claude Code (`.claude/agents/`) and OpenCode (`.opencode/agents/`) natively
|
|
296
306
|
- `CLAUDE.md` is a one-liner that imports `AGENTS.md` — so `AGENTS.md` is the single source of truth and works in both tools
|
|
297
|
-
- The setup script
|
|
307
|
+
- The setup script **copies** role files and injects a `model:` line into each frontmatter at install/update time — no runtime resolution needed by the AI tool itself
|
|
298
308
|
- Model resolution is **dynamic** — the MCP server reads config at call time, no rebuild needed
|
|
309
|
+
- `.agents.yml` is **never overwritten** after first install — it is user-owned config
|
|
310
|
+
- The OpenCode plugin (`.opencode/plugins/agents-auto-update.ts`) is **install-only** — `--update` skips it so user modifications are preserved
|
package/package.json
CHANGED
package/src/setup/index.ts
CHANGED
|
@@ -13,7 +13,7 @@ import type { Role } from "../models/types";
|
|
|
13
13
|
// Runs --update on every Claude Code session start so model overrides
|
|
14
14
|
// from .agents.yml are always applied without manual intervention.
|
|
15
15
|
const HOOK_COMMAND =
|
|
16
|
-
"bunx --bun
|
|
16
|
+
"bunx --bun @ryodeushii/ai-product-team-agents@latest --update 2>/dev/null; true";
|
|
17
17
|
|
|
18
18
|
interface SetupOptions {
|
|
19
19
|
projectName: string;
|
|
@@ -184,6 +184,20 @@ async function installClaudeHook(settingsPath: string): Promise<void> {
|
|
|
184
184
|
);
|
|
185
185
|
const settings = raw ? JSON.parse(raw) : {};
|
|
186
186
|
|
|
187
|
+
// Remove any stale agents hook (command changed between versions)
|
|
188
|
+
const HOOK_PACKAGE = "@ryodeushii/ai-product-team-agents";
|
|
189
|
+
if (settings.hooks?.SessionStart) {
|
|
190
|
+
for (const entry of settings.hooks.SessionStart) {
|
|
191
|
+
entry.hooks = entry.hooks?.filter(
|
|
192
|
+
(h: { command: string }) =>
|
|
193
|
+
!h.command.includes(HOOK_PACKAGE) || h.command === HOOK_COMMAND,
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
settings.hooks.SessionStart = settings.hooks.SessionStart.filter(
|
|
197
|
+
(entry: { hooks?: unknown[] }) => entry.hooks && entry.hooks.length > 0,
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
187
201
|
// idempotent: don't add duplicate hook
|
|
188
202
|
const existing: { matcher: string; hooks: { type: string; command: string }[] }[] =
|
|
189
203
|
settings.hooks?.SessionStart ?? [];
|
|
@@ -5,7 +5,7 @@ import type { Plugin } from "@opencode-ai/plugin";
|
|
|
5
5
|
// To remove: bunx @ryodeushii/ai-product-team-agents --uninstall
|
|
6
6
|
|
|
7
7
|
export const AgentsAutoUpdate: Plugin = async ({ $ }) => {
|
|
8
|
-
await $`bunx --bun
|
|
8
|
+
await $`bunx --bun @ryodeushii/ai-product-team-agents@latest --update`;
|
|
9
9
|
return {};
|
|
10
10
|
};
|
|
11
11
|
|