Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

feat(ruflo-ddd): function-hook mod (secret guard, /ddd-mod, status file)

ruv3a156539b852
diff --git a/plugins/ruflo-ddd/.claude-plugin/plugin.json b/plugins/ruflo-ddd/.claude-plugin/plugin.json
index 42efa6dc77..771f5e6ddc 100644
--- a/plugins/ruflo-ddd/.claude-plugin/plugin.json
+++ b/plugins/ruflo-ddd/.claude-plugin/plugin.json
@@ -1,7 +1,7 @@
{
"name": "ruflo-ddd",
"description": "Domain-Driven Design scaffolding — bounded contexts, aggregate roots, domain events, value objects, repositories, and anti-corruption layers; navigable domain graph stored in AgentDB",
- "version": "0.2.1",
+ "version": "0.3.0",
"author": {
"name": "ruvnet",
"url": "https://github.com/ruvnet"
@@ -18,6 +18,22 @@
"acl",
"value-objects",
"repositories",
- "mcp"
- ]
+ "mcp",
+ "mod",
+ "function-hooks",
+ "guard"
+ ],
+ "userConfig": {
+ "guard": {
+ "type": "string",
+ "title": "Secret guard",
+ "description": "Refuse domain-model memory writes that hold a key, token or password. On by default; it only ever tightens.",
+ "required": false,
+ "default": "on",
+ "options": [
+ "on",
+ "off"
+ ]
+ }
+ }
}
diff --git a/plugins/ruflo-ddd/README.md b/plugins/ruflo-ddd/README.md
index 634007ab30..f6814c80fc 100644
--- a/plugins/ruflo-ddd/README.md
+++ b/plugins/ruflo-ddd/README.md
@@ -93,3 +93,14 @@ bash plugins/ruflo-ddd/scripts/smoke.sh
## License
MIT
+
+## As a mod
+
+Since this version the plugin is also a function-hook mod (ADR-445 pattern; needs Claude Code 2.1.287 or later). It never calls the network or spawns a process, and it only tightens: it can refuse a call, never allow one.
+
+- **Guard** (default on): refuses domain-model memory writes (`ddd-*` keys and `context:`/`aggregate:` hierarchy edges) that hold a key, token or password. The reason names the kind of secret, never the value.
+- **`/ddd-mod`**: answered locally, no model turn: `status`, `scan <text>` (would the guard refuse this?), and `contexts` (folders under `src/`, `src/contexts`, `src/modules` with a `domain/` layer).
+- **Status file**: `.claude-flow/ddd-mod/status.json` (`{version, updatedMs, guard, blocked}`), written at session start and when a call is blocked.
+- **Option**: `guard` (`on` | `off`, default `on`) in the plugin's `userConfig`.
+
+Test it: `claude plugin test plugins/ruflo-ddd` and `bash plugins/ruflo-ddd/scripts/smoke.sh`.
diff --git a/plugins/ruflo-ddd/hooks/command.ts b/plugins/ruflo-ddd/hooks/command.ts
new file mode 100644
index 0000000000..98367719a8
--- /dev/null
+++ b/plugins/ruflo-ddd/hooks/command.ts
@@ -0,0 +1,52 @@
+import type { FsEntry } from 'claude-code'
+
+import { secretNames } from './screen'
+import type { Stats } from './status'
+
+/** `/ddd-mod` is answered locally and takes no model turn. Everything it reads is already connected; nothing is written. */
+export type CommandDeps = {
+ readonly guard: boolean
+ readonly stats: Stats
+ readonly tools: () => Promise<readonly string[]>
+ readonly list: (path: string) => Promise<readonly FsEntry[]>
+}
+
+const HELP = ['/ddd-mod status', '/ddd-mod scan <text>', '/ddd-mod contexts'].join('\n')
+
+export async function answer(args: string, deps: CommandDeps): Promise<string> {
+ const [verb = '', ...rest] = args.trim().split(/\s+/)
+ const arg = rest.join(' ')
+
+ if (verb === '' || verb === 'help') return HELP
+
+ if (verb === 'status') return `guard ${deps.guard ? 'on' : 'off'} · calls blocked ${deps.stats.blocked}`
+
+ if (verb === 'scan') {
+ if (arg === '') return 'usage: /ddd-mod scan <text>'
+ const found = secretNames(arg)
+ return found.length ? `The guard would refuse that (${found.join(', ')}).` : 'Nothing found: the guard would let that through.'
+ }
+
+ if (verb === 'contexts') {
+ const found: string[] = []
+ for (const base of ['src', 'src/contexts', 'src/modules']) {
+ let entries: readonly FsEntry[]
+ try {
+ entries = await deps.list(base)
+ } catch {
+ continue
+ }
+ if (entries.some(e => e.kind === 'dir' && e.name === 'domain') && base === 'src') found.push('src (single domain)')
+ for (const dir of entries.filter(e => e.kind === 'dir' && e.name !== 'domain').slice(0, 40)) {
+ try {
+ if ((await deps.list(`${base}/${dir.name}`)).some(e => e.kind === 'dir' && e.name === 'domain')) found.push(`${base}/${dir.name}`)
+ } catch {
+ /* unreadable: not a context */
+ }
+ }
+ }
+ return found.length ? `${found.length} bounded context${found.length === 1 ? '' : 's'} (a folder with a domain/ layer):\n${found.map(f => `- ${f}`).join('\n')}` : 'No bounded context found under src/, src/contexts or src/modules.'
+ }
+
+ return `Unknown: ${verb}\n${HELP}`
+}
diff --git a/plugins/ruflo-ddd/hooks/guard.ts b/plugins/ruflo-ddd/hooks/guard.ts
new file mode 100644
index 0000000000..7e47fa9f4e
--- /dev/null
+++ b/plugins/ruflo-ddd/hooks/guard.ts
@@ -0,0 +1,21 @@
+import { hasSecret, textsOf } from './screen'
+
+/** The tool name without its `mcp__<server>__` prefix. */
+const tail = (name: string) => (name.startsWith('mcp__') ? name.slice(name.lastIndexOf('__') + 2) : name)
+
+const WRITERS = new Set(['memory_store', 'agentdb_hierarchical-store'])
+const DOMAIN = /^ddd-|^(?:context|aggregate):/
+
+/** The DDD skills' own entries: a key named ddd-*, or a hierarchy edge whose ends are context:* or aggregate:*. */
+function isDomainWrite(input: unknown): boolean {
+ const o = (typeof input === 'object' && input !== null ? input : {}) as Record<string, unknown>
+ return ['key', 'parent', 'child'].some(k => typeof o[k] === 'string' && DOMAIN.test(o[k] as string))
+}
+
+/** The reason a domain-model memory write is refused, or undefined when it may go. Never names or echoes the secret. */
+export function verdict(tool: string, input: unknown): string | undefined {
+ if (!WRITERS.has(tail(tool)) || !isDomainWrite(input)) return undefined
+ return textsOf(input).some(hasSecret)
+ ? 'ruflo-ddd: this domain-model entry holds what looks like a secret (a key, token or password). The model records contexts and aggregates, not credentials.'
+ : undefined
+}
diff --git a/plugins/ruflo-ddd/hooks/hooks.json b/plugins/ruflo-ddd/hooks/hooks.json
new file mode 100644
index 0000000000..ae8f947f74
--- /dev/null
+++ b/plugins/ruflo-ddd/hooks/hooks.json
@@ -0,0 +1,4 @@
+{
+ "description": "DDD as a mod: a guard that keeps secrets out of DDD model memory writes, /ddd-mod (bounded-context listing), and a status file.",
+ "modules": ["./register.ts"]
+}
diff --git a/plugins/ruflo-ddd/hooks/options.ts b/plugins/ruflo-ddd/hooks/options.ts
new file mode 100644
index 0000000000..e18352b921
--- /dev/null
+++ b/plugins/ruflo-ddd/hooks/options.ts
@@ -0,0 +1,9 @@
+import type { PluginOptions } from 'claude-code'
+
+/** The plugin's `userConfig`, validated: a bad value is the default (guard on). */
+export type ModOptions = { readonly guard: boolean }
+
+const flag = (value: unknown, fallback: boolean) =>
+ value === true || value === 'true' || value === 'on' ? true : value === false || value === 'false' || value === 'off' ? false : fallback
+
+export const readOptions = (options: PluginOptions | undefined): ModOptions => ({ guard: flag((options ?? {}).guard, true) })
diff --git a/plugins/ruflo-ddd/hooks/register.ts b/plugins/ruflo-ddd/hooks/register.ts
new file mode 100644
index 0000000000..3b167ba321
--- /dev/null
+++ b/plugins/ruflo-ddd/hooks/register.ts
@@ -0,0 +1,62 @@
+import type { Hook, Register } from 'claude-code'
+
+import { answer } from './command'
+import { verdict } from './guard'
+import { readOptions, type ModOptions } from './options'
+import { newStats, STATUS_PATH, statusText, type Stats } from './status'
+
+type Dollar = Parameters<Hook<'session.start'>>[0]
+
+/** Everything one session of the mod keeps: its settings, counters and the project root. */
+type Session = { readonly opts: ModOptions; readonly stats: Stats; root?: string }
+
+async function flush($: Dollar, s: Session): Promise<void> {
+ if (s.root === undefined) return
+ try {
+ await $.fs.write(`${s.root}/${STATUS_PATH}`, statusText(s.stats, s.opts.guard, await $.clock.now()))
+ } catch {
+ /* the status file is a courtesy */
+ }
+}
+
+/**
+ * ruflo-ddd as a mod (ADR-445 pattern): a tighten-only guard on this plugin's own tools, `/ddd-mod` and a status file. No network, no process
+ * spawning: only tools already connected.
+ */
+export const register: Register = (on, options) => {
+ const s: Session = { opts: readOptions(options), stats: newStats() }
+
+ on('session.start', async ($, e, next) => {
+ const result = await next(e)
+ s.root = (await $.session.root()) as string | undefined
+ try {
+ await $.command.register({ name: 'ddd-mod', description: 'ruflo-ddd mod: status, scan <text>, plus a read-only listing' })
+ } catch {
+ /* a name taken by another plugin must not stop the mod */
+ }
+ await flush($, s)
+ return result
+ })
+
+ if (s.opts.guard) {
+ on('tool.call', async ($, e, next) => {
+ const reason = verdict(e.tool, e)
+ if (reason === undefined) return next(e)
+ s.stats.blocked++
+ await flush($, s)
+ return { deny: reason }
+ })
+ }
+
+ /** `/ddd-mod` is answered locally and takes no model turn. */
+ on('command.run', { command: 'ddd-mod' }, async ($, e) => {
+ const args = typeof e.args === 'string' ? e.args : ''
+ const text = await answer(args, {
+ guard: s.opts.guard,
+ stats: s.stats,
+ tools: async () => (await $.tool.list()).map(t => t.name),
+ list: path => $.fs.list(path),
+ })
+ return { text }
+ })
+}
diff --git a/plugins/ruflo-ddd/hooks/screen.ts b/plugins/ruflo-ddd/hooks/screen.ts
new file mode 100644
index 0000000000..14e017efed
--- /dev/null
+++ b/plugins/ruflo-ddd/hooks/screen.ts
@@ -0,0 +1,41 @@
+/**
+ * Pure secret screening for this mod (copied from ruflo-agentdb's ADR-445 screen.ts, injection rules dropped). Findings are NAMES only: the
+ * matched text is never returned, logged or counted by value.
+ */
+
+const SECRETS: readonly (readonly [string, RegExp])[] = [
+ ['private key', /-----BEGIN [A-Z ]*PRIVATE KEY-----/],
+ ['aws access key', /\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/],
+ ['github token', /\b(?:gh[pousr]_[A-Za-z0-9]{30,}|github_pat_[A-Za-z0-9_]{40,})\b/],
+ ['slack token', /\bxox[abprs]-[A-Za-z0-9-]{10,}/],
+ ['google api key', /\bAIza[0-9A-Za-z_-]{35}\b/],
+ ['anthropic or openai key', /\bsk-(?:ant-|proj-)?[A-Za-z0-9_-]{24,}/],
+ ['jwt', /\beyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/],
+ ['bearer token', /\bBearer\s+[A-Za-z0-9._~+/=-]{24,}/],
+ ['key assignment', /\b(?:api[_-]?key|secret|token|passw(?:or)?d|credential)s?["']?\s*[:=]\s*["']?[A-Za-z0-9/+=_.-]{16,}/i],
+]
+
+// C0/C1 controls (keeping tab and newline), DEL, zero-width and bidi override characters; built with escapes, never raw.
+const INVISIBLE = new RegExp('[\\u0000-\\u0008\\u000b-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2064\\ufeff]', 'g')
+
+const bare = (text: string) => (text.length > 20_000 ? text.slice(0, 20_000) : text).replace(INVISIBLE, '')
+
+/** Names of every secret shape found in `text`. Cost is linear in the capped input. */
+export const secretNames = (text: string): string[] => {
+ const bounded = bare(text)
+ return SECRETS.filter(([, re]) => re.test(bounded)).map(([name]) => name)
+}
+
+export const hasSecret = (text: string) => secretNames(text).length > 0
+
+/** Every string in a tool's input, to a bounded depth and size: what a guard reads. */
+export function textsOf(input: unknown, budget = { left: 20_000 }, depth = 0): string[] {
+ if (budget.left <= 0 || depth > 6) return []
+ if (typeof input === 'string') {
+ budget.left -= input.length
+ return [input]
+ }
+ if (Array.isArray(input)) return input.slice(0, 200).flatMap(v => textsOf(v, budget, depth + 1))
+ if (typeof input === 'object' && input !== null) return Object.values(input).slice(0, 200).flatMap(v => textsOf(v, budget, depth + 1))
+ return []
+}
diff --git a/plugins/ruflo-ddd/hooks/status.ts b/plugins/ruflo-ddd/hooks/status.ts
new file mode 100644
index 0000000000..e897a9227a
--- /dev/null
+++ b/plugins/ruflo-ddd/hooks/status.ts
@@ -0,0 +1,10 @@
+/** Counters the mod keeps for the session and writes to `.claude-flow/ddd-mod/status.json`. */
+export type Stats = { blocked: number }
+
+export const newStats = (): Stats => ({ blocked: 0 })
+
+export const STATUS_PATH = '.claude-flow/ddd-mod/status.json'
+
+/** The file's text; `version` lets a reader refuse a shape it does not know. */
+export const statusText = (stats: Stats, guard: boolean, nowMs: number): string =>
+ `${JSON.stringify({ version: 1, updatedMs: nowMs, guard, ...stats }, null, 2)}\n`
diff --git a/plugins/ruflo-ddd/scripts/smoke.sh b/plugins/ruflo-ddd/scripts/smoke.sh
index 3e1688c5c7..a6eac01fe8 100755
--- a/plugins/ruflo-ddd/scripts/smoke.sh
+++ b/plugins/ruflo-ddd/scripts/smoke.sh
@@ -7,9 +7,9 @@ step() { printf "→ %s ... " "$1"; }
ok() { printf "PASS\n"; PASS=$((PASS+1)); }
bad() { printf "FAIL: %s\n" "$1"; FAIL=$((FAIL+1)); }
-step "1. plugin.json declares 0.2.1 with new keywords"
+step "1. plugin.json declares 0.3.0 with new keywords"
v=$(grep -E '"version"' "$ROOT/.claude-plugin/plugin.json" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
-if [[ "$v" != "0.2.1" ]]; then bad "expected 0.2.1, got '$v'"; else
+if [[ "$v" != "0.3.0" ]]; then bad "expected 0.3.0, got '$v'"; else
miss=""
for k in acl value-objects repositories mcp; do
grep -q "\"$k\"" "$ROOT/.claude-plugin/plugin.json" || miss="$miss $k"
@@ -68,5 +68,24 @@ for f in "$ROOT"/skills/*/SKILL.md; do
done
[[ -z "$bad_skills" ]] && ok || bad "wildcard:$bad_skills"
+# M1. The mod (ADR-445 pattern): hooks module registered, files within the 500-line rule, no network or process access in the hooks
+step "M1. mod: hooks.json names register.ts, every hook file is present and under 500 lines"
+mod_ok=1
+grep -q '"./register.ts"' "$ROOT/hooks/hooks.json" || mod_ok=0
+for f in options screen guard command status register; do
+ [[ -f "$ROOT/hooks/$f.ts" ]] || mod_ok=0
+ [[ $(wc -l < "$ROOT/hooks/$f.ts" 2>/dev/null || echo 9999) -le 500 ]] || mod_ok=0
+done
+[[ $mod_ok -eq 1 ]] && ok || bad "mod hooks incomplete or too long"
+
+step "M2. mod: guard defaults on, and it is the only userConfig option"
+node -e '
+const c = require(process.argv[1]).userConfig || {}
+process.exit(c.guard && c.guard.default === "on" && Object.keys(c).length === 1 ? 0 : 1)
+' "$ROOT/.claude-plugin/plugin.json" && ok || bad "userConfig defaults wrong"
+
+step "M3. mod: hooks never touch the network or spawn a process"
+if grep -nE '\$\.(http|process)\.|child_process|fetch\(' "$ROOT"/hooks/*.ts >/dev/null; then bad "network or process call in hooks"; else ok; fi
+
printf "\n%s passed, %s failed\n" "$PASS" "$FAIL"
[[ $FAIL -eq 0 ]] || exit 1
diff --git a/plugins/ruflo-ddd/tests/mod.test.ts b/plugins/ruflo-ddd/tests/mod.test.ts
new file mode 100644
index 0000000000..2145e1e92b
--- /dev/null
+++ b/plugins/ruflo-ddd/tests/mod.test.ts
@@ -0,0 +1,123 @@
+import type { On } from 'claude-code'
+import { describe, expect, test, tier } from 'claude-code/testing'
+
+tier('user')
+
+const ROOT = '/work'
+const START = { surface: 'terminal', isInteractive: true, cwd: ROOT } as const
+const slash = (args: string) => ({ command: 'ddd-mod', args, origin: { kind: 'composer' }, presentation: { isFullscreen: false, columns: 100 } }) as const
+const STATUS = `${ROOT}/.claude-flow/ddd-mod/status.json`
+const SECRET = `ghp_${'a1B2'.repeat(10)}`
+
+/** The world beneath the mod: a project root, a file map, a tool list and a directory map. */
+function world(on: On, tools: readonly string[] = [], dirs: Record<string, { name: string; kind: 'file' | 'dir'; mtimeMs?: number }[]> = {}) {
+ const files = new Map<string, string>()
+ on('session.start', ($, e) => ({ cwd: e.cwd }))
+ on('session.root', () => ({ value: ROOT }))
+ on('command.register', ($, e) => ({ value: { command: e.name } }))
+ on('fs.write', ($, e) => (files.set(e.path, e.text), { value: undefined }))
+ on('fs.list', ($, e) => {
+ const key = Object.keys(dirs).find(k => e.path === k || e.path.endsWith(`/${k}`))
+ const entries = key === undefined ? undefined : dirs[key]
+ if (!entries) throw new Error('ENOENT')
+ return { value: entries.map(x => ({ size: 0, mtimeMs: 0, isLink: false, ...x })) }
+ })
+ on('tool.list', () => ({ value: tools.map(name => ({ name, description: '', mcp: true })) }))
+ on('clock.now', () => ({ value: 1_700_000_000_000 }))
+ return { files }
+}
+
+const call = (input: Record<string, unknown>) => input as never
+const denied = (r: unknown) => JSON.stringify(r)
+
+describe('guard', () => {
+ test('refuses a secret, never echoes it, and counts the block in the status file', async ($, on) => {
+ const w = world(on)
+ on('tool.call', () => ({ result: 'went through' }))
+ await $.session.start(START)
+ const r = await $.tool.call(call(((s: string) => ({ tool: 'mcp__plugin_ruflo-core_ruflo__memory_store', key: 'ddd-context-billing', value: `token ${s}` }))(SECRET))).then(
+ x => x,
+ (e: unknown) => ({ text: String(e) }),
+ )
+ expect(denied(r)).toContain('ruflo-')
+ expect(denied(r)).not.toContain('went through')
+ expect(denied(r)).not.toContain('ghp_')
+ expect(JSON.parse(w.files.get(STATUS) ?? '{}')).toMatchObject({ version: 1, guard: true, blocked: 1 })
+ })
+
+ test('passes clean input and tools the plugin does not own', async ($, on) => {
+ world(on)
+ on('tool.call', () => ({ result: 'went through' }))
+ await $.session.start(START)
+ expect(denied(await $.tool.call(call({ tool: 'mcp__plugin_ruflo-core_ruflo__memory_store', key: 'ddd-context-billing', value: 'Created bounded context' })))).toContain('went through')
+ expect(denied(await $.tool.call(call({ tool: 'Read', file_path: `/tmp/${SECRET}` })))).toContain('went through')
+ })
+
+ test('guard: off lets the call through', { options: { guard: 'off' } }, async ($, on) => {
+ world(on)
+ on('tool.call', () => ({ result: 'went through' }))
+ await $.session.start(START)
+ expect(denied(await $.tool.call(call(((s: string) => ({ tool: 'mcp__plugin_ruflo-core_ruflo__memory_store', key: 'ddd-context-billing', value: `token ${s}` }))(SECRET))))).toContain('went through')
+ })
+})
+
+describe('guard scope', () => {
+ test('a memory write outside the domain model is not this guard\'s business', async ($, on) => {
+ world(on)
+ on('tool.call', () => ({ result: 'went through' }))
+ await $.session.start(START)
+ expect(denied(await $.tool.call(call({ tool: 'mcp__plugin_ruflo-core_ruflo__memory_store', key: 'other-note', value: `token ${SECRET}` })))).toContain('went through')
+ })
+
+ test('a hierarchy edge between context: and aggregate: nodes is screened', async ($, on) => {
+ world(on)
+ on('tool.call', () => ({ result: 'went through' }))
+ await $.session.start(START)
+ const r = await $.tool.call(call({ tool: 'mcp__plugin_ruflo-core_ruflo__agentdb_hierarchical-store', parent: 'context:billing', child: `aggregate:${SECRET}`, relation: 'contains' })).then(
+ x => x,
+ (e: unknown) => ({ text: String(e) }),
+ )
+ expect(denied(r)).not.toContain('went through')
+ expect(denied(r)).not.toContain('ghp_')
+ })
+})
+
+describe('status file', () => {
+ test('is written at session start with the defaults', async ($, on) => {
+ const w = world(on)
+ await $.session.start(START)
+ expect(JSON.parse(w.files.get(STATUS) ?? '{}')).toEqual({ version: 1, updatedMs: 1_700_000_000_000, guard: true, blocked: 0 })
+ })
+})
+
+describe('/ddd-mod', () => {
+ test('status and scan answer locally, and help is the fallback', async ($, on) => {
+ world(on)
+ await $.session.start(START)
+ expect((await $.command.run(slash('status'))).text).toBe('guard on · calls blocked 0')
+ expect((await $.command.run(slash(`scan key ${SECRET}`))).text).toContain('github token')
+ expect((await $.command.run(slash(`scan key ${SECRET}`))).text).not.toContain('ghp_')
+ expect((await $.command.run(slash('scan plain words'))).text).toContain('Nothing found')
+ expect((await $.command.run(slash(''))).text).toContain('/ddd-mod scan <text>')
+ expect((await $.command.run(slash('what is this'))).text).toContain('Unknown: what')
+ })
+
+ test('contexts lists folders that hold a domain/ layer', async ($, on) => {
+ world(on, [], {
+ src: [{ name: 'billing', kind: 'dir' }, { name: 'shared', kind: 'dir' }, { name: 'index.ts', kind: 'file' }],
+ 'src/billing': [{ name: 'domain', kind: 'dir' }, { name: 'application', kind: 'dir' }],
+ 'src/shared': [{ name: 'util.ts', kind: 'file' }],
+ })
+ await $.session.start(START)
+ const text = (await $.command.run(slash('contexts'))).text ?? ''
+ expect(text).toContain('1 bounded context')
+ expect(text).toContain('src/billing')
+ expect(text).not.toContain('src/shared')
+ })
+
+ test('contexts says plainly when there is no src/', async ($, on) => {
+ world(on)
+ await $.session.start(START)
+ expect((await $.command.run(slash('contexts'))).text).toContain('No bounded context found')
+ })
+})
diff --git a/plugins/ruflo-ddd/tsconfig.json b/plugins/ruflo-ddd/tsconfig.json
new file mode 100644
index 0000000000..e4ba54993e
--- /dev/null
+++ b/plugins/ruflo-ddd/tsconfig.json
@@ -0,0 +1,19 @@
+{
+ "//": "Self-contained on purpose: bundlers (vite/esbuild in the root CI vitest) load this file for every module they transform, so it must not extend a file that only exists after Claude Code (>= 2.1.287) has loaded the plugin. Claude Code writes its declarations to .claude-plugin/types/ (gitignored) on load or validate; tsc -p . then reads them through typeRoots.",
+ "compilerOptions": {
+ "target": "es2023",
+ "lib": ["es2023"],
+ "module": "esnext",
+ "moduleResolution": "bundler",
+ "strict": true,
+ "noUncheckedIndexedAccess": true,
+ "noEmit": true,
+ "skipLibCheck": true,
+ "jsx": "react",
+ "jsxFactory": "h",
+ "jsxFragmentFactory": "Fragment",
+ "typeRoots": ["./.claude-plugin/types"],
+ "types": ["claude-code", "claude-code-tools", "claude-code-mcp"]
+ },
+ "include": ["hooks", "tests"]
+}