JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.
Python
fix(jiuwenswarm): Adapt commands and workspace init for jiuwenswarm
ray_leafd5ec5ff8ad
diff --git a/docker/Dockerfile.claw b/docker/Dockerfile.clawindex 540c1abfc6..4d94c78d7b 100644--- a/docker/Dockerfile.claw+++ b/docker/Dockerfile.claw@@ -23,4 +23,4 @@ RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -e ".[all]" --no-cac# Start claw appEXPOSE 5173-CMD ["jiuwenclaw-start"]+CMD ["jiuwenswarm-start"]diff --git a/jiuwenbox/src/jiuwenbox/supervisor/bwrap.py b/jiuwenbox/src/jiuwenbox/supervisor/bwrap.pyindex b02785a981..ffd270fb3d 100644--- a/jiuwenbox/src/jiuwenbox/supervisor/bwrap.py+++ b/jiuwenbox/src/jiuwenbox/supervisor/bwrap.py@@ -216,7 +216,7 @@ class BwrapConfig:rw_binds = [(src, dst) for src, dst in self.rw_binds if dst != "/"]if root_rw_binds:# A read-write root bind already exposes every absolute child path.- # Re-binding private children such as /home/<user>/.jiuwenclaw can+ # Re-binding private children such as /home/<user>/.jiuwenswarm can# fail because bwrap may open sources after entering userns.# Keep synthetic binds whose source differs from the sandbox path,# such as the Landlock launcher mounted into /run.diff --git a/jiuwenclaw/agents/harness/common/auto_harness/service.py b/jiuwenclaw/agents/harness/common/auto_harness/service.pyindex 38cf205dd3..0d75cda207 100644--- a/jiuwenclaw/agents/harness/common/auto_harness/service.py+++ b/jiuwenclaw/agents/harness/common/auto_harness/service.py@@ -511,14 +511,14 @@ class AutoHarnessService:config.local_repo = str(resolved_local_repo)# agent-core still uses config.workspace to scope DeepAgent file tools.# Keep it pinned to the repo checkout so assess/plan do not fall back- # to JiuwenClaw's user workspace (~/.jiuwenclaw).+ # to JiuwenSwarm's user workspace (~/.jiuwenswarm).config.workspace = str(resolved_local_repo)config.repo_url = repo_urlconfig.experience_dir = str(self.experience_dir)config.pipeline_preference = pipeline_preference if pipeline_preference else EXTENDED_EVOLVE_PIPELINEconfig.optimization_goal = str(optimization_goal or "")- # Set model from JiuwenClaw+ # Set model from JiuwenSwarmif model is not None:config.model = modelelse:diff --git a/jiuwenclaw/agents/harness/common/auto_harness/task_store.py b/jiuwenclaw/agents/harness/common/auto_harness/task_store.pyindex 4477dfced1..d23d798f5c 100644--- a/jiuwenclaw/agents/harness/common/auto_harness/task_store.py+++ b/jiuwenclaw/agents/harness/common/auto_harness/task_store.py@@ -18,7 +18,7 @@ class TaskStore:"""Manages scheduled task metadata and execution logs.Storage layout:- ~/.jiuwenclaw/auto-harness/+ ~/.jiuwenswarm/auto-harness/├── scheduled-tasks.json # Task index└── runs/└── sch_abc123/diff --git a/jiuwenclaw/agents/harness/common/memory/external_memory_builder.py b/jiuwenclaw/agents/harness/common/memory/external_memory_builder.pyindex d9d9a04626..2dab813f05 100644--- a/jiuwenclaw/agents/harness/common/memory/external_memory_builder.py+++ b/jiuwenclaw/agents/harness/common/memory/external_memory_builder.py@@ -6,7 +6,7 @@ Dispatches on `memory.external.provider`:- openjiuwen -> OpenJiuwenMemoryProvider (builds its own KV/Vector/DB from config)- mem0 -> Mem0MemoryProvider- openviking -> OpenVikingMemoryProvider- - <plugin> -> user-installed plugin from ~/.jiuwenclaw/plugins/memory/+ - <plugin> -> user-installed plugin from ~/.jiuwenswarm/plugins/memory/- "" -> disabled (returns None)Any failure returns None — the main flow is never blocked.@@ -91,8 +91,8 @@ def _build_mem0_provider(ext_cfg: Dict[str, Any]):mem0_cfg = ext_cfg.get("mem0") or {}api_key = mem0_cfg.get("api_key") or os.environ.get("MEM0_API_KEY", "")- user_id = mem0_cfg.get("user_id") or os.environ.get("MEM0_USER_ID", "jiuwenclaw-user")- agent_id = mem0_cfg.get("agent_id") or os.environ.get("MEM0_AGENT_ID", "jiuwenclaw")+ user_id = mem0_cfg.get("user_id") or os.environ.get("MEM0_USER_ID", "jiuwenswarm-user")+ agent_id = mem0_cfg.get("agent_id") or os.environ.get("MEM0_AGENT_ID", "jiuwenswarm")rerank = bool(mem0_cfg.get("rerank", True))provider = Mem0MemoryProvider(diff --git a/jiuwenclaw/agents/harness/common/memory/external_memory_config.py b/jiuwenclaw/agents/harness/common/memory/external_memory_config.pyindex 8d3f1a528b..eadc7a61af 100644--- a/jiuwenclaw/agents/harness/common/memory/external_memory_config.py+++ b/jiuwenclaw/agents/harness/common/memory/external_memory_config.py@@ -3,7 +3,7 @@"""External memory configuration helpers.Reads `memory.external` from config.yaml. For provider=openjiuwen, also-maps the jiuwenclaw-shaped config (`memory.external.stores` + top-level+maps the jiuwenswarm-shaped config (`memory.external.stores` + top-level`embed`) into the config dict that OpenJiuwenMemoryProvider expects.Concrete Store / Embedding instances are built inside the provider — nothere.diff --git a/jiuwenclaw/agents/harness/common/plugins/rail_manager.py b/jiuwenclaw/agents/harness/common/plugins/rail_manager.pyindex 2c1ae32d88..f754297800 100644--- a/jiuwenclaw/agents/harness/common/plugins/rail_manager.py+++ b/jiuwenclaw/agents/harness/common/plugins/rail_manager.py@@ -464,7 +464,7 @@ class RailManager:try:module: Anyif (folder_path / "__init__.py").exists():- package_name = f"jiuwenclaw_rail_extension_{name}"+ package_name = f"jiuwenswarm_rail_extension_{name}"package_spec = importlib.util.spec_from_file_location(package_name,folder_path / "__init__.py",diff --git a/jiuwenclaw/agents/harness/common/prompt/prompt_builder.py b/jiuwenclaw/agents/harness/common/prompt/prompt_builder.pyindex 85e02ffc74..bff450debf 100644--- a/jiuwenclaw/agents/harness/common/prompt/prompt_builder.py+++ b/jiuwenclaw/agents/harness/common/prompt/prompt_builder.py@@ -734,7 +734,7 @@ def _identity_prompt(language: str) -> PromptSection:# 你的家-你的一切从 `.jiuwenclaw` 目录开始。+你的一切从 `.jiuwenswarm` 目录开始。| 路径 | 用途 | 操作建议 ||------|------|----------|@@ -794,7 +794,7 @@ You are a personal agent created by JiuwenSwarm. Interact with your user like a# Your Home-Everything starts from the `.jiuwenclaw` directory.+Everything starts from the `.jiuwenswarm` directory.| Path | Purpose | Guidelines ||------|---------|------------|diff --git a/jiuwenclaw/agents/harness/common/rails/permissions/__init__.py b/jiuwenclaw/agents/harness/common/rails/permissions/__init__.pyindex 81286dd780..1a789381dd 100644--- a/jiuwenclaw/agents/harness/common/rails/permissions/__init__.py+++ b/jiuwenclaw/agents/harness/common/rails/permissions/__init__.py@@ -1,6 +1,6 @@"""Security and permission integration for AgentServer.-This package hosts jiuwenclaw-side glue code for openjiuwen security rails,+This package hosts jiuwenswarm-side glue code for openjiuwen security rails,owner-scoped policies, and persistence helpers."""diff --git a/jiuwenclaw/agents/harness/common/tools/web_file_download.py b/jiuwenclaw/agents/harness/common/tools/web_file_download.pyindex 62be5c4bf0..67c87e1df8 100644--- a/jiuwenclaw/agents/harness/common/tools/web_file_download.py+++ b/jiuwenclaw/agents/harness/common/tools/web_file_download.py@@ -35,7 +35,7 @@ def _get_secret_file_path() -> Path:workspace = os.getenv("JIUWENCLAW_WORKSPACE")if workspace:return Path(workspace) / "config" / _SECRET_FILE_NAME- return Path.home() / ".jiuwenclaw" / "config" / _SECRET_FILE_NAME+ return Path.home() / ".jiuwenswarm" / "config" / _SECRET_FILE_NAMEdef _load_or_create_secret() -> str:diff --git a/jiuwenclaw/app.py b/jiuwenclaw/app.pyindex e2b575f5e1..52628fb84d 100644--- a/jiuwenclaw/app.py+++ b/jiuwenclaw/app.py@@ -17,7 +17,7 @@ from dotenv import load_dotenv# --- Early --dotenv parsing (before jiuwenclaw imports) ---from jiuwenclaw.dotenv_early import parse_dotenv_early, get_parsed_dotenv-parse_dotenv_early("jiuwenclaw-app")+parse_dotenv_early("jiuwenswarm-app")# --- Now safe to import jiuwenclaw modules ---from jiuwenclaw.common.utils import (@@ -34,8 +34,8 @@ _parsed_dotenv_path = get_parsed_dotenv()_workspace_dir = get_user_workspace_dir()_config_file = _workspace_dir / "config" / "config.yaml"-_new_workspace = _workspace_dir / "agent" / "jiuwenclaw_workspace"-_old_workspace = _workspace_dir / "agent" / "workspace"+_new_workspace = _workspace_dir / "agent" / "workspace"+_old_workspace = _workspace_dir / "agent" / "jiuwenclaw_workspace"# 始终清理 Team 旧版本遗留文件(幂等操作,在 prepare_workspace 之前执行)cleanup_team_files(_workspace_dir)@@ -52,7 +52,7 @@ def main() -> None:import argparseparser = argparse.ArgumentParser(- prog="jiuwenclaw-app",+ prog="jiuwenswarm-app",description="Start JiuWenClaw AgentServer + Gateway (split layout, one command).",)parser.add_argument(diff --git a/jiuwenclaw/channels/acp/app_acp.py b/jiuwenclaw/channels/acp/app_acp.pyindex f4ef2b5ab1..0fe117f2d0 100644--- a/jiuwenclaw/channels/acp/app_acp.py+++ b/jiuwenclaw/channels/acp/app_acp.py@@ -15,7 +15,7 @@ import uuid# --- Early --dotenv parsing (before jiuwenclaw imports) ---from jiuwenclaw.dotenv_early import parse_dotenv_early, get_parsed_dotenv-parse_dotenv_early("jiuwenclaw-tui")+parse_dotenv_early("jiuwenswarm-tui")# --- Now safe to import jiuwenclaw modules ---from jiuwenclaw.common.e2a.adapters import (@@ -38,8 +38,8 @@ def write_json_stdout(payload: dict) -> None:def _build_parser() -> argparse.ArgumentParser:parser = argparse.ArgumentParser(- prog="jiuwenclaw-tui",- description="JiuwenClaw CLI 入口(子命令分发)。",+ prog="jiuwenswarm-tui",+ description="JiuwenSwarm CLI 入口(子命令分发)。",)subparsers = parser.add_subparsers(dest="command")diff --git a/jiuwenclaw/channels/tui/frontend/package-lock.json b/jiuwenclaw/channels/tui/frontend/package-lock.jsonindex 2dca7388e9..a19330a571 100644--- a/jiuwenclaw/channels/tui/frontend/package-lock.json+++ b/jiuwenclaw/channels/tui/frontend/package-lock.json@@ -1,11 +1,11 @@{- "name": "jiuwenclaw-tui",+ "name": "jiuwenswarm-tui","version": "0.1.0","lockfileVersion": 3,"requires": true,"packages": {"": {- "name": "jiuwenclaw-tui",+ "name": "jiuwenswarm-tui","version": "0.1.0","dependencies": {"@mariozechner/pi-tui": "^0.65.2",@@ -13,7 +13,7 @@"ws": "^8.18.0"},"bin": {- "jiuwenclaw-tui": "dist/index.js"+ "jiuwenswarm-tui": "dist/index.js"},"devDependencies": {"@types/node": "^22.0.0",diff --git a/jiuwenclaw/channels/tui/frontend/package.json b/jiuwenclaw/channels/tui/frontend/package.jsonindex d499496f35..eb9738ecb2 100644--- a/jiuwenclaw/channels/tui/frontend/package.json+++ b/jiuwenclaw/channels/tui/frontend/package.json@@ -1,9 +1,9 @@{- "name": "jiuwenclaw-tui",+ "name": "jiuwenswarm-tui","version": "0.1.0","description": "Terminal CLI for JiuwenClaw","bin": {- "jiuwenclaw-tui": "dist/index.js"+ "jiuwenswarm-tui": "dist/index.js"},"type": "module","scripts": {diff --git a/jiuwenclaw/channels/tui/frontend/src/app-state.ts b/jiuwenclaw/channels/tui/frontend/src/app-state.tsindex e7ef335d2d..70a2c07678 100644--- a/jiuwenclaw/channels/tui/frontend/src/app-state.ts+++ b/jiuwenclaw/channels/tui/frontend/src/app-state.ts@@ -1426,7 +1426,7 @@ readonly request = async <T = Record<string, unknown>>(// 1. Replace $(cat) (no args) with $(cat "filepath") for inline commands// 2. Export JIUWENCLAW_SL_FILE so script files can use it too:// input=$(cat "$JIUWENCLAW_SL_FILE")- const tmpFile = join(tmpdir(), "jiuwenclaw-sl.json");+ const tmpFile = join(tmpdir(), "jiuwenswarm-sl.json");writeFileSync(tmpFile, jsonInput, "utf8");const msysPath = tmpFile.split(sep).join("/").replace(/^([A-Za-z]):/, (_, d) => "/" + d.toLowerCase());const patchedCmd = cmd.replace(/\$\(cat\)/g, `$(cat "${msysPath}")`);diff --git a/jiuwenclaw/channels/tui/frontend/src/core/commands/builtins/workspace-dir.ts b/jiuwenclaw/channels/tui/frontend/src/core/commands/builtins/workspace-dir.tsindex 0e47948420..73a0013738 100644--- a/jiuwenclaw/channels/tui/frontend/src/core/commands/builtins/workspace-dir.ts+++ b/jiuwenclaw/channels/tui/frontend/src/core/commands/builtins/workspace-dir.ts@@ -9,7 +9,7 @@ function showAllTrustedPaths(ctx: CommandContext): void {// Show system default workspace (fixed)items.push({label: "workspace (system)",- value: "~/.jiuwenclaw/agent/jiuwenclaw_workspace",+ value: "~/.jiuwenswarm/agent/workspace",});// Show trusted directoriesdiff --git a/jiuwenclaw/channels/tui/frontend/src/core/tui-config-store.ts b/jiuwenclaw/channels/tui/frontend/src/core/tui-config-store.tsindex 8aeb3d5898..8d87af5a2e 100644--- a/jiuwenclaw/channels/tui/frontend/src/core/tui-config-store.ts+++ b/jiuwenclaw/channels/tui/frontend/src/core/tui-config-store.ts@@ -4,7 +4,7 @@ import { join } from "node:path";import type { AccentColorName, ThemeName } from "../ui/theme.js";-const CONFIG_DIR = join(homedir(), ".jiuwenclaw-tui");+const CONFIG_DIR = join(homedir(), ".jiuwenswarm-tui");const CONFIG_FILE = join(CONFIG_DIR, "config.json");export interface StatusLineSetting {diff --git a/jiuwenclaw/channels/tui/frontend/src/core/tui-trusted-dirs-store.ts b/jiuwenclaw/channels/tui/frontend/src/core/tui-trusted-dirs-store.tsindex 7ecc4ed0c5..fbf4aada70 100644--- a/jiuwenclaw/channels/tui/frontend/src/core/tui-trusted-dirs-store.ts+++ b/jiuwenclaw/channels/tui/frontend/src/core/tui-trusted-dirs-store.ts@@ -5,7 +5,7 @@ import { resolve } from "node:path";import { loadTuiConfig, saveTuiConfig } from "./tui-config-store.js";/**- * Trusted directories storage with persistence via ~/.jiuwenclaw-tui/config.json.+ * Trusted directories storage with persistence via ~/.jiuwenswarm-tui/config.json.* Managed at CLI startup and via /workspace commands.*/let _trustedDirs: string[] | null = null;@@ -213,5 +213,5 @@ export function isTrustedDir(path: string): boolean {* Get the default workspace path.*/export function getDefaultWorkspacePath(): string {- return resolve(homedir(), ".jiuwenclaw/agent/jiuwenclaw_workspace");+ return resolve(homedir(), ".jiuwenswarm/agent/workspace");}diff --git a/jiuwenclaw/channels/tui/frontend/src/index.ts b/jiuwenclaw/channels/tui/frontend/src/index.tsindex 589a0d51cf..5ef7477882 100644--- a/jiuwenclaw/channels/tui/frontend/src/index.ts+++ b/jiuwenclaw/channels/tui/frontend/src/index.ts@@ -19,7 +19,7 @@ const { values } = parseArgs({});if (values.help) {- console.log(`jiuwenclaw-tui - Terminal CLI for JiuwenClaw+ console.log(`jiuwenswarm-tui - Terminal CLI for JiuwenSwarmOptions:--url <url> Gateway CLI WebSocket URL (default: ws://127.0.0.1:19001/tui)@@ -31,7 +31,7 @@ Options:}if (!process.stdin.isTTY || !process.stdout.isTTY) {- console.error("jiuwenclaw-tui requires an interactive TTY");+ console.error("jiuwenswarm-tui requires an interactive TTY");process.exit(1);}diff --git a/jiuwenclaw/channels/tui/frontend/src/ui/app-screen.ts b/jiuwenclaw/channels/tui/frontend/src/ui/app-screen.tsindex 95d5e04c45..fb3b7e79c9 100644--- a/jiuwenclaw/channels/tui/frontend/src/ui/app-screen.ts+++ b/jiuwenclaw/channels/tui/frontend/src/ui/app-screen.ts@@ -563,7 +563,7 @@ export class AppScreen implements Component, Focusable {{label: "No, use default workspace",value: "no",- description: "Only ~/.jiuwenclaw/agent/jiuwenclaw_workspace will be accessible",+ description: "Only ~/.jiuwenswarm/agent/workspace will be accessible",},];this.startupPromptList = new SelectList(items, 2, selectListTheme, {diff --git a/jiuwenclaw/channels/tui/frontend/src/ui/components/messages/meta-components.ts b/jiuwenclaw/channels/tui/frontend/src/ui/components/messages/meta-components.tsindex 86a795e4f6..90fac3a7b1 100644--- a/jiuwenclaw/channels/tui/frontend/src/ui/components/messages/meta-components.ts+++ b/jiuwenclaw/channels/tui/frontend/src/ui/components/messages/meta-components.ts@@ -13,7 +13,7 @@ function renderGroupedHelpView(const innerWidth = Math.max(1, width);const version = meta?.version || "";- const versionText = version ? `jiuwenclaw CLI v${version}` : "jiuwenclaw CLI";+ const versionText = version ? `jiuwenswarm CLI v${version}` : "jiuwenswarm CLI";lines.push(...renderWrappedText(innerWidth, `· ${versionText} — ${meta?.title ?? "Slash Commands"}`, palette.text.info));lines.push("");diff --git a/jiuwenclaw/channels/tui/frontend/src/ui/welcome.ts b/jiuwenclaw/channels/tui/frontend/src/ui/welcome.tsindex 3f87c1d4b5..b8762ed53c 100644--- a/jiuwenclaw/channels/tui/frontend/src/ui/welcome.ts+++ b/jiuwenclaw/channels/tui/frontend/src/ui/welcome.ts@@ -50,7 +50,7 @@ function connectionHint(status: ConnectionStatus): string | null {case "reconnecting":return "Backend unavailable · retrying connection";case "idle":- return "Backend unavailable · start jiuwenclaw-gateway or check --url";+ return "Backend unavailable · start jiuwenswarm-gateway or check --url";case "auth_failed":return "Authentication failed · check --token";case "connected":diff --git a/jiuwenclaw/channels/web/app_web.py b/jiuwenclaw/channels/web/app_web.pyindex 75fc2f0fdb..1e1512f595 100644--- a/jiuwenclaw/channels/web/app_web.py+++ b/jiuwenclaw/channels/web/app_web.py@@ -25,7 +25,7 @@ from urllib.parse import quote, unquote, urlparse# --- Early --dotenv parsing (before jiuwenclaw imports) ---from jiuwenclaw.dotenv_early import parse_dotenv_early-parse_dotenv_early("jiuwenclaw-web")+parse_dotenv_early("jiuwenswarm-web")# --- Now safe to import jiuwenclaw modules ---from jiuwenclaw.agents.harness.common.tools.ssl_config import get_insecure_ssl_context, get_ssl_verify@@ -80,9 +80,9 @@ def _normalize_lang_suffix(name: str) -> str:def _generate_agent_data(project_root: Path) -> None:- """Generate agent/jiuwenclaw_workspace/agent-data.json from agent tree."""+ """Generate agent/workspace/agent-data.json from agent tree."""agent_root = (project_root / "agent").resolve()- workspace_root = (agent_root / "jiuwenclaw_workspace").resolve()+ workspace_root = (agent_root / "workspace").resolve()output_path = (workspace_root / "agent-data.json").resolve()root_folder_key = "__root__"@@ -605,7 +605,7 @@ class _SpaStaticHandler(SimpleHTTPRequestHandler):self._write_json(403, {"error": "forbidden_path"})returnif not full_path.exists():- if file_arg.replace("\\", "/") == "agent/jiuwenclaw_workspace/agent-data.json":+ if file_arg.replace("\\", "/") == "agent/workspace/agent-data.json":try:_generate_agent_data(self.project_root)except Exception as exc: # noqa: BLE001@@ -765,7 +765,7 @@ class _SpaStaticHandler(SimpleHTTPRequestHandler):type(self).ws_disable_compress = ws_disable_compressself.logger.info(- "[jiuwenclaw-web] ws disable compress updated: %s",+ "[jiuwenswarm-web] ws disable compress updated: %s",ws_disable_compress,)self._write_json(200, {"ok": True, "wsDisableCompress": ws_disable_compress})@@ -956,7 +956,7 @@ def main() -> None:except ValueError as exc:raise SystemExit(str(exc)) from exc- # default_project_root should be the user workspace root (~/.jiuwenclaw in package mode)+ # default_project_root should be the user workspace root (~/.jiuwenswarm in package mode)# get_root_dir() already handles this correctlydefault_project_root = get_user_workspace_dir()@@ -980,19 +980,19 @@ def main() -> None:handler = partial(_ConfiguredHandler, directory=str(dist_dir))server = ThreadingHTTPServer((args.host, args.port), handler)- logger.info("[jiuwenclaw-web] serving %s", dist_dir)- logger.info("[jiuwenclaw-web] http://%s:%s", args.host, args.port)- logger.info("[jiuwenclaw-web] /api -> %s", api_target)- logger.info("[jiuwenclaw-web] /ws -> %s", ws_target)- logger.info("[jiuwenclaw-web] ws disable compress: %s", args.ws_disable_compress)- logger.info("[jiuwenclaw-web] /file-api roots -> %s, %s, %s", workspace_root, agent_teams_root, logs_root)+ logger.info("[jiuwenswarm-web] serving %s", dist_dir)+ logger.info("[jiuwenswarm-web] http://%s:%s", args.host, args.port)+ logger.info("[jiuwenswarm-web] /api -> %s", api_target)+ logger.info("[jiuwenswarm-web] /ws -> %s", ws_target)+ logger.info("[jiuwenswarm-web] ws disable compress: %s", args.ws_disable_compress)+ logger.info("[jiuwenswarm-web] /file-api roots -> %s, %s, %s", workspace_root, agent_teams_root, logs_root)try:server.serve_forever()except KeyboardInterrupt:passfinally:server.server_close()- logger.info("[jiuwenclaw-web] server closed")+ logger.info("[jiuwenswarm-web] server closed")if __name__ == "__main__":diff --git a/jiuwenclaw/channels/web/frontend/src/components/AgentPanel/index.tsx b/jiuwenclaw/channels/web/frontend/src/components/AgentPanel/index.tsxindex bcf4bdf47a..42377a771a 100644--- a/jiuwenclaw/channels/web/frontend/src/components/AgentPanel/index.tsx+++ b/jiuwenclaw/channels/web/frontend/src/components/AgentPanel/index.tsx@@ -48,8 +48,8 @@ const getFolderDisplayName = (folderKey: string, t: (key: string) => string) =>const isSkillFolder = (folderKey: string) =>folderKey === 'skills' ||folderKey.startsWith('skills/') ||- folderKey === 'jiuwenclaw_workspace/skills' ||- folderKey.startsWith('jiuwenclaw_workspace/skills/');+ folderKey === 'workspace/skills' ||+ folderKey.startsWith('workspace/skills/');const normalizeFolderKey = (folderKey: string) => (folderKey ? folderKey : ROOT_FOLDER_KEY);@@ -195,7 +195,7 @@ export function AgentPanel({ sessionId: _sessionId }: AgentPanelProps) {}}- const res = await fetch('/file-api/file-content?path=agent/jiuwenclaw_workspace/agent-data.json');+ const res = await fetch('/file-api/file-content?path=agent/workspace/agent-data.json');if (!res.ok) {throw new Error('FETCH_FAILED');}diff --git a/jiuwenclaw/channels/web/frontend/src/components/SessionsPanel/index.tsx b/jiuwenclaw/channels/web/frontend/src/components/SessionsPanel/index.tsxindex 24d6be88c0..a863eafca5 100644--- a/jiuwenclaw/channels/web/frontend/src/components/SessionsPanel/index.tsx+++ b/jiuwenclaw/channels/web/frontend/src/components/SessionsPanel/index.tsx@@ -297,7 +297,7 @@ export function SessionsPanel({const rows = await fetchDirEntries(rootDir, 0);// Check for todo.json in DeepAgent workspace todo directory- const todoPath = `agent/jiuwenclaw_workspace/todo/${sessionId}/todo.json`;+ const todoPath = `agent/workspace/todo/${sessionId}/todo.json`;try {const todoResp = await fetch(`/file-api/file-content?path=${encodeURIComponent(todoPath)}`, { cache: 'no-store' });if (todoResp.ok) {diff --git a/jiuwenclaw/channels/web/frontend/src/i18n/locales/en.json b/jiuwenclaw/channels/web/frontend/src/i18n/locales/en.jsonindex 0fd7a82000..832df4fbed 100644--- a/jiuwenclaw/channels/web/frontend/src/i18n/locales/en.json+++ b/jiuwenclaw/channels/web/frontend/src/i18n/locales/en.json@@ -1017,7 +1017,7 @@"markdownOnly": "Only Markdown/JSON (.md/.mdx/.json) preview is supported","errors": {"refreshFailed": "Refresh failed: unable to rebuild the agent file index. Check the generator script logs.",- "loadFailed": "Unable to read the agent file list. Check whether agent/jiuwenclaw_workspace/agent-data.json has been generated."+ "loadFailed": "Unable to read the agent file list. Check whether agent/workspace/agent-data.json has been generated."}},"fileViewer": {@@ -1201,7 +1201,7 @@"helpTitle": "Usage Guide","help0": "Extension folder must contain rail.py as the entry file","help1": "Rail extension files must inherit from DeepAgentRail or AgentRail base class",- "help2": "Extension files are saved to ~/.jiuwenclaw/agent/jiuwenclaw_workspace/extensions/ directory"+ "help2": "Extension files are saved to ~/.jiuwenswarm/agent/workspace/extensions/ directory"},"ownerScopes": {"title": "Avatar Permission",diff --git a/jiuwenclaw/channels/web/frontend/src/i18n/locales/zh.json b/jiuwenclaw/channels/web/frontend/src/i18n/locales/zh.jsonindex e49fa83e22..4b7be683fb 100644--- a/jiuwenclaw/channels/web/frontend/src/i18n/locales/zh.json+++ b/jiuwenclaw/channels/web/frontend/src/i18n/locales/zh.json@@ -1017,7 +1017,7 @@"markdownOnly": "仅支持 Markdown/JSON(.md/.mdx/.json)预览","errors": {"refreshFailed": "刷新失败:无法重建 agent 文件索引,请检查生成脚本日志。",- "loadFailed": "无法读取 agent 文件列表,请检查 agent/jiuwenclaw_workspace/agent-data.json 是否已生成。"+ "loadFailed": "无法读取 agent 文件列表,请检查 agent/workspace/agent-data.json 是否已生成。"}},"fileViewer": {@@ -1201,7 +1201,7 @@"helpTitle": "使用说明","help0": "扩展文件夹必须包含 rail.py 作为入口文件","help1": "Rail 扩展文件必须继承 DeepAgentRail 或 AgentRail 基类",- "help2": "扩展文件会被保存到 ~/.jiuwenclaw/agent/jiuwenclaw_workspace/extensions/ 目录"+ "help2": "扩展文件会被保存到 ~/.jiuwenswarm/agent/workspace/extensions/ 目录"},"ownerScopes": {"title": "分身权限配置",diff --git a/jiuwenclaw/channels/web/frontend/vite.config.ts b/jiuwenclaw/channels/web/frontend/vite.config.tsindex ffa8b0c9ec..2c9342ea29 100644--- a/jiuwenclaw/channels/web/frontend/vite.config.ts+++ b/jiuwenclaw/channels/web/frontend/vite.config.ts@@ -13,7 +13,7 @@ interface ErrorWithCode {/*** file-api 使用的项目根目录,需与后端 get_root_dir() 一致,前端编辑的 HEARTBEAT.md 才会被心跳读到。- * 优先级:环境变量 > 已存在的用户工作区 ~/.jiuwenclaw > 仓库根。+ * 优先级:环境变量 > 已存在的用户工作区 ~/.jiuwenswarm > 仓库根。*/function resolveProjectRootDir(): string {const envRoot = process.env.JIUWENCLAW_ROOT || process.env.JIUWENCLAW_PROJECT_ROOT@@ -25,18 +25,18 @@ function resolveProjectRootDir(): string {const home = process.env.USERPROFILE || process.env.HOME || ''if (home) {// 优先检查多实例环境变量- const envWorkspace = process.env.JIUWENCLAW_DATA_DIR+ const envWorkspace = process.env.JIUWENSWARM_DATA_DIRif (envWorkspace) {- console.log('[file-api] 使用 JIUWENCLAW_DATA_DIR:', path.resolve(envWorkspace))+ console.log('[file-api] 使用 JIUWENSWARM_DATA_DIR:', path.resolve(envWorkspace))return path.resolve(envWorkspace)}- const userWorkspace = path.join(home, '.jiuwenclaw')+ const userWorkspace = path.join(home, '.jiuwenswarm')if (fs.existsSync(userWorkspace)) {console.log('[file-api] 使用用户工作区:', path.resolve(userWorkspace))return path.resolve(userWorkspace)}}- const repoRoot = path.resolve(__dirname, '../..')+ const repoRoot = path.resolve(__dirname, '../../../')console.log('[file-api] 使用仓库根目录:', repoRoot)return repoRoot}@@ -75,7 +75,8 @@ function devWsTrafficLogger(): Plugin {name: 'dev-ws-traffic-logger',configureServer(server) {const projectRootDir = resolveProjectRootDir()- const logDir = path.resolve(projectRootDir, '.logs')+ const agentDir = path.resolve(projectRootDir, 'agent')+ const logDir = path.resolve(agentDir, '.logs')const logFile = path.resolve(logDir, 'ws-dev.log')fs.mkdirSync(logDir, { recursive: true })// 每次前端 dev 服务启动时清空日志,避免历史数据干扰排查。@@ -165,9 +166,9 @@ function devFileContentApi(): Plugin {const projectRootDir = resolveProjectRootDir()const workspaceRootDir = path.resolve(projectRootDir, 'agent')const agentTeamsRootDir = path.resolve(projectRootDir, '.agent_teams')- const webLogsRootDir = path.resolve(projectRootDir, '.logs')+ const webLogsRootDir = path.resolve(workspaceRootDir, '.logs')const autoHarnessDir = path.resolve(projectRootDir, 'auto-harness')- const generateAgentFoldersScriptPath = path.resolve(__dirname, '../scripts/generate-agent-folders.js')+ const generateAgentFoldersScriptPath = path.resolve(__dirname, '../../../scripts/generate-agent-folders.js')// dev 模式默认开启调试视图,与“前端 dev 即调试模式”一致。let wsDisableCompress = trueconst isMarkdownFile = (targetPath: string) => {@@ -389,7 +390,7 @@ function devFileContentApi(): Plugin {return}if (!fs.existsSync(fullPath)) {- if (filePath.replace(/\\/g, '/') === 'agent/jiuwenclaw_workspace/agent-data.json') {+ if (filePath.replace(/\\/g, '/') === 'agent/workspace/agent-data.json') {try {const runResult = spawnSync(process.execPath, [generateAgentFoldersScriptPath], {encoding: 'utf-8',diff --git a/jiuwenclaw/common/updater.py b/jiuwenclaw/common/updater.pyindex 4bd506a432..574c95ba93 100644--- a/jiuwenclaw/common/updater.py+++ b/jiuwenclaw/common/updater.py@@ -20,8 +20,8 @@ from jiuwenclaw.common.version import __version__DEFAULT_RELEASE_API = "https://api.github.com/repos/{owner}/{repo}/releases/latest"-DEFAULT_ASSET_PATTERN = "jiuwenclaw-setup-{version}.exe"-DEFAULT_SHA256_PATTERN = "jiuwenclaw-setup-{version}.exe.sha256"+DEFAULT_ASSET_PATTERN = "jiuwenswarm-setup-{version}.exe"+DEFAULT_SHA256_PATTERN = "jiuwenswarm-setup-{version}.exe.sha256"DEFAULT_TIMEOUT_SECONDS = 20DOWNLOAD_CHUNK_SIZE = 1024 * 512@@ -205,7 +205,7 @@ class WindowsUpdaterService:thread = threading.Thread(target=self._download_worker,daemon=True,- name="jiuwenclaw-updater-download",+ name="jiuwenswarm-updater-download",)self._download_thread = threadthread.start()diff --git a/jiuwenclaw/common/utils.py b/jiuwenclaw/common/utils.pyindex 0ffe61b327..068bb30eb2 100644--- a/jiuwenclaw/common/utils.py+++ b/jiuwenclaw/common/utils.py@@ -1,14 +1,14 @@# Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.-"""Path management for JiuWenClaw.+"""Path management for JiuWenSwarm.-根目录见 ``JIUWENCLAW_DATA_DIR``(默认 ``~/.jiuwenclaw``;可由环境变量 ``JIUWENCLAW_DATA_DIR`` 指定绝对路径)。+根目录见 ``JIUWENSWARM_DATA_DIR``(默认 ``~/.jiuwenswarm``;可由环境变量 ``JIUWENSWARM_DATA_DIR`` 指定绝对路径)。Runtime layout:- <root>/config/config.yaml- <root>/config/.env- <root>/agent/home-- <root>/agent/jiuwenclaw_workspace(DeepAgent 标准工作空间)+- <root>/agent/workspace(DeepAgent 标准工作空间)- memory/- skills/- todo/@@ -20,7 +20,7 @@ Runtime layout:- HEARTBEAT.md- USER.md- <root>/agent/sessions-- <root>/agent/jiuwenclaw_workspace/agent-data.json+- <root>/agent/workspace/agent-data.json- <root>/agent/.checkpoint- <root>/agent/.logs(gateway.log / channel.log / agent_server.log / full.log)@@ -186,7 +186,7 @@ class _CompositeFilter(logging.Filter):def _load_logging_config_from_yaml() -> dict[str, Any]:- """读取 ~/.jiuwenclaw/config/config.yaml 中的 logging 段(无则空)。"""+ """读取 ~/.jiuwenswarm/config/config.yaml 中的 logging 段(无则空)。"""try:cf = get_config_file()if not cf.exists():@@ -277,21 +277,27 @@ def set_user_home(path: Path, initialized: bool = False) -> None:def get_user_workspace_dir() -> Path:- """Get the user workspace directory path (~/.jiuwenclaw or custom path).+ """Get the user workspace directory path (~/.jiuwenswarm or custom path).Priority:1. Cached value (if already set via set_user_workspace_dir or previous call)- 2. JIUWENCLAW_DATA_DIR environment variable (for multi-instance isolation)- 3. get_user_home() / ".jiuwenclaw" (default instance)+ 2. JIUWENSWARM_DATA_DIR environment variable (for multi-instance isolation)+ 3. get_user_home() / ".jiuwenswarm" (default instance)++ Also performs one-time migration from ~/.jiuwenclaw/ to ~/.jiuwenswarm/ if needed."""global _workspace_base_dirif _workspace_base_dir is not None:return _workspace_base_dir- env_workspace = os.getenv("JIUWENCLAW_DATA_DIR")+ env_workspace = os.getenv("JIUWENSWARM_DATA_DIR")if env_workspace:_workspace_base_dir = Path(env_workspace)return _workspace_base_dir- _workspace_base_dir = get_user_home() / ".jiuwenclaw"++ # One-time migration from .jiuwenclaw to .jiuwenswarm+ _migrate_from_jiuwenclaw_root()++ _workspace_base_dir = get_user_home() / ".jiuwenswarm"return _workspace_base_dir@@ -381,20 +387,20 @@ def _resolve_preferred_language(def prompt_preferred_language() -> Optional[Literal["zh", "en"]]:"""交互询问语言偏好。仅接受明确选项;空输入、不在列表或取消用语 → 返回 None(调用方应终止 init)。"""print()- print("[jiuwenclaw-init] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")- print("[jiuwenclaw-init] 请选择默认语言 / Choose your default language")- print("[jiuwenclaw-init] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")- print("[jiuwenclaw-init] [1] 中文(简体)")- print("[jiuwenclaw-init] → config: preferred_language: zh")- print("[jiuwenclaw-init] ────────────────────────────────────────────")- print("[jiuwenclaw-init] [2] English")- print("[jiuwenclaw-init] → config: preferred_language: en")- print("[jiuwenclaw-init] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")- print("[jiuwenclaw-init] 须明确选择:1 / 2 / zh / en(无默认语言)")- print("[jiuwenclaw-init] 取消:no / n / q / cancel / 取消")- print("[jiuwenclaw-init] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")+ print("[jiuwenswarm-init] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")+ print("[jiuwenswarm-init] 请选择默认语言 / Choose your default language")+ print("[jiuwenswarm-init] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")+ print("[jiuwenswarm-init] [1] 中文(简体)")+ print("[jiuwenswarm-init] → config: preferred_language: zh")+ print("[jiuwenswarm-init] ────────────────────────────────────────────")+ print("[jiuwenswarm-init] [2] English")+ print("[jiuwenswarm-init] → config: preferred_language: en")+ print("[jiuwenswarm-init] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")+ print("[jiuwenswarm-init] 须明确选择:1 / 2 / zh / en(无默认语言)")+ print("[jiuwenswarm-init] 取消:no / n / q / cancel / 取消")+ print("[jiuwenswarm-init] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")raw = input(- "[jiuwenclaw-init] 请输入选项 (1, 2, zh, en) 或 no 取消: "+ "[jiuwenswarm-init] 请输入选项 (1, 2, zh, en) 或 no 取消: ").strip().lower()if raw in ("no", "n", "q", "quit", "cancel", "取消"):return None@@ -402,7 +408,7 @@ def prompt_preferred_language() -> Optional[Literal["zh", "en"]]:return "zh"if raw in ("2", "en", "english", "e", "英文"):return "en"- print("[jiuwenclaw-init] 无效选项;未选择有效语言,初始化已取消(与拒绝 yes/no 相同)。")+ print("[jiuwenswarm-init] 无效选项;未选择有效语言,初始化已取消(与拒绝 yes/no 相同)。")return None@@ -414,53 +420,114 @@ def _get_builtin_skill_names() -> set[str]:return {item.name for item in builtin_skills_dir.iterdir() if item.is_dir()}+def _migrate_from_jiuwenclaw_root() -> bool:+ """Migrate from legacy ~/.jiuwenclaw/ to ~/.jiuwenswarm/.++ This is a one-time migration that moves the entire root directory.+ Called at startup before any workspace operations.++ Returns:+ True if migration was performed, False otherwise.+ """+ user_home = get_user_home()+ old_root = user_home / ".jiuwenclaw"+ new_root = user_home / ".jiuwenswarm"++ # No migration needed if old doesn't exist or new already exists+ if not old_root.exists():+ return False+ if new_root.exists():+ # New workspace exists, don't migrate+ print(f"[migration] Both .jiuwenclaw and .jiuwenswarm exist, skipping migration")+ return False++ print(f"[migration] Migrating from {old_root} to {new_root}")++ try:+ shutil.move(str(old_root), str(new_root))+ print(f"[migration] Migration completed: {old_root} -> {new_root}")+ return True+ except OSError as e:+ print(f"[migration] ERROR: Failed to migrate from .jiuwenclaw to .jiuwenswarm: {e}")+ return False+++def _migrate_jiuwenclaw_workspace_to_workspace(workspace_dir: Path) -> None:+ """Migrate from legacy jiuwenclaw_workspace directory name to workspace.++ Migration:+ - Old: ~/.jiuwenswarm/agent/jiuwenclaw_workspace/+ - New: ~/.jiuwenswarm/agent/workspace/++ Args:+ workspace_dir: Path to workspace root (~/.jiuwenswarm).+ """+ old_workspace = workspace_dir / "agent" / "jiuwenclaw_workspace"+ new_workspace = workspace_dir / "agent" / "workspace"++ if not old_workspace.exists():+ return+ if new_workspace.exists():+ # Both exist - merge carefully+ print(f"[migration] Both jiuwenclaw_workspace and workspace exist, merging...")+ for item in old_workspace.iterdir():+ dest = new_workspace / item.name+ if item.is_dir():+ if dest.exists():+ # Merge directories+ shutil.copytree(item, dest, dirs_exist_ok=True)+ else:+ shutil.copytree(item, dest)+ else:+ if not dest.exists():+ shutil.copy2(item, dest)+ # Remove old after successful merge+ shutil.rmtree(old_workspace)+ print(f"[migration] Merged and removed: {old_workspace}")+ else:+ # Simple rename+ shutil.move(str(old_workspace), str(new_workspace))+ print(f"[migration] Renamed: {old_workspace} -> {new_workspace}")++def _migrate_legacy_workspace(workspace_dir: Path,preferred_language: Optional[str] = None,) -> None:"""Migrate from legacy layout to new DeepAgent workspace layout.+ This handles VERY old layouts where skills, memory, and home were+ separate directories outside of the workspace.+Migration:- - Old: ~/.jiuwenclaw/agent/workspace/ (agent-data.json here)- - Old: ~/.jiuwenclaw/agent/home/ (PRINCIPLE.md, TONE.md, HEARTBEAT.md)- - Old: ~/.jiuwenclaw/agent/skills/- - Old: ~/.jiuwenclaw/agent/memory/+ - Old: ~/.jiuwenswarm/agent/home/ (PRINCIPLE.md, TONE.md, HEARTBEAT.md)+ - Old: ~/.jiuwenswarm/agent/skills/+ - Old: ~/.jiuwenswarm/agent/memory/- - New: ~/.jiuwenclaw/agent/jiuwenclaw_workspace/ (DeepAgent standard)+ - New: ~/.jiuwenswarm/agent/workspace/ (DeepAgent standard)Mapping:- - agent/workspace/ -> agent/jiuwenclaw_workspace/ (main workspace)- - agent/home/HEARTBEAT.md -> agent/jiuwenclaw_workspace/HEARTBEAT.md- - agent/skills/ -> agent/jiuwenclaw_workspace/skills/- - agent/memory/ -> agent/jiuwenclaw_workspace/memory/+ - agent/home/HEARTBEAT.md -> agent/workspace/HEARTBEAT.md+ - agent/skills/ -> agent/workspace/skills/+ - agent/memory/ -> agent/workspace/memory/++ Note: jiuwenclaw_workspace -> workspace renaming is handled separately by+ _migrate_jiuwenclaw_workspace_to_workspace.Args:- workspace_dir: Path to workspace root (~/.jiuwenclaw).+ workspace_dir: Path to workspace root (~/.jiuwenswarm).preferred_language: Preferred language for config (zh/en)."""logger.info(f"Migrating from legacy layout: {workspace_dir}")- old_workspace = workspace_dir / "agent" / "workspace"old_home = workspace_dir / "agent" / "home"old_skills = workspace_dir / "agent" / "skills"old_memory = workspace_dir / "agent" / "memory"- new_workspace = workspace_dir / "agent" / "jiuwenclaw_workspace"+ new_workspace = workspace_dir / "agent" / "workspace"new_workspace.mkdir(parents=True, exist_ok=True)- # 1. Migrate old workspace contents- if old_workspace.exists():- for item in old_workspace.iterdir():- dest = new_workspace / item.name- if item.is_dir():- if dest.exists():- shutil.rmtree(dest)- shutil.copytree(item, dest)- else:- shutil.copy2(item, dest)- logger.info(f"Migrated workspace: {old_workspace} -> {new_workspace}")-- # 2. Migrate old home files+ # 1. Migrate old home filesif old_home.exists():# HEARTBEAT.md -> HEARTBEAT.md (if not exists in new location)old_heartbeat = old_home / "HEARTBEAT.md"@@ -468,7 +535,7 @@ def _migrate_legacy_workspace(if old_heartbeat.exists() and not new_heartbeat.exists():shutil.copy2(old_heartbeat, new_heartbeat)logger.info("Migrated HEARTBEAT.md from home")-+# Merge PRINCIPLE.md and TONE.md into SOUL.mdold_principle = old_home / "PRINCIPLE.md"old_tone = old_home / "TONE.md"@@ -580,9 +647,6 @@ def _migrate_legacy_workspace(# 6. Clean up old directories after successful migrationtry:- if old_workspace.exists():- shutil.rmtree(old_workspace)- logger.info(f"Removed old workspace: {old_workspace}")if old_home.exists():shutil.rmtree(old_home)logger.info(f"Removed old home: {old_home}")@@ -612,7 +676,7 @@ def cleanup_team_files(workspace_dir: Path) -> None:- Old: {workspace_dir}/agent/team.db-shm (旧版本 team SHM 文件)Args:- workspace_dir: JiuWenClaw 用户工作空间根目录 (~/.jiuwenclaw)+ workspace_dir: JiuWenClaw 用户工作空间根目录 (~/.jiuwenswarm)"""agent_dir = workspace_dir / "agent"@@ -672,7 +736,11 @@ def prepare_workspace(workspace_dir = Path(workspace_dir)workspace_dir.mkdir(parents=True, exist_ok=True)- # Check for legacy workspace migration or cleanup+ # Migrate from legacy jiuwenclaw_workspace directory name to workspace+ _migrate_jiuwenclaw_workspace_to_workspace(workspace_dir)++ # Check for legacy workspace migration or cleanup (pre-DeepAgent layout)+ # These are even older layouts: agent/workspace, agent/home, agent/skills, agent/memoryold_workspace = workspace_dir / "agent" / "workspace"old_home = workspace_dir / "agent" / "home"old_skills = workspace_dir / "agent" / "skills"@@ -681,7 +749,7 @@ def prepare_workspace(# Check for legacy directory migration (for start command, overwrite=False)# Migration triggers when ANY legacy directory exists, not just old_workspacelegacy_dirs_exist = (- old_workspace.exists() or old_skills.exists() or old_memory.exists()+ old_home.exists() or old_skills.exists() or old_memory.exists())if legacy_dirs_exist and not overwrite:@@ -689,9 +757,6 @@ def prepare_workspace(# If overwrite (init command), clean up old legacy directories firstelif overwrite:try:- if old_workspace.exists():- shutil.rmtree(old_workspace)- logger.info(f"Removed old workspace: {old_workspace}")if old_home.exists():shutil.rmtree(old_home)logger.info(f"Removed old home: {old_home}")@@ -761,12 +826,12 @@ def prepare_workspace((agent_root / ".logs").mkdir(parents=True, exist_ok=True)# ----- DeepAgent workspace (standard DeepAgents schema) ------ deepagent_workspace = agent_root / "jiuwenclaw_workspace"+ deepagent_workspace = agent_root / "workspace"agent_skills = deepagent_workspace / "skills"agent_memory = deepagent_workspace / "memory"- template_agent_workspace = template_agent_dir / "jiuwenclaw_workspace"- template_agent_memory = template_agent_dir / "jiuwenclaw_workspace" / "memory"+ template_agent_workspace = template_agent_dir / "workspace"+ template_agent_memory = template_agent_dir / "workspace" / "memory"def _copy_dir(src_dir: Path,@@ -852,7 +917,7 @@ def _close_log_handlers() -> None:def init_user_workspace(overwrite: bool = True, workspace_dir: Optional[Path] = None) -> Path | Literal["cancelled"]:- """Initialize ~/.jiuwenclaw from package or source resources.+ """Initialize ~/.jiuwenswarm from package or source resources.资源布局:- 模板配置: <package_root>/resources/config.yaml@@ -860,10 +925,10 @@ def init_user_workspace(- 数据模板: <package_root>/resources/agent(含各技能模板)、skills_state.json上述内容会被复制到:- - ~/.jiuwenclaw/config/config.yaml(含 preferred_language)- - ~/.jiuwenclaw/config/builtin_rules.yaml(内置 shell 安全规则模板,与 config 同目录)- - ~/.jiuwenclaw/config/.env- - ~/.jiuwenclaw/agent/...+ - ~/.jiuwenswarm/config/config.yaml(含 preferred_language)+ - ~/.jiuwenswarm/config/builtin_rules.yaml(内置 shell 安全规则模板,与 config 同目录)+ - ~/.jiuwenswarm/config/.env+ - ~/.jiuwenswarm/agent/...注意:PRINCIPLE.md、TONE.md、HEARTBEAT.md 已被 SOUL.md 和新的心跳机制替代,不再由 JiuwenClaw 复制到用户工作区。@@ -883,17 +948,17 @@ def init_user_workspace(if overwrite:# Force mode: explain both modes and ask for confirmationprint(- f"[jiuwenclaw-init] With -f/--force flag, "+ f"[jiuwenswarm-init] With -f/--force flag, "f"entire {workspace_dir} will be deleted for clean initialization.")- print("[jiuwenclaw-init] WARNING: This will delete all historical configuration and memory information.")- print("[jiuwenclaw-init] This action cannot be undone.")+ print("[jiuwenswarm-init] WARNING: This will delete all historical configuration and memory information.")+ print("[jiuwenswarm-init] This action cannot be undone.")confirmation = input(- "[jiuwenclaw-init] Do you want to confirm reinitialization? (yes/no): "+ "[jiuwenswarm-init] Do you want to confirm reinitialization? (yes/no): ").strip().lower()if confirmation not in ("yes", "y"):- print("[jiuwenclaw-init] Initialization cancelled. Exiting.")+ print("[jiuwenswarm-init] Initialization cancelled. Exiting.")return "cancelled"# Close all log handlers to release file locks before deleting@@ -902,28 +967,28 @@ def init_user_workspace(# Delete entire workspace directory for clean initializationtry:shutil.rmtree(workspace_dir)- print(f"[jiuwenclaw-init] Removed workspace directory: {workspace_dir}")+ print(f"[jiuwenswarm-init] Removed workspace directory: {workspace_dir}")except OSError as e:- print(f"[jiuwenclaw-init] ERROR: Failed to remove workspace: {e}")+ print(f"[jiuwenswarm-init] ERROR: Failed to remove workspace: {e}")return "cancelled"else:# Merge mode: inform about preservationprint(- "[jiuwenclaw-init] Without -f/--force flag, "+ "[jiuwenswarm-init] Without -f/--force flag, ""existing files will be preserved and merged with template.")- print("[jiuwenclaw-init] This action cannot be undone.")- confirmation = input("[jiuwenclaw-init] Do you want to continue? (yes/no): ").strip().lower()+ print("[jiuwenswarm-init] This action cannot be undone.")+ confirmation = input("[jiuwenswarm-init] Do you want to continue? (yes/no): ").strip().lower()if confirmation not in ("yes", "y"):- print("[jiuwenclaw-init] Initialization cancelled. Exiting.")+ print("[jiuwenswarm-init] Initialization cancelled. Exiting.")return "cancelled"lang = prompt_preferred_language()if lang is None:- print("[jiuwenclaw-init] Initialization cancelled. Exiting.")+ print("[jiuwenswarm-init] Initialization cancelled. Exiting.")return "cancelled"- print(f"[jiuwenclaw-init] 将使用语言 / Language: {lang}")+ print(f"[jiuwenswarm-init] 将使用语言 / Language: {lang}")prepare_workspace(overwrite, preferred_language=lang, workspace_dir=workspace_dir)return workspace_dir@@ -937,22 +1002,26 @@ def _resolve_paths() -> None:returnworkspace_dir = get_user_workspace_dir()- # 优先使用已初始化的用户工作区 (~/.jiuwenclaw),++ # Migrate from legacy jiuwenclaw_workspace directory name to workspace+ _migrate_jiuwenclaw_workspace_to_workspace(workspace_dir)++ # 优先使用已初始化的用户工作区 (~/.jiuwenswarm),# 保证源码运行与安装包运行后的读写路径完全一致。user_config_dir = workspace_dir / "config"- user_workspace_dir = workspace_dir / "agent" / "jiuwenclaw_workspace"+ user_workspace_dir = workspace_dir / "agent" / "workspace"if user_config_dir.exists():_root_dir = workspace_dir_config_dir = user_config_dir_workspace_dir = user_workspace_direlse:- # 尚未初始化 ~/.jiuwenclaw:从包内 resources 直读配置,工作区指向包内 agent/jiuwenclaw_workspace+ # 尚未初始化 ~/.jiuwenswarm:从包内 resources 直读配置,工作区指向包内 agent/workspacepackage_root = _find_package_root()if package_root and (package_root / "resources" / "config.yaml").exists():res = package_root / "resources"_root_dir = package_root.parent_config_dir = res- _workspace_dir = res / "agent" / "jiuwenclaw_workspace"+ _workspace_dir = res / "agent" / "workspace"_workspace_dir.mkdir(parents=True, exist_ok=True)else:source_root = _find_source_root()@@ -960,7 +1029,7 @@ def _resolve_paths() -> None:res = pkg / "resources"_root_dir = source_root_config_dir = res if (res / "config.yaml").exists() else source_root / "config"- _workspace_dir = res / "agent" / "jiuwenclaw_workspace"+ _workspace_dir = res / "agent" / "workspace"_workspace_dir.mkdir(parents=True, exist_ok=True)_initialized = True@@ -991,9 +1060,9 @@ def get_agent_workspace_dir() -> Path:It contains standard nodes like skills, memory, todo, messages, etc.Returns:- Path to agent workspace: ~/.jiuwenclaw/agent/jiuwenclaw_workspace+ Path to agent workspace: ~/.jiuwenswarm/agent/workspace"""- return get_agent_root_dir() / "jiuwenclaw_workspace"+ return get_agent_root_dir() / "workspace"def get_agent_root_dir() -> Path:@@ -1010,7 +1079,7 @@ def get_agent_memory_dir() -> Path:Uses DeepAgent standard workspace location for unified workspace.Returns:- Path to memory directory: ~/.jiuwenclaw/agent/jiuwenclaw_workspace/memory+ Path to memory directory: ~/.jiuwenswarm/agent/workspace/memory"""return get_agent_workspace_dir() / "memory"@@ -1021,7 +1090,7 @@ def get_agent_skills_dir() -> Path:Uses DeepAgent standard workspace location for unified workspace.Returns:- Path to skills directory: ~/.jiuwenclaw/agent/jiuwenclaw_workspace/skills+ Path to skills directory: ~/.jiuwenswarm/agent/workspace/skills"""return get_agent_workspace_dir() / "skills"@@ -1030,7 +1099,7 @@ def get_interactions_dir() -> Path:"""Get the interactions directory for pending interaction contexts.Returns:- Path to interactions directory: {workspace}/agent/jiuwenclaw_workspace/interactions+ Path to interactions directory: {workspace}/agent/workspace/interactions"""return get_agent_workspace_dir() / "interactions"@@ -1044,7 +1113,7 @@ def get_deepagent_todo_dir() -> Path:"""Get the DeepAgent todo directory path.Returns:- Path to todo directory: ~/.jiuwenclaw/agent/jiuwenclaw_workspace/todo+ Path to todo directory: ~/.jiuwenswarm/agent/workspace/todo"""return get_agent_workspace_dir() / "todo"@@ -1053,7 +1122,7 @@ def get_deepagent_messages_dir() -> Path:"""Get the DeepAgent messages directory path.Returns:- Path to messages directory: ~/.jiuwenclaw/agent/jiuwenclaw_workspace/messages+ Path to messages directory: ~/.jiuwenswarm/agent/workspace/messages"""return get_agent_workspace_dir() / "messages"@@ -1062,7 +1131,7 @@ def get_deepagent_agents_dir() -> Path:"""Get the DeepAgent agents (sub-agent) directory path.Returns:- Path to agents directory: ~/.jiuwenclaw/agent/jiuwenclaw_workspace/agents+ Path to agents directory: ~/.jiuwenswarm/agent/workspace/agents"""return get_agent_workspace_dir() / "agents"@@ -1071,7 +1140,7 @@ def get_deepagent_heartbeat_path() -> Path:"""Get the DeepAgent HEARTBEAT.md file path.Returns:- Path to HEARTBEAT.md: ~/.jiuwenclaw/agent/jiuwenclaw_workspace/HEARTBEAT.md+ Path to HEARTBEAT.md: ~/.jiuwenswarm/agent/workspace/HEARTBEAT.md"""return get_agent_workspace_dir() / "HEARTBEAT.md"@@ -1080,7 +1149,7 @@ def get_deepagent_agent_md_path() -> Path:"""Get the DeepAgent AGENT.md file path.Returns:- Path to AGENT.md: ~/.jiuwenclaw/agent/jiuwenclaw_workspace/AGENT.md+ Path to AGENT.md: ~/.jiuwenswarm/agent/workspace/AGENT.md"""return get_agent_workspace_dir() / "AGENT.md"@@ -1089,7 +1158,7 @@ def get_deepagent_soul_md_path() -> Path:"""Get the DeepAgent SOUL.md file path.Returns:- Path to SOUL.md: ~/.jiuwenclaw/agent/jiuwenclaw_workspace/SOUL.md+ Path to SOUL.md: ~/.jiuwenswarm/agent/workspace/SOUL.md"""return get_agent_workspace_dir() / "SOUL.md"@@ -1098,7 +1167,7 @@ def get_deepagent_identity_md_path() -> Path:"""Get the DeepAgent IDENTITY.md file path.Returns:- Path to IDENTITY.md: ~/.jiuwenclaw/agent/jiuwenclaw_workspace/IDENTITY.md+ Path to IDENTITY.md: ~/.jiuwenswarm/agent/workspace/IDENTITY.md"""return get_agent_workspace_dir() / "IDENTITY.md"@@ -1107,7 +1176,7 @@ def get_deepagent_user_md_path() -> Path:"""Get the DeepAgent USER.md file path.Returns:- Path to USER.md: ~/.jiuwenclaw/agent/jiuwenclaw_workspace/USER.md+ Path to USER.md: ~/.jiuwenswarm/agent/workspace/USER.md"""return get_agent_workspace_dir() / "USER.md"@@ -1115,8 +1184,8 @@ def get_deepagent_user_md_path() -> Path:def get_builtin_skills_dir() -> Path:"""Get the built-in skills directory from package resources."""package_root = _find_package_root()- # 优先检查 jiuwenclaw_workspace/skills 目录(标准布局)- primary_path = package_root / "resources" / "agent" / "jiuwenclaw_workspace" / "skills"+ # 优先检查 workspace/skills 目录(标准布局)+ primary_path = package_root / "resources" / "agent" / "workspace" / "skills"if primary_path.exists() and primary_path.is_dir():return primary_path# 回退到 skills 目录@@ -1132,7 +1201,7 @@ _legacy_migration_done: bool = Falsedef _migrate_legacy_checkpoint_and_logs() -> None:- """One-time migration: move ~/.jiuwenclaw/.checkpoint and .logs to ~/.jiuwenclaw/agent/."""+ """One-time migration: move ~/.jiuwenswarm/.checkpoint and .logs to ~/.jiuwenswarm/agent/."""global _legacy_migration_doneif _legacy_migration_done:return@@ -1277,7 +1346,7 @@ def setup_logger(log_level: Optional[str] = None) -> logging.Logger:- ``jiuwenclaw.agents.*`` 或 ``jiuwenclaw.server.*`` → agent_server.log- 其余 ``jiuwenclaw.*``(含 ``jiuwenclaw.app``、gateway、evolution、utils 等)→ gateway.log- 所有分类日志同时写入 ``full.log``。输出目录:``~/.jiuwenclaw/agent/.logs/``。+ 所有分类日志同时写入 ``full.log``。输出目录:``~/.jiuwenswarm/agent/.logs/``。级别由 ``config.yaml`` 的 ``logging`` 段控制;环境变量 ``LOG_LEVEL`` 仅覆盖**控制台**级别(``log_level`` 参数为 ``None`` 时)。若传入 ``log_level``(如单测),则控制台与各文件级别均为该值。diff --git a/jiuwenclaw/dotenv_early.py b/jiuwenclaw/dotenv_early.pyindex 8422be9fd2..8c6d3ea732 100644--- a/jiuwenclaw/dotenv_early.py+++ b/jiuwenclaw/dotenv_early.py@@ -3,7 +3,7 @@"""Early --dotenv/--name parsing for multi-instance isolation.This module MUST be imported BEFORE any other jiuwenclaw modules,-because it sets JIUWENCLAW_DATA_DIR environment variable that affects+because it sets JIUWENSWARM_DATA_DIR environment variable that affectspath resolution in jiuwenclaw.utils.Usage in entry point files:@@ -17,7 +17,7 @@ The parsing happens before any jiuwenclaw imports:- sys.argv is scanned for --dotenv <path> and --name <name>- If --dotenv found: load that file- If --name found (no --dotenv): load instance bootstrap .env-- JIUWENCLAW_DATA_DIR is injected into os.environ+- JIUWENSWARM_DATA_DIR is injected into os.environ- Then get_user_workspace_dir() returns the correct instance pathIMPORTANT: This ensures module-level code uses correct workspace path.@@ -54,21 +54,21 @@ def parse_dotenv_early(component_name: str = "jiuwenclaw") -> Path | None:NOTE: This function does NOT remove arguments from sys.argv.- argparse will still see and parse them normally- - But JIUWENCLAW_DATA_DIR is set BEFORE module-level code executes+ - But JIUWENSWARM_DATA_DIR is set BEFORE module-level code executesPriority:1. --dotenv <path>: Use specified file directly2. --name <name>: Load instance bootstrap .env from instances.yamlArgs:- component_name: Name for warning messages (e.g., "jiuwenclaw-app")+ component_name: Name for warning messages (e.g., "jiuwenswarm-app")Returns:Path to the loaded .env file if found and loaded, None otherwiseUsage:from jiuwenclaw.dotenv_early import parse_dotenv_early- parse_dotenv_early("jiuwenclaw-app")+ parse_dotenv_early("jiuwenswarm-app")# Now safe to import jiuwenclaw modulesfrom jiuwenclaw.common.utils import get_user_workspace_dir@@ -130,11 +130,11 @@ def _load_bootstrap_by_name_early(name: str, component_name: str) -> Path | None# Find instances.yaml path (same logic as instance_manager but without imports)user_home = os.environ.get("JIUWENCLAW_HOME") or Path.home()- yaml_path = Path(user_home) / ".jiuwenclaw" / "instances.yaml"+ yaml_path = Path(user_home) / ".jiuwenswarm" / "instances.yaml"if not yaml_path.exists():_early_error(component_name, f"instances.yaml not found: {yaml_path}")- _early_error(component_name, f"Run 'jiuwenclaw-init --name {name}' to create it.")+ _early_error(component_name, f"Run 'jiuwenswarm-init --name {name}' to create it.")return None# Parse YAML to find instance workspace (minimal parsing without full imports)@@ -145,7 +145,7 @@ def _load_bootstrap_by_name_early(name: str, component_name: str) -> Path | Noneif name not in instances:_early_error(component_name, f"Instance '{name}' not found in instances.yaml")- _early_error(component_name, f"Run 'jiuwenclaw-init --name {name}' to create it.")+ _early_error(component_name, f"Run 'jiuwenswarm-init --name {name}' to create it.")return Noneinst_data = instances.get(name) or {}@@ -154,7 +154,7 @@ def _load_bootstrap_by_name_early(name: str, component_name: str) -> Path | Noneif workspace_str:workspace = Path(workspace_str).expanduser().resolve()else:- instances_dir = Path(user_home) / ".jiuwenclaw-instances"+ instances_dir = Path(user_home) / ".jiuwenswarm-instances"workspace = instances_dir / nameexcept Exception as exc:@@ -164,7 +164,7 @@ def _load_bootstrap_by_name_early(name: str, component_name: str) -> Path | None# Check workspace existsif not workspace.exists():_early_error(component_name, f"Workspace directory not found: {workspace}")- _early_error(component_name, f"Run 'jiuwenclaw-init --name {name}' to create it.")+ _early_error(component_name, f"Run 'jiuwenswarm-init --name {name}' to create it.")return None# Load bootstrap .env@@ -197,7 +197,7 @@ def set_component_name(name: str) -> None:Call this before importing the module if you want custom warnings:from jiuwenclaw import dotenv_early- dotenv_early.set_component_name("jiuwenclaw-app")+ dotenv_early.set_component_name("jiuwenswarm-app")# Now import triggers parsing with custom nameHowever, the simpler pattern is to just call parse_dotenv_early() directly.diff --git a/jiuwenclaw/gateway/app_gateway.py b/jiuwenclaw/gateway/app_gateway.pyindex de2f68ba7a..7e382c4edf 100644--- a/jiuwenclaw/gateway/app_gateway.py+++ b/jiuwenclaw/gateway/app_gateway.py@@ -33,7 +33,7 @@ from openjiuwen.core.common.logging import LogManager# --- Early --dotenv parsing (before jiuwenclaw imports) ---from jiuwenclaw.dotenv_early import parse_dotenv_early-parse_dotenv_early("jiuwenclaw-gateway")+parse_dotenv_early("jiuwenswarm-gateway")# --- Now safe to import jiuwenclaw modules ---from jiuwenclaw.gateway.channel_manager.protocol.acp.acp_connect import AcpGatewayBridge@@ -50,8 +50,8 @@ from jiuwenclaw.common.utils import (# Ensure workspace initialized_workspace_dir = get_user_workspace_dir()_config_file = _workspace_dir / "config" / "config.yaml"-_new_workspace = _workspace_dir / "agent" / "jiuwenclaw_workspace"-_old_workspace = _workspace_dir / "agent" / "workspace"+_new_workspace = _workspace_dir / "agent" / "workspace"+_old_workspace = _workspace_dir / "agent" / "jiuwenclaw_workspace"# Initialize if config doesn't exist, or if legacy workspace exists but new doesn't (migration)if not _config_file.exists() or (_old_workspace.exists() and not _new_workspace.exists()):@@ -1676,8 +1676,8 @@ def main() -> None:from jiuwenclaw.dotenv_early import get_parsed_dotenvparser = argparse.ArgumentParser(- prog="jiuwenclaw-gateway",- description="Start JiuwenClaw Gateway + Channels (split deployment; connects to jiuwenclaw-agentserver).",+ prog="jiuwenswarm-gateway",+ description="Start JiuwenClaw Gateway + Channels (split deployment; connects to jiuwenswarm-agentserver).",)parser.add_argument("--agent-server-url",diff --git a/jiuwenclaw/gateway/channel_manager/im_platforms/dingtalk/dingtalk_connect.py b/jiuwenclaw/gateway/channel_manager/im_platforms/dingtalk/dingtalk_connect.pyindex a8af010750..3d6951498d 100644--- a/jiuwenclaw/gateway/channel_manager/im_platforms/dingtalk/dingtalk_connect.py+++ b/jiuwenclaw/gateway/channel_manager/im_platforms/dingtalk/dingtalk_connect.py@@ -1059,7 +1059,7 @@ class DingTalkChannel(BaseChannel):found_files = []# 模式1:完整绝对路径匹配- # 匹配类似 /home/xxx/.jiuwenclaw/agent/workspace/xxx.ext 的路径+ # 匹配类似 /home/xxx/.jiuwenswarm/agent/workspace/xxx.ext 的路径path_pattern = re.compile(r'(?:^|["\'「「【《\s])(' + re.escape(workspace_dir) + r'[^\s"\'」」】》]+\.\w{1,10})(?:$|["\'」」】》\s])',re.MULTILINEdiff --git a/jiuwenclaw/gateway/channel_manager/im_platforms/feishu/feishu_connect.py b/jiuwenclaw/gateway/channel_manager/im_platforms/feishu/feishu_connect.pyindex b6d599d134..19fcac89bf 100644--- a/jiuwenclaw/gateway/channel_manager/im_platforms/feishu/feishu_connect.py+++ b/jiuwenclaw/gateway/channel_manager/im_platforms/feishu/feishu_connect.py@@ -1549,7 +1549,7 @@ class FeishuChannel(BaseChannel):用于兜底检测 LLM 提到但未通过 send_file_to_user 发送的文件。支持两种模式:- 1. 完整绝对路径:/home/xxx/.jiuwenclaw/agent/workspace/xxx.docx+ 1. 完整绝对路径:/home/xxx/.jiuwenswarm/agent/workspace/xxx.docx2. 仅文件名:'xxx.docx' 或 "xxx.docx"——在 workspace 目录下查找"""from jiuwenclaw.common.utils import get_agent_workspace_dir@@ -1559,7 +1559,7 @@ class FeishuChannel(BaseChannel):result: list[str] = []# 模式1:完整路径 - 动态匹配当前 workspace 目录- # 支持 Linux (/home/xxx/.jiuwenclaw/...) 和 Windows (C:\Users\xxx\.jiuwenclaw\...)+ # 支持 Linux (/home/xxx/.jiuwenswarm/...) 和 Windows (C:\Users\xxx\.jiuwenswarm\...)workspace_pattern = re.escape(workspace_dir) + r"[^\s\[\]\"']+\.\w+"for m in re.findall(workspace_pattern, text):m = m.rstrip(".,;:!?)")diff --git a/jiuwenclaw/gateway/channel_manager/protocol/acp/acp_connect.py b/jiuwenclaw/gateway/channel_manager/protocol/acp/acp_connect.pyindex 5e8c6f5353..5636b01f07 100644--- a/jiuwenclaw/gateway/channel_manager/protocol/acp/acp_connect.py+++ b/jiuwenclaw/gateway/channel_manager/protocol/acp/acp_connect.py@@ -13,7 +13,7 @@ from typing import Any, Callable# --- Early --dotenv parsing (before jiuwenclaw imports) ---from jiuwenclaw.dotenv_early import parse_dotenv_early-parse_dotenv_early("jiuwenclaw-acp-channel")+parse_dotenv_early("jiuwenswarm-acp-channel")# --- Now safe to import jiuwenclaw modules ---from jiuwenclaw.gateway.channel_manager.base import BaseChannel, RobotMessageRouter@@ -1774,7 +1774,7 @@ def main() -> None:sys.stdout = sys.stderrparser = argparse.ArgumentParser(- prog="jiuwenclaw-acp",+ prog="jiuwenswarm-acp",description="Start JiuwenClaw ACP stdio entrypoint.",)parser.add_argument(diff --git a/jiuwenclaw/gateway/channel_manager/tui/tui_connect.py b/jiuwenclaw/gateway/channel_manager/tui/tui_connect.pyindex 4a19bd2128..20782ad706 100644--- a/jiuwenclaw/gateway/channel_manager/tui/tui_connect.py+++ b/jiuwenclaw/gateway/channel_manager/tui/tui_connect.py@@ -347,7 +347,7 @@ _CLI_CONFIG_YAML_SETTERS: dict[str, Any] = {"permissions_enabled": update_permissions_enabled_in_config,"memory_forbidden_enabled": update_memory_forbidden_enabled_in_config,"preferred_language": update_preferred_language_in_config,- # Auto-Harness config items (stored in ~/.jiuwenclaw/auto-harness/config.yaml)+ # Auto-Harness config items (stored in ~/.jiuwenswarm/auto-harness/config.yaml)"auto_harness_git_user_name": _update_auto_harness_git_user_name,"auto_harness_git_user_email": _update_auto_harness_git_user_email,"auto_harness_git_fork_owner": _update_auto_harness_git_fork_owner,diff --git a/jiuwenclaw/gateway/cron/store.py b/jiuwenclaw/gateway/cron/store.pyindex 777c86f0d1..4116472978 100644--- a/jiuwenclaw/gateway/cron/store.py+++ b/jiuwenclaw/gateway/cron/store.py@@ -13,7 +13,7 @@ from jiuwenclaw.common.utils import get_cron_jobs_pathclass CronJobStore:- """Persist cron jobs to ~/.jiuwenclaw/agent/home/cron_jobs.json."""+ """Persist cron jobs to ~/.jiuwenswarm/agent/home/cron_jobs.json."""def __init__(self, path: Path | None = None) -> None:self._path = path or get_cron_jobs_path()diff --git a/jiuwenclaw/gateway/routing/interaction_context.py b/jiuwenclaw/gateway/routing/interaction_context.pyindex 37b20133ef..3e8c8e9740 100644--- a/jiuwenclaw/gateway/routing/interaction_context.py+++ b/jiuwenclaw/gateway/routing/interaction_context.py@@ -2,7 +2,7 @@"""PendingInteraction — 统一的追问上下文,支持群聊追问和 DM 追问两种模式。-存储路径: {workspace_dir}/agent/jiuwenclaw_workspace/interactions/{interaction_id}.json+存储路径: {workspace_dir}/agent/workspace/interactions/{interaction_id}.json文件名前缀: gpq_* 群聊追问, iact_* DM 追问TTL: 24 小时"""diff --git a/jiuwenclaw/init_workspace.py b/jiuwenclaw/init_workspace.pyindex f11966fe50..3654b6d18d 100644--- a/jiuwenclaw/init_workspace.py+++ b/jiuwenclaw/init_workspace.py@@ -1,7 +1,7 @@"""CLI:将运行时数据初始化到用户数据根目录(与 ``get_user_workspace_dir()`` 一致)。-默认根目录为 ``~/.jiuwenclaw``;若进程环境中已设置 ``JIUWENCLAW_DATA_DIR``(须为可用绝对路径,-且应在启动本脚本前注入,见 ``jiuwenclaw.utils`` 中的 ``JIUWENCLAW_DATA_DIR``),则初始化到该路径下。+默认根目录为 ``~/.jiuwenswarm``;若进程环境中已设置 ``JIUWENSWARM_DATA_DIR``(须为可用绝对路径,+且应在启动本脚本前注入,见 ``jiuwenclaw.utils`` 中的 ``JIUWENSWARM_DATA_DIR``),则初始化到该路径下。无论是通过 pip/whl 安装,还是在源码目录里直接运行:- 运行本脚本会先询问语言偏好(zh/en),写入 config 的 preferred_language;@@ -10,10 +10,10 @@源文件使用 _ZH/_EN 后缀,目标文件不带后缀。使用方式:-- jiuwenclaw-init -f: 强制清理,删除整个用户数据根目录后重新初始化-- jiuwenclaw-init: 保留原有数据,执行迁移合并-- jiuwenclaw-init --name alice: 创建命名实例 alice-- jiuwenclaw-init -f --name alice: 强制重建命名实例 alice+- jiuwenswarm-init -f: 强制清理,删除整个用户数据根目录后重新初始化+- jiuwenswarm-init: 保留原有数据,执行迁移合并+- jiuwenswarm-init --name alice: 创建命名实例 alice+- jiuwenswarm-init -f --name alice: 强制重建命名实例 alice"""from __future__ import annotations@@ -54,18 +54,18 @@ def run_init(force: bool = False, name: Optional[str] = None) -> int:if name:validation_error = validate_instance_name(name)if validation_error:- print(f"[jiuwenclaw-init] ERROR: {validation_error}")+ print(f"[jiuwenswarm-init] ERROR: {validation_error}")return 1# 2. Determine target workspace path and set env varif name:workspace_path = get_instance_workspace_path(name)- print(f"[jiuwenclaw-init] Creating instance: {name}")- print(f"[jiuwenclaw-init] Workspace: {workspace_path}")+ print(f"[jiuwenswarm-init] Creating instance: {name}")+ print(f"[jiuwenswarm-init] Workspace: {workspace_path}")else:- workspace_path = get_user_home() / ".jiuwenclaw"- print(f"[jiuwenclaw-init] Initializing default workspace")- print(f"[jiuwenclaw-init] Workspace: {workspace_path}")+ workspace_path = get_user_home() / ".jiuwenswarm"+ print(f"[jiuwenswarm-init] Initializing default workspace")+ print(f"[jiuwenswarm-init] Workspace: {workspace_path}")# 3. Check if instance is running (for named instances, always check)if name:@@ -79,15 +79,15 @@ def run_init(force: bool = False, name: Optional[str] = None) -> int:status = get_instance_status(config)if status.running:- print(f"[jiuwenclaw-init] ERROR: Instance '{name}' is running (PID={status.pid}).")- print(f"[jiuwenclaw-init] Stop it first with: jiuwenclaw-start --stop {name}")+ print(f"[jiuwenswarm-init] ERROR: Instance '{name}' is running (PID={status.pid}).")+ print(f"[jiuwenswarm-init] Stop it first with: jiuwenswarm-start --stop {name}")return 1elif force:# For default instance, use get_default_instance_status which includes port detectionstatus = get_default_instance_status()if status.running:- print(f"[jiuwenclaw-init] ERROR: Default instance is running (PID={status.pid or '-'}).")- print(f"[jiuwenclaw-init] Stop it first with: jiuwenclaw-start --stop default")+ print(f"[jiuwenswarm-init] ERROR: Default instance is running (PID={status.pid or '-'}).")+ print(f"[jiuwenswarm-init] Stop it first with: jiuwenswarm-start --stop default")return 1# 4. Call init_user_workspace with workspace path@@ -107,19 +107,19 @@ def run_init(force: bool = False, name: Optional[str] = None) -> int:config = InstanceConfig(name=name, workspace=workspace_path, ports=ports)create_bootstrap_env(config)- print(f"[jiuwenclaw-init] Instance '{name}' initialized successfully.")+ print(f"[jiuwenswarm-init] Instance '{name}' initialized successfully.")return 0if target == "cancelled":return 1- print(f"[jiuwenclaw-init] initialized: {target}")+ print(f"[jiuwenswarm-init] initialized: {target}")return 0def main() -> int:parser = argparse.ArgumentParser(- description="Initialize jiuwenclaw workspace directory (~/.jiuwenclaw)"+ description="Initialize jiuwenclaw workspace directory (~/.jiuwenswarm)")parser.add_argument("-f",diff --git a/jiuwenclaw/instance_manager/bootstrap.py b/jiuwenclaw/instance_manager/bootstrap.pyindex b71729ce9b..ca50477fca 100644--- a/jiuwenclaw/instance_manager/bootstrap.py+++ b/jiuwenclaw/instance_manager/bootstrap.py@@ -33,7 +33,7 @@ def create_bootstrap_env(config: InstanceConfig) -> Path:"""Create bootstrap .env file for an instance.The bootstrap .env contains:- - JIUWENCLAW_DATA_DIR: instance workspace path+ - JIUWENSWARM_DATA_DIR: instance workspace path- JIUWENCLAW_INSTANCE: instance name- Port assignments for each service@@ -48,7 +48,7 @@ def create_bootstrap_env(config: InstanceConfig) -> Path:lines = [f"# Bootstrap .env for instance: {config.name}",- f"JIUWENCLAW_DATA_DIR={config.workspace}",+ f"JIUWENSWARM_DATA_DIR={config.workspace}",f"JIUWENCLAW_INSTANCE={config.name}",]@@ -107,7 +107,7 @@ def _create_basic_bootstrap_env(# Get instance index from instances.yaml orderuser_home = os.environ.get("JIUWENCLAW_HOME") or Path.home()- yaml_path = Path(user_home) / ".jiuwenclaw" / "instances.yaml"+ yaml_path = Path(user_home) / ".jiuwenswarm" / "instances.yaml"try:data = yaml.safe_load(yaml_path.read_text(encoding="utf-8"))@@ -123,7 +123,7 @@ def _create_basic_bootstrap_env(bootstrap_env = workspace / ".env"lines = [f"# Bootstrap .env for instance: {name}",- f"JIUWENCLAW_DATA_DIR={workspace}",+ f"JIUWENSWARM_DATA_DIR={workspace}",f"JIUWENCLAW_INSTANCE={name}",f"AGENT_SERVER_PORT={ports['agent_server']}",f"WEB_PORT={ports['web']}",@@ -141,7 +141,7 @@ def load_instance_bootstrap_by_name(name: str) -> Path | None:This function is called from CLI main() when --name is specifiedbut --dotenv was not parsed early. It loads the instance's bootstrap- .env file to set JIUWENCLAW_DATA_DIR and port environment variables.+ .env file to set JIUWENSWARM_DATA_DIR and port environment variables.Args:name: Instance name (must exist in instances.yaml)@@ -179,7 +179,7 @@ def load_instance_bootstrap_by_name(name: str) -> Path | None:config = get_instance_config(name)if config is None:_logger.error("ERROR: Instance '%s' not found in instances.yaml", name)- _logger.error("Run 'jiuwenclaw-init --name %s' to create it.", name)+ _logger.error("Run 'jiuwenswarm-init --name %s' to create it.", name)return None# Check workspace directory exists@@ -187,7 +187,7 @@ def load_instance_bootstrap_by_name(name: str) -> Path | None:_logger.error("ERROR: Workspace directory not found: %s", config.workspace)- _logger.error("Run 'jiuwenclaw-init --name %s' to create it.", name)+ _logger.error("Run 'jiuwenswarm-init --name %s' to create it.", name)return None# Get or create bootstrap .envdiff --git a/jiuwenclaw/instance_manager/status.py b/jiuwenclaw/instance_manager/status.pyindex 2006218c12..3bcf9283c5 100644--- a/jiuwenclaw/instance_manager/status.py+++ b/jiuwenclaw/instance_manager/status.py@@ -80,7 +80,7 @@ def get_instance_status(config: InstanceConfig) -> InstanceStatus:def get_default_instance_status() -> InstanceStatus:- """Get status of the default instance (workspace at ~/.jiuwenclaw).+ """Get status of the default instance (workspace at ~/.jiuwenswarm).The default instance uses base ports (index 0) and standard workspace.For default instance, we check port availability to determine running statusdiff --git a/jiuwenclaw/instance_manager/yaml.py b/jiuwenclaw/instance_manager/yaml.pyindex 6ab9c4a8e2..4ab03e3579 100644--- a/jiuwenclaw/instance_manager/yaml.py+++ b/jiuwenclaw/instance_manager/yaml.py@@ -28,17 +28,17 @@ logger = logging.getLogger(__name__)def get_instances_yaml_path() -> Path:- """Return path to instances.yaml: ~/.jiuwenclaw/instances.yaml"""- return get_user_home() / ".jiuwenclaw" / "instances.yaml"+ """Return path to instances.yaml: ~/.jiuwenswarm/instances.yaml"""+ return get_user_home() / ".jiuwenswarm" / "instances.yaml"def get_instances_dir() -> Path:- """Return base directory for named instance workspaces: ~/.jiuwenclaw-instances/"""- return get_user_home() / ".jiuwenclaw-instances"+ """Return base directory for named instance workspaces: ~/.jiuwenswarm-instances/"""+ return get_user_home() / ".jiuwenswarm-instances"def get_instance_workspace_path(name: str) -> Path:- """Return workspace path for a named instance: ~/.jiuwenclaw-instances/<name>/"""+ """Return workspace path for a named instance: ~/.jiuwenswarm-instances/<name>/"""return get_instances_dir() / name@@ -71,7 +71,7 @@ def _read_yaml_file(path: Path) -> dict:f" Fix suggestions:\n"f" - Check YAML syntax (indentation, quotes, colons)\n"f" - Ensure no duplicate keys\n"- f" - Run 'jiuwenclaw-init' to recreate a valid template"+ f" - Run 'jiuwenswarm-init' to recreate a valid template") from excreturn data@@ -238,7 +238,7 @@ def create_instances_yaml_template() -> Path:# Example:# instances:# alice:-# # workspace: /custom/path/alice # optional, defaults to ~/.jiuwenclaw-instances/alice+# # workspace: /custom/path/alice # optional, defaults to ~/.jiuwenswarm-instances/alice# ports:# agent_server: 28092# web: 29000diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/agent-data.json b/jiuwenclaw/resources/agent/jiuwenclaw_workspace/agent-data.jsondeleted file mode 100644index 31df0162bd..0000000000--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/agent-data.json+++ /dev/null@@ -1,487 +0,0 @@-{- "jiuwenclaw_workspace": [- {- "name": "agent-data.json",- "path": "agent/jiuwenclaw_workspace/agent-data.json",- "isMarkdown": false- },- {- "name": "AGENT.md",- "path": "agent/jiuwenclaw_workspace/AGENT.md",- "isMarkdown": true- },- {- "name": "HEARTBEAT.md",- "path": "agent/jiuwenclaw_workspace/HEARTBEAT.md",- "isMarkdown": true- },- {- "name": "IDENTITY.md",- "path": "agent/jiuwenclaw_workspace/IDENTITY.md",- "isMarkdown": true- },- {- "name": "SOUL.md",- "path": "agent/jiuwenclaw_workspace/SOUL.md",- "isMarkdown": true- },- {- "name": "USER.md",- "path": "agent/jiuwenclaw_workspace/USER.md",- "isMarkdown": true- }- ],- "jiuwenclaw_workspace/memory": [- {- "name": "MEMORY.md",- "path": "agent/jiuwenclaw_workspace/memory/MEMORY.md",- "isMarkdown": true- }- ],- "jiuwenclaw_workspace/skills/advanced-daily-report": [- {- "name": "AI_ANALYSIS_TASKS.md",- "path": "agent/jiuwenclaw_workspace/skills/advanced-daily-report/AI_ANALYSIS_TASKS.md",- "isMarkdown": true- },- {- "name": "report_helper.py",- "path": "agent/jiuwenclaw_workspace/skills/advanced-daily-report/report_helper.py",- "isMarkdown": false- },- {- "name": "run_report.py",- "path": "agent/jiuwenclaw_workspace/skills/advanced-daily-report/run_report.py",- "isMarkdown": false- },- {- "name": "SKILL.md",- "path": "agent/jiuwenclaw_workspace/skills/advanced-daily-report/SKILL.md",- "isMarkdown": true- }- ],- "jiuwenclaw_workspace/skills/advanced-daily-report/analyzers": [- {- "name": "__init__.py",- "path": "agent/jiuwenclaw_workspace/skills/advanced-daily-report/analyzers/__init__.py",- "isMarkdown": false- },- {- "name": "ai_analyzer.py",- "path": "agent/jiuwenclaw_workspace/skills/advanced-daily-report/analyzers/ai_analyzer.py",- "isMarkdown": false- },- {- "name": "work_analyzer.py",- "path": "agent/jiuwenclaw_workspace/skills/advanced-daily-report/analyzers/work_analyzer.py",- "isMarkdown": false- }- ],- "jiuwenclaw_workspace/skills/advanced-daily-report/collectors": [- {- "name": "__init__.py",- "path": "agent/jiuwenclaw_workspace/skills/advanced-daily-report/collectors/__init__.py",- "isMarkdown": false- },- {- "name": "aggregator.py",- "path": "agent/jiuwenclaw_workspace/skills/advanced-daily-report/collectors/aggregator.py",- "isMarkdown": false- },- {- "name": "email_collector.py",- "path": "agent/jiuwenclaw_workspace/skills/advanced-daily-report/collectors/email_collector.py",- "isMarkdown": false- },- {- "name": "git_collector.py",- "path": "agent/jiuwenclaw_workspace/skills/advanced-daily-report/collectors/git_collector.py",- "isMarkdown": false- },- {- "name": "memory_collector.py",- "path": "agent/jiuwenclaw_workspace/skills/advanced-daily-report/collectors/memory_collector.py",- "isMarkdown": false- },- {- "name": "todo_collector.py",- "path": "agent/jiuwenclaw_workspace/skills/advanced-daily-report/collectors/todo_collector.py",- "isMarkdown": false- }- ],- "jiuwenclaw_workspace/skills/advanced-daily-report/generators": [- {- "name": "__init__.py",- "path": "agent/jiuwenclaw_workspace/skills/advanced-daily-report/generators/__init__.py",- "isMarkdown": false- },- {- "name": "report_generator.py",- "path": "agent/jiuwenclaw_workspace/skills/advanced-daily-report/generators/report_generator.py",- "isMarkdown": false- }- ],- "jiuwenclaw_workspace/skills/akg-agents": [- {- "name": "SKILL.md",- "path": "agent/jiuwenclaw_workspace/skills/akg-agents/SKILL.md",- "isMarkdown": true- }- ],- "jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer": [- {- "name": "app.py",- "path": "agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/app.py",- "isMarkdown": false- },- {- "name": "SKILL.md",- "path": "agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/SKILL.md",- "isMarkdown": true- }- ],- "jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers": [- {- "name": "__init__.py",- "path": "agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/__init__.py",- "isMarkdown": false- },- {- "name": "diagnosis.py",- "path": "agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/diagnosis.py",- "isMarkdown": false- },- {- "name": "llm_analysis.py",- "path": "agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/llm_analysis.py",- "isMarkdown": false- },- {- "name": "metrics.py",- "path": "agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/metrics.py",- "isMarkdown": false- },- {- "name": "parser.py",- "path": "agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/parser.py",- "isMarkdown": false- },- {- "name": "phase_mapper.py",- "path": "agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/phase_mapper.py",- "isMarkdown": false- },- {- "name": "plots.py",- "path": "agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/plots.py",- "isMarkdown": false- },- {- "name": "reporter.py",- "path": "agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/reporter.py",- "isMarkdown": false- }- ],- "jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/config": [- {- "name": "phase_map.yaml",- "path": "agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/config/phase_map.yaml",- "isMarkdown": false- }- ],- "jiuwenclaw_workspace/skills/cross-channel-history-retrieval": [- {- "name": "SKILL.md",- "path": "agent/jiuwenclaw_workspace/skills/cross-channel-history-retrieval/SKILL.md",- "isMarkdown": true- }- ],- "jiuwenclaw_workspace/skills/cross-channel-history-retrieval/scripts": [- {- "name": "search_history.py",- "path": "agent/jiuwenclaw_workspace/skills/cross-channel-history-retrieval/scripts/search_history.py",- "isMarkdown": false- }- ],- "jiuwenclaw_workspace/skills/delayed-restart-app": [- {- "name": "launch_delayed_restart.py",- "path": "agent/jiuwenclaw_workspace/skills/delayed-restart-app/launch_delayed_restart.py",- "isMarkdown": false- },- {- "name": "SKILL.md",- "path": "agent/jiuwenclaw_workspace/skills/delayed-restart-app/SKILL.md",- "isMarkdown": true- }- ],- "jiuwenclaw_workspace/skills/financial-document-parser": [- {- "name": "financial_parser.py",- "path": "agent/jiuwenclaw_workspace/skills/financial-document-parser/financial_parser.py",- "isMarkdown": false- },- {- "name": "SKILL.md",- "path": "agent/jiuwenclaw_workspace/skills/financial-document-parser/SKILL.md",- "isMarkdown": true- }- ],- "jiuwenclaw_workspace/skills/llm-wiki": [- {- "name": "SKILL.md",- "path": "agent/jiuwenclaw_workspace/skills/llm-wiki/SKILL.md",- "isMarkdown": true- }- ],- "jiuwenclaw_workspace/skills/openJiuwen-DeepSearch": [- {- "name": "README.md",- "path": "agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/README.md",- "isMarkdown": true- },- {- "name": "SKILL.md",- "path": "agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/SKILL.md",- "isMarkdown": true- }- ],- "jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/scripts": [- {- "name": "convert_docx.py",- "path": "agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/scripts/convert_docx.py",- "isMarkdown": false- },- {- "name": "convert_html.py",- "path": "agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/scripts/convert_html.py",- "isMarkdown": false- },- {- "name": "main.py",- "path": "agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/scripts/main.py",- "isMarkdown": false- },- {- "name": "validate_environment.py",- "path": "agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/scripts/validate_environment.py",- "isMarkdown": false- },- {- "name": "verify_skill_structure.py",- "path": "agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/scripts/verify_skill_structure.py",- "isMarkdown": false- }- ],- "jiuwenclaw_workspace/skills/skill-creator": [- {- "name": "LICENSE.txt",- "path": "agent/jiuwenclaw_workspace/skills/skill-creator/LICENSE.txt",- "isMarkdown": false- },- {- "name": "SKILL.md",- "path": "agent/jiuwenclaw_workspace/skills/skill-creator/SKILL.md",- "isMarkdown": true- }- ],- "jiuwenclaw_workspace/skills/skill-creator/agents": [- {- "name": "analyzer.md",- "path": "agent/jiuwenclaw_workspace/skills/skill-creator/agents/analyzer.md",- "isMarkdown": true- },- {- "name": "comparator.md",- "path": "agent/jiuwenclaw_workspace/skills/skill-creator/agents/comparator.md",- "isMarkdown": true- },- {- "name": "grader.md",- "path": "agent/jiuwenclaw_workspace/skills/skill-creator/agents/grader.md",- "isMarkdown": true- }- ],- "jiuwenclaw_workspace/skills/skill-creator/assets": [- {- "name": "eval_review.html",- "path": "agent/jiuwenclaw_workspace/skills/skill-creator/assets/eval_review.html",- "isMarkdown": false- }- ],- "jiuwenclaw_workspace/skills/skill-creator/eval-viewer": [- {- "name": "generate_review.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-creator/eval-viewer/generate_review.py",- "isMarkdown": false- },- {- "name": "viewer.html",- "path": "agent/jiuwenclaw_workspace/skills/skill-creator/eval-viewer/viewer.html",- "isMarkdown": false- }- ],- "jiuwenclaw_workspace/skills/skill-creator/references": [- {- "name": "schemas.md",- "path": "agent/jiuwenclaw_workspace/skills/skill-creator/references/schemas.md",- "isMarkdown": true- }- ],- "jiuwenclaw_workspace/skills/skill-creator/scripts": [- {- "name": "__init__.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-creator/scripts/__init__.py",- "isMarkdown": false- },- {- "name": "aggregate_benchmark.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-creator/scripts/aggregate_benchmark.py",- "isMarkdown": false- },- {- "name": "generate_report.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-creator/scripts/generate_report.py",- "isMarkdown": false- },- {- "name": "improve_description.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-creator/scripts/improve_description.py",- "isMarkdown": false- },- {- "name": "package_skill.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-creator/scripts/package_skill.py",- "isMarkdown": false- },- {- "name": "quick_validate.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-creator/scripts/quick_validate.py",- "isMarkdown": false- },- {- "name": "run_eval.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-creator/scripts/run_eval.py",- "isMarkdown": false- },- {- "name": "run_loop.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-creator/scripts/run_loop.py",- "isMarkdown": false- },- {- "name": "utils.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-creator/scripts/utils.py",- "isMarkdown": false- }- ],- "jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc": [- {- "name": "SKILL.md",- "path": "agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/SKILL.md",- "isMarkdown": true- }- ],- "jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/reference": [- {- "name": "generator-worker-spec.md",- "path": "agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/reference/generator-worker-spec.md",- "isMarkdown": true- },- {- "name": "operator-playbook.md",- "path": "agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/reference/operator-playbook.md",- "isMarkdown": true- },- {- "name": "sop-structure-pipeline.md",- "path": "agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/reference/sop-structure-pipeline.md",- "isMarkdown": true- }- ],- "jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts": [- {- "name": "skill_generator_cli.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_generator_cli.py",- "isMarkdown": false- }- ],- "jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen": [- {- "name": "__init__.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/__init__.py",- "isMarkdown": false- },- {- "name": "models.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/models.py",- "isMarkdown": false- },- {- "name": "sop_chunk_merge.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/sop_chunk_merge.py",- "isMarkdown": false- },- {- "name": "sop_parser.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/sop_parser.py",- "isMarkdown": false- },- {- "name": "validator.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/validator.py",- "isMarkdown": false- }- ],- "jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest": [- {- "name": "__init__.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/__init__.py",- "isMarkdown": false- },- {- "name": "models.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/models.py",- "isMarkdown": false- },- {- "name": "router.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/router.py",- "isMarkdown": false- },- {- "name": "url_safety.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/url_safety.py",- "isMarkdown": false- },- {- "name": "web_page.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/web_page.py",- "isMarkdown": false- },- {- "name": "wechat_article.py",- "path": "agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/wechat_article.py",- "isMarkdown": false- }- ],- "jiuwenclaw_workspace/skills/skvm-general": [- {- "name": "SKILL.md",- "path": "agent/jiuwenclaw_workspace/skills/skvm-general/SKILL.md",- "isMarkdown": true- }- ],- "jiuwenclaw_workspace/skills/skvm-jit": [- {- "name": "adapter-skill-paths.md",- "path": "agent/jiuwenclaw_workspace/skills/skvm-jit/adapter-skill-paths.md",- "isMarkdown": true- },- {- "name": "SKILL.md",- "path": "agent/jiuwenclaw_workspace/skills/skvm-jit/SKILL.md",- "isMarkdown": true- }- ]-}\ No newline at end of filediff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/AGENT_EN.md b/jiuwenclaw/resources/agent/workspace/AGENT_EN.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/AGENT_EN.mdrename to jiuwenclaw/resources/agent/workspace/AGENT_EN.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/AGENT_ZH.md b/jiuwenclaw/resources/agent/workspace/AGENT_ZH.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/AGENT_ZH.mdrename to jiuwenclaw/resources/agent/workspace/AGENT_ZH.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/HEARTBEAT_EN.md b/jiuwenclaw/resources/agent/workspace/HEARTBEAT_EN.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/HEARTBEAT_EN.mdrename to jiuwenclaw/resources/agent/workspace/HEARTBEAT_EN.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/HEARTBEAT_ZH.md b/jiuwenclaw/resources/agent/workspace/HEARTBEAT_ZH.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/HEARTBEAT_ZH.mdrename to jiuwenclaw/resources/agent/workspace/HEARTBEAT_ZH.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/IDENTITY_EN.md b/jiuwenclaw/resources/agent/workspace/IDENTITY_EN.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/IDENTITY_EN.mdrename to jiuwenclaw/resources/agent/workspace/IDENTITY_EN.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/IDENTITY_ZH.md b/jiuwenclaw/resources/agent/workspace/IDENTITY_ZH.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/IDENTITY_ZH.mdrename to jiuwenclaw/resources/agent/workspace/IDENTITY_ZH.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/SOUL_EN.md b/jiuwenclaw/resources/agent/workspace/SOUL_EN.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/SOUL_EN.mdrename to jiuwenclaw/resources/agent/workspace/SOUL_EN.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/SOUL_ZH.md b/jiuwenclaw/resources/agent/workspace/SOUL_ZH.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/SOUL_ZH.mdrename to jiuwenclaw/resources/agent/workspace/SOUL_ZH.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/USER.md b/jiuwenclaw/resources/agent/workspace/USER.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/USER.mdrename to jiuwenclaw/resources/agent/workspace/USER.mddiff --git a/jiuwenclaw/resources/agent/workspace/agent-data.json b/jiuwenclaw/resources/agent/workspace/agent-data.jsonnew file mode 100644index 0000000000..d77f804a8b--- /dev/null+++ b/jiuwenclaw/resources/agent/workspace/agent-data.json@@ -0,0 +1,690 @@+{+ "workspace": [+ {+ "name": "agent-data.json",+ "path": "agent/workspace/agent-data.json",+ "isMarkdown": false+ },+ {+ "name": "AGENT.md",+ "path": "agent/workspace/AGENT.md",+ "isMarkdown": true+ },+ {+ "name": "HEARTBEAT.md",+ "path": "agent/workspace/HEARTBEAT.md",+ "isMarkdown": true+ },+ {+ "name": "IDENTITY.md",+ "path": "agent/workspace/IDENTITY.md",+ "isMarkdown": true+ },+ {+ "name": "SOUL.md",+ "path": "agent/workspace/SOUL.md",+ "isMarkdown": true+ },+ {+ "name": "USER.md",+ "path": "agent/workspace/USER.md",+ "isMarkdown": true+ }+ ],+ "workspace/memory": [+ {+ "name": "MEMORY.md",+ "path": "agent/workspace/memory/MEMORY.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/advanced-daily-report": [+ {+ "name": "AI_ANALYSIS_TASKS.md",+ "path": "agent/workspace/skills/advanced-daily-report/AI_ANALYSIS_TASKS.md",+ "isMarkdown": true+ },+ {+ "name": "report_helper.py",+ "path": "agent/workspace/skills/advanced-daily-report/report_helper.py",+ "isMarkdown": false+ },+ {+ "name": "run_report.py",+ "path": "agent/workspace/skills/advanced-daily-report/run_report.py",+ "isMarkdown": false+ },+ {+ "name": "SKILL.md",+ "path": "agent/workspace/skills/advanced-daily-report/SKILL.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/advanced-daily-report/analyzers": [+ {+ "name": "__init__.py",+ "path": "agent/workspace/skills/advanced-daily-report/analyzers/__init__.py",+ "isMarkdown": false+ },+ {+ "name": "ai_analyzer.py",+ "path": "agent/workspace/skills/advanced-daily-report/analyzers/ai_analyzer.py",+ "isMarkdown": false+ },+ {+ "name": "work_analyzer.py",+ "path": "agent/workspace/skills/advanced-daily-report/analyzers/work_analyzer.py",+ "isMarkdown": false+ }+ ],+ "workspace/skills/advanced-daily-report/collectors": [+ {+ "name": "__init__.py",+ "path": "agent/workspace/skills/advanced-daily-report/collectors/__init__.py",+ "isMarkdown": false+ },+ {+ "name": "aggregator.py",+ "path": "agent/workspace/skills/advanced-daily-report/collectors/aggregator.py",+ "isMarkdown": false+ },+ {+ "name": "email_collector.py",+ "path": "agent/workspace/skills/advanced-daily-report/collectors/email_collector.py",+ "isMarkdown": false+ },+ {+ "name": "git_collector.py",+ "path": "agent/workspace/skills/advanced-daily-report/collectors/git_collector.py",+ "isMarkdown": false+ },+ {+ "name": "memory_collector.py",+ "path": "agent/workspace/skills/advanced-daily-report/collectors/memory_collector.py",+ "isMarkdown": false+ },+ {+ "name": "todo_collector.py",+ "path": "agent/workspace/skills/advanced-daily-report/collectors/todo_collector.py",+ "isMarkdown": false+ }+ ],+ "workspace/skills/advanced-daily-report/generators": [+ {+ "name": "__init__.py",+ "path": "agent/workspace/skills/advanced-daily-report/generators/__init__.py",+ "isMarkdown": false+ },+ {+ "name": "report_generator.py",+ "path": "agent/workspace/skills/advanced-daily-report/generators/report_generator.py",+ "isMarkdown": false+ }+ ],+ "workspace/skills/akg-agents": [+ {+ "name": "SKILL.md",+ "path": "agent/workspace/skills/akg-agents/SKILL.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/ascend-moe-optimizer-auto-trace": [+ {+ "name": "reference.md",+ "path": "agent/workspace/skills/ascend-moe-optimizer-auto-trace/reference.md",+ "isMarkdown": true+ },+ {+ "name": "SKILL.md",+ "path": "agent/workspace/skills/ascend-moe-optimizer-auto-trace/SKILL.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/ascend-moe-optimizer-auto-trace/scripts": [+ {+ "name": "apply_trace_scaffold.sh",+ "path": "agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/apply_trace_scaffold.sh",+ "isMarkdown": false+ },+ {+ "name": "bootstrap_trace_toolchain.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/bootstrap_trace_toolchain.py",+ "isMarkdown": false+ },+ {+ "name": "check_compile_safety.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/check_compile_safety.py",+ "isMarkdown": false+ },+ {+ "name": "generate_instrumentation_plan.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/generate_instrumentation_plan.py",+ "isMarkdown": false+ },+ {+ "name": "inspect_rank_pt.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/inspect_rank_pt.py",+ "isMarkdown": false+ },+ {+ "name": "instrument_operator.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/instrument_operator.py",+ "isMarkdown": false+ },+ {+ "name": "patch_build_pipeline.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/patch_build_pipeline.py",+ "isMarkdown": false+ },+ {+ "name": "run_instrumentation_checks.sh",+ "path": "agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/run_instrumentation_checks.sh",+ "isMarkdown": false+ },+ {+ "name": "trace_collector.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/trace_collector.py",+ "isMarkdown": false+ },+ {+ "name": "trace_preprocessor.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/trace_preprocessor.py",+ "isMarkdown": false+ },+ {+ "name": "trace_save.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/trace_save.py",+ "isMarkdown": false+ },+ {+ "name": "trace_utils.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/trace_utils.py",+ "isMarkdown": false+ },+ {+ "name": "validate_trace_points.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/validate_trace_points.py",+ "isMarkdown": false+ },+ {+ "name": "verify_trace_scaffold.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/verify_trace_scaffold.py",+ "isMarkdown": false+ }+ ],+ "workspace/skills/ascend-moe-optimizer-trace-analyzer": [+ {+ "name": "app.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/app.py",+ "isMarkdown": false+ },+ {+ "name": "SKILL.md",+ "path": "agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/SKILL.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers": [+ {+ "name": "__init__.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/__init__.py",+ "isMarkdown": false+ },+ {+ "name": "diagnosis.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/diagnosis.py",+ "isMarkdown": false+ },+ {+ "name": "llm_analysis.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/llm_analysis.py",+ "isMarkdown": false+ },+ {+ "name": "metrics.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/metrics.py",+ "isMarkdown": false+ },+ {+ "name": "parser.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/parser.py",+ "isMarkdown": false+ },+ {+ "name": "phase_mapper.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/phase_mapper.py",+ "isMarkdown": false+ },+ {+ "name": "plots.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/plots.py",+ "isMarkdown": false+ },+ {+ "name": "reporter.py",+ "path": "agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/reporter.py",+ "isMarkdown": false+ }+ ],+ "workspace/skills/ascend-moe-optimizer-trace-analyzer/config": [+ {+ "name": "phase_map.yaml",+ "path": "agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/config/phase_map.yaml",+ "isMarkdown": false+ }+ ],+ "workspace/skills/cross-channel-history-retrieval": [+ {+ "name": "SKILL.md",+ "path": "agent/workspace/skills/cross-channel-history-retrieval/SKILL.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/cross-channel-history-retrieval/scripts": [+ {+ "name": "search_history.py",+ "path": "agent/workspace/skills/cross-channel-history-retrieval/scripts/search_history.py",+ "isMarkdown": false+ }+ ],+ "workspace/skills/deepep-to-cam-converter": [+ {+ "name": "SKILL.md",+ "path": "agent/workspace/skills/deepep-to-cam-converter/SKILL.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/deepep-to-cam-converter/references": [+ {+ "name": "cam_dispatch_and_combine_a2.md",+ "path": "agent/workspace/skills/deepep-to-cam-converter/references/cam_dispatch_and_combine_a2.md",+ "isMarkdown": true+ },+ {+ "name": "cam_dispatch_and_combine_a3.md",+ "path": "agent/workspace/skills/deepep-to-cam-converter/references/cam_dispatch_and_combine_a3.md",+ "isMarkdown": true+ },+ {+ "name": "cam_dispatch_and_combine_shmem.md",+ "path": "agent/workspace/skills/deepep-to-cam-converter/references/cam_dispatch_and_combine_shmem.md",+ "isMarkdown": true+ },+ {+ "name": "cam_fused_deep_moe.md",+ "path": "agent/workspace/skills/deepep-to-cam-converter/references/cam_fused_deep_moe.md",+ "isMarkdown": true+ },+ {+ "name": "nccl_to_hccl_converter.md",+ "path": "agent/workspace/skills/deepep-to-cam-converter/references/nccl_to_hccl_converter.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/delayed-restart-app": [+ {+ "name": "launch_delayed_restart.py",+ "path": "agent/workspace/skills/delayed-restart-app/launch_delayed_restart.py",+ "isMarkdown": false+ },+ {+ "name": "SKILL.md",+ "path": "agent/workspace/skills/delayed-restart-app/SKILL.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/doc-update": [+ {+ "name": "SKILL.md",+ "path": "agent/workspace/skills/doc-update/SKILL.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/financial-document-parser": [+ {+ "name": "financial_parser.py",+ "path": "agent/workspace/skills/financial-document-parser/financial_parser.py",+ "isMarkdown": false+ },+ {+ "name": "SKILL.md",+ "path": "agent/workspace/skills/financial-document-parser/SKILL.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/llm-wiki": [+ {+ "name": "SKILL.md",+ "path": "agent/workspace/skills/llm-wiki/SKILL.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/openJiuwen-DeepSearch": [+ {+ "name": "README.md",+ "path": "agent/workspace/skills/openJiuwen-DeepSearch/README.md",+ "isMarkdown": true+ },+ {+ "name": "SKILL.md",+ "path": "agent/workspace/skills/openJiuwen-DeepSearch/SKILL.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/openJiuwen-DeepSearch/scripts": [+ {+ "name": "convert_docx.py",+ "path": "agent/workspace/skills/openJiuwen-DeepSearch/scripts/convert_docx.py",+ "isMarkdown": false+ },+ {+ "name": "convert_html.py",+ "path": "agent/workspace/skills/openJiuwen-DeepSearch/scripts/convert_html.py",+ "isMarkdown": false+ },+ {+ "name": "main.py",+ "path": "agent/workspace/skills/openJiuwen-DeepSearch/scripts/main.py",+ "isMarkdown": false+ },+ {+ "name": "validate_environment.py",+ "path": "agent/workspace/skills/openJiuwen-DeepSearch/scripts/validate_environment.py",+ "isMarkdown": false+ },+ {+ "name": "verify_skill_structure.py",+ "path": "agent/workspace/skills/openJiuwen-DeepSearch/scripts/verify_skill_structure.py",+ "isMarkdown": false+ }+ ],+ "workspace/skills/skill-creator": [+ {+ "name": "LICENSE.txt",+ "path": "agent/workspace/skills/skill-creator/LICENSE.txt",+ "isMarkdown": false+ },+ {+ "name": "SKILL.md",+ "path": "agent/workspace/skills/skill-creator/SKILL.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/skill-creator/agents": [+ {+ "name": "analyzer.md",+ "path": "agent/workspace/skills/skill-creator/agents/analyzer.md",+ "isMarkdown": true+ },+ {+ "name": "comparator.md",+ "path": "agent/workspace/skills/skill-creator/agents/comparator.md",+ "isMarkdown": true+ },+ {+ "name": "grader.md",+ "path": "agent/workspace/skills/skill-creator/agents/grader.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/skill-creator/assets": [+ {+ "name": "eval_review.html",+ "path": "agent/workspace/skills/skill-creator/assets/eval_review.html",+ "isMarkdown": false+ }+ ],+ "workspace/skills/skill-creator/eval-viewer": [+ {+ "name": "generate_review.py",+ "path": "agent/workspace/skills/skill-creator/eval-viewer/generate_review.py",+ "isMarkdown": false+ },+ {+ "name": "viewer.html",+ "path": "agent/workspace/skills/skill-creator/eval-viewer/viewer.html",+ "isMarkdown": false+ }+ ],+ "workspace/skills/skill-creator/references": [+ {+ "name": "schemas.md",+ "path": "agent/workspace/skills/skill-creator/references/schemas.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/skill-creator/scripts": [+ {+ "name": "__init__.py",+ "path": "agent/workspace/skills/skill-creator/scripts/__init__.py",+ "isMarkdown": false+ },+ {+ "name": "aggregate_benchmark.py",+ "path": "agent/workspace/skills/skill-creator/scripts/aggregate_benchmark.py",+ "isMarkdown": false+ },+ {+ "name": "generate_report.py",+ "path": "agent/workspace/skills/skill-creator/scripts/generate_report.py",+ "isMarkdown": false+ },+ {+ "name": "improve_description.py",+ "path": "agent/workspace/skills/skill-creator/scripts/improve_description.py",+ "isMarkdown": false+ },+ {+ "name": "package_skill.py",+ "path": "agent/workspace/skills/skill-creator/scripts/package_skill.py",+ "isMarkdown": false+ },+ {+ "name": "quick_validate.py",+ "path": "agent/workspace/skills/skill-creator/scripts/quick_validate.py",+ "isMarkdown": false+ },+ {+ "name": "run_eval.py",+ "path": "agent/workspace/skills/skill-creator/scripts/run_eval.py",+ "isMarkdown": false+ },+ {+ "name": "run_loop.py",+ "path": "agent/workspace/skills/skill-creator/scripts/run_loop.py",+ "isMarkdown": false+ },+ {+ "name": "utils.py",+ "path": "agent/workspace/skills/skill-creator/scripts/utils.py",+ "isMarkdown": false+ }+ ],+ "workspace/skills/skill-gen-4-enterprise-doc": [+ {+ "name": "SKILL.md",+ "path": "agent/workspace/skills/skill-gen-4-enterprise-doc/SKILL.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/skill-gen-4-enterprise-doc/reference": [+ {+ "name": "generator-worker-spec.md",+ "path": "agent/workspace/skills/skill-gen-4-enterprise-doc/reference/generator-worker-spec.md",+ "isMarkdown": true+ },+ {+ "name": "operator-playbook.md",+ "path": "agent/workspace/skills/skill-gen-4-enterprise-doc/reference/operator-playbook.md",+ "isMarkdown": true+ },+ {+ "name": "sop-recovery-and-interview-fallback.md",+ "path": "agent/workspace/skills/skill-gen-4-enterprise-doc/reference/sop-recovery-and-interview-fallback.md",+ "isMarkdown": true+ },+ {+ "name": "sop-structure-pipeline.md",+ "path": "agent/workspace/skills/skill-gen-4-enterprise-doc/reference/sop-structure-pipeline.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/skill-gen-4-enterprise-doc/scripts": [+ {+ "name": "skill_generator_cli.py",+ "path": "agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_generator_cli.py",+ "isMarkdown": false+ }+ ],+ "workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen": [+ {+ "name": "__init__.py",+ "path": "agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/__init__.py",+ "isMarkdown": false+ },+ {+ "name": "models.py",+ "path": "agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/models.py",+ "isMarkdown": false+ },+ {+ "name": "sop_chunk_merge.py",+ "path": "agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/sop_chunk_merge.py",+ "isMarkdown": false+ },+ {+ "name": "sop_fallback.py",+ "path": "agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/sop_fallback.py",+ "isMarkdown": false+ },+ {+ "name": "sop_parser.py",+ "path": "agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/sop_parser.py",+ "isMarkdown": false+ },+ {+ "name": "validator.py",+ "path": "agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/validator.py",+ "isMarkdown": false+ }+ ],+ "workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest": [+ {+ "name": "__init__.py",+ "path": "agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/__init__.py",+ "isMarkdown": false+ },+ {+ "name": "models.py",+ "path": "agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/models.py",+ "isMarkdown": false+ },+ {+ "name": "router.py",+ "path": "agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/router.py",+ "isMarkdown": false+ },+ {+ "name": "url_safety.py",+ "path": "agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/url_safety.py",+ "isMarkdown": false+ },+ {+ "name": "web_page.py",+ "path": "agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/web_page.py",+ "isMarkdown": false+ },+ {+ "name": "wechat_article.py",+ "path": "agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/wechat_article.py",+ "isMarkdown": false+ }+ ],+ "workspace/skills/skvm-general": [+ {+ "name": "SKILL.md",+ "path": "agent/workspace/skills/skvm-general/SKILL.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/skvm-jit": [+ {+ "name": "adapter-skill-paths.md",+ "path": "agent/workspace/skills/skvm-jit/adapter-skill-paths.md",+ "isMarkdown": true+ },+ {+ "name": "SKILL.md",+ "path": "agent/workspace/skills/skvm-jit/SKILL.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/teamskill-creator": [+ {+ "name": "SKILL.md",+ "path": "agent/workspace/skills/teamskill-creator/SKILL.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/teamskill-creator/reference": [+ {+ "name": "community-search.md",+ "path": "agent/workspace/skills/teamskill-creator/reference/community-search.md",+ "isMarkdown": true+ },+ {+ "name": "compliance-checklist.md",+ "path": "agent/workspace/skills/teamskill-creator/reference/compliance-checklist.md",+ "isMarkdown": true+ },+ {+ "name": "conversion-guide.md",+ "path": "agent/workspace/skills/teamskill-creator/reference/conversion-guide.md",+ "isMarkdown": true+ },+ {+ "name": "pattern-selection.md",+ "path": "agent/workspace/skills/teamskill-creator/reference/pattern-selection.md",+ "isMarkdown": true+ },+ {+ "name": "role-design.md",+ "path": "agent/workspace/skills/teamskill-creator/reference/role-design.md",+ "isMarkdown": true+ }+ ],+ "workspace/skills/teamskill-creator/scripts": [+ {+ "name": "validate_teamskill.py",+ "path": "agent/workspace/skills/teamskill-creator/scripts/validate_teamskill.py",+ "isMarkdown": false+ }+ ],+ "workspace/skills/teamskill-creator/templates": [+ {+ "name": "bind.md.template",+ "path": "agent/workspace/skills/teamskill-creator/templates/bind.md.template",+ "isMarkdown": false+ },+ {+ "name": "dependencies.yaml.template",+ "path": "agent/workspace/skills/teamskill-creator/templates/dependencies.yaml.template",+ "isMarkdown": false+ },+ {+ "name": "role.md.template",+ "path": "agent/workspace/skills/teamskill-creator/templates/role.md.template",+ "isMarkdown": false+ },+ {+ "name": "SKILL.md.template",+ "path": "agent/workspace/skills/teamskill-creator/templates/SKILL.md.template",+ "isMarkdown": false+ },+ {+ "name": "workflow.md.template",+ "path": "agent/workspace/skills/teamskill-creator/templates/workflow.md.template",+ "isMarkdown": false+ }+ ]+}\ No newline at end of filediff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/memory/MEMORY_EN.md b/jiuwenclaw/resources/agent/workspace/memory/MEMORY_EN.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/memory/MEMORY_EN.mdrename to jiuwenclaw/resources/agent/workspace/memory/MEMORY_EN.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/memory/MEMORY_ZH.md b/jiuwenclaw/resources/agent/workspace/memory/MEMORY_ZH.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/memory/MEMORY_ZH.mdrename to jiuwenclaw/resources/agent/workspace/memory/MEMORY_ZH.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/AI_ANALYSIS_TASKS.md b/jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/AI_ANALYSIS_TASKS.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/AI_ANALYSIS_TASKS.mdrename to jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/AI_ANALYSIS_TASKS.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/SKILL.md b/jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/SKILL.mdsimilarity index 88%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/SKILL.mdrename to jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/SKILL.mdindex 6dd844a468..5c8a16e42b 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/SKILL.md+++ b/jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/SKILL.md@@ -76,8 +76,8 @@ daily-report/**脚本会自动采集以下数据**:- **Git 提交记录**:通过 `git log` 命令读取 `D:/Download/jiuwenclaw` 仓库的提交历史- **邮箱邮件统计**:通过 IMAP 协议连接 `.env` 中配置的邮箱账户读取邮件统计(需要邮箱授权码)-- **记忆系统**:读取 `~/.jiuwenclaw/agent/memory/` 目录下的每日记忆文件-- **待办事项**:读取 `~/.jiuwenclaw/agent/sessions/` 下各会话的 `todo.md` 文件+- **记忆系统**:读取 `~/.jiuwenswarm/agent/workspace/memory/` 目录下的每日记忆文件+- **待办事项**:读取 `~/.jiuwenswarm/agent/sessions/` 下各会话的 `todo.md` 文件### 手动触发@@ -85,19 +85,19 @@ daily-report/```bash# 生成今日日报(记忆/待办/Git 等;Git 在仓库根目录统计)-python ~/.jiuwenclaw/agent/skills/daily-report/run_report.py daily --save+python ~/.jiuwenswarm/agent/workspace/skills/daily-report/run_report.py daily --save# 生成指定日期日报-python ~/.jiuwenclaw/agent/skills/daily-report/run_report.py daily --date 2026-03-06 --save+python ~/.jiuwenswarm/agent/workspace/skills/daily-report/run_report.py daily --date 2026-03-06 --save# 生成周报(聚合一周数据)-python ~/.jiuwenclaw/agent/skills/daily-report/run_report.py weekly --save+python ~/.jiuwenswarm/agent/workspace/skills/daily-report/run_report.py weekly --save# 生成月报(聚合一月数据,包含每日Git提交统计)-python ~/.jiuwenclaw/agent/skills/daily-report/run_report.py monthly --save+python ~/.jiuwenswarm/agent/workspace/skills/daily-report/run_report.py monthly --save# 生成月报(指定月份)-python ~/.jiuwenclaw/agent/skills/daily-report/run_report.py monthly --year 2026 --month 3 --save+python ~/.jiuwenswarm/agent/workspace/skills/daily-report/run_report.py monthly --year 2026 --month 3 --save```### 执行步骤@@ -127,8 +127,8 @@ python ~/.jiuwenclaw/agent/skills/daily-report/run_report.py monthly --year 2026|--------|----------|----------|| **Git 仓库** | `git log` 命令 | 仓库路径: `D:/Download/jiuwenclaw` || **网易邮箱** | IMAP 协议 | `.env`: `EMAIL_ADDRESS`, `EMAIL_TOKEN` |-| **记忆系统** | 读取 MD 文件 | `~/.jiuwenclaw/agent/memory/YYYY-MM-DD.md` |-| **待办事项** | 解析 todo.md | `~/.jiuwenclaw/agent/sessions/*/todo.md` |+| **记忆系统** | 读取 MD 文件 | `~/.jiuwenswarm/agent/workspace/memory/YYYY-MM-DD.md` |+| **待办事项** | 解析 todo.md | `~/.jiuwenswarm/agent/sessions/*/todo.md` |### 定时触发@@ -236,7 +236,7 @@ heartbeat:from collectors import DataAggregatoraggregator = DataAggregator(- workspace_dir="~/.jiuwenclaw/agent",+ workspace_dir="~/.jiuwenswarm/agent",git_repo="path/to/repo",email_config={"address": "[email protected]",@@ -287,7 +287,7 @@ monthly = generator.generate_monthly(2026, 3)1. **Git 仓库**: 确保仓库路径正确且有访问权限2. **邮箱授权**: 使用授权码而非登录密码3. **心跳时间**: 修改后需重启服务-4. **数据存储**: 报告保存到 `~/.jiuwenclaw/agent/reports/`+4. **数据存储**: 报告保存到 `~/.jiuwenswarm/agent/reports/`## 更新日志diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/analyzers/__init__.py b/jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/analyzers/__init__.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/analyzers/__init__.pyrename to jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/analyzers/__init__.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/analyzers/ai_analyzer.py b/jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/analyzers/ai_analyzer.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/analyzers/ai_analyzer.pyrename to jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/analyzers/ai_analyzer.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/analyzers/work_analyzer.py b/jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/analyzers/work_analyzer.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/analyzers/work_analyzer.pyrename to jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/analyzers/work_analyzer.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/collectors/__init__.py b/jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/collectors/__init__.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/collectors/__init__.pyrename to jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/collectors/__init__.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/collectors/aggregator.py b/jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/collectors/aggregator.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/collectors/aggregator.pyrename to jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/collectors/aggregator.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/collectors/email_collector.py b/jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/collectors/email_collector.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/collectors/email_collector.pyrename to jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/collectors/email_collector.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/collectors/git_collector.py b/jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/collectors/git_collector.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/collectors/git_collector.pyrename to jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/collectors/git_collector.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/collectors/memory_collector.py b/jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/collectors/memory_collector.pysimilarity index 98%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/collectors/memory_collector.pyrename to jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/collectors/memory_collector.pyindex 53e5537204..589695f61b 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/collectors/memory_collector.py+++ b/jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/collectors/memory_collector.py@@ -43,7 +43,7 @@ class MemoryCollector:初始化记忆采集器Args:- workspace_dir: Agent 根目录(如 ~/.jiuwenclaw/agent)+ workspace_dir: Agent 根目录(如 ~/.jiuwenswarm/agent)"""self.workspace_dir = Path(workspace_dir)self.memory_dir = self.workspace_dir / "memory"diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/collectors/todo_collector.py b/jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/collectors/todo_collector.pysimilarity index 99%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/collectors/todo_collector.pyrename to jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/collectors/todo_collector.pyindex e2831222d3..bd033b549c 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/collectors/todo_collector.py+++ b/jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/collectors/todo_collector.py@@ -73,7 +73,7 @@ class TodoCollector:初始化待办采集器Args:- workspace_dir: Agent 根目录(如 ~/.jiuwenclaw/agent)+ workspace_dir: Agent 根目录(如 ~/.jiuwenswarm/agent)"""self.workspace_dir = Path(workspace_dir)self.session_dir = self.workspace_dir / "sessions"diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/generators/__init__.py b/jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/generators/__init__.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/generators/__init__.pyrename to jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/generators/__init__.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/generators/report_generator.py b/jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/generators/report_generator.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/generators/report_generator.pyrename to jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/generators/report_generator.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/report_helper.py b/jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/report_helper.pysimilarity index 98%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/report_helper.pyrename to jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/report_helper.pyindex a00e33b407..40131cbef6 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/report_helper.py+++ b/jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/report_helper.py@@ -41,15 +41,15 @@ def get_workspace_dir() -> Path:优先级:1. jiuwenclaw.utils.get_agent_root_dir()(如果可用)- 2. JIUWENCLAW_DATA_DIR 环境变量 / agent+ 2. JIUWENSWARM_DATA_DIR 环境变量 / agent3. JIUWENCLAW_AGENT_ROOT 环境变量- 4. 默认 ~/.jiuwenclaw/agent+ 4. 默认 ~/.jiuwenswarm/agent"""if _has_jiuwenclaw:return get_agent_root_dir()# 检查多实例环境变量- env_workspace = os.getenv("JIUWENCLAW_DATA_DIR")+ env_workspace = os.getenv("JIUWENSWARM_DATA_DIR")if env_workspace:return Path(env_workspace) / "agent"@@ -58,7 +58,7 @@ def get_workspace_dir() -> Path:return Path(os.environ["JIUWENCLAW_AGENT_ROOT"])# 默认路径- home_agent = Path.home() / ".jiuwenclaw" / "agent"+ home_agent = Path.home() / ".jiuwenswarm" / "agent"if home_agent.is_dir():return home_agentdiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/run_report.py b/jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/run_report.pysimilarity index 98%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/run_report.pyrename to jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/run_report.pyindex ace506d5b0..db9934b76d 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/advanced-daily-report/run_report.py+++ b/jiuwenclaw/resources/agent/workspace/skills/advanced-daily-report/run_report.py@@ -33,11 +33,11 @@ try:if _has_jiuwenclaw:_cfg_env = get_env_file()else:- env_workspace = os.getenv("JIUWENCLAW_DATA_DIR")+ env_workspace = os.getenv("JIUWENSWARM_DATA_DIR")if env_workspace:_cfg_env = Path(env_workspace) / "config" / ".env"else:- _cfg_env = Path.home() / ".jiuwenclaw" / "config" / ".env"+ _cfg_env = Path.home() / ".jiuwenswarm" / "config" / ".env"if _cfg_env.exists():load_dotenv(_cfg_env)except ImportError:@@ -72,21 +72,21 @@ REPO_ROOT = PACKAGE_ROOT.parentif _has_jiuwenclaw:AGENT_ROOT = get_agent_root_dir()else:- env_workspace = os.getenv("JIUWENCLAW_DATA_DIR")+ env_workspace = os.getenv("JIUWENSWARM_DATA_DIR")if env_workspace:AGENT_ROOT = Path(env_workspace) / "agent"else:- AGENT_ROOT = Path(os.environ.get("JIUWENCLAW_AGENT_ROOT", str(Path.home() / ".jiuwenclaw" / "agent")))+ AGENT_ROOT = Path(os.environ.get("JIUWENCLAW_AGENT_ROOT", str(Path.home() / ".jiuwenswarm" / "agent")))# 配置环境文件路径if _has_jiuwenclaw:CONFIG_ENV = get_env_file()else:- env_workspace = os.getenv("JIUWENCLAW_DATA_DIR")+ env_workspace = os.getenv("JIUWENSWARM_DATA_DIR")if env_workspace:CONFIG_ENV = Path(env_workspace) / "config" / ".env"else:- CONFIG_ENV = Path.home() / ".jiuwenclaw" / "config" / ".env"+ CONFIG_ENV = Path.home() / ".jiuwenswarm" / "config" / ".env"# 报告用「日历日/当前年月」与项目 cron 默认时区一致(避免 naive datetime)_REPORT_TZ = ZoneInfo("Asia/Shanghai")diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/akg-agents/SKILL.md b/jiuwenclaw/resources/agent/workspace/skills/akg-agents/SKILL.mdsimilarity index 98%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/akg-agents/SKILL.mdrename to jiuwenclaw/resources/agent/workspace/skills/akg-agents/SKILL.mdindex 981cb269a1..cf4113ff4f 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/akg-agents/SKILL.md+++ b/jiuwenclaw/resources/agent/workspace/skills/akg-agents/SKILL.md@@ -20,7 +20,7 @@ description: 代理执行 AKG 算子任务。先检查固定仓库与分支;- `<AKG_REPO_URL>`:`https://gitcode.com/mindspore/akg/`- `<AKG_REPO_BRANCH>`:`br_agents`-- `<AKG_REPO_DIR>`:`$HOME/.jiuwenclaw/agent/jiuwenclaw_workspace/akg`+- `<AKG_REPO_DIR>`:`$HOME/.jiuwenswarm/agent/workspace/akg`- `<AKG_AGENTS_DIR>`:`<AKG_REPO_DIR>/akg_agents`先检查 `<AKG_REPO_DIR>` 是否存在;若存在,再检查它是否为 git 仓库以及当前分支是否为 `<AKG_REPO_BRANCH>`。diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/SKILL.md b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/SKILL.mdsimilarity index 99%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/SKILL.mdrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/SKILL.mdindex 1bef905ff0..aeeb04989d 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/SKILL.md+++ b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/SKILL.md@@ -59,7 +59,7 @@ description: >- **写哪里**:默认编辑本目录下的 `SKILL.md`(与 `reference.md` 同级;本仓库示例路径见 `reference.md` 文首);过长细节写入 `reference.md` 并保持链接。- **写什么**:短条目、可执行检查项、易错的「不要 / 必须」、与代码路径/常量名的对应;**不要**整段粘贴 plog 或冗长堆栈。-- **本仓库 UMDK 与 Skill 同步**:若修改本 skill **`scripts/`** 下的 `trace_preprocessor.py`、`trace_utils.py`、`trace_save.py`、`trace_collector.py`、`validate_trace_points.py`、`check_compile_safety.py`、`inspect_rank_pt.py`、`bootstrap_trace_toolchain.py`,应**同步更新** **`umdk/build/cam/comm_operator/`** 下同名文件(若仓库内另有**对照/金标树**(本仓常见为并行目录下的 `build/cam/comm_operator/`),应与之对齐或文档说明有意差异)。批量同步:`python3 <skill_root>/scripts/bootstrap_trace_toolchain.py --build-dir umdk/build/cam/comm_operator`(`<skill_root>` 为含本 `SKILL.md` 的目录;从仓库根代入 `jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/`)。+- **本仓库 UMDK 与 Skill 同步**:若修改本 skill **`scripts/`** 下的 `trace_preprocessor.py`、`trace_utils.py`、`trace_save.py`、`trace_collector.py`、`validate_trace_points.py`、`check_compile_safety.py`、`inspect_rank_pt.py`、`bootstrap_trace_toolchain.py`,应**同步更新** **`umdk/build/cam/comm_operator/`** 下同名文件(若仓库内另有**对照/金标树**(本仓常见为并行目录下的 `build/cam/comm_operator/`),应与之对齐或文档说明有意差异)。批量同步:`python3 <skill_root>/scripts/bootstrap_trace_toolchain.py --build-dir umdk/build/cam/comm_operator`(`<skill_root>` 为含本 `SKILL.md` 的目录;从仓库根代入 `jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/`)。- **何时写**:用户明确要求「记成规则 / 写进 skill」时必做;若新结论 **修正** skill 里旧表述(例如 optional vs REQUIRED),应直接改原文并保持一致性。- **触发词**:用户说「记录规则」「经验更新到 skill」「探讨的结论落盘」等,按本条执行。diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/reference.md b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/reference.mdsimilarity index 99%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/reference.mdrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/reference.mdindex 5f9f4ffd94..3e82dce598 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/reference.md+++ b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/reference.md@@ -6,7 +6,7 @@## Skill 根目录与本仓库路径-下文中的 `<skill_root>` 表示与本 `SKILL.md` 同级目录。**本仓库**(workspace 根下常见相对路径)示例:`jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/`。+下文中的 `<skill_root>` 表示与本 `SKILL.md` 同级目录。**本仓库**(workspace 根下常见相对路径)示例:`jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/`。## MoeTracing 运行时规格diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/apply_trace_scaffold.sh b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/apply_trace_scaffold.shsimilarity index 88%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/apply_trace_scaffold.shrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/apply_trace_scaffold.shindex 1a8db14fd5..a00508e7c4 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/apply_trace_scaffold.sh+++ b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/apply_trace_scaffold.sh@@ -6,7 +6,7 @@ set -euo pipefailif [[ $# -lt 3 ]]; thenecho "usage: $0 <skill_root> <build_dir> <compile_script>"- echo "example: $0 jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace build/cam/comm_operator build/cam/comm_operator/compile_ascend_proj.sh"+ echo "example: $0 jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace build/cam/comm_operator build/cam/comm_operator/compile_ascend_proj.sh"exit 1fidiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/bootstrap_trace_toolchain.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/bootstrap_trace_toolchain.pysimilarity index 98%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/bootstrap_trace_toolchain.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/bootstrap_trace_toolchain.pyindex a5b9cc47d2..ec78434c0b 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/bootstrap_trace_toolchain.py+++ b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/bootstrap_trace_toolchain.py@@ -8,7 +8,7 @@ Typical uses:``scripts/`` directory (same folder as ``SKILL.md``) — from repo root, e.g.::python3 \\- jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ \\+ jiuwenclaw/resources/agent/workspace/skills/ \\ascend-moe-optimizer-auto-trace/scripts/bootstrap_trace_toolchain.py \\--build-dir umdk/build/cam/comm_operatordiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/check_compile_safety.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/check_compile_safety.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/check_compile_safety.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/check_compile_safety.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/generate_instrumentation_plan.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/generate_instrumentation_plan.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/generate_instrumentation_plan.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/generate_instrumentation_plan.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/inspect_rank_pt.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/inspect_rank_pt.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/inspect_rank_pt.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/inspect_rank_pt.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/instrument_operator.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/instrument_operator.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/instrument_operator.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/instrument_operator.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/patch_build_pipeline.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/patch_build_pipeline.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/patch_build_pipeline.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/patch_build_pipeline.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/run_instrumentation_checks.sh b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/run_instrumentation_checks.shsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/run_instrumentation_checks.shrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/run_instrumentation_checks.shdiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/trace_collector.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/trace_collector.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/trace_collector.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/trace_collector.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/trace_preprocessor.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/trace_preprocessor.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/trace_preprocessor.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/trace_preprocessor.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/trace_save.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/trace_save.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/trace_save.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/trace_save.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/trace_utils.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/trace_utils.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/trace_utils.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/trace_utils.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/validate_trace_points.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/validate_trace_points.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/validate_trace_points.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/validate_trace_points.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/verify_trace_scaffold.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/verify_trace_scaffold.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-auto-trace/scripts/verify_trace_scaffold.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace/scripts/verify_trace_scaffold.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/SKILL.md b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/SKILL.mdsimilarity index 98%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/SKILL.mdrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/SKILL.mdindex 503d13c549..ac7a0ed89c 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/SKILL.md+++ b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/SKILL.md@@ -15,9 +15,9 @@ description: 在用户提供 Chrome/Perfetto trace.json、或排查 Ascend 上 M## 脚本位置-- 用户安装后的 skill 根目录:`<ASCEND_MOE_OPTIMIZER_SKILL>` = `~/.jiuwenclaw/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer`+- 用户安装后的 skill 根目录:`<ASCEND_MOE_OPTIMIZER_SKILL>` = `~/.jiuwenswarm/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer`- 入口:`<ASCEND_MOE_OPTIMIZER_SKILL>/app.py`-- 从本仓库资源运行时,将上述路径换为 `jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer`(相对仓库根目录)。+- 从本仓库资源运行时,将上述路径换为 `jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer`(相对仓库根目录)。执行命令前请先 `cd` 到 `<ASCEND_MOE_OPTIMIZER_SKILL>`,或使用下文绝对路径形式的 `python3 .../app.py`。diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/__init__.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/__init__.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/__init__.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/__init__.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/diagnosis.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/diagnosis.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/diagnosis.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/diagnosis.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/llm_analysis.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/llm_analysis.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/llm_analysis.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/llm_analysis.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/metrics.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/metrics.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/metrics.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/metrics.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/parser.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/parser.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/parser.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/parser.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/phase_mapper.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/phase_mapper.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/phase_mapper.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/phase_mapper.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/plots.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/plots.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/plots.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/plots.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/reporter.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/reporter.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/reporter.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/analyzers/reporter.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/app.py b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/app.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/app.pyrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/app.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/config/phase_map.yaml b/jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/config/phase_map.yamlsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/ascend-moe-optimizer-trace-analyzer/config/phase_map.yamlrename to jiuwenclaw/resources/agent/workspace/skills/ascend-moe-optimizer-trace-analyzer/config/phase_map.yamldiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/cross-channel-history-retrieval/SKILL.md b/jiuwenclaw/resources/agent/workspace/skills/cross-channel-history-retrieval/SKILL.mdsimilarity index 77%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/cross-channel-history-retrieval/SKILL.mdrename to jiuwenclaw/resources/agent/workspace/skills/cross-channel-history-retrieval/SKILL.mdindex d955e69eea..5c627e8f09 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/cross-channel-history-retrieval/SKILL.md+++ b/jiuwenclaw/resources/agent/workspace/skills/cross-channel-history-retrieval/SKILL.md@@ -1,13 +1,13 @@---name: cross-channel-history-retrievaldescription: >-- 跨会话检索聊天原文(记忆不足时再用)。在回答任何关于历史事件、日期、人物、过去对话的问题时,如果记忆中没有相关信息或不足以回答,则需要使用跨会话检索聊天原文。用 mcp_exec_command 执行 scripts/search_history.py,读 ~/.jiuwenclaw/agent/sessions/*/history.json。支持 channel、session_id、关键词、时间窗。如果搜索结果不足,尝试用不同的关键词再次搜索。+ 跨会话检索聊天原文(记忆不足时再用)。在回答任何关于历史事件、日期、人物、过去对话的问题时,如果记忆中没有相关信息或不足以回答,则需要使用跨会话检索聊天原文。用 mcp_exec_command 执行 scripts/search_history.py,读 ~/.jiuwenswarm/agent/sessions/*/history.json。支持 channel、session_id、关键词、时间窗。如果搜索结果不足,尝试用不同的关键词再次搜索。allowed_tools: [mcp_exec_command]---# 跨频道历史检索-用于从 `~/.jiuwenclaw/agent/sessions/<session_id>/history.json` 中检索历史消息,并把命中结果整理为可直接粘贴进当前上下文的文本块。+用于从 `~/.jiuwenswarm/agent/sessions/<session_id>/history.json` 中检索历史消息,并把命中结果整理为可直接粘贴进当前上下文的文本块。## 何时使用@@ -21,10 +21,10 @@ allowed_tools: [mcp_exec_command]必须使用 `mcp_exec_command` 执行脚本,不要只口头总结。```bash-python ~/.jiuwenclaw/agent/skills/cross-channel-history-retrieval/scripts/search_history.py --channel feishu --query "报销 审批" --start "2026-03-26 09:00" --end "2026-03-26 18:00" --limit 30+python ~/.jiuwenswarm/agent/workspace/skills/cross-channel-history-retrieval/scripts/search_history.py --channel feishu --query "报销 审批" --start "2026-03-26 09:00" --end "2026-03-26 18:00" --limit 30```-(Windows:**`--channel` / `--query` / 时间参数等与 Unix 相同**;默认 `mcp_exec_command` 走 **cmd**,**cmd 不会展开 `~`**,不要用 `~/.jiuwenclaw`,应写 `python %USERPROFILE%\.jiuwenclaw\agent\skills\cross-channel-history-retrieval\scripts\search_history.py` 再接同样参数。若整条命令在 PowerShell 里执行,`~` 一般会展开,也可用 `$env:USERPROFILE\...`。)+(Windows:**`--channel` / `--query` / 时间参数等与 Unix 相同**;默认 `mcp_exec_command` 走 **cmd**,**cmd 不会展开 `~`**,不要用 `~/.jiuwenswarm`,应写 `python %USERPROFILE%\.jiuwenswarm\agent\skills\cross-channel-history-retrieval\scripts\search_history.py` 再接同样参数。若整条命令在 PowerShell 里执行,`~` 一般会展开,也可用 `$env:USERPROFILE\...`。)## 参数说明diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/cross-channel-history-retrieval/scripts/search_history.py b/jiuwenclaw/resources/agent/workspace/skills/cross-channel-history-retrieval/scripts/search_history.pysimilarity index 98%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/cross-channel-history-retrieval/scripts/search_history.pyrename to jiuwenclaw/resources/agent/workspace/skills/cross-channel-history-retrieval/scripts/search_history.pyindex 5fdd7cf000..4bd551305d 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/cross-channel-history-retrieval/scripts/search_history.py+++ b/jiuwenclaw/resources/agent/workspace/skills/cross-channel-history-retrieval/scripts/search_history.py@@ -83,10 +83,10 @@ def _default_sessions_root() -> Path:if _has_jiuwenclaw:return get_agent_sessions_dir()# Fallback: check environment variable or use hardcoded path- env_workspace = os.getenv("JIUWENCLAW_DATA_DIR")+ env_workspace = os.getenv("JIUWENSWARM_DATA_DIR")if env_workspace:return Path(env_workspace) / "agent" / "sessions"- return Path.home() / ".jiuwenclaw" / "agent" / "sessions"+ return Path.home() / ".jiuwenswarm" / "agent" / "sessions"def _to_float_ts(v: Any, tz: timezone) -> float | None:@@ -306,7 +306,7 @@ def main() -> int:"--sessions-root",type=str,default="",- help="Path to sessions root. Default: ~/.jiuwenclaw/agent/sessions",+ help="Path to sessions root. Default: ~/.jiuwenswarm/agent/sessions",)parser.add_argument("--channel", type=str, default="", help="Filter by channel prefix in session_id, e.g. feishu")parser.add_argument("--session-id", type=str, default="", help="Exact session_id")diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/deepep-to-cam-converter/SKILL.md b/jiuwenclaw/resources/agent/workspace/skills/deepep-to-cam-converter/SKILL.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/deepep-to-cam-converter/SKILL.mdrename to jiuwenclaw/resources/agent/workspace/skills/deepep-to-cam-converter/SKILL.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/deepep-to-cam-converter/references/cam_dispatch_and_combine_a2.md b/jiuwenclaw/resources/agent/workspace/skills/deepep-to-cam-converter/references/cam_dispatch_and_combine_a2.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/deepep-to-cam-converter/references/cam_dispatch_and_combine_a2.mdrename to jiuwenclaw/resources/agent/workspace/skills/deepep-to-cam-converter/references/cam_dispatch_and_combine_a2.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/deepep-to-cam-converter/references/cam_dispatch_and_combine_a3.md b/jiuwenclaw/resources/agent/workspace/skills/deepep-to-cam-converter/references/cam_dispatch_and_combine_a3.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/deepep-to-cam-converter/references/cam_dispatch_and_combine_a3.mdrename to jiuwenclaw/resources/agent/workspace/skills/deepep-to-cam-converter/references/cam_dispatch_and_combine_a3.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/deepep-to-cam-converter/references/cam_dispatch_and_combine_shmem.md b/jiuwenclaw/resources/agent/workspace/skills/deepep-to-cam-converter/references/cam_dispatch_and_combine_shmem.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/deepep-to-cam-converter/references/cam_dispatch_and_combine_shmem.mdrename to jiuwenclaw/resources/agent/workspace/skills/deepep-to-cam-converter/references/cam_dispatch_and_combine_shmem.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/deepep-to-cam-converter/references/cam_fused_deep_moe.md b/jiuwenclaw/resources/agent/workspace/skills/deepep-to-cam-converter/references/cam_fused_deep_moe.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/deepep-to-cam-converter/references/cam_fused_deep_moe.mdrename to jiuwenclaw/resources/agent/workspace/skills/deepep-to-cam-converter/references/cam_fused_deep_moe.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/deepep-to-cam-converter/references/nccl_to_hccl_converter.md b/jiuwenclaw/resources/agent/workspace/skills/deepep-to-cam-converter/references/nccl_to_hccl_converter.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/deepep-to-cam-converter/references/nccl_to_hccl_converter.mdrename to jiuwenclaw/resources/agent/workspace/skills/deepep-to-cam-converter/references/nccl_to_hccl_converter.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/delayed-restart-app/SKILL.md b/jiuwenclaw/resources/agent/workspace/skills/delayed-restart-app/SKILL.mdsimilarity index 84%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/delayed-restart-app/SKILL.mdrename to jiuwenclaw/resources/agent/workspace/skills/delayed-restart-app/SKILL.mdindex e34272be58..a4e97227a9 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/delayed-restart-app/SKILL.md+++ b/jiuwenclaw/resources/agent/workspace/skills/delayed-restart-app/SKILL.md@@ -18,10 +18,10 @@ description: 安排延迟重启本 Agent 所在的服务(jiuwenclaw app)。使用 `bash` 工具执行(必须使用 launcher,否则重启时会连同脚本一起被终止):```bash-python %USERPROFILE%\.jiuwenclaw\agent\skills\delayed-restart-app\launch_delayed_restart.py --pid <当前 app 的 PID> --delay 5+python %USERPROFILE%\.jiuwenswarm\agent\skills\delayed-restart-app\launch_delayed_restart.py --pid <当前 app 的 PID> --delay 5```-(Unix/macOS 使用:`python ~/.jiuwenclaw/agent/skills/delayed-restart-app/launch_delayed_restart.py --pid <PID> --delay 5`)+(Unix/macOS 使用:`python ~/.jiuwenswarm/agent/workspace/skills/delayed-restart-app/launch_delayed_restart.py --pid <PID> --delay 5`)- `--pid`:必填,当前 jiuwenclaw app 进程的 PID(执行前需先获取,如从 config 或通过 `tasklist`/`pgrep` 等命令)- `--delay 5`:延迟 5 秒后重启(可改为 3、10 等)diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/delayed-restart-app/launch_delayed_restart.py b/jiuwenclaw/resources/agent/workspace/skills/delayed-restart-app/launch_delayed_restart.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/delayed-restart-app/launch_delayed_restart.pyrename to jiuwenclaw/resources/agent/workspace/skills/delayed-restart-app/launch_delayed_restart.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/doc-update/SKILL.md b/jiuwenclaw/resources/agent/workspace/skills/doc-update/SKILL.mdsimilarity index 96%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/doc-update/SKILL.mdrename to jiuwenclaw/resources/agent/workspace/skills/doc-update/SKILL.mdindex e0e24d7ef0..a0ba9acad1 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/doc-update/SKILL.md+++ b/jiuwenclaw/resources/agent/workspace/skills/doc-update/SKILL.md@@ -89,7 +89,7 @@ trigger: 用户提到"刷文档"、"更新文档"、"check 文档"、"doc audit"## 常见陷阱-- **配置里写的 ≠ 运行时用的** — 配置文件记录相对路径,运行时会拼接工作目录前缀(如 `agent/skills` → `workspace/agent/skills/`)。文档应记录配置文件中的原始值,而非运行时解析后的路径。+- **配置里写的 ≠ 运行时用的** — 配置文件记录相对路径,运行时会拼接工作目录前缀(如 `agent/skills` → `workspace/agent/workspace/skills/`)。文档应记录配置文件中的原始值,而非运行时解析后的路径。- **配置注释可能过时** — 注释标注"60秒"但实际值为 `3600` 的情况较为常见。应以实际值为准,注释不可作为依据。- **区分配置变量和环境变量** — 仅出现在环境变量模板中、未在配置文件中定义的变量,不应归入配置表章节,应单独放在"仅环境变量可配置"区域。- **插入章节后需修改其后所有编号** — 不得仅修改下一节,其后各节的编号均需递增 +1。diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/financial-document-parser/SKILL.md b/jiuwenclaw/resources/agent/workspace/skills/financial-document-parser/SKILL.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/financial-document-parser/SKILL.mdrename to jiuwenclaw/resources/agent/workspace/skills/financial-document-parser/SKILL.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/financial-document-parser/financial_parser.py b/jiuwenclaw/resources/agent/workspace/skills/financial-document-parser/financial_parser.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/financial-document-parser/financial_parser.pyrename to jiuwenclaw/resources/agent/workspace/skills/financial-document-parser/financial_parser.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/llm-wiki/SKILL.md b/jiuwenclaw/resources/agent/workspace/skills/llm-wiki/SKILL.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/llm-wiki/SKILL.mdrename to jiuwenclaw/resources/agent/workspace/skills/llm-wiki/SKILL.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/.env.example b/jiuwenclaw/resources/agent/workspace/skills/openJiuwen-DeepSearch/.env.examplesimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/.env.examplerename to jiuwenclaw/resources/agent/workspace/skills/openJiuwen-DeepSearch/.env.examplediff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/README.md b/jiuwenclaw/resources/agent/workspace/skills/openJiuwen-DeepSearch/README.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/README.mdrename to jiuwenclaw/resources/agent/workspace/skills/openJiuwen-DeepSearch/README.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/SKILL.md b/jiuwenclaw/resources/agent/workspace/skills/openJiuwen-DeepSearch/SKILL.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/SKILL.mdrename to jiuwenclaw/resources/agent/workspace/skills/openJiuwen-DeepSearch/SKILL.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/scripts/convert_docx.py b/jiuwenclaw/resources/agent/workspace/skills/openJiuwen-DeepSearch/scripts/convert_docx.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/scripts/convert_docx.pyrename to jiuwenclaw/resources/agent/workspace/skills/openJiuwen-DeepSearch/scripts/convert_docx.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/scripts/convert_html.py b/jiuwenclaw/resources/agent/workspace/skills/openJiuwen-DeepSearch/scripts/convert_html.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/scripts/convert_html.pyrename to jiuwenclaw/resources/agent/workspace/skills/openJiuwen-DeepSearch/scripts/convert_html.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/scripts/main.py b/jiuwenclaw/resources/agent/workspace/skills/openJiuwen-DeepSearch/scripts/main.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/scripts/main.pyrename to jiuwenclaw/resources/agent/workspace/skills/openJiuwen-DeepSearch/scripts/main.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/scripts/validate_environment.py b/jiuwenclaw/resources/agent/workspace/skills/openJiuwen-DeepSearch/scripts/validate_environment.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/scripts/validate_environment.pyrename to jiuwenclaw/resources/agent/workspace/skills/openJiuwen-DeepSearch/scripts/validate_environment.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/scripts/verify_skill_structure.py b/jiuwenclaw/resources/agent/workspace/skills/openJiuwen-DeepSearch/scripts/verify_skill_structure.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/openJiuwen-DeepSearch/scripts/verify_skill_structure.pyrename to jiuwenclaw/resources/agent/workspace/skills/openJiuwen-DeepSearch/scripts/verify_skill_structure.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/LICENSE.txt b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/LICENSE.txtsimilarity index 97%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/LICENSE.txtrename to jiuwenclaw/resources/agent/workspace/skills/skill-creator/LICENSE.txtindex 9b5e4019df..7a4a3ea242 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/LICENSE.txt+++ b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/LICENSE.txt@@ -1,202 +1,202 @@-- Apache License- Version 2.0, January 2004- http://www.apache.org/licenses/-- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION-- 1. Definitions.-- "License" shall mean the terms and conditions for use, reproduction,- and distribution as defined by Sections 1 through 9 of this document.-- "Licensor" shall mean the copyright owner or entity authorized by- the copyright owner that is granting the License.-- "Legal Entity" shall mean the union of the acting entity and all- other entities that control, are controlled by, or are under common- control with that entity. For the purposes of this definition,- "control" means (i) the power, direct or indirect, to cause the- direction or management of such entity, whether by contract or- otherwise, or (ii) ownership of fifty percent (50%) or more of the- outstanding shares, or (iii) beneficial ownership of such entity.-- "You" (or "Your") shall mean an individual or Legal Entity- exercising permissions granted by this License.-- "Source" form shall mean the preferred form for making modifications,- including but not limited to software source code, documentation- source, and configuration files.-- "Object" form shall mean any form resulting from mechanical- transformation or translation of a Source form, including but- not limited to compiled object code, generated documentation,- and conversions to other media types.-- "Work" shall mean the work of authorship, whether in Source or- Object form, made available under the License, as indicated by a- copyright notice that is included in or attached to the work- (an example is provided in the Appendix below).-- "Derivative Works" shall mean any work, whether in Source or Object- form, that is based on (or derived from) the Work and for which the- editorial revisions, annotations, elaborations, or other modifications- represent, as a whole, an original work of authorship. For the purposes- of this License, Derivative Works shall not include works that remain- separable from, or merely link (or bind by name) to the interfaces of,- the Work and Derivative Works thereof.-- "Contribution" shall mean any work of authorship, including- the original version of the Work and any modifications or additions- to that Work or Derivative Works thereof, that is intentionally- submitted to Licensor for inclusion in the Work by the copyright owner- or by an individual or Legal Entity authorized to submit on behalf of- the copyright owner. For the purposes of this definition, "submitted"- means any form of electronic, verbal, or written communication sent- to the Licensor or its representatives, including but not limited to- communication on electronic mailing lists, source code control systems,- and issue tracking systems that are managed by, or on behalf of, the- Licensor for the purpose of discussing and improving the Work, but- excluding communication that is conspicuously marked or otherwise- designated in writing by the copyright owner as "Not a Contribution."-- "Contributor" shall mean Licensor and any individual or Legal Entity- on behalf of whom a Contribution has been received by Licensor and- subsequently incorporated within the Work.-- 2. Grant of Copyright License. Subject to the terms and conditions of- this License, each Contributor hereby grants to You a perpetual,- worldwide, non-exclusive, no-charge, royalty-free, irrevocable- copyright license to reproduce, prepare Derivative Works of,- publicly display, publicly perform, sublicense, and distribute the- Work and such Derivative Works in Source or Object form.-- 3. Grant of Patent License. Subject to the terms and conditions of- this License, each Contributor hereby grants to You a perpetual,- worldwide, non-exclusive, no-charge, royalty-free, irrevocable- (except as stated in this section) patent license to make, have made,- use, offer to sell, sell, import, and otherwise transfer the Work,- where such license applies only to those patent claims licensable- by such Contributor that are necessarily infringed by their- Contribution(s) alone or by combination of their Contribution(s)- with the Work to which such Contribution(s) was submitted. If You- institute patent litigation against any entity (including a- cross-claim or counterclaim in a lawsuit) alleging that the Work- or a Contribution incorporated within the Work constitutes direct- or contributory patent infringement, then any patent licenses- granted to You under this License for that Work shall terminate- as of the date such litigation is filed.-- 4. Redistribution. You may reproduce and distribute copies of the- Work or Derivative Works thereof in any medium, with or without- modifications, and in Source or Object form, provided that You- meet the following conditions:-- (a) You must give any other recipients of the Work or- Derivative Works a copy of this License; and-- (b) You must cause any modified files to carry prominent notices- stating that You changed the files; and-- (c) You must retain, in the Source form of any Derivative Works- that You distribute, all copyright, patent, trademark, and- attribution notices from the Source form of the Work,- excluding those notices that do not pertain to any part of- the Derivative Works; and-- (d) If the Work includes a "NOTICE" text file as part of its- distribution, then any Derivative Works that You distribute must- include a readable copy of the attribution notices contained- within such NOTICE file, excluding those notices that do not- pertain to any part of the Derivative Works, in at least one- of the following places: within a NOTICE text file distributed- as part of the Derivative Works; within the Source form or- documentation, if provided along with the Derivative Works; or,- within a display generated by the Derivative Works, if and- wherever such third-party notices normally appear. The contents- of the NOTICE file are for informational purposes only and- do not modify the License. You may add Your own attribution- notices within Derivative Works that You distribute, alongside- or as an addendum to the NOTICE text from the Work, provided- that such additional attribution notices cannot be construed- as modifying the License.-- You may add Your own copyright statement to Your modifications and- may provide additional or different license terms and conditions- for use, reproduction, or distribution of Your modifications, or- for any such Derivative Works as a whole, provided Your use,- reproduction, and distribution of the Work otherwise complies with- the conditions stated in this License.-- 5. Submission of Contributions. Unless You explicitly state otherwise,- any Contribution intentionally submitted for inclusion in the Work- by You to the Licensor shall be under the terms and conditions of- this License, without any additional terms or conditions.- Notwithstanding the above, nothing herein shall supersede or modify- the terms of any separate license agreement you may have executed- with Licensor regarding such Contributions.-- 6. Trademarks. This License does not grant permission to use the trade- names, trademarks, service marks, or product names of the Licensor,- except as required for reasonable and customary use in describing the- origin of the Work and reproducing the content of the NOTICE file.-- 7. Disclaimer of Warranty. Unless required by applicable law or- agreed to in writing, Licensor provides the Work (and each- Contributor provides its Contributions) on an "AS IS" BASIS,- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or- implied, including, without limitation, any warranties or conditions- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A- PARTICULAR PURPOSE. You are solely responsible for determining the- appropriateness of using or redistributing the Work and assume any- risks associated with Your exercise of permissions under this License.-- 8. Limitation of Liability. In no event and under no legal theory,- whether in tort (including negligence), contract, or otherwise,- unless required by applicable law (such as deliberate and grossly- negligent acts) or agreed to in writing, shall any Contributor be- liable to You for damages, including any direct, indirect, special,- incidental, or consequential damages of any character arising as a- result of this License or out of the use or inability to use the- Work (including but not limited to damages for loss of goodwill,- work stoppage, computer failure or malfunction, or any and all- other commercial damages or losses), even if such Contributor- has been advised of the possibility of such damages.-- 9. Accepting Warranty or Additional Liability. While redistributing- the Work or Derivative Works thereof, You may choose to offer,- and charge a fee for, acceptance of support, warranty, indemnity,- or other liability obligations and/or rights consistent with this- License. However, in accepting such obligations, You may act only- on Your own behalf and on Your sole responsibility, not on behalf- of any other Contributor, and only if You agree to indemnify,- defend, and hold each Contributor harmless for any liability- incurred by, or claims asserted against, such Contributor by reason- of your accepting any such warranty or additional liability.-- END OF TERMS AND CONDITIONS-- APPENDIX: How to apply the Apache License to your work.-- To apply the Apache License to your work, attach the following- boilerplate notice, with the fields enclosed by brackets "[]"- replaced with your own identifying information. (Don't include- the brackets!) The text should be enclosed in the appropriate- comment syntax for the file format. We also recommend that a- file or class name and description of purpose be included on the- same "printed page" as the copyright notice for easier- identification within third-party archives.-- Copyright [yyyy] [name of copyright owner]-- Licensed under the Apache License, Version 2.0 (the "License");- you may not use this file except in compliance with the License.- You may obtain a copy of the License at-- http://www.apache.org/licenses/LICENSE-2.0-- Unless required by applicable law or agreed to in writing, software- distributed under the License is distributed on an "AS IS" BASIS,- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- See the License for the specific language governing permissions and++ Apache License+ Version 2.0, January 2004+ http://www.apache.org/licenses/++ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION++ 1. Definitions.++ "License" shall mean the terms and conditions for use, reproduction,+ and distribution as defined by Sections 1 through 9 of this document.++ "Licensor" shall mean the copyright owner or entity authorized by+ the copyright owner that is granting the License.++ "Legal Entity" shall mean the union of the acting entity and all+ other entities that control, are controlled by, or are under common+ control with that entity. For the purposes of this definition,+ "control" means (i) the power, direct or indirect, to cause the+ direction or management of such entity, whether by contract or+ otherwise, or (ii) ownership of fifty percent (50%) or more of the+ outstanding shares, or (iii) beneficial ownership of such entity.++ "You" (or "Your") shall mean an individual or Legal Entity+ exercising permissions granted by this License.++ "Source" form shall mean the preferred form for making modifications,+ including but not limited to software source code, documentation+ source, and configuration files.++ "Object" form shall mean any form resulting from mechanical+ transformation or translation of a Source form, including but+ not limited to compiled object code, generated documentation,+ and conversions to other media types.++ "Work" shall mean the work of authorship, whether in Source or+ Object form, made available under the License, as indicated by a+ copyright notice that is included in or attached to the work+ (an example is provided in the Appendix below).++ "Derivative Works" shall mean any work, whether in Source or Object+ form, that is based on (or derived from) the Work and for which the+ editorial revisions, annotations, elaborations, or other modifications+ represent, as a whole, an original work of authorship. For the purposes+ of this License, Derivative Works shall not include works that remain+ separable from, or merely link (or bind by name) to the interfaces of,+ the Work and Derivative Works thereof.++ "Contribution" shall mean any work of authorship, including+ the original version of the Work and any modifications or additions+ to that Work or Derivative Works thereof, that is intentionally+ submitted to Licensor for inclusion in the Work by the copyright owner+ or by an individual or Legal Entity authorized to submit on behalf of+ the copyright owner. For the purposes of this definition, "submitted"+ means any form of electronic, verbal, or written communication sent+ to the Licensor or its representatives, including but not limited to+ communication on electronic mailing lists, source code control systems,+ and issue tracking systems that are managed by, or on behalf of, the+ Licensor for the purpose of discussing and improving the Work, but+ excluding communication that is conspicuously marked or otherwise+ designated in writing by the copyright owner as "Not a Contribution."++ "Contributor" shall mean Licensor and any individual or Legal Entity+ on behalf of whom a Contribution has been received by Licensor and+ subsequently incorporated within the Work.++ 2. Grant of Copyright License. Subject to the terms and conditions of+ this License, each Contributor hereby grants to You a perpetual,+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable+ copyright license to reproduce, prepare Derivative Works of,+ publicly display, publicly perform, sublicense, and distribute the+ Work and such Derivative Works in Source or Object form.++ 3. Grant of Patent License. Subject to the terms and conditions of+ this License, each Contributor hereby grants to You a perpetual,+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable+ (except as stated in this section) patent license to make, have made,+ use, offer to sell, sell, import, and otherwise transfer the Work,+ where such license applies only to those patent claims licensable+ by such Contributor that are necessarily infringed by their+ Contribution(s) alone or by combination of their Contribution(s)+ with the Work to which such Contribution(s) was submitted. If You+ institute patent litigation against any entity (including a+ cross-claim or counterclaim in a lawsuit) alleging that the Work+ or a Contribution incorporated within the Work constitutes direct+ or contributory patent infringement, then any patent licenses+ granted to You under this License for that Work shall terminate+ as of the date such litigation is filed.++ 4. Redistribution. You may reproduce and distribute copies of the+ Work or Derivative Works thereof in any medium, with or without+ modifications, and in Source or Object form, provided that You+ meet the following conditions:++ (a) You must give any other recipients of the Work or+ Derivative Works a copy of this License; and++ (b) You must cause any modified files to carry prominent notices+ stating that You changed the files; and++ (c) You must retain, in the Source form of any Derivative Works+ that You distribute, all copyright, patent, trademark, and+ attribution notices from the Source form of the Work,+ excluding those notices that do not pertain to any part of+ the Derivative Works; and++ (d) If the Work includes a "NOTICE" text file as part of its+ distribution, then any Derivative Works that You distribute must+ include a readable copy of the attribution notices contained+ within such NOTICE file, excluding those notices that do not+ pertain to any part of the Derivative Works, in at least one+ of the following places: within a NOTICE text file distributed+ as part of the Derivative Works; within the Source form or+ documentation, if provided along with the Derivative Works; or,+ within a display generated by the Derivative Works, if and+ wherever such third-party notices normally appear. The contents+ of the NOTICE file are for informational purposes only and+ do not modify the License. You may add Your own attribution+ notices within Derivative Works that You distribute, alongside+ or as an addendum to the NOTICE text from the Work, provided+ that such additional attribution notices cannot be construed+ as modifying the License.++ You may add Your own copyright statement to Your modifications and+ may provide additional or different license terms and conditions+ for use, reproduction, or distribution of Your modifications, or+ for any such Derivative Works as a whole, provided Your use,+ reproduction, and distribution of the Work otherwise complies with+ the conditions stated in this License.++ 5. Submission of Contributions. Unless You explicitly state otherwise,+ any Contribution intentionally submitted for inclusion in the Work+ by You to the Licensor shall be under the terms and conditions of+ this License, without any additional terms or conditions.+ Notwithstanding the above, nothing herein shall supersede or modify+ the terms of any separate license agreement you may have executed+ with Licensor regarding such Contributions.++ 6. Trademarks. This License does not grant permission to use the trade+ names, trademarks, service marks, or product names of the Licensor,+ except as required for reasonable and customary use in describing the+ origin of the Work and reproducing the content of the NOTICE file.++ 7. Disclaimer of Warranty. Unless required by applicable law or+ agreed to in writing, Licensor provides the Work (and each+ Contributor provides its Contributions) on an "AS IS" BASIS,+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or+ implied, including, without limitation, any warranties or conditions+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A+ PARTICULAR PURPOSE. You are solely responsible for determining the+ appropriateness of using or redistributing the Work and assume any+ risks associated with Your exercise of permissions under this License.++ 8. Limitation of Liability. In no event and under no legal theory,+ whether in tort (including negligence), contract, or otherwise,+ unless required by applicable law (such as deliberate and grossly+ negligent acts) or agreed to in writing, shall any Contributor be+ liable to You for damages, including any direct, indirect, special,+ incidental, or consequential damages of any character arising as a+ result of this License or out of the use or inability to use the+ Work (including but not limited to damages for loss of goodwill,+ work stoppage, computer failure or malfunction, or any and all+ other commercial damages or losses), even if such Contributor+ has been advised of the possibility of such damages.++ 9. Accepting Warranty or Additional Liability. While redistributing+ the Work or Derivative Works thereof, You may choose to offer,+ and charge a fee for, acceptance of support, warranty, indemnity,+ or other liability obligations and/or rights consistent with this+ License. However, in accepting such obligations, You may act only+ on Your own behalf and on Your sole responsibility, not on behalf+ of any other Contributor, and only if You agree to indemnify,+ defend, and hold each Contributor harmless for any liability+ incurred by, or claims asserted against, such Contributor by reason+ of your accepting any such warranty or additional liability.++ END OF TERMS AND CONDITIONS++ APPENDIX: How to apply the Apache License to your work.++ To apply the Apache License to your work, attach the following+ boilerplate notice, with the fields enclosed by brackets "[]"+ replaced with your own identifying information. (Don't include+ the brackets!) The text should be enclosed in the appropriate+ comment syntax for the file format. We also recommend that a+ file or class name and description of purpose be included on the+ same "printed page" as the copyright notice for easier+ identification within third-party archives.++ Copyright [yyyy] [name of copyright owner]++ Licensed under the Apache License, Version 2.0 (the "License");+ you may not use this file except in compliance with the License.+ You may obtain a copy of the License at++ http://www.apache.org/licenses/LICENSE-2.0++ Unless required by applicable law or agreed to in writing, software+ distributed under the License is distributed on an "AS IS" BASIS,+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ See the License for the specific language governing permissions andlimitations under the License.\ No newline at end of filediff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/SKILL.md b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/SKILL.mdsimilarity index 98%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/SKILL.mdrename to jiuwenclaw/resources/agent/workspace/skills/skill-creator/SKILL.mdindex c3f6418346..dfc4a4deaa 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/SKILL.md+++ b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/SKILL.md@@ -1,610 +1,610 @@-----name: skill-creator-description: Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.------# Skill Creator--A skill for creating new skills and iteratively improving them.--At a high level, the process of creating a skill goes like this:--- Decide what you want the skill to do and roughly how it should do it-- Write a draft of the skill-- Create a few test prompts and run claude-with-access-to-the-skill on them-- Help the user evaluate the results both qualitatively and quantitatively- - While the runs happen in the background, draft some quantitative evals if there aren't any (if there are some, you can either use as is or modify if you feel something needs to change about them). Then explain them to the user (or if they already existed, explain the ones that already exist)- - Use the `eval-viewer/generate_review.py` script to show the user the results for them to look at, and also let them look at the quantitative metrics-- Rewrite the skill based on feedback from the user's evaluation of the results (and also if there are any glaring flaws that become apparent from the quantitative benchmarks)-- Repeat until you're satisfied-- Expand the test set and try again at larger scale--Your job when using this skill is to figure out where the user is in this process and then jump in and help them progress through these stages. So for instance, maybe they're like "I want to make a skill for X". You can help narrow down what they mean, write a draft, write the test cases, figure out how they want to evaluate, run all the prompts, and repeat.--On the other hand, maybe they already have a draft of the skill. In this case you can go straight to the eval/iterate part of the loop.--Of course, you should always be flexible and if the user is like "I don't need to run a bunch of evaluations, just vibe with me", you can do that instead.--Then after the skill is done (but again, the order is flexible), you can also run the skill description improver, which we have a whole separate script for, to optimize the triggering of the skill.--Cool? Cool.--## Communicating with the user--The skill creator is liable to be used by people across a wide range of familiarity with coding jargon. If you haven't heard (and how could you, it's only very recently that it started), there's a trend now where the power of Claude is inspiring plumbers to open up their terminals, parents and grandparents to google "how to install npm". On the other hand, the bulk of users are probably fairly computer-literate.--So please pay attention to context cues to understand how to phrase your communication! In the default case, just to give you some idea:--- "evaluation" and "benchmark" are borderline, but OK-- for "JSON" and "assertion" you want to see serious cues from the user that they know what those things are before using them without explaining them--It's OK to briefly explain terms if you're in doubt, and feel free to clarify terms with a short definition if you're unsure if the user will get it.-------## Creating a skill--### Capture Intent--Start by understanding the user's intent. The current conversation might already contain a workflow the user wants to capture (e.g., they say "turn this into a skill"). If so, extract answers from the conversation history first — the tools used, the sequence of steps, corrections the user made, input/output formats observed. The user may need to fill the gaps, and should confirm before proceeding to the next step.--1. What should this skill enable Claude to do?-2. When should this skill trigger? (what user phrases/contexts)-3. What's the expected output format?-4. Should we set up test cases to verify the skill works? Skills with objectively verifiable outputs (file transforms, data extraction, code generation, fixed workflow steps) benefit from test cases. Skills with subjective outputs (writing style, art) often don't need them. Suggest the appropriate default based on the skill type, but let the user decide.--### Interview and Research--Proactively ask questions about edge cases, input/output formats, example files, success criteria, and dependencies. Wait to write test prompts until you've got this part ironed out.--Check available MCPs - if useful for research (searching docs, finding similar skills, looking up best practices), research in parallel via subagents if available, otherwise inline. Come prepared with context to reduce burden on the user.--### Reference Discovery--Before writing from scratch, search the community for proven skills similar to what you're building. A skill with tens of thousands of installs has been validated at scale — its structure, scope decisions, and edge case handling encode hard-won lessons. You're not copying; you're learning from what works.--**Step 1: Extract search keywords**--Distill the user's intent into 1–2 concise English keywords describing what the skill *does*. Be semantic, not literal:-- "我想创建一个 PR review 技能" → `code review`-- "a skill that generates changelogs from git history" → `changelog git`-- "help write a skill for translating documents" → `translation`-- "deploy to cloud with rollback support" → `deploy rollback`--> ⚠️ **Keywords must be in English.** Chinese or other non-English keywords will silently return zero results — not because no skill exists, but because the search index only supports English. Always translate the user's intent into English before searching.--**Step 2: Search for related skills**--On Windows:-```bash-powershell -Command "npx skills find '<keywords>'"-```-On macOS/Linux:-```bash-npx skills find '<keywords>'-```--> ⚠️ **Windows critical:** On Windows, running `npx skills find` *without* the `powershell -Command "..."` wrapper will silently produce empty output — this is a Windows/npx compatibility bug, not a sign that no skills exist. If you accidentally get empty output, re-run with the correct PowerShell wrapper before concluding there are no results.--Each result includes an install count (e.g., `112.7K installs`). Results are already sorted descending by installs — select the **top 2**. If fewer than 2 results are returned, use what you have. If 0 results after confirming the command ran correctly, skip to writing.--**Step 3: Fetch the full skill directory without installing**--For each selected result (format: `owner/repo@skill-name`), fetch the **entire skill directory** — not just SKILL.md. Complex skills bundle scripts, reference docs, and asset templates that are equally instructive. Do **not** use `npx skills add` — that creates symlinks and pollutes the user's skill environment.--```bash-SKILL_NAME="<the-skill-being-created>"-REFS_DIR="${SKILL_NAME}-workspace/_borrowed_refs"-mkdir -p "$REFS_DIR"--# Sparse-clone: fetch only the skill subdirectory from the repo-git clone --depth=1 --filter=blob:none --sparse \- https://github.com/<owner>/<repo>.git "$REFS_DIR/ref-1-repo" 2>/dev/null-git -C "$REFS_DIR/ref-1-repo" sparse-checkout set <skill-name> 2>/dev/null--# Copy the full skill directory (preserving scripts/, references/, assets/, etc.)-# The skill dir may be a named subdirectory, or at repo root — try both-if [ -d "$REFS_DIR/ref-1-repo/<skill-name>" ]; then- cp -r "$REFS_DIR/ref-1-repo/<skill-name>" "$REFS_DIR/ref-1"-else- cp -r "$REFS_DIR/ref-1-repo" "$REFS_DIR/ref-1"-fi--rm -rf "$REFS_DIR/ref-1-repo"-# Repeat for ref-2-```--Tell the user what you found and what structure each reference has: e.g., "Found 2 reference skills: **skill-creator** (112.7K installs) — has scripts/, references/, agents/, assets/; **microsoft-skill-creator** (7.6K installs) — SKILL.md only. I'll use these as structural models."--**Step 4: Internalize via progressive disclosure**--Do not read everything at once. Start shallow, then go deeper only where it's relevant to the skill you're building.--**Layer 1 — directory survey (always do this):**-List the directory tree of each reference skill. Note every subdirectory and file name — the structure itself reveals design decisions before you read a single line:-- A `scripts/` directory means the author chose to automate repetitive steps rather than describe them in prose-- A `references/` directory means there's domain knowledge too large to inline-- An `assets/` directory means the skill produces output files (templates, icons, etc.)-- Multiple files in `references/` suggest the skill is domain-partitioned (see "Domain organization" in the Skill Writing Guide)--**Layer 2 — read SKILL.md (always do this):**-Read the main instruction file. Extract:-- **Scope**: what does it do, and what does it explicitly leave out?-- **Structure**: which sections and headings carry the most weight?-- **Instruction style**: how are constraints and examples communicated?-- **Pointers**: does SKILL.md reference bundled files? Note the "when to read X" guidance it gives.-- **Edge cases**: what tricky situations does it handle explicitly?--**Layer 3 — selectively read bundled resources (only when relevant):**-After reading SKILL.md and understanding the user's new skill requirements, decide which bundled files to read:--| If the new skill needs… | Then read… |-|---|---|-| Automation / deterministic steps | `scripts/` files from the reference |-| Structured domain knowledge | `references/` files that overlap with the new domain |-| Output file templates | `assets/` files |-| Subagent coordination | `agents/` prompt files |--Don't read everything — read the files that answer: *"How did they solve the same problem I'm about to solve?"* One well-chosen script or reference doc can save you from designing a flawed structure.--Bring these patterns into writing. Synthesize, don't copy. If a reference script handles a repetitive task elegantly and the new skill has a similar need, bundle a variant of it rather than asking the model to reinvent it every run.--**Cleanup (after user approves the final skill)**--Before or during packaging, delete the borrowed references — they've served their purpose:-```bash-rm -rf "<skill-name>-workspace/_borrowed_refs"-```--### Write the SKILL.md--#### Plan the directory structure first--Before writing a single line of SKILL.md, decide what the skill directory should contain. A skill that only consists of SKILL.md is acceptable for genuinely simple, single-step tasks — but most non-trivial skills deserve a richer structure. Defaulting to a bare SKILL.md for complex skills is the single most common quality failure: it forces the model to reinvent the wheel on every run and buries reusable knowledge inside prose instructions where it can't be executed or updated independently.--Use this decision framework:--| Signal | Action |-|---|---|-| The skill involves repetitive or deterministic steps (parsing, formatting, file generation, aggregation) | Create `scripts/` and bundle an executable script |-| The skill requires domain knowledge, SOPs, schemas, or API references too large to inline | Create `references/` and write standalone docs |-| The skill produces output files (reports, templates, configs, designs) | Create `assets/` with starter templates |-| The skill orchestrates multiple sub-tasks or delegates to specialized agents | Create `agents/` with prompt files for each subagent role |-| The skill covers multiple domains or platforms (AWS vs GCP, Python vs JS) | Create `references/<domain>.md` per variant |--Cross-check against what you found in Reference Discovery: if the highest-install reference skill bundles a `scripts/` directory, there's a proven reason for it. If the new skill has a similar need, mirror that decision.--**Write out the planned structure as a directory tree before coding anything.** Show it to the user: "Here's the structure I'm planning — [tree]. Does this look right?" This takes 30 seconds and prevents throwing away hours of work.--Once the structure is agreed, create all directories and populate them in parallel with writing SKILL.md. SKILL.md should always include clear `references/` pointers with "when to read this" guidance for every bundled file, so the model using the skill knows what to load and when.--Based on the user interview and insights from the reference skills above, fill in these components:--- **name**: Skill identifier-- **description**: When to trigger, what it does. This is the primary triggering mechanism - include both what the skill does AND specific contexts for when to use it. All "when to use" info goes here, not in the body. Note: currently Claude has a tendency to "undertrigger" skills -- to not use them when they'd be useful. To combat this, please make the skill descriptions a little bit "pushy". So for instance, instead of "How to build a simple fast dashboard to display internal Anthropic data.", you might write "How to build a simple fast dashboard to display internal Anthropic data. Make sure to use this skill whenever the user mentions dashboards, data visualization, internal metrics, or wants to display any kind of company data, even if they don't explicitly ask for a 'dashboard.'"-- **compatibility**: Required tools, dependencies (optional, rarely needed)-- **the rest of the skill :)**--### Skill Writing Guide--#### Anatomy of a Skill--```-skill-name/-├── SKILL.md (required)-│ ├── YAML frontmatter (name, description required)-│ └── Markdown instructions + pointers to bundled resources-└── Bundled Resources (create proactively for non-trivial skills)- ├── scripts/ - Executable code for deterministic/repetitive tasks- ├── references/ - Domain knowledge, SOPs, schemas, API docs- ├── assets/ - Output templates, icons, fonts, starter files- └── agents/ - Prompt files for subagent roles-```--#### Progressive Disclosure--Skills use a three-level loading system:-1. **Metadata** (name + description) - Always in context (~100 words)-2. **SKILL.md body** - In context whenever skill triggers (<500 lines ideal)-3. **Bundled resources** - As needed (unlimited, scripts can execute without loading)--These word counts are approximate and you can feel free to go longer if needed.--**Key patterns:**-- Keep SKILL.md under 500 lines; if you're approaching this limit, add an additional layer of hierarchy along with clear pointers about where the model using the skill should go next to follow up.-- Reference files clearly from SKILL.md with guidance on when to read them-- For large reference files (>300 lines), include a table of contents--**Domain organization**: When a skill supports multiple domains/frameworks, organize by variant:-```-cloud-deploy/-├── SKILL.md (workflow + selection)-└── references/- ├── aws.md- ├── gcp.md- └── azure.md-```-Claude reads only the relevant reference file.--#### Principle of Lack of Surprise--This goes without saying, but skills must not contain malware, exploit code, or any content that could compromise system security. A skill's contents should not surprise the user in their intent if described. Don't go along with requests to create misleading skills or skills designed to facilitate unauthorized access, data exfiltration, or other malicious activities. Things like a "roleplay as an XYZ" are OK though.--#### Writing Patterns--Prefer using the imperative form in instructions.--**Defining output formats** - You can do it like this:-```markdown-## Report structure-ALWAYS use this exact template:-# [Title]-## Executive summary-## Key findings-## Recommendations-```--**Examples pattern** - It's useful to include examples. You can format them like this (but if "Input" and "Output" are in the examples you might want to deviate a little):-```markdown-## Commit message format-**Example 1:**-Input: Added user authentication with JWT tokens-Output: feat(auth): implement JWT-based authentication-```--### Writing Style--Try to explain to the model why things are important in lieu of heavy-handed musty MUSTs. Use theory of mind and try to make the skill general and not super-narrow to specific examples. Start by writing a draft and then look at it with fresh eyes and improve it.--### Test Cases--After writing the skill draft, come up with 2-3 realistic test prompts — the kind of thing a real user would actually say. Share them with the user: [you don't have to use this exact language] "Here are a few test cases I'd like to try. Do these look right, or do you want to add more?" Then run them.--Save test cases to `evals/evals.json`. Don't write assertions yet — just the prompts. You'll draft assertions in the next step while the runs are in progress.--```json-{- "skill_name": "example-skill",- "evals": [- {- "id": 1,- "prompt": "User's task prompt",- "expected_output": "Description of expected result",- "files": []- }- ]-}-```--See `references/schemas.md` for the full schema (including the `assertions` field, which you'll add later).--## Running and evaluating test cases--This section is one continuous sequence — don't stop partway through. Do NOT use `/skill-test` or any other testing skill.--Put results in `<skill-name>-workspace/` as a sibling to the skill directory. Within the workspace, organize results by iteration (`iteration-1/`, `iteration-2/`, etc.) and within that, each test case gets a directory (`eval-0/`, `eval-1/`, etc.). Don't create all of this upfront — just create directories as you go.--### Step 1: Spawn all runs (with-skill AND baseline) in the same turn--For each test case, spawn two subagents in the same turn — one with the skill, one without. This is important: don't spawn the with-skill runs first and then come back for baselines later. Launch everything at once so it all finishes around the same time.--**With-skill run:**--```-Execute this task:-- Skill path: <path-to-skill>-- Task: <eval prompt>-- Input files: <eval files if any, or "none">-- Save outputs to: <workspace>/iteration-<N>/eval-<ID>/with_skill/outputs/-- Outputs to save: <what the user cares about — e.g., "the .docx file", "the final CSV">-```--**Baseline run** (same prompt, but the baseline depends on context):-- **Creating a new skill**: no skill at all. Same prompt, no skill path, save to `without_skill/outputs/`.-- **Improving an existing skill**: the old version. Before editing, snapshot the skill (`cp -r <skill-path> <workspace>/skill-snapshot/`), then point the baseline subagent at the snapshot. Save to `old_skill/outputs/`.--Write an `eval_metadata.json` for each test case (assertions can be empty for now). Give each eval a descriptive name based on what it's testing — not just "eval-0". Use this name for the directory too. If this iteration uses new or modified eval prompts, create these files for each new eval directory — don't assume they carry over from previous iterations.--```json-{- "eval_id": 0,- "eval_name": "descriptive-name-here",- "prompt": "The user's task prompt",- "assertions": []-}-```--### Step 2: While runs are in progress, draft assertions--Don't just wait for the runs to finish — you can use this time productively. Draft quantitative assertions for each test case and explain them to the user. If assertions already exist in `evals/evals.json`, review them and explain what they check.--Good assertions are objectively verifiable and have descriptive names — they should read clearly in the benchmark viewer so someone glancing at the results immediately understands what each one checks. Subjective skills (writing style, design quality) are better evaluated qualitatively — don't force assertions onto things that need human judgment.--Update the `eval_metadata.json` files and `evals/evals.json` with the assertions once drafted. Also explain to the user what they'll see in the viewer — both the qualitative outputs and the quantitative benchmark.--### Step 3: As runs complete, capture timing data--When each subagent task completes, you receive a notification containing `total_tokens` and `duration_ms`. Save this data immediately to `timing.json` in the run directory:--```json-{- "total_tokens": 84852,- "duration_ms": 23332,- "total_duration_seconds": 23.3-}-```--This is the only opportunity to capture this data — it comes through the task notification and isn't persisted elsewhere. Process each notification as it arrives rather than trying to batch them.--### Step 4: Grade, aggregate, and launch the viewer--Once all runs are done:--1. **Grade each run** — spawn a grader subagent (or grade inline) that reads `agents/grader.md` and evaluates each assertion against the outputs. Save results to `grading.json` in each run directory. The grading.json expectations array must use the fields `text`, `passed`, and `evidence` (not `name`/`met`/`details` or other variants) — the viewer depends on these exact field names. For assertions that can be checked programmatically, write and run a script rather than eyeballing it — scripts are faster, more reliable, and can be reused across iterations.--2. **Aggregate into benchmark** — run the aggregation script from the skill-creator directory:- ```bash- python -m scripts.aggregate_benchmark <workspace>/iteration-N --skill-name <name>- ```- This produces `benchmark.json` and `benchmark.md` with pass_rate, time, and tokens for each configuration, with mean ± stddev and the delta. If generating benchmark.json manually, see `references/schemas.md` for the exact schema the viewer expects.-Put each with_skill version before its baseline counterpart.--3. **Do an analyst pass** — read the benchmark data and surface patterns the aggregate stats might hide. See `agents/analyzer.md` (the "Analyzing Benchmark Results" section) for what to look for — things like assertions that always pass regardless of skill (non-discriminating), high-variance evals (possibly flaky), and time/token tradeoffs.--4. **Launch the viewer** with both qualitative outputs and quantitative data:- ```bash- nohup python <skill-creator-path>/eval-viewer/generate_review.py \- <workspace>/iteration-N \- --skill-name "my-skill" \- --benchmark <workspace>/iteration-N/benchmark.json \- > /dev/null 2>&1 &- VIEWER_PID=$!- ```- For iteration 2+, also pass `--previous-workspace <workspace>/iteration-<N-1>`.-- **Cowork / headless environments:** If `webbrowser.open()` is not available or the environment has no display, use `--static <output_path>` to write a standalone HTML file instead of starting a server. Feedback will be downloaded as a `feedback.json` file when the user clicks "Submit All Reviews". After download, copy `feedback.json` into the workspace directory for the next iteration to pick up.--Note: please use generate_review.py to create the viewer; there's no need to write custom HTML.--5. **Tell the user** something like: "I've opened the results in your browser. There are two tabs — 'Outputs' lets you click through each test case and leave feedback, 'Benchmark' shows the quantitative comparison. When you're done, come back here and let me know."--### What the user sees in the viewer--The "Outputs" tab shows one test case at a time:-- **Prompt**: the task that was given-- **Output**: the files the skill produced, rendered inline where possible-- **Previous Output** (iteration 2+): collapsed section showing last iteration's output-- **Formal Grades** (if grading was run): collapsed section showing assertion pass/fail-- **Feedback**: a textbox that auto-saves as they type-- **Previous Feedback** (iteration 2+): their comments from last time, shown below the textbox--The "Benchmark" tab shows the stats summary: pass rates, timing, and token usage for each configuration, with per-eval breakdowns and analyst observations.--Navigation is via prev/next buttons or arrow keys. When done, they click "Submit All Reviews" which saves all feedback to `feedback.json`.--### Step 5: Read the feedback--When the user tells you they're done, read `feedback.json`:--```json-{- "reviews": [- {"run_id": "eval-0-with_skill", "feedback": "the chart is missing axis labels", "timestamp": "..."},- {"run_id": "eval-1-with_skill", "feedback": "", "timestamp": "..."},- {"run_id": "eval-2-with_skill", "feedback": "perfect, love this", "timestamp": "..."}- ],- "status": "complete"-}-```--Empty feedback means the user thought it was fine. Focus your improvements on the test cases where the user had specific complaints.--Kill the viewer server when you're done with it:--```bash-kill $VIEWER_PID 2>/dev/null-```-------## Improving the skill--This is the heart of the loop. You've run the test cases, the user has reviewed the results, and now you need to make the skill better based on their feedback.--### How to think about improvements--1. **Generalize from the feedback.** The big picture thing that's happening here is that we're trying to create skills that can be used a million times (maybe literally, maybe even more who knows) across many different prompts. Here you and the user are iterating on only a few examples over and over again because it helps move faster. The user knows these examples in and out and it's quick for them to assess new outputs. But if the skill you and the user are codeveloping works only for those examples, it's useless. Rather than put in fiddly overfitty changes, or oppressively constrictive MUSTs, if there's some stubborn issue, you might try branching out and using different metaphors, or recommending different patterns of working. It's relatively cheap to try and maybe you'll land on something great.--2. **Keep the prompt lean.** Remove things that aren't pulling their weight. Make sure to read the transcripts, not just the final outputs — if it looks like the skill is making the model waste a bunch of time doing things that are unproductive, you can try getting rid of the parts of the skill that are making it do that and seeing what happens.--3. **Explain the why.** Try hard to explain the **why** behind everything you're asking the model to do. Today's LLMs are *smart*. They have good theory of mind and when given a good harness can go beyond rote instructions and really make things happen. Even if the feedback from the user is terse or frustrated, try to actually understand the task and why the user is writing what they wrote, and what they actually wrote, and then transmit this understanding into the instructions. If you find yourself writing ALWAYS or NEVER in all caps, or using super rigid structures, that's a yellow flag — if possible, reframe and explain the reasoning so that the model understands why the thing you're asking for is important. That's a more humane, powerful, and effective approach.--4. **Look for repeated work across test cases.** Read the transcripts from the test runs and notice if the subagents all independently wrote similar helper scripts or took the same multi-step approach to something. If all 3 test cases resulted in the subagent writing a `create_docx.py` or a `build_chart.py`, that's a strong signal the skill should bundle that script. Write it once, put it in `scripts/`, and tell the skill to use it. This saves every future invocation from reinventing the wheel.--This task is pretty important (we are trying to create billions a year in economic value here!) and your thinking time is not the blocker; take your time and really mull things over. I'd suggest writing a draft revision and then looking at it anew and making improvements. Really do your best to get into the head of the user and understand what they want and need.--### The iteration loop--After improving the skill:--1. Apply your improvements to the skill-2. Rerun all test cases into a new `iteration-<N+1>/` directory, including baseline runs. If you're creating a new skill, the baseline is always `without_skill` (no skill) — that stays the same across iterations. If you're improving an existing skill, use your judgment on what makes sense as the baseline: the original version the user came in with, or the previous iteration.-3. Launch the reviewer with `--previous-workspace` pointing at the previous iteration-4. Wait for the user to review and tell you they're done-5. Read the new feedback, improve again, repeat--Keep going until:-- The user says they're happy-- The feedback is all empty (everything looks good)-- You're not making meaningful progress-------## Advanced: Blind comparison--For situations where you want a more rigorous comparison between two versions of a skill (e.g., the user asks "is the new version actually better?"), there's a blind comparison system. Read `agents/comparator.md` and `agents/analyzer.md` for the details. The basic idea is: give two outputs to an independent agent without telling it which is which, and let it judge quality. Then analyze why the winner won.--This is optional, requires subagents, and most users won't need it. The human review loop is usually sufficient.-------## Description Optimization--The description field in SKILL.md frontmatter is the primary mechanism that determines whether Claude invokes a skill. After creating or improving a skill, offer to optimize the description for better triggering accuracy.--### Step 1: Generate trigger eval queries--Create 20 eval queries — a mix of should-trigger and should-not-trigger. Save as JSON:--```json-[- {"query": "the user prompt", "should_trigger": true},- {"query": "another prompt", "should_trigger": false}-]-```--The queries must be realistic and something a Claude Code or Claude.ai user would actually type. Not abstract requests, but requests that are concrete and specific and have a good amount of detail. For instance, file paths, personal context about the user's job or situation, column names and values, company names, URLs. A little bit of backstory. Some might be in lowercase or contain abbreviations or typos or casual speech. Use a mix of different lengths, and focus on edge cases rather than making them clear-cut (the user will get a chance to sign off on them).--Bad: `"Format this data"`, `"Extract text from PDF"`, `"Create a chart"`--Good: `"ok so my boss just sent me this xlsx file (its in my downloads, called something like 'Q4 sales final FINAL v2.xlsx') and she wants me to add a column that shows the profit margin as a percentage. The revenue is in column C and costs are in column D i think"`--For the **should-trigger** queries (8-10), think about coverage. You want different phrasings of the same intent — some formal, some casual. Include cases where the user doesn't explicitly name the skill or file type but clearly needs it. Throw in some uncommon use cases and cases where this skill competes with another but should win.--For the **should-not-trigger** queries (8-10), the most valuable ones are the near-misses — queries that share keywords or concepts with the skill but actually need something different. Think adjacent domains, ambiguous phrasing where a naive keyword match would trigger but shouldn't, and cases where the query touches on something the skill does but in a context where another tool is more appropriate.--The key thing to avoid: don't make should-not-trigger queries obviously irrelevant. "Write a fibonacci function" as a negative test for a PDF skill is too easy — it doesn't test anything. The negative cases should be genuinely tricky.--### Step 2: Review with user--Present the eval set to the user for review using the HTML template:--1. Read the template from `assets/eval_review.html`-2. Replace the placeholders:- - `__EVAL_DATA_PLACEHOLDER__` → the JSON array of eval items (no quotes around it — it's a JS variable assignment)- - `__SKILL_NAME_PLACEHOLDER__` → the skill's name- - `__SKILL_DESCRIPTION_PLACEHOLDER__` → the skill's current description-3. Write to a temp file (e.g., `/tmp/eval_review_<skill-name>.html`) and open it: `open /tmp/eval_review_<skill-name>.html`-4. The user can edit queries, toggle should-trigger, add/remove entries, then click "Export Eval Set"-5. The file downloads to `~/Downloads/eval_set.json` — check the Downloads folder for the most recent version in case there are multiple (e.g., `eval_set (1).json`)--This step matters — bad eval queries lead to bad descriptions.--### Step 3: Run the optimization loop--Tell the user: "This will take some time — I'll run the optimization loop in the background and check on it periodically."--Save the eval set to the workspace, then run in the background:--```bash-python -m scripts.run_loop \- --eval-set <path-to-trigger-eval.json> \- --skill-path <path-to-skill> \- --model <model-id-powering-this-session> \- --max-iterations 5 \- --verbose-```--Use the model ID from your system prompt (the one powering the current session) so the triggering test matches what the user actually experiences.--While it runs, periodically tail the output to give the user updates on which iteration it's on and what the scores look like.--This handles the full optimization loop automatically. It splits the eval set into 60% train and 40% held-out test, evaluates the current description (running each query 3 times to get a reliable trigger rate), then calls Claude to propose improvements based on what failed. It re-evaluates each new description on both train and test, iterating up to 5 times. When it's done, it opens an HTML report in the browser showing the results per iteration and returns JSON with `best_description` — selected by test score rather than train score to avoid overfitting.--### How skill triggering works--Understanding the triggering mechanism helps design better eval queries. Skills appear in Claude's `available_skills` list with their name + description, and Claude decides whether to consult a skill based on that description. The important thing to know is that Claude only consults skills for tasks it can't easily handle on its own — simple, one-step queries like "read this PDF" may not trigger a skill even if the description matches perfectly, because Claude can handle them directly with basic tools. Complex, multi-step, or specialized queries reliably trigger skills when the description matches.--This means your eval queries should be substantive enough that Claude would actually benefit from consulting a skill. Simple queries like "read file X" are poor test cases — they won't trigger skills regardless of description quality.--### Step 4: Apply the result--Take `best_description` from the JSON output and update the skill's SKILL.md frontmatter. Show the user before/after and report the scores.-------### Package and Present (only if `present_files` tool is available)--Check whether you have access to the `present_files` tool. If you don't, skip this step. If you do, package the skill and present the .skill file to the user:--```bash-python -m scripts.package_skill <path/to/skill-folder>-```--After packaging, direct the user to the resulting `.skill` file path so they can install it.--If you ran Reference Discovery earlier and haven't cleaned up yet, delete borrowed references now:-```bash-rm -rf "<skill-name>-workspace/_borrowed_refs"-```-------## Claude.ai-specific instructions--In Claude.ai, the core workflow is the same (draft → test → review → improve → repeat), but because Claude.ai doesn't have subagents, some mechanics change. Here's what to adapt:--**Running test cases**: No subagents means no parallel execution. For each test case, read the skill's SKILL.md, then follow its instructions to accomplish the test prompt yourself. Do them one at a time. This is less rigorous than independent subagents (you wrote the skill and you're also running it, so you have full context), but it's a useful sanity check — and the human review step compensates. Skip the baseline runs — just use the skill to complete the task as requested.--**Reviewing results**: If you can't open a browser (e.g., Claude.ai's VM has no display, or you're on a remote server), skip the browser reviewer entirely. Instead, present results directly in the conversation. For each test case, show the prompt and the output. If the output is a file the user needs to see (like a .docx or .xlsx), save it to the filesystem and tell them where it is so they can download and inspect it. Ask for feedback inline: "How does this look? Anything you'd change?"--**Benchmarking**: Skip the quantitative benchmarking — it relies on baseline comparisons which aren't meaningful without subagents. Focus on qualitative feedback from the user.--**The iteration loop**: Same as before — improve the skill, rerun the test cases, ask for feedback — just without the browser reviewer in the middle. You can still organize results into iteration directories on the filesystem if you have one.--**Description optimization**: This section requires the `claude` CLI tool (specifically `claude -p`) which is only available in Claude Code. Skip it if you're on Claude.ai.--**Blind comparison**: Requires subagents. Skip it.--**Packaging**: The `package_skill.py` script works anywhere with Python and a filesystem. On Claude.ai, you can run it and the user can download the resulting `.skill` file.--**Updating an existing skill**: The user might be asking you to update an existing skill, not create a new one. In this case:-- **Preserve the original name.** Note the skill's directory name and `name` frontmatter field -- use them unchanged. E.g., if the installed skill is `research-helper`, output `research-helper.skill` (not `research-helper-v2`).-- **Copy to a writeable location before editing.** The installed skill path may be read-only. Copy to `/tmp/skill-name/`, edit there, and package from the copy.-- **If packaging manually, stage in `/tmp/` first**, then copy to the output directory -- direct writes may fail due to permissions.-------## Cowork-Specific Instructions--If you're in Cowork, the main things to know are:--- You have subagents, so the main workflow (spawn test cases in parallel, run baselines, grade, etc.) all works. (However, if you run into severe problems with timeouts, it's OK to run the test prompts in series rather than parallel.)-- You don't have a browser or display, so when generating the eval viewer, use `--static <output_path>` to write a standalone HTML file instead of starting a server. Then proffer a link that the user can click to open the HTML in their browser.-- For whatever reason, the Cowork setup seems to disincline Claude from generating the eval viewer after running the tests, so just to reiterate: whether you're in Cowork or in Claude Code, after running tests, you should always generate the eval viewer for the human to look at examples before revising the skill yourself and trying to make corrections, using `generate_review.py` (not writing your own boutique html code). Sorry in advance but I'm gonna go all caps here: GENERATE THE EVAL VIEWER *BEFORE* evaluating inputs yourself. You want to get them in front of the human ASAP!-- Feedback works differently: since there's no running server, the viewer's "Submit All Reviews" button will download `feedback.json` as a file. You can then read it from there (you may have to request access first).-- Packaging works — `package_skill.py` just needs Python and a filesystem.-- Description optimization (`run_loop.py` / `run_eval.py`) should work in Cowork just fine since it uses `claude -p` via subprocess, not a browser, but please save it until you've fully finished making the skill and the user agrees it's in good shape.-- **Updating an existing skill**: The user might be asking you to update an existing skill, not create a new one. Follow the update guidance in the claude.ai section above.-------## Reference files--The agents/ directory contains instructions for specialized subagents. Read them when you need to spawn the relevant subagent.--- `agents/grader.md` — How to evaluate assertions against outputs-- `agents/comparator.md` — How to do blind A/B comparison between two outputs-- `agents/analyzer.md` — How to analyze why one version beat another--The references/ directory has additional documentation:-- `references/schemas.md` — JSON structures for evals.json, grading.json, etc.-------Repeating one more time the core loop here for emphasis:--- Figure out what the skill is about-- Draft or edit the skill-- Run claude-with-access-to-the-skill on test prompts-- With the user, evaluate the outputs:- - Create benchmark.json and run `eval-viewer/generate_review.py` to help the user review them- - Run quantitative evals-- Repeat until you and the user are satisfied-- Package the final skill and return it to the user.--Please add steps to your TodoList, if you have such a thing, to make sure you don't forget. If you're in Cowork, please specifically put "Create evals JSON and run `eval-viewer/generate_review.py` so human can review test cases" in your TodoList to make sure it happens.--Good luck!--+---+name: skill-creator+description: Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.+---++# Skill Creator++A skill for creating new skills and iteratively improving them.++At a high level, the process of creating a skill goes like this:++- Decide what you want the skill to do and roughly how it should do it+- Write a draft of the skill+- Create a few test prompts and run claude-with-access-to-the-skill on them+- Help the user evaluate the results both qualitatively and quantitatively+ - While the runs happen in the background, draft some quantitative evals if there aren't any (if there are some, you can either use as is or modify if you feel something needs to change about them). Then explain them to the user (or if they already existed, explain the ones that already exist)+ - Use the `eval-viewer/generate_review.py` script to show the user the results for them to look at, and also let them look at the quantitative metrics+- Rewrite the skill based on feedback from the user's evaluation of the results (and also if there are any glaring flaws that become apparent from the quantitative benchmarks)+- Repeat until you're satisfied+- Expand the test set and try again at larger scale++Your job when using this skill is to figure out where the user is in this process and then jump in and help them progress through these stages. So for instance, maybe they're like "I want to make a skill for X". You can help narrow down what they mean, write a draft, write the test cases, figure out how they want to evaluate, run all the prompts, and repeat.++On the other hand, maybe they already have a draft of the skill. In this case you can go straight to the eval/iterate part of the loop.++Of course, you should always be flexible and if the user is like "I don't need to run a bunch of evaluations, just vibe with me", you can do that instead.++Then after the skill is done (but again, the order is flexible), you can also run the skill description improver, which we have a whole separate script for, to optimize the triggering of the skill.++Cool? Cool.++## Communicating with the user++The skill creator is liable to be used by people across a wide range of familiarity with coding jargon. If you haven't heard (and how could you, it's only very recently that it started), there's a trend now where the power of Claude is inspiring plumbers to open up their terminals, parents and grandparents to google "how to install npm". On the other hand, the bulk of users are probably fairly computer-literate.++So please pay attention to context cues to understand how to phrase your communication! In the default case, just to give you some idea:++- "evaluation" and "benchmark" are borderline, but OK+- for "JSON" and "assertion" you want to see serious cues from the user that they know what those things are before using them without explaining them++It's OK to briefly explain terms if you're in doubt, and feel free to clarify terms with a short definition if you're unsure if the user will get it.++---++## Creating a skill++### Capture Intent++Start by understanding the user's intent. The current conversation might already contain a workflow the user wants to capture (e.g., they say "turn this into a skill"). If so, extract answers from the conversation history first — the tools used, the sequence of steps, corrections the user made, input/output formats observed. The user may need to fill the gaps, and should confirm before proceeding to the next step.++1. What should this skill enable Claude to do?+2. When should this skill trigger? (what user phrases/contexts)+3. What's the expected output format?+4. Should we set up test cases to verify the skill works? Skills with objectively verifiable outputs (file transforms, data extraction, code generation, fixed workflow steps) benefit from test cases. Skills with subjective outputs (writing style, art) often don't need them. Suggest the appropriate default based on the skill type, but let the user decide.++### Interview and Research++Proactively ask questions about edge cases, input/output formats, example files, success criteria, and dependencies. Wait to write test prompts until you've got this part ironed out.++Check available MCPs - if useful for research (searching docs, finding similar skills, looking up best practices), research in parallel via subagents if available, otherwise inline. Come prepared with context to reduce burden on the user.++### Reference Discovery++Before writing from scratch, search the community for proven skills similar to what you're building. A skill with tens of thousands of installs has been validated at scale — its structure, scope decisions, and edge case handling encode hard-won lessons. You're not copying; you're learning from what works.++**Step 1: Extract search keywords**++Distill the user's intent into 1–2 concise English keywords describing what the skill *does*. Be semantic, not literal:+- "我想创建一个 PR review 技能" → `code review`+- "a skill that generates changelogs from git history" → `changelog git`+- "help write a skill for translating documents" → `translation`+- "deploy to cloud with rollback support" → `deploy rollback`++> ⚠️ **Keywords must be in English.** Chinese or other non-English keywords will silently return zero results — not because no skill exists, but because the search index only supports English. Always translate the user's intent into English before searching.++**Step 2: Search for related skills**++On Windows:+```bash+powershell -Command "npx skills find '<keywords>'"+```+On macOS/Linux:+```bash+npx skills find '<keywords>'+```++> ⚠️ **Windows critical:** On Windows, running `npx skills find` *without* the `powershell -Command "..."` wrapper will silently produce empty output — this is a Windows/npx compatibility bug, not a sign that no skills exist. If you accidentally get empty output, re-run with the correct PowerShell wrapper before concluding there are no results.++Each result includes an install count (e.g., `112.7K installs`). Results are already sorted descending by installs — select the **top 2**. If fewer than 2 results are returned, use what you have. If 0 results after confirming the command ran correctly, skip to writing.++**Step 3: Fetch the full skill directory without installing**++For each selected result (format: `owner/repo@skill-name`), fetch the **entire skill directory** — not just SKILL.md. Complex skills bundle scripts, reference docs, and asset templates that are equally instructive. Do **not** use `npx skills add` — that creates symlinks and pollutes the user's skill environment.++```bash+SKILL_NAME="<the-skill-being-created>"+REFS_DIR="${SKILL_NAME}-workspace/_borrowed_refs"+mkdir -p "$REFS_DIR"++# Sparse-clone: fetch only the skill subdirectory from the repo+git clone --depth=1 --filter=blob:none --sparse \+ https://github.com/<owner>/<repo>.git "$REFS_DIR/ref-1-repo" 2>/dev/null+git -C "$REFS_DIR/ref-1-repo" sparse-checkout set <skill-name> 2>/dev/null++# Copy the full skill directory (preserving scripts/, references/, assets/, etc.)+# The skill dir may be a named subdirectory, or at repo root — try both+if [ -d "$REFS_DIR/ref-1-repo/<skill-name>" ]; then+ cp -r "$REFS_DIR/ref-1-repo/<skill-name>" "$REFS_DIR/ref-1"+else+ cp -r "$REFS_DIR/ref-1-repo" "$REFS_DIR/ref-1"+fi++rm -rf "$REFS_DIR/ref-1-repo"+# Repeat for ref-2+```++Tell the user what you found and what structure each reference has: e.g., "Found 2 reference skills: **skill-creator** (112.7K installs) — has scripts/, references/, agents/, assets/; **microsoft-skill-creator** (7.6K installs) — SKILL.md only. I'll use these as structural models."++**Step 4: Internalize via progressive disclosure**++Do not read everything at once. Start shallow, then go deeper only where it's relevant to the skill you're building.++**Layer 1 — directory survey (always do this):**+List the directory tree of each reference skill. Note every subdirectory and file name — the structure itself reveals design decisions before you read a single line:+- A `scripts/` directory means the author chose to automate repetitive steps rather than describe them in prose+- A `references/` directory means there's domain knowledge too large to inline+- An `assets/` directory means the skill produces output files (templates, icons, etc.)+- Multiple files in `references/` suggest the skill is domain-partitioned (see "Domain organization" in the Skill Writing Guide)++**Layer 2 — read SKILL.md (always do this):**+Read the main instruction file. Extract:+- **Scope**: what does it do, and what does it explicitly leave out?+- **Structure**: which sections and headings carry the most weight?+- **Instruction style**: how are constraints and examples communicated?+- **Pointers**: does SKILL.md reference bundled files? Note the "when to read X" guidance it gives.+- **Edge cases**: what tricky situations does it handle explicitly?++**Layer 3 — selectively read bundled resources (only when relevant):**+After reading SKILL.md and understanding the user's new skill requirements, decide which bundled files to read:++| If the new skill needs… | Then read… |+|---|---|+| Automation / deterministic steps | `scripts/` files from the reference |+| Structured domain knowledge | `references/` files that overlap with the new domain |+| Output file templates | `assets/` files |+| Subagent coordination | `agents/` prompt files |++Don't read everything — read the files that answer: *"How did they solve the same problem I'm about to solve?"* One well-chosen script or reference doc can save you from designing a flawed structure.++Bring these patterns into writing. Synthesize, don't copy. If a reference script handles a repetitive task elegantly and the new skill has a similar need, bundle a variant of it rather than asking the model to reinvent it every run.++**Cleanup (after user approves the final skill)**++Before or during packaging, delete the borrowed references — they've served their purpose:+```bash+rm -rf "<skill-name>-workspace/_borrowed_refs"+```++### Write the SKILL.md++#### Plan the directory structure first++Before writing a single line of SKILL.md, decide what the skill directory should contain. A skill that only consists of SKILL.md is acceptable for genuinely simple, single-step tasks — but most non-trivial skills deserve a richer structure. Defaulting to a bare SKILL.md for complex skills is the single most common quality failure: it forces the model to reinvent the wheel on every run and buries reusable knowledge inside prose instructions where it can't be executed or updated independently.++Use this decision framework:++| Signal | Action |+|---|---|+| The skill involves repetitive or deterministic steps (parsing, formatting, file generation, aggregation) | Create `scripts/` and bundle an executable script |+| The skill requires domain knowledge, SOPs, schemas, or API references too large to inline | Create `references/` and write standalone docs |+| The skill produces output files (reports, templates, configs, designs) | Create `assets/` with starter templates |+| The skill orchestrates multiple sub-tasks or delegates to specialized agents | Create `agents/` with prompt files for each subagent role |+| The skill covers multiple domains or platforms (AWS vs GCP, Python vs JS) | Create `references/<domain>.md` per variant |++Cross-check against what you found in Reference Discovery: if the highest-install reference skill bundles a `scripts/` directory, there's a proven reason for it. If the new skill has a similar need, mirror that decision.++**Write out the planned structure as a directory tree before coding anything.** Show it to the user: "Here's the structure I'm planning — [tree]. Does this look right?" This takes 30 seconds and prevents throwing away hours of work.++Once the structure is agreed, create all directories and populate them in parallel with writing SKILL.md. SKILL.md should always include clear `references/` pointers with "when to read this" guidance for every bundled file, so the model using the skill knows what to load and when.++Based on the user interview and insights from the reference skills above, fill in these components:++- **name**: Skill identifier+- **description**: When to trigger, what it does. This is the primary triggering mechanism - include both what the skill does AND specific contexts for when to use it. All "when to use" info goes here, not in the body. Note: currently Claude has a tendency to "undertrigger" skills -- to not use them when they'd be useful. To combat this, please make the skill descriptions a little bit "pushy". So for instance, instead of "How to build a simple fast dashboard to display internal Anthropic data.", you might write "How to build a simple fast dashboard to display internal Anthropic data. Make sure to use this skill whenever the user mentions dashboards, data visualization, internal metrics, or wants to display any kind of company data, even if they don't explicitly ask for a 'dashboard.'"+- **compatibility**: Required tools, dependencies (optional, rarely needed)+- **the rest of the skill :)**++### Skill Writing Guide++#### Anatomy of a Skill++```+skill-name/+├── SKILL.md (required)+│ ├── YAML frontmatter (name, description required)+│ └── Markdown instructions + pointers to bundled resources+└── Bundled Resources (create proactively for non-trivial skills)+ ├── scripts/ - Executable code for deterministic/repetitive tasks+ ├── references/ - Domain knowledge, SOPs, schemas, API docs+ ├── assets/ - Output templates, icons, fonts, starter files+ └── agents/ - Prompt files for subagent roles+```++#### Progressive Disclosure++Skills use a three-level loading system:+1. **Metadata** (name + description) - Always in context (~100 words)+2. **SKILL.md body** - In context whenever skill triggers (<500 lines ideal)+3. **Bundled resources** - As needed (unlimited, scripts can execute without loading)++These word counts are approximate and you can feel free to go longer if needed.++**Key patterns:**+- Keep SKILL.md under 500 lines; if you're approaching this limit, add an additional layer of hierarchy along with clear pointers about where the model using the skill should go next to follow up.+- Reference files clearly from SKILL.md with guidance on when to read them+- For large reference files (>300 lines), include a table of contents++**Domain organization**: When a skill supports multiple domains/frameworks, organize by variant:+```+cloud-deploy/+├── SKILL.md (workflow + selection)+└── references/+ ├── aws.md+ ├── gcp.md+ └── azure.md+```+Claude reads only the relevant reference file.++#### Principle of Lack of Surprise++This goes without saying, but skills must not contain malware, exploit code, or any content that could compromise system security. A skill's contents should not surprise the user in their intent if described. Don't go along with requests to create misleading skills or skills designed to facilitate unauthorized access, data exfiltration, or other malicious activities. Things like a "roleplay as an XYZ" are OK though.++#### Writing Patterns++Prefer using the imperative form in instructions.++**Defining output formats** - You can do it like this:+```markdown+## Report structure+ALWAYS use this exact template:+# [Title]+## Executive summary+## Key findings+## Recommendations+```++**Examples pattern** - It's useful to include examples. You can format them like this (but if "Input" and "Output" are in the examples you might want to deviate a little):+```markdown+## Commit message format+**Example 1:**+Input: Added user authentication with JWT tokens+Output: feat(auth): implement JWT-based authentication+```++### Writing Style++Try to explain to the model why things are important in lieu of heavy-handed musty MUSTs. Use theory of mind and try to make the skill general and not super-narrow to specific examples. Start by writing a draft and then look at it with fresh eyes and improve it.++### Test Cases++After writing the skill draft, come up with 2-3 realistic test prompts — the kind of thing a real user would actually say. Share them with the user: [you don't have to use this exact language] "Here are a few test cases I'd like to try. Do these look right, or do you want to add more?" Then run them.++Save test cases to `evals/evals.json`. Don't write assertions yet — just the prompts. You'll draft assertions in the next step while the runs are in progress.++```json+{+ "skill_name": "example-skill",+ "evals": [+ {+ "id": 1,+ "prompt": "User's task prompt",+ "expected_output": "Description of expected result",+ "files": []+ }+ ]+}+```++See `references/schemas.md` for the full schema (including the `assertions` field, which you'll add later).++## Running and evaluating test cases++This section is one continuous sequence — don't stop partway through. Do NOT use `/skill-test` or any other testing skill.++Put results in `<skill-name>-workspace/` as a sibling to the skill directory. Within the workspace, organize results by iteration (`iteration-1/`, `iteration-2/`, etc.) and within that, each test case gets a directory (`eval-0/`, `eval-1/`, etc.). Don't create all of this upfront — just create directories as you go.++### Step 1: Spawn all runs (with-skill AND baseline) in the same turn++For each test case, spawn two subagents in the same turn — one with the skill, one without. This is important: don't spawn the with-skill runs first and then come back for baselines later. Launch everything at once so it all finishes around the same time.++**With-skill run:**++```+Execute this task:+- Skill path: <path-to-skill>+- Task: <eval prompt>+- Input files: <eval files if any, or "none">+- Save outputs to: <workspace>/iteration-<N>/eval-<ID>/with_skill/outputs/+- Outputs to save: <what the user cares about — e.g., "the .docx file", "the final CSV">+```++**Baseline run** (same prompt, but the baseline depends on context):+- **Creating a new skill**: no skill at all. Same prompt, no skill path, save to `without_skill/outputs/`.+- **Improving an existing skill**: the old version. Before editing, snapshot the skill (`cp -r <skill-path> <workspace>/skill-snapshot/`), then point the baseline subagent at the snapshot. Save to `old_skill/outputs/`.++Write an `eval_metadata.json` for each test case (assertions can be empty for now). Give each eval a descriptive name based on what it's testing — not just "eval-0". Use this name for the directory too. If this iteration uses new or modified eval prompts, create these files for each new eval directory — don't assume they carry over from previous iterations.++```json+{+ "eval_id": 0,+ "eval_name": "descriptive-name-here",+ "prompt": "The user's task prompt",+ "assertions": []+}+```++### Step 2: While runs are in progress, draft assertions++Don't just wait for the runs to finish — you can use this time productively. Draft quantitative assertions for each test case and explain them to the user. If assertions already exist in `evals/evals.json`, review them and explain what they check.++Good assertions are objectively verifiable and have descriptive names — they should read clearly in the benchmark viewer so someone glancing at the results immediately understands what each one checks. Subjective skills (writing style, design quality) are better evaluated qualitatively — don't force assertions onto things that need human judgment.++Update the `eval_metadata.json` files and `evals/evals.json` with the assertions once drafted. Also explain to the user what they'll see in the viewer — both the qualitative outputs and the quantitative benchmark.++### Step 3: As runs complete, capture timing data++When each subagent task completes, you receive a notification containing `total_tokens` and `duration_ms`. Save this data immediately to `timing.json` in the run directory:++```json+{+ "total_tokens": 84852,+ "duration_ms": 23332,+ "total_duration_seconds": 23.3+}+```++This is the only opportunity to capture this data — it comes through the task notification and isn't persisted elsewhere. Process each notification as it arrives rather than trying to batch them.++### Step 4: Grade, aggregate, and launch the viewer++Once all runs are done:++1. **Grade each run** — spawn a grader subagent (or grade inline) that reads `agents/grader.md` and evaluates each assertion against the outputs. Save results to `grading.json` in each run directory. The grading.json expectations array must use the fields `text`, `passed`, and `evidence` (not `name`/`met`/`details` or other variants) — the viewer depends on these exact field names. For assertions that can be checked programmatically, write and run a script rather than eyeballing it — scripts are faster, more reliable, and can be reused across iterations.++2. **Aggregate into benchmark** — run the aggregation script from the skill-creator directory:+ ```bash+ python -m scripts.aggregate_benchmark <workspace>/iteration-N --skill-name <name>+ ```+ This produces `benchmark.json` and `benchmark.md` with pass_rate, time, and tokens for each configuration, with mean ± stddev and the delta. If generating benchmark.json manually, see `references/schemas.md` for the exact schema the viewer expects.+Put each with_skill version before its baseline counterpart.++3. **Do an analyst pass** — read the benchmark data and surface patterns the aggregate stats might hide. See `agents/analyzer.md` (the "Analyzing Benchmark Results" section) for what to look for — things like assertions that always pass regardless of skill (non-discriminating), high-variance evals (possibly flaky), and time/token tradeoffs.++4. **Launch the viewer** with both qualitative outputs and quantitative data:+ ```bash+ nohup python <skill-creator-path>/eval-viewer/generate_review.py \+ <workspace>/iteration-N \+ --skill-name "my-skill" \+ --benchmark <workspace>/iteration-N/benchmark.json \+ > /dev/null 2>&1 &+ VIEWER_PID=$!+ ```+ For iteration 2+, also pass `--previous-workspace <workspace>/iteration-<N-1>`.++ **Cowork / headless environments:** If `webbrowser.open()` is not available or the environment has no display, use `--static <output_path>` to write a standalone HTML file instead of starting a server. Feedback will be downloaded as a `feedback.json` file when the user clicks "Submit All Reviews". After download, copy `feedback.json` into the workspace directory for the next iteration to pick up.++Note: please use generate_review.py to create the viewer; there's no need to write custom HTML.++5. **Tell the user** something like: "I've opened the results in your browser. There are two tabs — 'Outputs' lets you click through each test case and leave feedback, 'Benchmark' shows the quantitative comparison. When you're done, come back here and let me know."++### What the user sees in the viewer++The "Outputs" tab shows one test case at a time:+- **Prompt**: the task that was given+- **Output**: the files the skill produced, rendered inline where possible+- **Previous Output** (iteration 2+): collapsed section showing last iteration's output+- **Formal Grades** (if grading was run): collapsed section showing assertion pass/fail+- **Feedback**: a textbox that auto-saves as they type+- **Previous Feedback** (iteration 2+): their comments from last time, shown below the textbox++The "Benchmark" tab shows the stats summary: pass rates, timing, and token usage for each configuration, with per-eval breakdowns and analyst observations.++Navigation is via prev/next buttons or arrow keys. When done, they click "Submit All Reviews" which saves all feedback to `feedback.json`.++### Step 5: Read the feedback++When the user tells you they're done, read `feedback.json`:++```json+{+ "reviews": [+ {"run_id": "eval-0-with_skill", "feedback": "the chart is missing axis labels", "timestamp": "..."},+ {"run_id": "eval-1-with_skill", "feedback": "", "timestamp": "..."},+ {"run_id": "eval-2-with_skill", "feedback": "perfect, love this", "timestamp": "..."}+ ],+ "status": "complete"+}+```++Empty feedback means the user thought it was fine. Focus your improvements on the test cases where the user had specific complaints.++Kill the viewer server when you're done with it:++```bash+kill $VIEWER_PID 2>/dev/null+```++---++## Improving the skill++This is the heart of the loop. You've run the test cases, the user has reviewed the results, and now you need to make the skill better based on their feedback.++### How to think about improvements++1. **Generalize from the feedback.** The big picture thing that's happening here is that we're trying to create skills that can be used a million times (maybe literally, maybe even more who knows) across many different prompts. Here you and the user are iterating on only a few examples over and over again because it helps move faster. The user knows these examples in and out and it's quick for them to assess new outputs. But if the skill you and the user are codeveloping works only for those examples, it's useless. Rather than put in fiddly overfitty changes, or oppressively constrictive MUSTs, if there's some stubborn issue, you might try branching out and using different metaphors, or recommending different patterns of working. It's relatively cheap to try and maybe you'll land on something great.++2. **Keep the prompt lean.** Remove things that aren't pulling their weight. Make sure to read the transcripts, not just the final outputs — if it looks like the skill is making the model waste a bunch of time doing things that are unproductive, you can try getting rid of the parts of the skill that are making it do that and seeing what happens.++3. **Explain the why.** Try hard to explain the **why** behind everything you're asking the model to do. Today's LLMs are *smart*. They have good theory of mind and when given a good harness can go beyond rote instructions and really make things happen. Even if the feedback from the user is terse or frustrated, try to actually understand the task and why the user is writing what they wrote, and what they actually wrote, and then transmit this understanding into the instructions. If you find yourself writing ALWAYS or NEVER in all caps, or using super rigid structures, that's a yellow flag — if possible, reframe and explain the reasoning so that the model understands why the thing you're asking for is important. That's a more humane, powerful, and effective approach.++4. **Look for repeated work across test cases.** Read the transcripts from the test runs and notice if the subagents all independently wrote similar helper scripts or took the same multi-step approach to something. If all 3 test cases resulted in the subagent writing a `create_docx.py` or a `build_chart.py`, that's a strong signal the skill should bundle that script. Write it once, put it in `scripts/`, and tell the skill to use it. This saves every future invocation from reinventing the wheel.++This task is pretty important (we are trying to create billions a year in economic value here!) and your thinking time is not the blocker; take your time and really mull things over. I'd suggest writing a draft revision and then looking at it anew and making improvements. Really do your best to get into the head of the user and understand what they want and need.++### The iteration loop++After improving the skill:++1. Apply your improvements to the skill+2. Rerun all test cases into a new `iteration-<N+1>/` directory, including baseline runs. If you're creating a new skill, the baseline is always `without_skill` (no skill) — that stays the same across iterations. If you're improving an existing skill, use your judgment on what makes sense as the baseline: the original version the user came in with, or the previous iteration.+3. Launch the reviewer with `--previous-workspace` pointing at the previous iteration+4. Wait for the user to review and tell you they're done+5. Read the new feedback, improve again, repeat++Keep going until:+- The user says they're happy+- The feedback is all empty (everything looks good)+- You're not making meaningful progress++---++## Advanced: Blind comparison++For situations where you want a more rigorous comparison between two versions of a skill (e.g., the user asks "is the new version actually better?"), there's a blind comparison system. Read `agents/comparator.md` and `agents/analyzer.md` for the details. The basic idea is: give two outputs to an independent agent without telling it which is which, and let it judge quality. Then analyze why the winner won.++This is optional, requires subagents, and most users won't need it. The human review loop is usually sufficient.++---++## Description Optimization++The description field in SKILL.md frontmatter is the primary mechanism that determines whether Claude invokes a skill. After creating or improving a skill, offer to optimize the description for better triggering accuracy.++### Step 1: Generate trigger eval queries++Create 20 eval queries — a mix of should-trigger and should-not-trigger. Save as JSON:++```json+[+ {"query": "the user prompt", "should_trigger": true},+ {"query": "another prompt", "should_trigger": false}+]+```++The queries must be realistic and something a Claude Code or Claude.ai user would actually type. Not abstract requests, but requests that are concrete and specific and have a good amount of detail. For instance, file paths, personal context about the user's job or situation, column names and values, company names, URLs. A little bit of backstory. Some might be in lowercase or contain abbreviations or typos or casual speech. Use a mix of different lengths, and focus on edge cases rather than making them clear-cut (the user will get a chance to sign off on them).++Bad: `"Format this data"`, `"Extract text from PDF"`, `"Create a chart"`++Good: `"ok so my boss just sent me this xlsx file (its in my downloads, called something like 'Q4 sales final FINAL v2.xlsx') and she wants me to add a column that shows the profit margin as a percentage. The revenue is in column C and costs are in column D i think"`++For the **should-trigger** queries (8-10), think about coverage. You want different phrasings of the same intent — some formal, some casual. Include cases where the user doesn't explicitly name the skill or file type but clearly needs it. Throw in some uncommon use cases and cases where this skill competes with another but should win.++For the **should-not-trigger** queries (8-10), the most valuable ones are the near-misses — queries that share keywords or concepts with the skill but actually need something different. Think adjacent domains, ambiguous phrasing where a naive keyword match would trigger but shouldn't, and cases where the query touches on something the skill does but in a context where another tool is more appropriate.++The key thing to avoid: don't make should-not-trigger queries obviously irrelevant. "Write a fibonacci function" as a negative test for a PDF skill is too easy — it doesn't test anything. The negative cases should be genuinely tricky.++### Step 2: Review with user++Present the eval set to the user for review using the HTML template:++1. Read the template from `assets/eval_review.html`+2. Replace the placeholders:+ - `__EVAL_DATA_PLACEHOLDER__` → the JSON array of eval items (no quotes around it — it's a JS variable assignment)+ - `__SKILL_NAME_PLACEHOLDER__` → the skill's name+ - `__SKILL_DESCRIPTION_PLACEHOLDER__` → the skill's current description+3. Write to a temp file (e.g., `/tmp/eval_review_<skill-name>.html`) and open it: `open /tmp/eval_review_<skill-name>.html`+4. The user can edit queries, toggle should-trigger, add/remove entries, then click "Export Eval Set"+5. The file downloads to `~/Downloads/eval_set.json` — check the Downloads folder for the most recent version in case there are multiple (e.g., `eval_set (1).json`)++This step matters — bad eval queries lead to bad descriptions.++### Step 3: Run the optimization loop++Tell the user: "This will take some time — I'll run the optimization loop in the background and check on it periodically."++Save the eval set to the workspace, then run in the background:++```bash+python -m scripts.run_loop \+ --eval-set <path-to-trigger-eval.json> \+ --skill-path <path-to-skill> \+ --model <model-id-powering-this-session> \+ --max-iterations 5 \+ --verbose+```++Use the model ID from your system prompt (the one powering the current session) so the triggering test matches what the user actually experiences.++While it runs, periodically tail the output to give the user updates on which iteration it's on and what the scores look like.++This handles the full optimization loop automatically. It splits the eval set into 60% train and 40% held-out test, evaluates the current description (running each query 3 times to get a reliable trigger rate), then calls Claude to propose improvements based on what failed. It re-evaluates each new description on both train and test, iterating up to 5 times. When it's done, it opens an HTML report in the browser showing the results per iteration and returns JSON with `best_description` — selected by test score rather than train score to avoid overfitting.++### How skill triggering works++Understanding the triggering mechanism helps design better eval queries. Skills appear in Claude's `available_skills` list with their name + description, and Claude decides whether to consult a skill based on that description. The important thing to know is that Claude only consults skills for tasks it can't easily handle on its own — simple, one-step queries like "read this PDF" may not trigger a skill even if the description matches perfectly, because Claude can handle them directly with basic tools. Complex, multi-step, or specialized queries reliably trigger skills when the description matches.++This means your eval queries should be substantive enough that Claude would actually benefit from consulting a skill. Simple queries like "read file X" are poor test cases — they won't trigger skills regardless of description quality.++### Step 4: Apply the result++Take `best_description` from the JSON output and update the skill's SKILL.md frontmatter. Show the user before/after and report the scores.++---++### Package and Present (only if `present_files` tool is available)++Check whether you have access to the `present_files` tool. If you don't, skip this step. If you do, package the skill and present the .skill file to the user:++```bash+python -m scripts.package_skill <path/to/skill-folder>+```++After packaging, direct the user to the resulting `.skill` file path so they can install it.++If you ran Reference Discovery earlier and haven't cleaned up yet, delete borrowed references now:+```bash+rm -rf "<skill-name>-workspace/_borrowed_refs"+```++---++## Claude.ai-specific instructions++In Claude.ai, the core workflow is the same (draft → test → review → improve → repeat), but because Claude.ai doesn't have subagents, some mechanics change. Here's what to adapt:++**Running test cases**: No subagents means no parallel execution. For each test case, read the skill's SKILL.md, then follow its instructions to accomplish the test prompt yourself. Do them one at a time. This is less rigorous than independent subagents (you wrote the skill and you're also running it, so you have full context), but it's a useful sanity check — and the human review step compensates. Skip the baseline runs — just use the skill to complete the task as requested.++**Reviewing results**: If you can't open a browser (e.g., Claude.ai's VM has no display, or you're on a remote server), skip the browser reviewer entirely. Instead, present results directly in the conversation. For each test case, show the prompt and the output. If the output is a file the user needs to see (like a .docx or .xlsx), save it to the filesystem and tell them where it is so they can download and inspect it. Ask for feedback inline: "How does this look? Anything you'd change?"++**Benchmarking**: Skip the quantitative benchmarking — it relies on baseline comparisons which aren't meaningful without subagents. Focus on qualitative feedback from the user.++**The iteration loop**: Same as before — improve the skill, rerun the test cases, ask for feedback — just without the browser reviewer in the middle. You can still organize results into iteration directories on the filesystem if you have one.++**Description optimization**: This section requires the `claude` CLI tool (specifically `claude -p`) which is only available in Claude Code. Skip it if you're on Claude.ai.++**Blind comparison**: Requires subagents. Skip it.++**Packaging**: The `package_skill.py` script works anywhere with Python and a filesystem. On Claude.ai, you can run it and the user can download the resulting `.skill` file.++**Updating an existing skill**: The user might be asking you to update an existing skill, not create a new one. In this case:+- **Preserve the original name.** Note the skill's directory name and `name` frontmatter field -- use them unchanged. E.g., if the installed skill is `research-helper`, output `research-helper.skill` (not `research-helper-v2`).+- **Copy to a writeable location before editing.** The installed skill path may be read-only. Copy to `/tmp/skill-name/`, edit there, and package from the copy.+- **If packaging manually, stage in `/tmp/` first**, then copy to the output directory -- direct writes may fail due to permissions.++---++## Cowork-Specific Instructions++If you're in Cowork, the main things to know are:++- You have subagents, so the main workflow (spawn test cases in parallel, run baselines, grade, etc.) all works. (However, if you run into severe problems with timeouts, it's OK to run the test prompts in series rather than parallel.)+- You don't have a browser or display, so when generating the eval viewer, use `--static <output_path>` to write a standalone HTML file instead of starting a server. Then proffer a link that the user can click to open the HTML in their browser.+- For whatever reason, the Cowork setup seems to disincline Claude from generating the eval viewer after running the tests, so just to reiterate: whether you're in Cowork or in Claude Code, after running tests, you should always generate the eval viewer for the human to look at examples before revising the skill yourself and trying to make corrections, using `generate_review.py` (not writing your own boutique html code). Sorry in advance but I'm gonna go all caps here: GENERATE THE EVAL VIEWER *BEFORE* evaluating inputs yourself. You want to get them in front of the human ASAP!+- Feedback works differently: since there's no running server, the viewer's "Submit All Reviews" button will download `feedback.json` as a file. You can then read it from there (you may have to request access first).+- Packaging works — `package_skill.py` just needs Python and a filesystem.+- Description optimization (`run_loop.py` / `run_eval.py`) should work in Cowork just fine since it uses `claude -p` via subprocess, not a browser, but please save it until you've fully finished making the skill and the user agrees it's in good shape.+- **Updating an existing skill**: The user might be asking you to update an existing skill, not create a new one. Follow the update guidance in the claude.ai section above.++---++## Reference files++The agents/ directory contains instructions for specialized subagents. Read them when you need to spawn the relevant subagent.++- `agents/grader.md` — How to evaluate assertions against outputs+- `agents/comparator.md` — How to do blind A/B comparison between two outputs+- `agents/analyzer.md` — How to analyze why one version beat another++The references/ directory has additional documentation:+- `references/schemas.md` — JSON structures for evals.json, grading.json, etc.++---++Repeating one more time the core loop here for emphasis:++- Figure out what the skill is about+- Draft or edit the skill+- Run claude-with-access-to-the-skill on test prompts+- With the user, evaluate the outputs:+ - Create benchmark.json and run `eval-viewer/generate_review.py` to help the user review them+ - Run quantitative evals+- Repeat until you and the user are satisfied+- Package the final skill and return it to the user.++Please add steps to your TodoList, if you have such a thing, to make sure you don't forget. If you're in Cowork, please specifically put "Create evals JSON and run `eval-viewer/generate_review.py` so human can review test cases" in your TodoList to make sure it happens.++Good luck!++diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/agents/analyzer.md b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/agents/analyzer.mdsimilarity index 97%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/agents/analyzer.mdrename to jiuwenclaw/resources/agent/workspace/skills/skill-creator/agents/analyzer.mdindex 89ffec909f..14e41d6068 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/agents/analyzer.md+++ b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/agents/analyzer.md@@ -1,274 +1,274 @@-# Post-hoc Analyzer Agent--Analyze blind comparison results to understand WHY the winner won and generate improvement suggestions.--## Role--After the blind comparator determines a winner, the Post-hoc Analyzer "unblids" the results by examining the skills and transcripts. The goal is to extract actionable insights: what made the winner better, and how can the loser be improved?--## Inputs--You receive these parameters in your prompt:--- **winner**: "A" or "B" (from blind comparison)-- **winner_skill_path**: Path to the skill that produced the winning output-- **winner_transcript_path**: Path to the execution transcript for the winner-- **loser_skill_path**: Path to the skill that produced the losing output-- **loser_transcript_path**: Path to the execution transcript for the loser-- **comparison_result_path**: Path to the blind comparator's output JSON-- **output_path**: Where to save the analysis results--## Process--### Step 1: Read Comparison Result--1. Read the blind comparator's output at comparison_result_path-2. Note the winning side (A or B), the reasoning, and any scores-3. Understand what the comparator valued in the winning output--### Step 2: Read Both Skills--1. Read the winner skill's SKILL.md and key referenced files-2. Read the loser skill's SKILL.md and key referenced files-3. Identify structural differences:- - Instructions clarity and specificity- - Script/tool usage patterns- - Example coverage- - Edge case handling--### Step 3: Read Both Transcripts--1. Read the winner's transcript-2. Read the loser's transcript-3. Compare execution patterns:- - How closely did each follow their skill's instructions?- - What tools were used differently?- - Where did the loser diverge from optimal behavior?- - Did either encounter errors or make recovery attempts?--### Step 4: Analyze Instruction Following--For each transcript, evaluate:-- Did the agent follow the skill's explicit instructions?-- Did the agent use the skill's provided tools/scripts?-- Were there missed opportunities to leverage skill content?-- Did the agent add unnecessary steps not in the skill?--Score instruction following 1-10 and note specific issues.--### Step 5: Identify Winner Strengths--Determine what made the winner better:-- Clearer instructions that led to better behavior?-- Better scripts/tools that produced better output?-- More comprehensive examples that guided edge cases?-- Better error handling guidance?--Be specific. Quote from skills/transcripts where relevant.--### Step 6: Identify Loser Weaknesses--Determine what held the loser back:-- Ambiguous instructions that led to suboptimal choices?-- Missing tools/scripts that forced workarounds?-- Gaps in edge case coverage?-- Poor error handling that caused failures?--### Step 7: Generate Improvement Suggestions--Based on the analysis, produce actionable suggestions for improving the loser skill:-- Specific instruction changes to make-- Tools/scripts to add or modify-- Examples to include-- Edge cases to address--Prioritize by impact. Focus on changes that would have changed the outcome.--### Step 8: Write Analysis Results--Save structured analysis to `{output_path}`.--## Output Format--Write a JSON file with this structure:--```json-{- "comparison_summary": {- "winner": "A",- "winner_skill": "path/to/winner/skill",- "loser_skill": "path/to/loser/skill",- "comparator_reasoning": "Brief summary of why comparator chose winner"- },- "winner_strengths": [- "Clear step-by-step instructions for handling multi-page documents",- "Included validation script that caught formatting errors",- "Explicit guidance on fallback behavior when OCR fails"- ],- "loser_weaknesses": [- "Vague instruction 'process the document appropriately' led to inconsistent behavior",- "No script for validation, agent had to improvise and made errors",- "No guidance on OCR failure, agent gave up instead of trying alternatives"- ],- "instruction_following": {- "winner": {- "score": 9,- "issues": [- "Minor: skipped optional logging step"- ]- },- "loser": {- "score": 6,- "issues": [- "Did not use the skill's formatting template",- "Invented own approach instead of following step 3",- "Missed the 'always validate output' instruction"- ]- }- },- "improvement_suggestions": [- {- "priority": "high",- "category": "instructions",- "suggestion": "Replace 'process the document appropriately' with explicit steps: 1) Extract text, 2) Identify sections, 3) Format per template",- "expected_impact": "Would eliminate ambiguity that caused inconsistent behavior"- },- {- "priority": "high",- "category": "tools",- "suggestion": "Add validate_output.py script similar to winner skill's validation approach",- "expected_impact": "Would catch formatting errors before final output"- },- {- "priority": "medium",- "category": "error_handling",- "suggestion": "Add fallback instructions: 'If OCR fails, try: 1) different resolution, 2) image preprocessing, 3) manual extraction'",- "expected_impact": "Would prevent early failure on difficult documents"- }- ],- "transcript_insights": {- "winner_execution_pattern": "Read skill -> Followed 5-step process -> Used validation script -> Fixed 2 issues -> Produced output",- "loser_execution_pattern": "Read skill -> Unclear on approach -> Tried 3 different methods -> No validation -> Output had errors"- }-}-```--## Guidelines--- **Be specific**: Quote from skills and transcripts, don't just say "instructions were unclear"-- **Be actionable**: Suggestions should be concrete changes, not vague advice-- **Focus on skill improvements**: The goal is to improve the losing skill, not critique the agent-- **Prioritize by impact**: Which changes would most likely have changed the outcome?-- **Consider causation**: Did the skill weakness actually cause the worse output, or is it incidental?-- **Stay objective**: Analyze what happened, don't editorialize-- **Think about generalization**: Would this improvement help on other evals too?--## Categories for Suggestions--Use these categories to organize improvement suggestions:--| Category | Description |-|----------|-------------|-| `instructions` | Changes to the skill's prose instructions |-| `tools` | Scripts, templates, or utilities to add/modify |-| `examples` | Example inputs/outputs to include |-| `error_handling` | Guidance for handling failures |-| `structure` | Reorganization of skill content |-| `references` | External docs or resources to add |--## Priority Levels--- **high**: Would likely change the outcome of this comparison-- **medium**: Would improve quality but may not change win/loss-- **low**: Nice to have, marginal improvement-------# Analyzing Benchmark Results--When analyzing benchmark results, the analyzer's purpose is to **surface patterns and anomalies** across multiple runs, not suggest skill improvements.--## Role--Review all benchmark run results and generate freeform notes that help the user understand skill performance. Focus on patterns that wouldn't be visible from aggregate metrics alone.--## Inputs--You receive these parameters in your prompt:--- **benchmark_data_path**: Path to the in-progress benchmark.json with all run results-- **skill_path**: Path to the skill being benchmarked-- **output_path**: Where to save the notes (as JSON array of strings)--## Process--### Step 1: Read Benchmark Data--1. Read the benchmark.json containing all run results-2. Note the configurations tested (with_skill, without_skill)-3. Understand the run_summary aggregates already calculated--### Step 2: Analyze Per-Assertion Patterns--For each expectation across all runs:-- Does it **always pass** in both configurations? (may not differentiate skill value)-- Does it **always fail** in both configurations? (may be broken or beyond capability)-- Does it **always pass with skill but fail without**? (skill clearly adds value here)-- Does it **always fail with skill but pass without**? (skill may be hurting)-- Is it **highly variable**? (flaky expectation or non-deterministic behavior)--### Step 3: Analyze Cross-Eval Patterns--Look for patterns across evals:-- Are certain eval types consistently harder/easier?-- Do some evals show high variance while others are stable?-- Are there surprising results that contradict expectations?--### Step 4: Analyze Metrics Patterns--Look at time_seconds, tokens, tool_calls:-- Does the skill significantly increase execution time?-- Is there high variance in resource usage?-- Are there outlier runs that skew the aggregates?--### Step 5: Generate Notes--Write freeform observations as a list of strings. Each note should:-- State a specific observation-- Be grounded in the data (not speculation)-- Help the user understand something the aggregate metrics don't show--Examples:-- "Assertion 'Output is a PDF file' passes 100% in both configurations - may not differentiate skill value"-- "Eval 3 shows high variance (50% ± 40%) - run 2 had an unusual failure that may be flaky"-- "Without-skill runs consistently fail on table extraction expectations (0% pass rate)"-- "Skill adds 13s average execution time but improves pass rate by 50%"-- "Token usage is 80% higher with skill, primarily due to script output parsing"-- "All 3 without-skill runs for eval 1 produced empty output"--### Step 6: Write Notes--Save notes to `{output_path}` as a JSON array of strings:--```json-[- "Assertion 'Output is a PDF file' passes 100% in both configurations - may not differentiate skill value",- "Eval 3 shows high variance (50% ± 40%) - run 2 had an unusual failure",- "Without-skill runs consistently fail on table extraction expectations",- "Skill adds 13s average execution time but improves pass rate by 50%"-]-```--## Guidelines--**DO:**-- Report what you observe in the data-- Be specific about which evals, expectations, or runs you're referring to-- Note patterns that aggregate metrics would hide-- Provide context that helps interpret the numbers--**DO NOT:**-- Suggest improvements to the skill (that's for the improvement step, not benchmarking)-- Make subjective quality judgments ("the output was good/bad")-- Speculate about causes without evidence-- Repeat information already in the run_summary aggregates+# Post-hoc Analyzer Agent++Analyze blind comparison results to understand WHY the winner won and generate improvement suggestions.++## Role++After the blind comparator determines a winner, the Post-hoc Analyzer "unblids" the results by examining the skills and transcripts. The goal is to extract actionable insights: what made the winner better, and how can the loser be improved?++## Inputs++You receive these parameters in your prompt:++- **winner**: "A" or "B" (from blind comparison)+- **winner_skill_path**: Path to the skill that produced the winning output+- **winner_transcript_path**: Path to the execution transcript for the winner+- **loser_skill_path**: Path to the skill that produced the losing output+- **loser_transcript_path**: Path to the execution transcript for the loser+- **comparison_result_path**: Path to the blind comparator's output JSON+- **output_path**: Where to save the analysis results++## Process++### Step 1: Read Comparison Result++1. Read the blind comparator's output at comparison_result_path+2. Note the winning side (A or B), the reasoning, and any scores+3. Understand what the comparator valued in the winning output++### Step 2: Read Both Skills++1. Read the winner skill's SKILL.md and key referenced files+2. Read the loser skill's SKILL.md and key referenced files+3. Identify structural differences:+ - Instructions clarity and specificity+ - Script/tool usage patterns+ - Example coverage+ - Edge case handling++### Step 3: Read Both Transcripts++1. Read the winner's transcript+2. Read the loser's transcript+3. Compare execution patterns:+ - How closely did each follow their skill's instructions?+ - What tools were used differently?+ - Where did the loser diverge from optimal behavior?+ - Did either encounter errors or make recovery attempts?++### Step 4: Analyze Instruction Following++For each transcript, evaluate:+- Did the agent follow the skill's explicit instructions?+- Did the agent use the skill's provided tools/scripts?+- Were there missed opportunities to leverage skill content?+- Did the agent add unnecessary steps not in the skill?++Score instruction following 1-10 and note specific issues.++### Step 5: Identify Winner Strengths++Determine what made the winner better:+- Clearer instructions that led to better behavior?+- Better scripts/tools that produced better output?+- More comprehensive examples that guided edge cases?+- Better error handling guidance?++Be specific. Quote from skills/transcripts where relevant.++### Step 6: Identify Loser Weaknesses++Determine what held the loser back:+- Ambiguous instructions that led to suboptimal choices?+- Missing tools/scripts that forced workarounds?+- Gaps in edge case coverage?+- Poor error handling that caused failures?++### Step 7: Generate Improvement Suggestions++Based on the analysis, produce actionable suggestions for improving the loser skill:+- Specific instruction changes to make+- Tools/scripts to add or modify+- Examples to include+- Edge cases to address++Prioritize by impact. Focus on changes that would have changed the outcome.++### Step 8: Write Analysis Results++Save structured analysis to `{output_path}`.++## Output Format++Write a JSON file with this structure:++```json+{+ "comparison_summary": {+ "winner": "A",+ "winner_skill": "path/to/winner/skill",+ "loser_skill": "path/to/loser/skill",+ "comparator_reasoning": "Brief summary of why comparator chose winner"+ },+ "winner_strengths": [+ "Clear step-by-step instructions for handling multi-page documents",+ "Included validation script that caught formatting errors",+ "Explicit guidance on fallback behavior when OCR fails"+ ],+ "loser_weaknesses": [+ "Vague instruction 'process the document appropriately' led to inconsistent behavior",+ "No script for validation, agent had to improvise and made errors",+ "No guidance on OCR failure, agent gave up instead of trying alternatives"+ ],+ "instruction_following": {+ "winner": {+ "score": 9,+ "issues": [+ "Minor: skipped optional logging step"+ ]+ },+ "loser": {+ "score": 6,+ "issues": [+ "Did not use the skill's formatting template",+ "Invented own approach instead of following step 3",+ "Missed the 'always validate output' instruction"+ ]+ }+ },+ "improvement_suggestions": [+ {+ "priority": "high",+ "category": "instructions",+ "suggestion": "Replace 'process the document appropriately' with explicit steps: 1) Extract text, 2) Identify sections, 3) Format per template",+ "expected_impact": "Would eliminate ambiguity that caused inconsistent behavior"+ },+ {+ "priority": "high",+ "category": "tools",+ "suggestion": "Add validate_output.py script similar to winner skill's validation approach",+ "expected_impact": "Would catch formatting errors before final output"+ },+ {+ "priority": "medium",+ "category": "error_handling",+ "suggestion": "Add fallback instructions: 'If OCR fails, try: 1) different resolution, 2) image preprocessing, 3) manual extraction'",+ "expected_impact": "Would prevent early failure on difficult documents"+ }+ ],+ "transcript_insights": {+ "winner_execution_pattern": "Read skill -> Followed 5-step process -> Used validation script -> Fixed 2 issues -> Produced output",+ "loser_execution_pattern": "Read skill -> Unclear on approach -> Tried 3 different methods -> No validation -> Output had errors"+ }+}+```++## Guidelines++- **Be specific**: Quote from skills and transcripts, don't just say "instructions were unclear"+- **Be actionable**: Suggestions should be concrete changes, not vague advice+- **Focus on skill improvements**: The goal is to improve the losing skill, not critique the agent+- **Prioritize by impact**: Which changes would most likely have changed the outcome?+- **Consider causation**: Did the skill weakness actually cause the worse output, or is it incidental?+- **Stay objective**: Analyze what happened, don't editorialize+- **Think about generalization**: Would this improvement help on other evals too?++## Categories for Suggestions++Use these categories to organize improvement suggestions:++| Category | Description |+|----------|-------------|+| `instructions` | Changes to the skill's prose instructions |+| `tools` | Scripts, templates, or utilities to add/modify |+| `examples` | Example inputs/outputs to include |+| `error_handling` | Guidance for handling failures |+| `structure` | Reorganization of skill content |+| `references` | External docs or resources to add |++## Priority Levels++- **high**: Would likely change the outcome of this comparison+- **medium**: Would improve quality but may not change win/loss+- **low**: Nice to have, marginal improvement++---++# Analyzing Benchmark Results++When analyzing benchmark results, the analyzer's purpose is to **surface patterns and anomalies** across multiple runs, not suggest skill improvements.++## Role++Review all benchmark run results and generate freeform notes that help the user understand skill performance. Focus on patterns that wouldn't be visible from aggregate metrics alone.++## Inputs++You receive these parameters in your prompt:++- **benchmark_data_path**: Path to the in-progress benchmark.json with all run results+- **skill_path**: Path to the skill being benchmarked+- **output_path**: Where to save the notes (as JSON array of strings)++## Process++### Step 1: Read Benchmark Data++1. Read the benchmark.json containing all run results+2. Note the configurations tested (with_skill, without_skill)+3. Understand the run_summary aggregates already calculated++### Step 2: Analyze Per-Assertion Patterns++For each expectation across all runs:+- Does it **always pass** in both configurations? (may not differentiate skill value)+- Does it **always fail** in both configurations? (may be broken or beyond capability)+- Does it **always pass with skill but fail without**? (skill clearly adds value here)+- Does it **always fail with skill but pass without**? (skill may be hurting)+- Is it **highly variable**? (flaky expectation or non-deterministic behavior)++### Step 3: Analyze Cross-Eval Patterns++Look for patterns across evals:+- Are certain eval types consistently harder/easier?+- Do some evals show high variance while others are stable?+- Are there surprising results that contradict expectations?++### Step 4: Analyze Metrics Patterns++Look at time_seconds, tokens, tool_calls:+- Does the skill significantly increase execution time?+- Is there high variance in resource usage?+- Are there outlier runs that skew the aggregates?++### Step 5: Generate Notes++Write freeform observations as a list of strings. Each note should:+- State a specific observation+- Be grounded in the data (not speculation)+- Help the user understand something the aggregate metrics don't show++Examples:+- "Assertion 'Output is a PDF file' passes 100% in both configurations - may not differentiate skill value"+- "Eval 3 shows high variance (50% ± 40%) - run 2 had an unusual failure that may be flaky"+- "Without-skill runs consistently fail on table extraction expectations (0% pass rate)"+- "Skill adds 13s average execution time but improves pass rate by 50%"+- "Token usage is 80% higher with skill, primarily due to script output parsing"+- "All 3 without-skill runs for eval 1 produced empty output"++### Step 6: Write Notes++Save notes to `{output_path}` as a JSON array of strings:++```json+[+ "Assertion 'Output is a PDF file' passes 100% in both configurations - may not differentiate skill value",+ "Eval 3 shows high variance (50% ± 40%) - run 2 had an unusual failure",+ "Without-skill runs consistently fail on table extraction expectations",+ "Skill adds 13s average execution time but improves pass rate by 50%"+]+```++## Guidelines++**DO:**+- Report what you observe in the data+- Be specific about which evals, expectations, or runs you're referring to+- Note patterns that aggregate metrics would hide+- Provide context that helps interpret the numbers++**DO NOT:**+- Suggest improvements to the skill (that's for the improvement step, not benchmarking)+- Make subjective quality judgments ("the output was good/bad")+- Speculate about causes without evidence+- Repeat information already in the run_summary aggregatesdiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/agents/comparator.md b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/agents/comparator.mdsimilarity index 97%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/agents/comparator.mdrename to jiuwenclaw/resources/agent/workspace/skills/skill-creator/agents/comparator.mdindex b37cb70c8d..80e00eb45d 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/agents/comparator.md+++ b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/agents/comparator.md@@ -1,202 +1,202 @@-# Blind Comparator Agent--Compare two outputs WITHOUT knowing which skill produced them.--## Role--The Blind Comparator judges which output better accomplishes the eval task. You receive two outputs labeled A and B, but you do NOT know which skill produced which. This prevents bias toward a particular skill or approach.--Your judgment is based purely on output quality and task completion.--## Inputs--You receive these parameters in your prompt:--- **output_a_path**: Path to the first output file or directory-- **output_b_path**: Path to the second output file or directory-- **eval_prompt**: The original task/prompt that was executed-- **expectations**: List of expectations to check (optional - may be empty)--## Process--### Step 1: Read Both Outputs--1. Examine output A (file or directory)-2. Examine output B (file or directory)-3. Note the type, structure, and content of each-4. If outputs are directories, examine all relevant files inside--### Step 2: Understand the Task--1. Read the eval_prompt carefully-2. Identify what the task requires:- - What should be produced?- - What qualities matter (accuracy, completeness, format)?- - What would distinguish a good output from a poor one?--### Step 3: Generate Evaluation Rubric--Based on the task, generate a rubric with two dimensions:--**Content Rubric** (what the output contains):-| Criterion | 1 (Poor) | 3 (Acceptable) | 5 (Excellent) |-|-----------|----------|----------------|---------------|-| Correctness | Major errors | Minor errors | Fully correct |-| Completeness | Missing key elements | Mostly complete | All elements present |-| Accuracy | Significant inaccuracies | Minor inaccuracies | Accurate throughout |--**Structure Rubric** (how the output is organized):-| Criterion | 1 (Poor) | 3 (Acceptable) | 5 (Excellent) |-|-----------|----------|----------------|---------------|-| Organization | Disorganized | Reasonably organized | Clear, logical structure |-| Formatting | Inconsistent/broken | Mostly consistent | Professional, polished |-| Usability | Difficult to use | Usable with effort | Easy to use |--Adapt criteria to the specific task. For example:-- PDF form → "Field alignment", "Text readability", "Data placement"-- Document → "Section structure", "Heading hierarchy", "Paragraph flow"-- Data output → "Schema correctness", "Data types", "Completeness"--### Step 4: Evaluate Each Output Against the Rubric--For each output (A and B):--1. **Score each criterion** on the rubric (1-5 scale)-2. **Calculate dimension totals**: Content score, Structure score-3. **Calculate overall score**: Average of dimension scores, scaled to 1-10--### Step 5: Check Assertions (if provided)--If expectations are provided:--1. Check each expectation against output A-2. Check each expectation against output B-3. Count pass rates for each output-4. Use expectation scores as secondary evidence (not the primary decision factor)--### Step 6: Determine the Winner--Compare A and B based on (in priority order):--1. **Primary**: Overall rubric score (content + structure)-2. **Secondary**: Assertion pass rates (if applicable)-3. **Tiebreaker**: If truly equal, declare a TIE--Be decisive - ties should be rare. One output is usually better, even if marginally.--### Step 7: Write Comparison Results--Save results to a JSON file at the path specified (or `comparison.json` if not specified).--## Output Format--Write a JSON file with this structure:--```json-{- "winner": "A",- "reasoning": "Output A provides a complete solution with proper formatting and all required fields. Output B is missing the date field and has formatting inconsistencies.",- "rubric": {- "A": {- "content": {- "correctness": 5,- "completeness": 5,- "accuracy": 4- },- "structure": {- "organization": 4,- "formatting": 5,- "usability": 4- },- "content_score": 4.7,- "structure_score": 4.3,- "overall_score": 9.0- },- "B": {- "content": {- "correctness": 3,- "completeness": 2,- "accuracy": 3- },- "structure": {- "organization": 3,- "formatting": 2,- "usability": 3- },- "content_score": 2.7,- "structure_score": 2.7,- "overall_score": 5.4- }- },- "output_quality": {- "A": {- "score": 9,- "strengths": ["Complete solution", "Well-formatted", "All fields present"],- "weaknesses": ["Minor style inconsistency in header"]- },- "B": {- "score": 5,- "strengths": ["Readable output", "Correct basic structure"],- "weaknesses": ["Missing date field", "Formatting inconsistencies", "Partial data extraction"]- }- },- "expectation_results": {- "A": {- "passed": 4,- "total": 5,- "pass_rate": 0.80,- "details": [- {"text": "Output includes name", "passed": true},- {"text": "Output includes date", "passed": true},- {"text": "Format is PDF", "passed": true},- {"text": "Contains signature", "passed": false},- {"text": "Readable text", "passed": true}- ]- },- "B": {- "passed": 3,- "total": 5,- "pass_rate": 0.60,- "details": [- {"text": "Output includes name", "passed": true},- {"text": "Output includes date", "passed": false},- {"text": "Format is PDF", "passed": true},- {"text": "Contains signature", "passed": false},- {"text": "Readable text", "passed": true}- ]- }- }-}-```--If no expectations were provided, omit the `expectation_results` field entirely.--## Field Descriptions--- **winner**: "A", "B", or "TIE"-- **reasoning**: Clear explanation of why the winner was chosen (or why it's a tie)-- **rubric**: Structured rubric evaluation for each output- - **content**: Scores for content criteria (correctness, completeness, accuracy)- - **structure**: Scores for structure criteria (organization, formatting, usability)- - **content_score**: Average of content criteria (1-5)- - **structure_score**: Average of structure criteria (1-5)- - **overall_score**: Combined score scaled to 1-10-- **output_quality**: Summary quality assessment- - **score**: 1-10 rating (should match rubric overall_score)- - **strengths**: List of positive aspects- - **weaknesses**: List of issues or shortcomings-- **expectation_results**: (Only if expectations provided)- - **passed**: Number of expectations that passed- - **total**: Total number of expectations- - **pass_rate**: Fraction passed (0.0 to 1.0)- - **details**: Individual expectation results--## Guidelines--- **Stay blind**: DO NOT try to infer which skill produced which output. Judge purely on output quality.-- **Be specific**: Cite specific examples when explaining strengths and weaknesses.-- **Be decisive**: Choose a winner unless outputs are genuinely equivalent.-- **Output quality first**: Assertion scores are secondary to overall task completion.-- **Be objective**: Don't favor outputs based on style preferences; focus on correctness and completeness.-- **Explain your reasoning**: The reasoning field should make it clear why you chose the winner.-- **Handle edge cases**: If both outputs fail, pick the one that fails less badly. If both are excellent, pick the one that's marginally better.+# Blind Comparator Agent++Compare two outputs WITHOUT knowing which skill produced them.++## Role++The Blind Comparator judges which output better accomplishes the eval task. You receive two outputs labeled A and B, but you do NOT know which skill produced which. This prevents bias toward a particular skill or approach.++Your judgment is based purely on output quality and task completion.++## Inputs++You receive these parameters in your prompt:++- **output_a_path**: Path to the first output file or directory+- **output_b_path**: Path to the second output file or directory+- **eval_prompt**: The original task/prompt that was executed+- **expectations**: List of expectations to check (optional - may be empty)++## Process++### Step 1: Read Both Outputs++1. Examine output A (file or directory)+2. Examine output B (file or directory)+3. Note the type, structure, and content of each+4. If outputs are directories, examine all relevant files inside++### Step 2: Understand the Task++1. Read the eval_prompt carefully+2. Identify what the task requires:+ - What should be produced?+ - What qualities matter (accuracy, completeness, format)?+ - What would distinguish a good output from a poor one?++### Step 3: Generate Evaluation Rubric++Based on the task, generate a rubric with two dimensions:++**Content Rubric** (what the output contains):+| Criterion | 1 (Poor) | 3 (Acceptable) | 5 (Excellent) |+|-----------|----------|----------------|---------------|+| Correctness | Major errors | Minor errors | Fully correct |+| Completeness | Missing key elements | Mostly complete | All elements present |+| Accuracy | Significant inaccuracies | Minor inaccuracies | Accurate throughout |++**Structure Rubric** (how the output is organized):+| Criterion | 1 (Poor) | 3 (Acceptable) | 5 (Excellent) |+|-----------|----------|----------------|---------------|+| Organization | Disorganized | Reasonably organized | Clear, logical structure |+| Formatting | Inconsistent/broken | Mostly consistent | Professional, polished |+| Usability | Difficult to use | Usable with effort | Easy to use |++Adapt criteria to the specific task. For example:+- PDF form → "Field alignment", "Text readability", "Data placement"+- Document → "Section structure", "Heading hierarchy", "Paragraph flow"+- Data output → "Schema correctness", "Data types", "Completeness"++### Step 4: Evaluate Each Output Against the Rubric++For each output (A and B):++1. **Score each criterion** on the rubric (1-5 scale)+2. **Calculate dimension totals**: Content score, Structure score+3. **Calculate overall score**: Average of dimension scores, scaled to 1-10++### Step 5: Check Assertions (if provided)++If expectations are provided:++1. Check each expectation against output A+2. Check each expectation against output B+3. Count pass rates for each output+4. Use expectation scores as secondary evidence (not the primary decision factor)++### Step 6: Determine the Winner++Compare A and B based on (in priority order):++1. **Primary**: Overall rubric score (content + structure)+2. **Secondary**: Assertion pass rates (if applicable)+3. **Tiebreaker**: If truly equal, declare a TIE++Be decisive - ties should be rare. One output is usually better, even if marginally.++### Step 7: Write Comparison Results++Save results to a JSON file at the path specified (or `comparison.json` if not specified).++## Output Format++Write a JSON file with this structure:++```json+{+ "winner": "A",+ "reasoning": "Output A provides a complete solution with proper formatting and all required fields. Output B is missing the date field and has formatting inconsistencies.",+ "rubric": {+ "A": {+ "content": {+ "correctness": 5,+ "completeness": 5,+ "accuracy": 4+ },+ "structure": {+ "organization": 4,+ "formatting": 5,+ "usability": 4+ },+ "content_score": 4.7,+ "structure_score": 4.3,+ "overall_score": 9.0+ },+ "B": {+ "content": {+ "correctness": 3,+ "completeness": 2,+ "accuracy": 3+ },+ "structure": {+ "organization": 3,+ "formatting": 2,+ "usability": 3+ },+ "content_score": 2.7,+ "structure_score": 2.7,+ "overall_score": 5.4+ }+ },+ "output_quality": {+ "A": {+ "score": 9,+ "strengths": ["Complete solution", "Well-formatted", "All fields present"],+ "weaknesses": ["Minor style inconsistency in header"]+ },+ "B": {+ "score": 5,+ "strengths": ["Readable output", "Correct basic structure"],+ "weaknesses": ["Missing date field", "Formatting inconsistencies", "Partial data extraction"]+ }+ },+ "expectation_results": {+ "A": {+ "passed": 4,+ "total": 5,+ "pass_rate": 0.80,+ "details": [+ {"text": "Output includes name", "passed": true},+ {"text": "Output includes date", "passed": true},+ {"text": "Format is PDF", "passed": true},+ {"text": "Contains signature", "passed": false},+ {"text": "Readable text", "passed": true}+ ]+ },+ "B": {+ "passed": 3,+ "total": 5,+ "pass_rate": 0.60,+ "details": [+ {"text": "Output includes name", "passed": true},+ {"text": "Output includes date", "passed": false},+ {"text": "Format is PDF", "passed": true},+ {"text": "Contains signature", "passed": false},+ {"text": "Readable text", "passed": true}+ ]+ }+ }+}+```++If no expectations were provided, omit the `expectation_results` field entirely.++## Field Descriptions++- **winner**: "A", "B", or "TIE"+- **reasoning**: Clear explanation of why the winner was chosen (or why it's a tie)+- **rubric**: Structured rubric evaluation for each output+ - **content**: Scores for content criteria (correctness, completeness, accuracy)+ - **structure**: Scores for structure criteria (organization, formatting, usability)+ - **content_score**: Average of content criteria (1-5)+ - **structure_score**: Average of structure criteria (1-5)+ - **overall_score**: Combined score scaled to 1-10+- **output_quality**: Summary quality assessment+ - **score**: 1-10 rating (should match rubric overall_score)+ - **strengths**: List of positive aspects+ - **weaknesses**: List of issues or shortcomings+- **expectation_results**: (Only if expectations provided)+ - **passed**: Number of expectations that passed+ - **total**: Total number of expectations+ - **pass_rate**: Fraction passed (0.0 to 1.0)+ - **details**: Individual expectation results++## Guidelines++- **Stay blind**: DO NOT try to infer which skill produced which output. Judge purely on output quality.+- **Be specific**: Cite specific examples when explaining strengths and weaknesses.+- **Be decisive**: Choose a winner unless outputs are genuinely equivalent.+- **Output quality first**: Assertion scores are secondary to overall task completion.+- **Be objective**: Don't favor outputs based on style preferences; focus on correctness and completeness.+- **Explain your reasoning**: The reasoning field should make it clear why you chose the winner.+- **Handle edge cases**: If both outputs fail, pick the one that fails less badly. If both are excellent, pick the one that's marginally better.diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/agents/grader.md b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/agents/grader.mdsimilarity index 97%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/agents/grader.mdrename to jiuwenclaw/resources/agent/workspace/skills/skill-creator/agents/grader.mdindex 384e19fc4a..558ab05c0a 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/agents/grader.md+++ b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/agents/grader.md@@ -1,223 +1,223 @@-# Grader Agent--Evaluate expectations against an execution transcript and outputs.--## Role--The Grader reviews a transcript and output files, then determines whether each expectation passes or fails. Provide clear evidence for each judgment.--You have two jobs: grade the outputs, and critique the evals themselves. A passing grade on a weak assertion is worse than useless — it creates false confidence. When you notice an assertion that's trivially satisfied, or an important outcome that no assertion checks, say so.--## Inputs--You receive these parameters in your prompt:--- **expectations**: List of expectations to evaluate (strings)-- **transcript_path**: Path to the execution transcript (markdown file)-- **outputs_dir**: Directory containing output files from execution--## Process--### Step 1: Read the Transcript--1. Read the transcript file completely-2. Note the eval prompt, execution steps, and final result-3. Identify any issues or errors documented--### Step 2: Examine Output Files--1. List files in outputs_dir-2. Read/examine each file relevant to the expectations. If outputs aren't plain text, use the inspection tools provided in your prompt — don't rely solely on what the transcript says the executor produced.-3. Note contents, structure, and quality--### Step 3: Evaluate Each Assertion--For each expectation:--1. **Search for evidence** in the transcript and outputs-2. **Determine verdict**:- - **PASS**: Clear evidence the expectation is true AND the evidence reflects genuine task completion, not just surface-level compliance- - **FAIL**: No evidence, or evidence contradicts the expectation, or the evidence is superficial (e.g., correct filename but empty/wrong content)-3. **Cite the evidence**: Quote the specific text or describe what you found--### Step 4: Extract and Verify Claims--Beyond the predefined expectations, extract implicit claims from the outputs and verify them:--1. **Extract claims** from the transcript and outputs:- - Factual statements ("The form has 12 fields")- - Process claims ("Used pypdf to fill the form")- - Quality claims ("All fields were filled correctly")--2. **Verify each claim**:- - **Factual claims**: Can be checked against the outputs or external sources- - **Process claims**: Can be verified from the transcript- - **Quality claims**: Evaluate whether the claim is justified--3. **Flag unverifiable claims**: Note claims that cannot be verified with available information--This catches issues that predefined expectations might miss.--### Step 5: Read User Notes--If `{outputs_dir}/user_notes.md` exists:-1. Read it and note any uncertainties or issues flagged by the executor-2. Include relevant concerns in the grading output-3. These may reveal problems even when expectations pass--### Step 6: Critique the Evals--After grading, consider whether the evals themselves could be improved. Only surface suggestions when there's a clear gap.--Good suggestions test meaningful outcomes — assertions that are hard to satisfy without actually doing the work correctly. Think about what makes an assertion *discriminating*: it passes when the skill genuinely succeeds and fails when it doesn't.--Suggestions worth raising:-- An assertion that passed but would also pass for a clearly wrong output (e.g., checking filename existence but not file content)-- An important outcome you observed — good or bad — that no assertion covers at all-- An assertion that can't actually be verified from the available outputs--Keep the bar high. The goal is to flag things the eval author would say "good catch" about, not to nitpick every assertion.--### Step 7: Write Grading Results--Save results to `{outputs_dir}/../grading.json` (sibling to outputs_dir).--## Grading Criteria--**PASS when**:-- The transcript or outputs clearly demonstrate the expectation is true-- Specific evidence can be cited-- The evidence reflects genuine substance, not just surface compliance (e.g., a file exists AND contains correct content, not just the right filename)--**FAIL when**:-- No evidence found for the expectation-- Evidence contradicts the expectation-- The expectation cannot be verified from available information-- The evidence is superficial — the assertion is technically satisfied but the underlying task outcome is wrong or incomplete-- The output appears to meet the assertion by coincidence rather than by actually doing the work--**When uncertain**: The burden of proof to pass is on the expectation.--### Step 8: Read Executor Metrics and Timing--1. If `{outputs_dir}/metrics.json` exists, read it and include in grading output-2. If `{outputs_dir}/../timing.json` exists, read it and include timing data--## Output Format--Write a JSON file with this structure:--```json-{- "expectations": [- {- "text": "The output includes the name 'John Smith'",- "passed": true,- "evidence": "Found in transcript Step 3: 'Extracted names: John Smith, Sarah Johnson'"- },- {- "text": "The spreadsheet has a SUM formula in cell B10",- "passed": false,- "evidence": "No spreadsheet was created. The output was a text file."- },- {- "text": "The assistant used the skill's OCR script",- "passed": true,- "evidence": "Transcript Step 2 shows: 'Tool: Bash - python ocr_script.py image.png'"- }- ],- "summary": {- "passed": 2,- "failed": 1,- "total": 3,- "pass_rate": 0.67- },- "execution_metrics": {- "tool_calls": {- "Read": 5,- "Write": 2,- "Bash": 8- },- "total_tool_calls": 15,- "total_steps": 6,- "errors_encountered": 0,- "output_chars": 12450,- "transcript_chars": 3200- },- "timing": {- "executor_duration_seconds": 165.0,- "grader_duration_seconds": 26.0,- "total_duration_seconds": 191.0- },- "claims": [- {- "claim": "The form has 12 fillable fields",- "type": "factual",- "verified": true,- "evidence": "Counted 12 fields in field_info.json"- },- {- "claim": "All required fields were populated",- "type": "quality",- "verified": false,- "evidence": "Reference section was left blank despite data being available"- }- ],- "user_notes_summary": {- "uncertainties": ["Used 2023 data, may be stale"],- "needs_review": [],- "workarounds": ["Fell back to text overlay for non-fillable fields"]- },- "eval_feedback": {- "suggestions": [- {- "assertion": "The output includes the name 'John Smith'",- "reason": "A hallucinated document that mentions the name would also pass — consider checking it appears as the primary contact with matching phone and email from the input"- },- {- "reason": "No assertion checks whether the extracted phone numbers match the input — I observed incorrect numbers in the output that went uncaught"- }- ],- "overall": "Assertions check presence but not correctness. Consider adding content verification."- }-}-```--## Field Descriptions--- **expectations**: Array of graded expectations- - **text**: The original expectation text- - **passed**: Boolean - true if expectation passes- - **evidence**: Specific quote or description supporting the verdict-- **summary**: Aggregate statistics- - **passed**: Count of passed expectations- - **failed**: Count of failed expectations- - **total**: Total expectations evaluated- - **pass_rate**: Fraction passed (0.0 to 1.0)-- **execution_metrics**: Copied from executor's metrics.json (if available)- - **output_chars**: Total character count of output files (proxy for tokens)- - **transcript_chars**: Character count of transcript-- **timing**: Wall clock timing from timing.json (if available)- - **executor_duration_seconds**: Time spent in executor subagent- - **total_duration_seconds**: Total elapsed time for the run-- **claims**: Extracted and verified claims from the output- - **claim**: The statement being verified- - **type**: "factual", "process", or "quality"- - **verified**: Boolean - whether the claim holds- - **evidence**: Supporting or contradicting evidence-- **user_notes_summary**: Issues flagged by the executor- - **uncertainties**: Things the executor wasn't sure about- - **needs_review**: Items requiring human attention- - **workarounds**: Places where the skill didn't work as expected-- **eval_feedback**: Improvement suggestions for the evals (only when warranted)- - **suggestions**: List of concrete suggestions, each with a `reason` and optionally an `assertion` it relates to- - **overall**: Brief assessment — can be "No suggestions, evals look solid" if nothing to flag--## Guidelines--- **Be objective**: Base verdicts on evidence, not assumptions-- **Be specific**: Quote the exact text that supports your verdict-- **Be thorough**: Check both transcript and output files-- **Be consistent**: Apply the same standard to each expectation-- **Explain failures**: Make it clear why evidence was insufficient-- **No partial credit**: Each expectation is pass or fail, not partial+# Grader Agent++Evaluate expectations against an execution transcript and outputs.++## Role++The Grader reviews a transcript and output files, then determines whether each expectation passes or fails. Provide clear evidence for each judgment.++You have two jobs: grade the outputs, and critique the evals themselves. A passing grade on a weak assertion is worse than useless — it creates false confidence. When you notice an assertion that's trivially satisfied, or an important outcome that no assertion checks, say so.++## Inputs++You receive these parameters in your prompt:++- **expectations**: List of expectations to evaluate (strings)+- **transcript_path**: Path to the execution transcript (markdown file)+- **outputs_dir**: Directory containing output files from execution++## Process++### Step 1: Read the Transcript++1. Read the transcript file completely+2. Note the eval prompt, execution steps, and final result+3. Identify any issues or errors documented++### Step 2: Examine Output Files++1. List files in outputs_dir+2. Read/examine each file relevant to the expectations. If outputs aren't plain text, use the inspection tools provided in your prompt — don't rely solely on what the transcript says the executor produced.+3. Note contents, structure, and quality++### Step 3: Evaluate Each Assertion++For each expectation:++1. **Search for evidence** in the transcript and outputs+2. **Determine verdict**:+ - **PASS**: Clear evidence the expectation is true AND the evidence reflects genuine task completion, not just surface-level compliance+ - **FAIL**: No evidence, or evidence contradicts the expectation, or the evidence is superficial (e.g., correct filename but empty/wrong content)+3. **Cite the evidence**: Quote the specific text or describe what you found++### Step 4: Extract and Verify Claims++Beyond the predefined expectations, extract implicit claims from the outputs and verify them:++1. **Extract claims** from the transcript and outputs:+ - Factual statements ("The form has 12 fields")+ - Process claims ("Used pypdf to fill the form")+ - Quality claims ("All fields were filled correctly")++2. **Verify each claim**:+ - **Factual claims**: Can be checked against the outputs or external sources+ - **Process claims**: Can be verified from the transcript+ - **Quality claims**: Evaluate whether the claim is justified++3. **Flag unverifiable claims**: Note claims that cannot be verified with available information++This catches issues that predefined expectations might miss.++### Step 5: Read User Notes++If `{outputs_dir}/user_notes.md` exists:+1. Read it and note any uncertainties or issues flagged by the executor+2. Include relevant concerns in the grading output+3. These may reveal problems even when expectations pass++### Step 6: Critique the Evals++After grading, consider whether the evals themselves could be improved. Only surface suggestions when there's a clear gap.++Good suggestions test meaningful outcomes — assertions that are hard to satisfy without actually doing the work correctly. Think about what makes an assertion *discriminating*: it passes when the skill genuinely succeeds and fails when it doesn't.++Suggestions worth raising:+- An assertion that passed but would also pass for a clearly wrong output (e.g., checking filename existence but not file content)+- An important outcome you observed — good or bad — that no assertion covers at all+- An assertion that can't actually be verified from the available outputs++Keep the bar high. The goal is to flag things the eval author would say "good catch" about, not to nitpick every assertion.++### Step 7: Write Grading Results++Save results to `{outputs_dir}/../grading.json` (sibling to outputs_dir).++## Grading Criteria++**PASS when**:+- The transcript or outputs clearly demonstrate the expectation is true+- Specific evidence can be cited+- The evidence reflects genuine substance, not just surface compliance (e.g., a file exists AND contains correct content, not just the right filename)++**FAIL when**:+- No evidence found for the expectation+- Evidence contradicts the expectation+- The expectation cannot be verified from available information+- The evidence is superficial — the assertion is technically satisfied but the underlying task outcome is wrong or incomplete+- The output appears to meet the assertion by coincidence rather than by actually doing the work++**When uncertain**: The burden of proof to pass is on the expectation.++### Step 8: Read Executor Metrics and Timing++1. If `{outputs_dir}/metrics.json` exists, read it and include in grading output+2. If `{outputs_dir}/../timing.json` exists, read it and include timing data++## Output Format++Write a JSON file with this structure:++```json+{+ "expectations": [+ {+ "text": "The output includes the name 'John Smith'",+ "passed": true,+ "evidence": "Found in transcript Step 3: 'Extracted names: John Smith, Sarah Johnson'"+ },+ {+ "text": "The spreadsheet has a SUM formula in cell B10",+ "passed": false,+ "evidence": "No spreadsheet was created. The output was a text file."+ },+ {+ "text": "The assistant used the skill's OCR script",+ "passed": true,+ "evidence": "Transcript Step 2 shows: 'Tool: Bash - python ocr_script.py image.png'"+ }+ ],+ "summary": {+ "passed": 2,+ "failed": 1,+ "total": 3,+ "pass_rate": 0.67+ },+ "execution_metrics": {+ "tool_calls": {+ "Read": 5,+ "Write": 2,+ "Bash": 8+ },+ "total_tool_calls": 15,+ "total_steps": 6,+ "errors_encountered": 0,+ "output_chars": 12450,+ "transcript_chars": 3200+ },+ "timing": {+ "executor_duration_seconds": 165.0,+ "grader_duration_seconds": 26.0,+ "total_duration_seconds": 191.0+ },+ "claims": [+ {+ "claim": "The form has 12 fillable fields",+ "type": "factual",+ "verified": true,+ "evidence": "Counted 12 fields in field_info.json"+ },+ {+ "claim": "All required fields were populated",+ "type": "quality",+ "verified": false,+ "evidence": "Reference section was left blank despite data being available"+ }+ ],+ "user_notes_summary": {+ "uncertainties": ["Used 2023 data, may be stale"],+ "needs_review": [],+ "workarounds": ["Fell back to text overlay for non-fillable fields"]+ },+ "eval_feedback": {+ "suggestions": [+ {+ "assertion": "The output includes the name 'John Smith'",+ "reason": "A hallucinated document that mentions the name would also pass — consider checking it appears as the primary contact with matching phone and email from the input"+ },+ {+ "reason": "No assertion checks whether the extracted phone numbers match the input — I observed incorrect numbers in the output that went uncaught"+ }+ ],+ "overall": "Assertions check presence but not correctness. Consider adding content verification."+ }+}+```++## Field Descriptions++- **expectations**: Array of graded expectations+ - **text**: The original expectation text+ - **passed**: Boolean - true if expectation passes+ - **evidence**: Specific quote or description supporting the verdict+- **summary**: Aggregate statistics+ - **passed**: Count of passed expectations+ - **failed**: Count of failed expectations+ - **total**: Total expectations evaluated+ - **pass_rate**: Fraction passed (0.0 to 1.0)+- **execution_metrics**: Copied from executor's metrics.json (if available)+ - **output_chars**: Total character count of output files (proxy for tokens)+ - **transcript_chars**: Character count of transcript+- **timing**: Wall clock timing from timing.json (if available)+ - **executor_duration_seconds**: Time spent in executor subagent+ - **total_duration_seconds**: Total elapsed time for the run+- **claims**: Extracted and verified claims from the output+ - **claim**: The statement being verified+ - **type**: "factual", "process", or "quality"+ - **verified**: Boolean - whether the claim holds+ - **evidence**: Supporting or contradicting evidence+- **user_notes_summary**: Issues flagged by the executor+ - **uncertainties**: Things the executor wasn't sure about+ - **needs_review**: Items requiring human attention+ - **workarounds**: Places where the skill didn't work as expected+- **eval_feedback**: Improvement suggestions for the evals (only when warranted)+ - **suggestions**: List of concrete suggestions, each with a `reason` and optionally an `assertion` it relates to+ - **overall**: Brief assessment — can be "No suggestions, evals look solid" if nothing to flag++## Guidelines++- **Be objective**: Base verdicts on evidence, not assumptions+- **Be specific**: Quote the exact text that supports your verdict+- **Be thorough**: Check both transcript and output files+- **Be consistent**: Apply the same standard to each expectation+- **Explain failures**: Make it clear why evidence was insufficient+- **No partial credit**: Each expectation is pass or fail, not partialdiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/assets/eval_review.html b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/assets/eval_review.htmlsimilarity index 97%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/assets/eval_review.htmlrename to jiuwenclaw/resources/agent/workspace/skills/skill-creator/assets/eval_review.htmlindex 454e4816f7..938ff32aed 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/assets/eval_review.html+++ b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/assets/eval_review.html@@ -1,146 +1,146 @@-<!DOCTYPE html>-<html lang="en">-<head>- <meta charset="UTF-8">- <meta name="viewport" content="width=device-width, initial-scale=1.0">- <title>Eval Set Review - __SKILL_NAME_PLACEHOLDER__</title>- <link rel="preconnect" href="https://fonts.googleapis.com">- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>- <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@500;600&family=Lora:wght@400;500&display=swap" rel="stylesheet">- <style>- * { box-sizing: border-box; margin: 0; padding: 0; }- body { font-family: 'Lora', Georgia, serif; background: #faf9f5; padding: 2rem; color: #141413; }- h1 { font-family: 'Poppins', sans-serif; margin-bottom: 0.5rem; font-size: 1.5rem; }- .description { color: #b0aea5; margin-bottom: 1.5rem; font-style: italic; max-width: 900px; }- .controls { margin-bottom: 1rem; display: flex; gap: 0.5rem; }- .btn { font-family: 'Poppins', sans-serif; padding: 0.5rem 1rem; border: none; border-radius: 6px; cursor: pointer; font-size: 0.875rem; font-weight: 500; }- .btn-add { background: #6a9bcc; color: white; }- .btn-add:hover { background: #5889b8; }- .btn-export { background: #d97757; color: white; }- .btn-export:hover { background: #c4613f; }- table { width: 100%; max-width: 1100px; border-collapse: collapse; background: white; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }- th { font-family: 'Poppins', sans-serif; background: #141413; color: #faf9f5; padding: 0.75rem 1rem; text-align: left; font-size: 0.875rem; }- td { padding: 0.75rem 1rem; border-bottom: 1px solid #e8e6dc; vertical-align: top; }- tr:nth-child(even) td { background: #faf9f5; }- tr:hover td { background: #f3f1ea; }- .section-header td { background: #e8e6dc; font-family: 'Poppins', sans-serif; font-weight: 500; font-size: 0.8rem; color: #141413; text-transform: uppercase; letter-spacing: 0.05em; }- .query-input { width: 100%; padding: 0.4rem; border: 1px solid #e8e6dc; border-radius: 4px; font-size: 0.875rem; font-family: 'Lora', Georgia, serif; resize: vertical; min-height: 60px; }- .query-input:focus { outline: none; border-color: #d97757; box-shadow: 0 0 0 2px rgba(217,119,87,0.15); }- .toggle { position: relative; display: inline-block; width: 44px; height: 24px; }- .toggle input { opacity: 0; width: 0; height: 0; }- .toggle .slider { position: absolute; inset: 0; background: #b0aea5; border-radius: 24px; cursor: pointer; transition: 0.2s; }- .toggle .slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.2s; }- .toggle input:checked + .slider { background: #d97757; }- .toggle input:checked + .slider::before { transform: translateX(20px); }- .btn-delete { background: #c44; color: white; padding: 0.3rem 0.6rem; border: none; border-radius: 4px; cursor: pointer; font-size: 0.75rem; font-family: 'Poppins', sans-serif; }- .btn-delete:hover { background: #a33; }- .summary { margin-top: 1rem; color: #b0aea5; font-size: 0.875rem; }- </style>-</head>-<body>- <h1>Eval Set Review: <span id="skill-name">__SKILL_NAME_PLACEHOLDER__</span></h1>- <p class="description">Current description: <span id="skill-desc">__SKILL_DESCRIPTION_PLACEHOLDER__</span></p>-- <div class="controls">- <button class="btn btn-add" onclick="addRow()">+ Add Query</button>- <button class="btn btn-export" onclick="exportEvalSet()">Export Eval Set</button>- </div>-- <table>- <thead>- <tr>- <th style="width:65%">Query</th>- <th style="width:18%">Should Trigger</th>- <th style="width:10%">Actions</th>- </tr>- </thead>- <tbody id="eval-body"></tbody>- </table>-- <p class="summary" id="summary"></p>-- <script>- const EVAL_DATA = __EVAL_DATA_PLACEHOLDER__;-- let evalItems = [...EVAL_DATA];-- function render() {- const tbody = document.getElementById('eval-body');- tbody.innerHTML = '';-- // Sort: should-trigger first, then should-not-trigger- const sorted = evalItems- .map((item, origIdx) => ({ ...item, origIdx }))- .sort((a, b) => (b.should_trigger ? 1 : 0) - (a.should_trigger ? 1 : 0));-- let lastGroup = null;- sorted.forEach(item => {- const group = item.should_trigger ? 'trigger' : 'no-trigger';- if (group !== lastGroup) {- const headerRow = document.createElement('tr');- headerRow.className = 'section-header';- headerRow.innerHTML = `<td colspan="3">${item.should_trigger ? 'Should Trigger' : 'Should NOT Trigger'}</td>`;- tbody.appendChild(headerRow);- lastGroup = group;- }-- const idx = item.origIdx;- const tr = document.createElement('tr');- tr.innerHTML = `- <td><textarea class="query-input" onchange="updateQuery(${idx}, this.value)">${escapeHtml(item.query)}</textarea></td>- <td>- <label class="toggle">- <input type="checkbox" ${item.should_trigger ? 'checked' : ''} onchange="updateTrigger(${idx}, this.checked)">- <span class="slider"></span>- </label>- <span style="margin-left:8px;font-size:0.8rem;color:#b0aea5">${item.should_trigger ? 'Yes' : 'No'}</span>- </td>- <td><button class="btn-delete" onclick="deleteRow(${idx})">Delete</button></td>- `;- tbody.appendChild(tr);- });- updateSummary();- }-- function escapeHtml(text) {- const div = document.createElement('div');- div.textContent = text;- return div.innerHTML;- }-- function updateQuery(idx, value) { evalItems[idx].query = value; updateSummary(); }- function updateTrigger(idx, value) { evalItems[idx].should_trigger = value; render(); }- function deleteRow(idx) { evalItems.splice(idx, 1); render(); }-- function addRow() {- evalItems.push({ query: '', should_trigger: true });- render();- const inputs = document.querySelectorAll('.query-input');- inputs[inputs.length - 1].focus();- }-- function updateSummary() {- const trigger = evalItems.filter(i => i.should_trigger).length;- const noTrigger = evalItems.filter(i => !i.should_trigger).length;- document.getElementById('summary').textContent =- `${evalItems.length} queries total: ${trigger} should trigger, ${noTrigger} should not trigger`;- }-- function exportEvalSet() {- const valid = evalItems.filter(i => i.query.trim() !== '');- const data = valid.map(i => ({ query: i.query.trim(), should_trigger: i.should_trigger }));- const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' });- const url = URL.createObjectURL(blob);- const a = document.createElement('a');- a.href = url;- a.download = 'eval_set.json';- document.body.appendChild(a);- a.click();- document.body.removeChild(a);- URL.revokeObjectURL(url);- }-- render();- </script>-</body>-</html>+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>Eval Set Review - __SKILL_NAME_PLACEHOLDER__</title>+ <link rel="preconnect" href="https://fonts.googleapis.com">+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@500;600&family=Lora:wght@400;500&display=swap" rel="stylesheet">+ <style>+ * { box-sizing: border-box; margin: 0; padding: 0; }+ body { font-family: 'Lora', Georgia, serif; background: #faf9f5; padding: 2rem; color: #141413; }+ h1 { font-family: 'Poppins', sans-serif; margin-bottom: 0.5rem; font-size: 1.5rem; }+ .description { color: #b0aea5; margin-bottom: 1.5rem; font-style: italic; max-width: 900px; }+ .controls { margin-bottom: 1rem; display: flex; gap: 0.5rem; }+ .btn { font-family: 'Poppins', sans-serif; padding: 0.5rem 1rem; border: none; border-radius: 6px; cursor: pointer; font-size: 0.875rem; font-weight: 500; }+ .btn-add { background: #6a9bcc; color: white; }+ .btn-add:hover { background: #5889b8; }+ .btn-export { background: #d97757; color: white; }+ .btn-export:hover { background: #c4613f; }+ table { width: 100%; max-width: 1100px; border-collapse: collapse; background: white; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }+ th { font-family: 'Poppins', sans-serif; background: #141413; color: #faf9f5; padding: 0.75rem 1rem; text-align: left; font-size: 0.875rem; }+ td { padding: 0.75rem 1rem; border-bottom: 1px solid #e8e6dc; vertical-align: top; }+ tr:nth-child(even) td { background: #faf9f5; }+ tr:hover td { background: #f3f1ea; }+ .section-header td { background: #e8e6dc; font-family: 'Poppins', sans-serif; font-weight: 500; font-size: 0.8rem; color: #141413; text-transform: uppercase; letter-spacing: 0.05em; }+ .query-input { width: 100%; padding: 0.4rem; border: 1px solid #e8e6dc; border-radius: 4px; font-size: 0.875rem; font-family: 'Lora', Georgia, serif; resize: vertical; min-height: 60px; }+ .query-input:focus { outline: none; border-color: #d97757; box-shadow: 0 0 0 2px rgba(217,119,87,0.15); }+ .toggle { position: relative; display: inline-block; width: 44px; height: 24px; }+ .toggle input { opacity: 0; width: 0; height: 0; }+ .toggle .slider { position: absolute; inset: 0; background: #b0aea5; border-radius: 24px; cursor: pointer; transition: 0.2s; }+ .toggle .slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.2s; }+ .toggle input:checked + .slider { background: #d97757; }+ .toggle input:checked + .slider::before { transform: translateX(20px); }+ .btn-delete { background: #c44; color: white; padding: 0.3rem 0.6rem; border: none; border-radius: 4px; cursor: pointer; font-size: 0.75rem; font-family: 'Poppins', sans-serif; }+ .btn-delete:hover { background: #a33; }+ .summary { margin-top: 1rem; color: #b0aea5; font-size: 0.875rem; }+ </style>+</head>+<body>+ <h1>Eval Set Review: <span id="skill-name">__SKILL_NAME_PLACEHOLDER__</span></h1>+ <p class="description">Current description: <span id="skill-desc">__SKILL_DESCRIPTION_PLACEHOLDER__</span></p>++ <div class="controls">+ <button class="btn btn-add" onclick="addRow()">+ Add Query</button>+ <button class="btn btn-export" onclick="exportEvalSet()">Export Eval Set</button>+ </div>++ <table>+ <thead>+ <tr>+ <th style="width:65%">Query</th>+ <th style="width:18%">Should Trigger</th>+ <th style="width:10%">Actions</th>+ </tr>+ </thead>+ <tbody id="eval-body"></tbody>+ </table>++ <p class="summary" id="summary"></p>++ <script>+ const EVAL_DATA = __EVAL_DATA_PLACEHOLDER__;++ let evalItems = [...EVAL_DATA];++ function render() {+ const tbody = document.getElementById('eval-body');+ tbody.innerHTML = '';++ // Sort: should-trigger first, then should-not-trigger+ const sorted = evalItems+ .map((item, origIdx) => ({ ...item, origIdx }))+ .sort((a, b) => (b.should_trigger ? 1 : 0) - (a.should_trigger ? 1 : 0));++ let lastGroup = null;+ sorted.forEach(item => {+ const group = item.should_trigger ? 'trigger' : 'no-trigger';+ if (group !== lastGroup) {+ const headerRow = document.createElement('tr');+ headerRow.className = 'section-header';+ headerRow.innerHTML = `<td colspan="3">${item.should_trigger ? 'Should Trigger' : 'Should NOT Trigger'}</td>`;+ tbody.appendChild(headerRow);+ lastGroup = group;+ }++ const idx = item.origIdx;+ const tr = document.createElement('tr');+ tr.innerHTML = `+ <td><textarea class="query-input" onchange="updateQuery(${idx}, this.value)">${escapeHtml(item.query)}</textarea></td>+ <td>+ <label class="toggle">+ <input type="checkbox" ${item.should_trigger ? 'checked' : ''} onchange="updateTrigger(${idx}, this.checked)">+ <span class="slider"></span>+ </label>+ <span style="margin-left:8px;font-size:0.8rem;color:#b0aea5">${item.should_trigger ? 'Yes' : 'No'}</span>+ </td>+ <td><button class="btn-delete" onclick="deleteRow(${idx})">Delete</button></td>+ `;+ tbody.appendChild(tr);+ });+ updateSummary();+ }++ function escapeHtml(text) {+ const div = document.createElement('div');+ div.textContent = text;+ return div.innerHTML;+ }++ function updateQuery(idx, value) { evalItems[idx].query = value; updateSummary(); }+ function updateTrigger(idx, value) { evalItems[idx].should_trigger = value; render(); }+ function deleteRow(idx) { evalItems.splice(idx, 1); render(); }++ function addRow() {+ evalItems.push({ query: '', should_trigger: true });+ render();+ const inputs = document.querySelectorAll('.query-input');+ inputs[inputs.length - 1].focus();+ }++ function updateSummary() {+ const trigger = evalItems.filter(i => i.should_trigger).length;+ const noTrigger = evalItems.filter(i => !i.should_trigger).length;+ document.getElementById('summary').textContent =+ `${evalItems.length} queries total: ${trigger} should trigger, ${noTrigger} should not trigger`;+ }++ function exportEvalSet() {+ const valid = evalItems.filter(i => i.query.trim() !== '');+ const data = valid.map(i => ({ query: i.query.trim(), should_trigger: i.should_trigger }));+ const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' });+ const url = URL.createObjectURL(blob);+ const a = document.createElement('a');+ a.href = url;+ a.download = 'eval_set.json';+ document.body.appendChild(a);+ a.click();+ document.body.removeChild(a);+ URL.revokeObjectURL(url);+ }++ render();+ </script>+</body>+</html>diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/eval-viewer/generate_review.py b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/eval-viewer/generate_review.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/eval-viewer/generate_review.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-creator/eval-viewer/generate_review.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/eval-viewer/viewer.html b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/eval-viewer/viewer.htmlsimilarity index 97%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/eval-viewer/viewer.htmlrename to jiuwenclaw/resources/agent/workspace/skills/skill-creator/eval-viewer/viewer.htmlindex ca9880450f..6d8e96348a 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/eval-viewer/viewer.html+++ b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/eval-viewer/viewer.html@@ -1,1325 +1,1325 @@-<!DOCTYPE html>-<html lang="en">-<head>- <meta charset="UTF-8">- <meta name="viewport" content="width=device-width, initial-scale=1.0">- <title>Eval Review</title>- <link rel="preconnect" href="https://fonts.googleapis.com">- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>- <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@500;600&family=Lora:wght@400;500&display=swap" rel="stylesheet">- <script src="https://cdn.sheetjs.com/xlsx-0.20.3/package/dist/xlsx.full.min.js" integrity="sha384-EnyY0/GSHQGSxSgMwaIPzSESbqoOLSexfnSMN2AP+39Ckmn92stwABZynq1JyzdT" crossorigin="anonymous"></script>- <style>- :root {- --bg: #faf9f5;- --surface: #ffffff;- --border: #e8e6dc;- --text: #141413;- --text-muted: #b0aea5;- --accent: #d97757;- --accent-hover: #c4613f;- --green: #788c5d;- --green-bg: #eef2e8;- --red: #c44;- --red-bg: #fceaea;- --header-bg: #141413;- --header-text: #faf9f5;- --radius: 6px;- }-- * { box-sizing: border-box; margin: 0; padding: 0; }-- body {- font-family: 'Lora', Georgia, serif;- background: var(--bg);- color: var(--text);- height: 100vh;- display: flex;- flex-direction: column;- }-- /* ---- Header ---- */- .header {- background: var(--header-bg);- color: var(--header-text);- padding: 1rem 2rem;- display: flex;- justify-content: space-between;- align-items: center;- flex-shrink: 0;- }- .header h1 {- font-family: 'Poppins', sans-serif;- font-size: 1.25rem;- font-weight: 600;- }- .header .instructions {- font-size: 0.8rem;- opacity: 0.7;- margin-top: 0.25rem;- }- .header .progress {- font-size: 0.875rem;- opacity: 0.8;- text-align: right;- }-- /* ---- Main content ---- */- .main {- flex: 1;- overflow-y: auto;- padding: 1.5rem 2rem;- display: flex;- flex-direction: column;- gap: 1.25rem;- }-- /* ---- Sections ---- */- .section {- background: var(--surface);- border: 1px solid var(--border);- border-radius: var(--radius);- flex-shrink: 0;- }- .section-header {- font-family: 'Poppins', sans-serif;- padding: 0.75rem 1rem;- font-size: 0.75rem;- font-weight: 500;- text-transform: uppercase;- letter-spacing: 0.05em;- color: var(--text-muted);- border-bottom: 1px solid var(--border);- background: var(--bg);- }- .section-body {- padding: 1rem;- }-- /* ---- Config badge ---- */- .config-badge {- display: inline-block;- padding: 0.2rem 0.625rem;- border-radius: 9999px;- font-family: 'Poppins', sans-serif;- font-size: 0.6875rem;- font-weight: 600;- text-transform: uppercase;- letter-spacing: 0.03em;- margin-left: 0.75rem;- vertical-align: middle;- }- .config-badge.config-primary {- background: rgba(33, 150, 243, 0.12);- color: #1976d2;- }- .config-badge.config-baseline {- background: rgba(255, 193, 7, 0.15);- color: #f57f17;- }-- /* ---- Prompt ---- */- .prompt-text {- white-space: pre-wrap;- font-size: 0.9375rem;- line-height: 1.6;- }-- /* ---- Outputs ---- */- .output-file {- border: 1px solid var(--border);- border-radius: var(--radius);- overflow: hidden;- }- .output-file + .output-file {- margin-top: 1rem;- }- .output-file-header {- padding: 0.5rem 0.75rem;- font-size: 0.8rem;- font-weight: 600;- color: var(--text-muted);- background: var(--bg);- border-bottom: 1px solid var(--border);- font-family: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;- display: flex;- justify-content: space-between;- align-items: center;- }- .output-file-header .dl-btn {- font-size: 0.7rem;- color: var(--accent);- text-decoration: none;- cursor: pointer;- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;- font-weight: 500;- opacity: 0.8;- }- .output-file-header .dl-btn:hover {- opacity: 1;- text-decoration: underline;- }- .output-file-content {- padding: 0.75rem;- overflow-x: auto;- }- .output-file-content pre {- font-size: 0.8125rem;- line-height: 1.5;- white-space: pre-wrap;- word-break: break-word;- font-family: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;- }- .output-file-content img {- max-width: 100%;- height: auto;- border-radius: 4px;- }- .output-file-content iframe {- width: 100%;- height: 600px;- border: none;- }- .output-file-content table {- border-collapse: collapse;- font-size: 0.8125rem;- width: 100%;- }- .output-file-content table td,- .output-file-content table th {- border: 1px solid var(--border);- padding: 0.375rem 0.5rem;- text-align: left;- }- .output-file-content table th {- background: var(--bg);- font-weight: 600;- }- .output-file-content .download-link {- display: inline-flex;- align-items: center;- gap: 0.5rem;- padding: 0.5rem 1rem;- background: var(--bg);- border: 1px solid var(--border);- border-radius: 4px;- color: var(--accent);- text-decoration: none;- font-size: 0.875rem;- cursor: pointer;- }- .output-file-content .download-link:hover {- background: var(--border);- }- .empty-state {- color: var(--text-muted);- font-style: italic;- padding: 2rem;- text-align: center;- }-- /* ---- Feedback ---- */- .prev-feedback {- background: var(--bg);- border: 1px solid var(--border);- border-radius: 4px;- padding: 0.625rem 0.75rem;- margin-top: 0.75rem;- font-size: 0.8125rem;- color: var(--text-muted);- line-height: 1.5;- }- .prev-feedback-label {- font-size: 0.7rem;- font-weight: 600;- text-transform: uppercase;- letter-spacing: 0.04em;- margin-bottom: 0.25rem;- color: var(--text-muted);- }- .feedback-textarea {- width: 100%;- min-height: 100px;- padding: 0.75rem;- border: 1px solid var(--border);- border-radius: 4px;- font-family: inherit;- font-size: 0.9375rem;- line-height: 1.5;- resize: vertical;- color: var(--text);- }- .feedback-textarea:focus {- outline: none;- border-color: var(--accent);- box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);- }- .feedback-status {- font-size: 0.75rem;- color: var(--text-muted);- margin-top: 0.5rem;- min-height: 1.1em;- }-- /* ---- Grades (collapsible) ---- */- .grades-toggle {- display: flex;- align-items: center;- cursor: pointer;- user-select: none;- }- .grades-toggle:hover {- color: var(--accent);- }- .grades-toggle .arrow {- margin-right: 0.5rem;- transition: transform 0.15s;- font-size: 0.75rem;- }- .grades-toggle .arrow.open {- transform: rotate(90deg);- }- .grades-content {- display: none;- margin-top: 0.75rem;- }- .grades-content.open {- display: block;- }- .grades-summary {- font-size: 0.875rem;- margin-bottom: 0.75rem;- display: flex;- align-items: center;- gap: 0.5rem;- }- .grade-badge {- display: inline-block;- padding: 0.125rem 0.5rem;- border-radius: 9999px;- font-size: 0.75rem;- font-weight: 600;- }- .grade-pass { background: var(--green-bg); color: var(--green); }- .grade-fail { background: var(--red-bg); color: var(--red); }- .assertion-list {- list-style: none;- }- .assertion-item {- padding: 0.625rem 0;- border-bottom: 1px solid var(--border);- font-size: 0.8125rem;- }- .assertion-item:last-child { border-bottom: none; }- .assertion-status {- font-weight: 600;- margin-right: 0.5rem;- }- .assertion-status.pass { color: var(--green); }- .assertion-status.fail { color: var(--red); }- .assertion-evidence {- color: var(--text-muted);- font-size: 0.75rem;- margin-top: 0.25rem;- padding-left: 1.5rem;- }-- /* ---- View tabs ---- */- .view-tabs {- display: flex;- gap: 0;- padding: 0 2rem;- background: var(--bg);- border-bottom: 1px solid var(--border);- flex-shrink: 0;- }- .view-tab {- font-family: 'Poppins', sans-serif;- padding: 0.625rem 1.25rem;- font-size: 0.8125rem;- font-weight: 500;- cursor: pointer;- border: none;- background: none;- color: var(--text-muted);- border-bottom: 2px solid transparent;- transition: all 0.15s;- }- .view-tab:hover { color: var(--text); }- .view-tab.active {- color: var(--accent);- border-bottom-color: var(--accent);- }- .view-panel { display: none; }- .view-panel.active { display: flex; flex-direction: column; flex: 1; overflow: hidden; }-- /* ---- Benchmark view ---- */- .benchmark-view {- padding: 1.5rem 2rem;- overflow-y: auto;- flex: 1;- }- .benchmark-table {- border-collapse: collapse;- background: var(--surface);- border: 1px solid var(--border);- border-radius: var(--radius);- font-size: 0.8125rem;- width: 100%;- margin-bottom: 1.5rem;- }- .benchmark-table th, .benchmark-table td {- padding: 0.625rem 0.75rem;- text-align: left;- border: 1px solid var(--border);- }- .benchmark-table th {- font-family: 'Poppins', sans-serif;- background: var(--header-bg);- color: var(--header-text);- font-weight: 500;- font-size: 0.75rem;- text-transform: uppercase;- letter-spacing: 0.04em;- }- .benchmark-table tr:hover { background: var(--bg); }- .benchmark-table tr.benchmark-row-with { background: rgba(33, 150, 243, 0.06); }- .benchmark-table tr.benchmark-row-without { background: rgba(255, 193, 7, 0.06); }- .benchmark-table tr.benchmark-row-with:hover { background: rgba(33, 150, 243, 0.12); }- .benchmark-table tr.benchmark-row-without:hover { background: rgba(255, 193, 7, 0.12); }- .benchmark-table tr.benchmark-row-avg { font-weight: 600; border-top: 2px solid var(--border); }- .benchmark-table tr.benchmark-row-avg.benchmark-row-with { background: rgba(33, 150, 243, 0.12); }- .benchmark-table tr.benchmark-row-avg.benchmark-row-without { background: rgba(255, 193, 7, 0.12); }- .benchmark-delta-positive { color: var(--green); font-weight: 600; }- .benchmark-delta-negative { color: var(--red); font-weight: 600; }- .benchmark-notes {- background: var(--surface);- border: 1px solid var(--border);- border-radius: var(--radius);- padding: 1rem;- }- .benchmark-notes h3 {- font-family: 'Poppins', sans-serif;- font-size: 0.875rem;- margin-bottom: 0.75rem;- }- .benchmark-notes ul {- list-style: disc;- padding-left: 1.25rem;- }- .benchmark-notes li {- font-size: 0.8125rem;- line-height: 1.6;- margin-bottom: 0.375rem;- }- .benchmark-empty {- color: var(--text-muted);- font-style: italic;- text-align: center;- padding: 3rem;- }-- /* ---- Navigation ---- */- .nav {- display: flex;- justify-content: space-between;- align-items: center;- padding: 1rem 2rem;- border-top: 1px solid var(--border);- background: var(--surface);- flex-shrink: 0;- }- .nav-btn {- font-family: 'Poppins', sans-serif;- padding: 0.5rem 1.25rem;- border: 1px solid var(--border);- border-radius: var(--radius);- background: var(--surface);- cursor: pointer;- font-size: 0.875rem;- font-weight: 500;- color: var(--text);- transition: all 0.15s;- }- .nav-btn:hover:not(:disabled) {- background: var(--bg);- border-color: var(--text-muted);- }- .nav-btn:disabled {- opacity: 0.4;- cursor: not-allowed;- }- .done-btn {- font-family: 'Poppins', sans-serif;- padding: 0.5rem 1.5rem;- border: 1px solid var(--border);- border-radius: var(--radius);- background: var(--surface);- color: var(--text);- cursor: pointer;- font-size: 0.875rem;- font-weight: 500;- transition: all 0.15s;- }- .done-btn:hover {- background: var(--bg);- border-color: var(--text-muted);- }- .done-btn.ready {- border: none;- background: var(--accent);- color: white;- font-weight: 600;- }- .done-btn.ready:hover {- background: var(--accent-hover);- }- /* ---- Done overlay ---- */- .done-overlay {- display: none;- position: fixed;- inset: 0;- background: rgba(0, 0, 0, 0.5);- z-index: 100;- justify-content: center;- align-items: center;- }- .done-overlay.visible {- display: flex;- }- .done-card {- background: var(--surface);- border-radius: 12px;- padding: 2rem 3rem;- text-align: center;- box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);- max-width: 500px;- }- .done-card h2 {- font-size: 1.5rem;- margin-bottom: 0.5rem;- }- .done-card p {- color: var(--text-muted);- margin-bottom: 1.5rem;- line-height: 1.5;- }- .done-card .btn-row {- display: flex;- gap: 0.5rem;- justify-content: center;- }- .done-card button {- padding: 0.5rem 1.25rem;- border: 1px solid var(--border);- border-radius: var(--radius);- background: var(--surface);- cursor: pointer;- font-size: 0.875rem;- }- .done-card button:hover {- background: var(--bg);- }- /* ---- Toast ---- */- .toast {- position: fixed;- bottom: 5rem;- left: 50%;- transform: translateX(-50%);- background: var(--header-bg);- color: var(--header-text);- padding: 0.625rem 1.25rem;- border-radius: var(--radius);- font-size: 0.875rem;- opacity: 0;- transition: opacity 0.3s;- pointer-events: none;- z-index: 200;- }- .toast.visible {- opacity: 1;- }- </style>-</head>-<body>- <div id="app" style="height:100vh; display:flex; flex-direction:column;">- <div class="header">- <div>- <h1>Eval Review: <span id="skill-name"></span></h1>- <div class="instructions">Review each output and leave feedback below. Navigate with arrow keys or buttons. When done, copy feedback and paste into Claude Code.</div>- </div>- <div class="progress" id="progress"></div>- </div>-- <!-- View tabs (only shown when benchmark data exists) -->- <div class="view-tabs" id="view-tabs" style="display:none;">- <button class="view-tab active" onclick="switchView('outputs')">Outputs</button>- <button class="view-tab" onclick="switchView('benchmark')">Benchmark</button>- </div>-- <!-- Outputs panel (qualitative review) -->- <div class="view-panel active" id="panel-outputs">- <div class="main">- <!-- Prompt -->- <div class="section">- <div class="section-header">Prompt <span class="config-badge" id="config-badge" style="display:none;"></span></div>- <div class="section-body">- <div class="prompt-text" id="prompt-text"></div>- </div>- </div>-- <!-- Outputs -->- <div class="section">- <div class="section-header">Output</div>- <div class="section-body" id="outputs-body">- <div class="empty-state">No output files found</div>- </div>- </div>-- <!-- Previous Output (collapsible) -->- <div class="section" id="prev-outputs-section" style="display:none;">- <div class="section-header">- <div class="grades-toggle" onclick="togglePrevOutputs()">- <span class="arrow" id="prev-outputs-arrow">▶</span>- Previous Output- </div>- </div>- <div class="grades-content" id="prev-outputs-content"></div>- </div>-- <!-- Grades (collapsible) -->- <div class="section" id="grades-section" style="display:none;">- <div class="section-header">- <div class="grades-toggle" onclick="toggleGrades()">- <span class="arrow" id="grades-arrow">▶</span>- Formal Grades- </div>- </div>- <div class="grades-content" id="grades-content"></div>- </div>-- <!-- Feedback -->- <div class="section">- <div class="section-header">Your Feedback</div>- <div class="section-body">- <textarea- class="feedback-textarea"- id="feedback"- placeholder="What do you think of this output? Any issues, suggestions, or things that look great?"- ></textarea>- <div class="feedback-status" id="feedback-status"></div>- <div class="prev-feedback" id="prev-feedback" style="display:none;">- <div class="prev-feedback-label">Previous feedback</div>- <div id="prev-feedback-text"></div>- </div>- </div>- </div>- </div>-- <div class="nav" id="outputs-nav">- <button class="nav-btn" id="prev-btn" onclick="navigate(-1)">← Previous</button>- <button class="done-btn" id="done-btn" onclick="showDoneDialog()">Submit All Reviews</button>- <button class="nav-btn" id="next-btn" onclick="navigate(1)">Next →</button>- </div>- </div><!-- end panel-outputs -->-- <!-- Benchmark panel (quantitative stats) -->- <div class="view-panel" id="panel-benchmark">- <div class="benchmark-view" id="benchmark-content">- <div class="benchmark-empty">No benchmark data available. Run a benchmark to see quantitative results here.</div>- </div>- </div>- </div>-- <!-- Done overlay -->- <div class="done-overlay" id="done-overlay">- <div class="done-card">- <h2>Review Complete</h2>- <p>Your feedback has been saved. Go back to your Claude Code session and tell Claude you're done reviewing.</p>- <div class="btn-row">- <button onclick="closeDoneDialog()">OK</button>- </div>- </div>- </div>-- <!-- Toast -->- <div class="toast" id="toast"></div>-- <script>- // ---- Embedded data (injected by generate_review.py) ----- /*__EMBEDDED_DATA__*/-- // ---- State ----- let feedbackMap = {}; // run_id -> feedback text- let currentIndex = 0;- let visitedRuns = new Set();-- // ---- Init ----- async function init() {- // Load saved feedback from server — but only if this isn't a fresh- // iteration (indicated by previous_feedback being present). When- // previous feedback exists, the feedback.json on disk is stale from- // the prior iteration and should not pre-fill the textareas.- const hasPrevious = Object.keys(EMBEDDED_DATA.previous_feedback || {}).length > 0- || Object.keys(EMBEDDED_DATA.previous_outputs || {}).length > 0;- if (!hasPrevious) {- try {- const resp = await fetch("/api/feedback");- const data = await resp.json();- if (data.reviews) {- for (const r of data.reviews) feedbackMap[r.run_id] = r.feedback;- }- } catch { /* first run, no feedback yet */ }- }-- document.getElementById("skill-name").textContent = EMBEDDED_DATA.skill_name;- showRun(0);-- // Wire up feedback auto-save- const textarea = document.getElementById("feedback");- let saveTimeout = null;- textarea.addEventListener("input", () => {- clearTimeout(saveTimeout);- document.getElementById("feedback-status").textContent = "";- saveTimeout = setTimeout(() => saveCurrentFeedback(), 800);- });- }-- // ---- Navigation ----- function navigate(delta) {- const newIndex = currentIndex + delta;- if (newIndex >= 0 && newIndex < EMBEDDED_DATA.runs.length) {- saveCurrentFeedback();- showRun(newIndex);- }- }-- function updateNavButtons() {- document.getElementById("prev-btn").disabled = currentIndex === 0;- document.getElementById("next-btn").disabled =- currentIndex === EMBEDDED_DATA.runs.length - 1;- }-- // ---- Show a run ----- function showRun(index) {- currentIndex = index;- const run = EMBEDDED_DATA.runs[index];-- // Progress- document.getElementById("progress").textContent =- `${index + 1} of ${EMBEDDED_DATA.runs.length}`;-- // Prompt- document.getElementById("prompt-text").textContent = run.prompt;-- // Config badge- const badge = document.getElementById("config-badge");- const configMatch = run.id.match(/(with_skill|without_skill|new_skill|old_skill)/);- if (configMatch) {- const config = configMatch[1];- const isBaseline = config === "without_skill" || config === "old_skill";- badge.textContent = config.replace(/_/g, " ");- badge.className = "config-badge " + (isBaseline ? "config-baseline" : "config-primary");- badge.style.display = "inline-block";- } else {- badge.style.display = "none";- }-- // Outputs- renderOutputs(run);-- // Previous outputs- renderPrevOutputs(run);-- // Grades- renderGrades(run);-- // Previous feedback- const prevFb = (EMBEDDED_DATA.previous_feedback || {})[run.id];- const prevEl = document.getElementById("prev-feedback");- if (prevFb) {- document.getElementById("prev-feedback-text").textContent = prevFb;- prevEl.style.display = "block";- } else {- prevEl.style.display = "none";- }-- // Feedback- document.getElementById("feedback").value = feedbackMap[run.id] || "";- document.getElementById("feedback-status").textContent = "";-- updateNavButtons();-- // Track visited runs and promote done button when all visited- visitedRuns.add(index);- const doneBtn = document.getElementById("done-btn");- if (visitedRuns.size >= EMBEDDED_DATA.runs.length) {- doneBtn.classList.add("ready");- }-- // Scroll main content to top- document.querySelector(".main").scrollTop = 0;- }-- // ---- Render outputs ----- function renderOutputs(run) {- const container = document.getElementById("outputs-body");- container.innerHTML = "";-- const outputs = run.outputs || [];- if (outputs.length === 0) {- container.innerHTML = '<div class="empty-state">No output files</div>';- return;- }-- for (const file of outputs) {- const fileDiv = document.createElement("div");- fileDiv.className = "output-file";-- // Always show file header with download link- const header = document.createElement("div");- header.className = "output-file-header";- const nameSpan = document.createElement("span");- nameSpan.textContent = file.name;- header.appendChild(nameSpan);- const dlBtn = document.createElement("a");- dlBtn.className = "dl-btn";- dlBtn.textContent = "Download";- dlBtn.download = file.name;- dlBtn.href = getDownloadUri(file);- header.appendChild(dlBtn);- fileDiv.appendChild(header);-- const content = document.createElement("div");- content.className = "output-file-content";-- if (file.type === "text") {- const pre = document.createElement("pre");- pre.textContent = file.content;- content.appendChild(pre);- } else if (file.type === "image") {- const img = document.createElement("img");- img.src = file.data_uri;- img.alt = file.name;- content.appendChild(img);- } else if (file.type === "pdf") {- const iframe = document.createElement("iframe");- iframe.src = file.data_uri;- content.appendChild(iframe);- } else if (file.type === "xlsx") {- renderXlsx(content, file.data_b64);- } else if (file.type === "binary") {- const a = document.createElement("a");- a.className = "download-link";- a.href = file.data_uri;- a.download = file.name;- a.textContent = "Download " + file.name;- content.appendChild(a);- } else if (file.type === "error") {- const pre = document.createElement("pre");- pre.textContent = file.content;- pre.style.color = "var(--red)";- content.appendChild(pre);- }-- fileDiv.appendChild(content);- container.appendChild(fileDiv);- }- }-- // ---- XLSX rendering via SheetJS ----- function renderXlsx(container, b64Data) {- try {- const raw = Uint8Array.from(atob(b64Data), c => c.charCodeAt(0));- const wb = XLSX.read(raw, { type: "array" });-- for (let i = 0; i < wb.SheetNames.length; i++) {- const sheetName = wb.SheetNames[i];- const ws = wb.Sheets[sheetName];-- if (wb.SheetNames.length > 1) {- const sheetLabel = document.createElement("div");- sheetLabel.style.cssText =- "font-weight:600; font-size:0.8rem; color:#b0aea5; margin-top:0.5rem; margin-bottom:0.25rem;";- sheetLabel.textContent = "Sheet: " + sheetName;- container.appendChild(sheetLabel);- }-- const htmlStr = XLSX.utils.sheet_to_html(ws, { editable: false });- const wrapper = document.createElement("div");- wrapper.innerHTML = htmlStr;- container.appendChild(wrapper);- }- } catch (err) {- container.textContent = "Error rendering spreadsheet: " + err.message;- }- }-- // ---- Grades ----- function renderGrades(run) {- const section = document.getElementById("grades-section");- const content = document.getElementById("grades-content");-- if (!run.grading) {- section.style.display = "none";- return;- }-- const grading = run.grading;- section.style.display = "block";- // Reset to collapsed- content.classList.remove("open");- document.getElementById("grades-arrow").classList.remove("open");-- const summary = grading.summary || {};- const expectations = grading.expectations || [];-- let html = '<div style="padding: 1rem;">';-- // Summary line- const passRate = summary.pass_rate != null- ? Math.round(summary.pass_rate * 100) + "%"- : "?";- const badgeClass = summary.pass_rate >= 0.8 ? "grade-pass" : summary.pass_rate >= 0.5 ? "" : "grade-fail";- html += '<div class="grades-summary">';- html += '<span class="grade-badge ' + badgeClass + '">' + passRate + '</span>';- html += '<span>' + (summary.passed || 0) + ' passed, ' + (summary.failed || 0) + ' failed of ' + (summary.total || 0) + '</span>';- html += '</div>';-- // Assertions list- html += '<ul class="assertion-list">';- for (const exp of expectations) {- const statusClass = exp.passed ? "pass" : "fail";- const statusIcon = exp.passed ? "\u2713" : "\u2717";- html += '<li class="assertion-item">';- html += '<span class="assertion-status ' + statusClass + '">' + statusIcon + '</span>';- html += '<span>' + escapeHtml(exp.text) + '</span>';- if (exp.evidence) {- html += '<div class="assertion-evidence">' + escapeHtml(exp.evidence) + '</div>';- }- html += '</li>';- }- html += '</ul>';-- html += '</div>';- content.innerHTML = html;- }-- function toggleGrades() {- const content = document.getElementById("grades-content");- const arrow = document.getElementById("grades-arrow");- content.classList.toggle("open");- arrow.classList.toggle("open");- }-- // ---- Previous outputs (collapsible) ----- function renderPrevOutputs(run) {- const section = document.getElementById("prev-outputs-section");- const content = document.getElementById("prev-outputs-content");- const prevOutputs = (EMBEDDED_DATA.previous_outputs || {})[run.id];-- if (!prevOutputs || prevOutputs.length === 0) {- section.style.display = "none";- return;- }-- section.style.display = "block";- // Reset to collapsed- content.classList.remove("open");- document.getElementById("prev-outputs-arrow").classList.remove("open");-- // Render the files into the content area- content.innerHTML = "";- const wrapper = document.createElement("div");- wrapper.style.padding = "1rem";-- for (const file of prevOutputs) {- const fileDiv = document.createElement("div");- fileDiv.className = "output-file";-- const header = document.createElement("div");- header.className = "output-file-header";- const nameSpan = document.createElement("span");- nameSpan.textContent = file.name;- header.appendChild(nameSpan);- const dlBtn = document.createElement("a");- dlBtn.className = "dl-btn";- dlBtn.textContent = "Download";- dlBtn.download = file.name;- dlBtn.href = getDownloadUri(file);- header.appendChild(dlBtn);- fileDiv.appendChild(header);-- const fc = document.createElement("div");- fc.className = "output-file-content";-- if (file.type === "text") {- const pre = document.createElement("pre");- pre.textContent = file.content;- fc.appendChild(pre);- } else if (file.type === "image") {- const img = document.createElement("img");- img.src = file.data_uri;- img.alt = file.name;- fc.appendChild(img);- } else if (file.type === "pdf") {- const iframe = document.createElement("iframe");- iframe.src = file.data_uri;- fc.appendChild(iframe);- } else if (file.type === "xlsx") {- renderXlsx(fc, file.data_b64);- } else if (file.type === "binary") {- const a = document.createElement("a");- a.className = "download-link";- a.href = file.data_uri;- a.download = file.name;- a.textContent = "Download " + file.name;- fc.appendChild(a);- }-- fileDiv.appendChild(fc);- wrapper.appendChild(fileDiv);- }-- content.appendChild(wrapper);- }-- function togglePrevOutputs() {- const content = document.getElementById("prev-outputs-content");- const arrow = document.getElementById("prev-outputs-arrow");- content.classList.toggle("open");- arrow.classList.toggle("open");- }-- // ---- Feedback (saved to server -> feedback.json) ----- function saveCurrentFeedback() {- const run = EMBEDDED_DATA.runs[currentIndex];- const text = document.getElementById("feedback").value;-- if (text.trim() === "") {- delete feedbackMap[run.id];- } else {- feedbackMap[run.id] = text;- }-- // Build reviews array from map- const reviews = [];- for (const [run_id, feedback] of Object.entries(feedbackMap)) {- if (feedback.trim()) {- reviews.push({ run_id, feedback, timestamp: new Date().toISOString() });- }- }-- fetch("/api/feedback", {- method: "POST",- headers: { "Content-Type": "application/json" },- body: JSON.stringify({ reviews, status: "in_progress" }),- }).then(() => {- document.getElementById("feedback-status").textContent = "Saved";- }).catch(() => {- // Static mode or server unavailable — no-op on auto-save,- // feedback will be downloaded on final submit- document.getElementById("feedback-status").textContent = "Will download on submit";- });- }-- // ---- Done ----- function showDoneDialog() {- // Save current textarea to feedbackMap (but don't POST yet)- const run = EMBEDDED_DATA.runs[currentIndex];- const text = document.getElementById("feedback").value;- if (text.trim() === "") {- delete feedbackMap[run.id];- } else {- feedbackMap[run.id] = text;- }-- // POST once with status: complete — include ALL runs so the model- // can distinguish "no feedback" (looks good) from "not reviewed"- const reviews = [];- const ts = new Date().toISOString();- for (const r of EMBEDDED_DATA.runs) {- reviews.push({ run_id: r.id, feedback: feedbackMap[r.id] || "", timestamp: ts });- }- const payload = JSON.stringify({ reviews, status: "complete" }, null, 2);- fetch("/api/feedback", {- method: "POST",- headers: { "Content-Type": "application/json" },- body: payload,- }).then(() => {- document.getElementById("done-overlay").classList.add("visible");- }).catch(() => {- // Server not available (static mode) — download as file- const blob = new Blob([payload], { type: "application/json" });- const url = URL.createObjectURL(blob);- const a = document.createElement("a");- a.href = url;- a.download = "feedback.json";- a.click();- URL.revokeObjectURL(url);- document.getElementById("done-overlay").classList.add("visible");- });- }-- function closeDoneDialog() {- // Reset status back to in_progress- saveCurrentFeedback();- document.getElementById("done-overlay").classList.remove("visible");- }-- // ---- Toast ----- function showToast(message) {- const toast = document.getElementById("toast");- toast.textContent = message;- toast.classList.add("visible");- setTimeout(() => toast.classList.remove("visible"), 2000);- }-- // ---- Keyboard nav ----- document.addEventListener("keydown", (e) => {- // Don't capture when typing in textarea- if (e.target.tagName === "TEXTAREA") return;-- if (e.key === "ArrowLeft" || e.key === "ArrowUp") {- e.preventDefault();- navigate(-1);- } else if (e.key === "ArrowRight" || e.key === "ArrowDown") {- e.preventDefault();- navigate(1);- }- });-- // ---- Util ----- function getDownloadUri(file) {- if (file.data_uri) return file.data_uri;- if (file.data_b64) return "data:application/octet-stream;base64," + file.data_b64;- if (file.type === "text") return "data:text/plain;charset=utf-8," + encodeURIComponent(file.content);- return "#";- }-- function escapeHtml(text) {- const div = document.createElement("div");- div.textContent = text;- return div.innerHTML;- }-- // ---- View switching ----- function switchView(view) {- document.querySelectorAll(".view-tab").forEach(t => t.classList.remove("active"));- document.querySelectorAll(".view-panel").forEach(p => p.classList.remove("active"));- document.querySelector(`[onclick="switchView('${view}')"]`).classList.add("active");- document.getElementById("panel-" + view).classList.add("active");- }-- // ---- Benchmark rendering ----- function renderBenchmark() {- const data = EMBEDDED_DATA.benchmark;- if (!data) return;-- // Show the tabs- document.getElementById("view-tabs").style.display = "flex";-- const container = document.getElementById("benchmark-content");- const summary = data.run_summary || {};- const metadata = data.metadata || {};- const notes = data.notes || [];-- let html = "";-- // Header- html += "<h2 style='font-family: Poppins, sans-serif; margin-bottom: 0.5rem;'>Benchmark Results</h2>";- html += "<p style='color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.25rem;'>";- if (metadata.skill_name) html += "<strong>" + escapeHtml(metadata.skill_name) + "</strong> — ";- if (metadata.timestamp) html += metadata.timestamp + " — ";- if (metadata.evals_run) html += "Evals: " + metadata.evals_run.join(", ") + " — ";- html += (metadata.runs_per_configuration || "?") + " runs per configuration";- html += "</p>";-- // Summary table- html += '<table class="benchmark-table">';-- function fmtStat(stat, pct) {- if (!stat) return "—";- const suffix = pct ? "%" : "";- const m = pct ? (stat.mean * 100).toFixed(0) : stat.mean.toFixed(1);- const s = pct ? (stat.stddev * 100).toFixed(0) : stat.stddev.toFixed(1);- return m + suffix + " ± " + s + suffix;- }-- function deltaClass(val) {- if (!val) return "";- const n = parseFloat(val);- if (n > 0) return "benchmark-delta-positive";- if (n < 0) return "benchmark-delta-negative";- return "";- }-- // Discover config names dynamically (everything except "delta")- const configs = Object.keys(summary).filter(k => k !== "delta");- const configA = configs[0] || "config_a";- const configB = configs[1] || "config_b";- const labelA = configA.replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());- const labelB = configB.replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());- const a = summary[configA] || {};- const b = summary[configB] || {};- const delta = summary.delta || {};-- html += "<thead><tr><th>Metric</th><th>" + escapeHtml(labelA) + "</th><th>" + escapeHtml(labelB) + "</th><th>Delta</th></tr></thead>";- html += "<tbody>";-- html += "<tr><td><strong>Pass Rate</strong></td>";- html += "<td>" + fmtStat(a.pass_rate, true) + "</td>";- html += "<td>" + fmtStat(b.pass_rate, true) + "</td>";- html += '<td class="' + deltaClass(delta.pass_rate) + '">' + (delta.pass_rate || "—") + "</td></tr>";-- // Time (only show row if data exists)- if (a.time_seconds || b.time_seconds) {- html += "<tr><td><strong>Time (s)</strong></td>";- html += "<td>" + fmtStat(a.time_seconds, false) + "</td>";- html += "<td>" + fmtStat(b.time_seconds, false) + "</td>";- html += '<td class="' + deltaClass(delta.time_seconds) + '">' + (delta.time_seconds ? delta.time_seconds + "s" : "—") + "</td></tr>";- }-- // Tokens (only show row if data exists)- if (a.tokens || b.tokens) {- html += "<tr><td><strong>Tokens</strong></td>";- html += "<td>" + fmtStat(a.tokens, false) + "</td>";- html += "<td>" + fmtStat(b.tokens, false) + "</td>";- html += '<td class="' + deltaClass(delta.tokens) + '">' + (delta.tokens || "—") + "</td></tr>";- }-- html += "</tbody></table>";-- // Per-eval breakdown (if runs data available)- const runs = data.runs || [];- if (runs.length > 0) {- const evalIds = [...new Set(runs.map(r => r.eval_id))].sort((a, b) => a - b);-- html += "<h3 style='font-family: Poppins, sans-serif; margin-bottom: 0.75rem;'>Per-Eval Breakdown</h3>";-- const hasTime = runs.some(r => r.result && r.result.time_seconds != null);- const hasErrors = runs.some(r => r.result && r.result.errors > 0);-- for (const evalId of evalIds) {- const evalRuns = runs.filter(r => r.eval_id === evalId);- const evalName = evalRuns[0] && evalRuns[0].eval_name ? evalRuns[0].eval_name : "Eval " + evalId;-- html += "<h4 style='font-family: Poppins, sans-serif; margin: 1rem 0 0.5rem; color: var(--text);'>" + escapeHtml(evalName) + "</h4>";- html += '<table class="benchmark-table">';- html += "<thead><tr><th>Config</th><th>Run</th><th>Pass Rate</th>";- if (hasTime) html += "<th>Time (s)</th>";- if (hasErrors) html += "<th>Crashes During Execution</th>";- html += "</tr></thead>";- html += "<tbody>";-- // Group by config and render with average rows- const configGroups = [...new Set(evalRuns.map(r => r.configuration))];- for (let ci = 0; ci < configGroups.length; ci++) {- const config = configGroups[ci];- const configRuns = evalRuns.filter(r => r.configuration === config);- if (configRuns.length === 0) continue;-- const rowClass = ci === 0 ? "benchmark-row-with" : "benchmark-row-without";- const configLabel = config.replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());-- for (const run of configRuns) {- const r = run.result || {};- const prClass = r.pass_rate >= 0.8 ? "benchmark-delta-positive" : r.pass_rate < 0.5 ? "benchmark-delta-negative" : "";- html += '<tr class="' + rowClass + '">';- html += "<td>" + configLabel + "</td>";- html += "<td>" + run.run_number + "</td>";- html += '<td class="' + prClass + '">' + ((r.pass_rate || 0) * 100).toFixed(0) + "% (" + (r.passed || 0) + "/" + (r.total || 0) + ")</td>";- if (hasTime) html += "<td>" + (r.time_seconds != null ? r.time_seconds.toFixed(1) : "—") + "</td>";- if (hasErrors) html += "<td>" + (r.errors || 0) + "</td>";- html += "</tr>";- }-- // Average row- const rates = configRuns.map(r => (r.result || {}).pass_rate || 0);- const avgRate = rates.reduce((a, b) => a + b, 0) / rates.length;- const avgPrClass = avgRate >= 0.8 ? "benchmark-delta-positive" : avgRate < 0.5 ? "benchmark-delta-negative" : "";- html += '<tr class="benchmark-row-avg ' + rowClass + '">';- html += "<td>" + configLabel + "</td>";- html += "<td>Avg</td>";- html += '<td class="' + avgPrClass + '">' + (avgRate * 100).toFixed(0) + "%</td>";- if (hasTime) {- const times = configRuns.map(r => (r.result || {}).time_seconds).filter(t => t != null);- html += "<td>" + (times.length ? (times.reduce((a, b) => a + b, 0) / times.length).toFixed(1) : "—") + "</td>";- }- if (hasErrors) html += "<td></td>";- html += "</tr>";- }- html += "</tbody></table>";-- // Per-assertion detail for this eval- const runsWithExpectations = {};- for (const config of configGroups) {- runsWithExpectations[config] = evalRuns.filter(r => r.configuration === config && r.expectations && r.expectations.length > 0);- }- const hasAnyExpectations = Object.values(runsWithExpectations).some(runs => runs.length > 0);- if (hasAnyExpectations) {- // Collect all unique assertion texts across all configs- const allAssertions = [];- const seen = new Set();- for (const config of configGroups) {- for (const run of runsWithExpectations[config]) {- for (const exp of (run.expectations || [])) {- if (!seen.has(exp.text)) {- seen.add(exp.text);- allAssertions.push(exp.text);- }- }- }- }-- html += '<table class="benchmark-table" style="margin-top: 0.5rem;">';- html += "<thead><tr><th>Assertion</th>";- for (const config of configGroups) {- const label = config.replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());- html += "<th>" + escapeHtml(label) + "</th>";- }- html += "</tr></thead><tbody>";-- for (const assertionText of allAssertions) {- html += "<tr><td>" + escapeHtml(assertionText) + "</td>";-- for (const config of configGroups) {- html += "<td>";- for (const run of runsWithExpectations[config]) {- const exp = (run.expectations || []).find(e => e.text === assertionText);- if (exp) {- const cls = exp.passed ? "benchmark-delta-positive" : "benchmark-delta-negative";- const icon = exp.passed ? "\u2713" : "\u2717";- html += '<span class="' + cls + '" title="Run ' + run.run_number + ': ' + escapeHtml(exp.evidence || "") + '">' + icon + "</span> ";- } else {- html += "— ";- }- }- html += "</td>";- }- html += "</tr>";- }- html += "</tbody></table>";- }- }- }-- // Notes- if (notes.length > 0) {- html += '<div class="benchmark-notes">';- html += "<h3>Analysis Notes</h3>";- html += "<ul>";- for (const note of notes) {- html += "<li>" + escapeHtml(note) + "</li>";- }- html += "</ul></div>";- }-- container.innerHTML = html;- }-- // ---- Start ----- init();- renderBenchmark();- </script>-</body>-</html>+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>Eval Review</title>+ <link rel="preconnect" href="https://fonts.googleapis.com">+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@500;600&family=Lora:wght@400;500&display=swap" rel="stylesheet">+ <script src="https://cdn.sheetjs.com/xlsx-0.20.3/package/dist/xlsx.full.min.js" integrity="sha384-EnyY0/GSHQGSxSgMwaIPzSESbqoOLSexfnSMN2AP+39Ckmn92stwABZynq1JyzdT" crossorigin="anonymous"></script>+ <style>+ :root {+ --bg: #faf9f5;+ --surface: #ffffff;+ --border: #e8e6dc;+ --text: #141413;+ --text-muted: #b0aea5;+ --accent: #d97757;+ --accent-hover: #c4613f;+ --green: #788c5d;+ --green-bg: #eef2e8;+ --red: #c44;+ --red-bg: #fceaea;+ --header-bg: #141413;+ --header-text: #faf9f5;+ --radius: 6px;+ }++ * { box-sizing: border-box; margin: 0; padding: 0; }++ body {+ font-family: 'Lora', Georgia, serif;+ background: var(--bg);+ color: var(--text);+ height: 100vh;+ display: flex;+ flex-direction: column;+ }++ /* ---- Header ---- */+ .header {+ background: var(--header-bg);+ color: var(--header-text);+ padding: 1rem 2rem;+ display: flex;+ justify-content: space-between;+ align-items: center;+ flex-shrink: 0;+ }+ .header h1 {+ font-family: 'Poppins', sans-serif;+ font-size: 1.25rem;+ font-weight: 600;+ }+ .header .instructions {+ font-size: 0.8rem;+ opacity: 0.7;+ margin-top: 0.25rem;+ }+ .header .progress {+ font-size: 0.875rem;+ opacity: 0.8;+ text-align: right;+ }++ /* ---- Main content ---- */+ .main {+ flex: 1;+ overflow-y: auto;+ padding: 1.5rem 2rem;+ display: flex;+ flex-direction: column;+ gap: 1.25rem;+ }++ /* ---- Sections ---- */+ .section {+ background: var(--surface);+ border: 1px solid var(--border);+ border-radius: var(--radius);+ flex-shrink: 0;+ }+ .section-header {+ font-family: 'Poppins', sans-serif;+ padding: 0.75rem 1rem;+ font-size: 0.75rem;+ font-weight: 500;+ text-transform: uppercase;+ letter-spacing: 0.05em;+ color: var(--text-muted);+ border-bottom: 1px solid var(--border);+ background: var(--bg);+ }+ .section-body {+ padding: 1rem;+ }++ /* ---- Config badge ---- */+ .config-badge {+ display: inline-block;+ padding: 0.2rem 0.625rem;+ border-radius: 9999px;+ font-family: 'Poppins', sans-serif;+ font-size: 0.6875rem;+ font-weight: 600;+ text-transform: uppercase;+ letter-spacing: 0.03em;+ margin-left: 0.75rem;+ vertical-align: middle;+ }+ .config-badge.config-primary {+ background: rgba(33, 150, 243, 0.12);+ color: #1976d2;+ }+ .config-badge.config-baseline {+ background: rgba(255, 193, 7, 0.15);+ color: #f57f17;+ }++ /* ---- Prompt ---- */+ .prompt-text {+ white-space: pre-wrap;+ font-size: 0.9375rem;+ line-height: 1.6;+ }++ /* ---- Outputs ---- */+ .output-file {+ border: 1px solid var(--border);+ border-radius: var(--radius);+ overflow: hidden;+ }+ .output-file + .output-file {+ margin-top: 1rem;+ }+ .output-file-header {+ padding: 0.5rem 0.75rem;+ font-size: 0.8rem;+ font-weight: 600;+ color: var(--text-muted);+ background: var(--bg);+ border-bottom: 1px solid var(--border);+ font-family: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;+ display: flex;+ justify-content: space-between;+ align-items: center;+ }+ .output-file-header .dl-btn {+ font-size: 0.7rem;+ color: var(--accent);+ text-decoration: none;+ cursor: pointer;+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;+ font-weight: 500;+ opacity: 0.8;+ }+ .output-file-header .dl-btn:hover {+ opacity: 1;+ text-decoration: underline;+ }+ .output-file-content {+ padding: 0.75rem;+ overflow-x: auto;+ }+ .output-file-content pre {+ font-size: 0.8125rem;+ line-height: 1.5;+ white-space: pre-wrap;+ word-break: break-word;+ font-family: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;+ }+ .output-file-content img {+ max-width: 100%;+ height: auto;+ border-radius: 4px;+ }+ .output-file-content iframe {+ width: 100%;+ height: 600px;+ border: none;+ }+ .output-file-content table {+ border-collapse: collapse;+ font-size: 0.8125rem;+ width: 100%;+ }+ .output-file-content table td,+ .output-file-content table th {+ border: 1px solid var(--border);+ padding: 0.375rem 0.5rem;+ text-align: left;+ }+ .output-file-content table th {+ background: var(--bg);+ font-weight: 600;+ }+ .output-file-content .download-link {+ display: inline-flex;+ align-items: center;+ gap: 0.5rem;+ padding: 0.5rem 1rem;+ background: var(--bg);+ border: 1px solid var(--border);+ border-radius: 4px;+ color: var(--accent);+ text-decoration: none;+ font-size: 0.875rem;+ cursor: pointer;+ }+ .output-file-content .download-link:hover {+ background: var(--border);+ }+ .empty-state {+ color: var(--text-muted);+ font-style: italic;+ padding: 2rem;+ text-align: center;+ }++ /* ---- Feedback ---- */+ .prev-feedback {+ background: var(--bg);+ border: 1px solid var(--border);+ border-radius: 4px;+ padding: 0.625rem 0.75rem;+ margin-top: 0.75rem;+ font-size: 0.8125rem;+ color: var(--text-muted);+ line-height: 1.5;+ }+ .prev-feedback-label {+ font-size: 0.7rem;+ font-weight: 600;+ text-transform: uppercase;+ letter-spacing: 0.04em;+ margin-bottom: 0.25rem;+ color: var(--text-muted);+ }+ .feedback-textarea {+ width: 100%;+ min-height: 100px;+ padding: 0.75rem;+ border: 1px solid var(--border);+ border-radius: 4px;+ font-family: inherit;+ font-size: 0.9375rem;+ line-height: 1.5;+ resize: vertical;+ color: var(--text);+ }+ .feedback-textarea:focus {+ outline: none;+ border-color: var(--accent);+ box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);+ }+ .feedback-status {+ font-size: 0.75rem;+ color: var(--text-muted);+ margin-top: 0.5rem;+ min-height: 1.1em;+ }++ /* ---- Grades (collapsible) ---- */+ .grades-toggle {+ display: flex;+ align-items: center;+ cursor: pointer;+ user-select: none;+ }+ .grades-toggle:hover {+ color: var(--accent);+ }+ .grades-toggle .arrow {+ margin-right: 0.5rem;+ transition: transform 0.15s;+ font-size: 0.75rem;+ }+ .grades-toggle .arrow.open {+ transform: rotate(90deg);+ }+ .grades-content {+ display: none;+ margin-top: 0.75rem;+ }+ .grades-content.open {+ display: block;+ }+ .grades-summary {+ font-size: 0.875rem;+ margin-bottom: 0.75rem;+ display: flex;+ align-items: center;+ gap: 0.5rem;+ }+ .grade-badge {+ display: inline-block;+ padding: 0.125rem 0.5rem;+ border-radius: 9999px;+ font-size: 0.75rem;+ font-weight: 600;+ }+ .grade-pass { background: var(--green-bg); color: var(--green); }+ .grade-fail { background: var(--red-bg); color: var(--red); }+ .assertion-list {+ list-style: none;+ }+ .assertion-item {+ padding: 0.625rem 0;+ border-bottom: 1px solid var(--border);+ font-size: 0.8125rem;+ }+ .assertion-item:last-child { border-bottom: none; }+ .assertion-status {+ font-weight: 600;+ margin-right: 0.5rem;+ }+ .assertion-status.pass { color: var(--green); }+ .assertion-status.fail { color: var(--red); }+ .assertion-evidence {+ color: var(--text-muted);+ font-size: 0.75rem;+ margin-top: 0.25rem;+ padding-left: 1.5rem;+ }++ /* ---- View tabs ---- */+ .view-tabs {+ display: flex;+ gap: 0;+ padding: 0 2rem;+ background: var(--bg);+ border-bottom: 1px solid var(--border);+ flex-shrink: 0;+ }+ .view-tab {+ font-family: 'Poppins', sans-serif;+ padding: 0.625rem 1.25rem;+ font-size: 0.8125rem;+ font-weight: 500;+ cursor: pointer;+ border: none;+ background: none;+ color: var(--text-muted);+ border-bottom: 2px solid transparent;+ transition: all 0.15s;+ }+ .view-tab:hover { color: var(--text); }+ .view-tab.active {+ color: var(--accent);+ border-bottom-color: var(--accent);+ }+ .view-panel { display: none; }+ .view-panel.active { display: flex; flex-direction: column; flex: 1; overflow: hidden; }++ /* ---- Benchmark view ---- */+ .benchmark-view {+ padding: 1.5rem 2rem;+ overflow-y: auto;+ flex: 1;+ }+ .benchmark-table {+ border-collapse: collapse;+ background: var(--surface);+ border: 1px solid var(--border);+ border-radius: var(--radius);+ font-size: 0.8125rem;+ width: 100%;+ margin-bottom: 1.5rem;+ }+ .benchmark-table th, .benchmark-table td {+ padding: 0.625rem 0.75rem;+ text-align: left;+ border: 1px solid var(--border);+ }+ .benchmark-table th {+ font-family: 'Poppins', sans-serif;+ background: var(--header-bg);+ color: var(--header-text);+ font-weight: 500;+ font-size: 0.75rem;+ text-transform: uppercase;+ letter-spacing: 0.04em;+ }+ .benchmark-table tr:hover { background: var(--bg); }+ .benchmark-table tr.benchmark-row-with { background: rgba(33, 150, 243, 0.06); }+ .benchmark-table tr.benchmark-row-without { background: rgba(255, 193, 7, 0.06); }+ .benchmark-table tr.benchmark-row-with:hover { background: rgba(33, 150, 243, 0.12); }+ .benchmark-table tr.benchmark-row-without:hover { background: rgba(255, 193, 7, 0.12); }+ .benchmark-table tr.benchmark-row-avg { font-weight: 600; border-top: 2px solid var(--border); }+ .benchmark-table tr.benchmark-row-avg.benchmark-row-with { background: rgba(33, 150, 243, 0.12); }+ .benchmark-table tr.benchmark-row-avg.benchmark-row-without { background: rgba(255, 193, 7, 0.12); }+ .benchmark-delta-positive { color: var(--green); font-weight: 600; }+ .benchmark-delta-negative { color: var(--red); font-weight: 600; }+ .benchmark-notes {+ background: var(--surface);+ border: 1px solid var(--border);+ border-radius: var(--radius);+ padding: 1rem;+ }+ .benchmark-notes h3 {+ font-family: 'Poppins', sans-serif;+ font-size: 0.875rem;+ margin-bottom: 0.75rem;+ }+ .benchmark-notes ul {+ list-style: disc;+ padding-left: 1.25rem;+ }+ .benchmark-notes li {+ font-size: 0.8125rem;+ line-height: 1.6;+ margin-bottom: 0.375rem;+ }+ .benchmark-empty {+ color: var(--text-muted);+ font-style: italic;+ text-align: center;+ padding: 3rem;+ }++ /* ---- Navigation ---- */+ .nav {+ display: flex;+ justify-content: space-between;+ align-items: center;+ padding: 1rem 2rem;+ border-top: 1px solid var(--border);+ background: var(--surface);+ flex-shrink: 0;+ }+ .nav-btn {+ font-family: 'Poppins', sans-serif;+ padding: 0.5rem 1.25rem;+ border: 1px solid var(--border);+ border-radius: var(--radius);+ background: var(--surface);+ cursor: pointer;+ font-size: 0.875rem;+ font-weight: 500;+ color: var(--text);+ transition: all 0.15s;+ }+ .nav-btn:hover:not(:disabled) {+ background: var(--bg);+ border-color: var(--text-muted);+ }+ .nav-btn:disabled {+ opacity: 0.4;+ cursor: not-allowed;+ }+ .done-btn {+ font-family: 'Poppins', sans-serif;+ padding: 0.5rem 1.5rem;+ border: 1px solid var(--border);+ border-radius: var(--radius);+ background: var(--surface);+ color: var(--text);+ cursor: pointer;+ font-size: 0.875rem;+ font-weight: 500;+ transition: all 0.15s;+ }+ .done-btn:hover {+ background: var(--bg);+ border-color: var(--text-muted);+ }+ .done-btn.ready {+ border: none;+ background: var(--accent);+ color: white;+ font-weight: 600;+ }+ .done-btn.ready:hover {+ background: var(--accent-hover);+ }+ /* ---- Done overlay ---- */+ .done-overlay {+ display: none;+ position: fixed;+ inset: 0;+ background: rgba(0, 0, 0, 0.5);+ z-index: 100;+ justify-content: center;+ align-items: center;+ }+ .done-overlay.visible {+ display: flex;+ }+ .done-card {+ background: var(--surface);+ border-radius: 12px;+ padding: 2rem 3rem;+ text-align: center;+ box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);+ max-width: 500px;+ }+ .done-card h2 {+ font-size: 1.5rem;+ margin-bottom: 0.5rem;+ }+ .done-card p {+ color: var(--text-muted);+ margin-bottom: 1.5rem;+ line-height: 1.5;+ }+ .done-card .btn-row {+ display: flex;+ gap: 0.5rem;+ justify-content: center;+ }+ .done-card button {+ padding: 0.5rem 1.25rem;+ border: 1px solid var(--border);+ border-radius: var(--radius);+ background: var(--surface);+ cursor: pointer;+ font-size: 0.875rem;+ }+ .done-card button:hover {+ background: var(--bg);+ }+ /* ---- Toast ---- */+ .toast {+ position: fixed;+ bottom: 5rem;+ left: 50%;+ transform: translateX(-50%);+ background: var(--header-bg);+ color: var(--header-text);+ padding: 0.625rem 1.25rem;+ border-radius: var(--radius);+ font-size: 0.875rem;+ opacity: 0;+ transition: opacity 0.3s;+ pointer-events: none;+ z-index: 200;+ }+ .toast.visible {+ opacity: 1;+ }+ </style>+</head>+<body>+ <div id="app" style="height:100vh; display:flex; flex-direction:column;">+ <div class="header">+ <div>+ <h1>Eval Review: <span id="skill-name"></span></h1>+ <div class="instructions">Review each output and leave feedback below. Navigate with arrow keys or buttons. When done, copy feedback and paste into Claude Code.</div>+ </div>+ <div class="progress" id="progress"></div>+ </div>++ <!-- View tabs (only shown when benchmark data exists) -->+ <div class="view-tabs" id="view-tabs" style="display:none;">+ <button class="view-tab active" onclick="switchView('outputs')">Outputs</button>+ <button class="view-tab" onclick="switchView('benchmark')">Benchmark</button>+ </div>++ <!-- Outputs panel (qualitative review) -->+ <div class="view-panel active" id="panel-outputs">+ <div class="main">+ <!-- Prompt -->+ <div class="section">+ <div class="section-header">Prompt <span class="config-badge" id="config-badge" style="display:none;"></span></div>+ <div class="section-body">+ <div class="prompt-text" id="prompt-text"></div>+ </div>+ </div>++ <!-- Outputs -->+ <div class="section">+ <div class="section-header">Output</div>+ <div class="section-body" id="outputs-body">+ <div class="empty-state">No output files found</div>+ </div>+ </div>++ <!-- Previous Output (collapsible) -->+ <div class="section" id="prev-outputs-section" style="display:none;">+ <div class="section-header">+ <div class="grades-toggle" onclick="togglePrevOutputs()">+ <span class="arrow" id="prev-outputs-arrow">▶</span>+ Previous Output+ </div>+ </div>+ <div class="grades-content" id="prev-outputs-content"></div>+ </div>++ <!-- Grades (collapsible) -->+ <div class="section" id="grades-section" style="display:none;">+ <div class="section-header">+ <div class="grades-toggle" onclick="toggleGrades()">+ <span class="arrow" id="grades-arrow">▶</span>+ Formal Grades+ </div>+ </div>+ <div class="grades-content" id="grades-content"></div>+ </div>++ <!-- Feedback -->+ <div class="section">+ <div class="section-header">Your Feedback</div>+ <div class="section-body">+ <textarea+ class="feedback-textarea"+ id="feedback"+ placeholder="What do you think of this output? Any issues, suggestions, or things that look great?"+ ></textarea>+ <div class="feedback-status" id="feedback-status"></div>+ <div class="prev-feedback" id="prev-feedback" style="display:none;">+ <div class="prev-feedback-label">Previous feedback</div>+ <div id="prev-feedback-text"></div>+ </div>+ </div>+ </div>+ </div>++ <div class="nav" id="outputs-nav">+ <button class="nav-btn" id="prev-btn" onclick="navigate(-1)">← Previous</button>+ <button class="done-btn" id="done-btn" onclick="showDoneDialog()">Submit All Reviews</button>+ <button class="nav-btn" id="next-btn" onclick="navigate(1)">Next →</button>+ </div>+ </div><!-- end panel-outputs -->++ <!-- Benchmark panel (quantitative stats) -->+ <div class="view-panel" id="panel-benchmark">+ <div class="benchmark-view" id="benchmark-content">+ <div class="benchmark-empty">No benchmark data available. Run a benchmark to see quantitative results here.</div>+ </div>+ </div>+ </div>++ <!-- Done overlay -->+ <div class="done-overlay" id="done-overlay">+ <div class="done-card">+ <h2>Review Complete</h2>+ <p>Your feedback has been saved. Go back to your Claude Code session and tell Claude you're done reviewing.</p>+ <div class="btn-row">+ <button onclick="closeDoneDialog()">OK</button>+ </div>+ </div>+ </div>++ <!-- Toast -->+ <div class="toast" id="toast"></div>++ <script>+ // ---- Embedded data (injected by generate_review.py) ----+ /*__EMBEDDED_DATA__*/++ // ---- State ----+ let feedbackMap = {}; // run_id -> feedback text+ let currentIndex = 0;+ let visitedRuns = new Set();++ // ---- Init ----+ async function init() {+ // Load saved feedback from server — but only if this isn't a fresh+ // iteration (indicated by previous_feedback being present). When+ // previous feedback exists, the feedback.json on disk is stale from+ // the prior iteration and should not pre-fill the textareas.+ const hasPrevious = Object.keys(EMBEDDED_DATA.previous_feedback || {}).length > 0+ || Object.keys(EMBEDDED_DATA.previous_outputs || {}).length > 0;+ if (!hasPrevious) {+ try {+ const resp = await fetch("/api/feedback");+ const data = await resp.json();+ if (data.reviews) {+ for (const r of data.reviews) feedbackMap[r.run_id] = r.feedback;+ }+ } catch { /* first run, no feedback yet */ }+ }++ document.getElementById("skill-name").textContent = EMBEDDED_DATA.skill_name;+ showRun(0);++ // Wire up feedback auto-save+ const textarea = document.getElementById("feedback");+ let saveTimeout = null;+ textarea.addEventListener("input", () => {+ clearTimeout(saveTimeout);+ document.getElementById("feedback-status").textContent = "";+ saveTimeout = setTimeout(() => saveCurrentFeedback(), 800);+ });+ }++ // ---- Navigation ----+ function navigate(delta) {+ const newIndex = currentIndex + delta;+ if (newIndex >= 0 && newIndex < EMBEDDED_DATA.runs.length) {+ saveCurrentFeedback();+ showRun(newIndex);+ }+ }++ function updateNavButtons() {+ document.getElementById("prev-btn").disabled = currentIndex === 0;+ document.getElementById("next-btn").disabled =+ currentIndex === EMBEDDED_DATA.runs.length - 1;+ }++ // ---- Show a run ----+ function showRun(index) {+ currentIndex = index;+ const run = EMBEDDED_DATA.runs[index];++ // Progress+ document.getElementById("progress").textContent =+ `${index + 1} of ${EMBEDDED_DATA.runs.length}`;++ // Prompt+ document.getElementById("prompt-text").textContent = run.prompt;++ // Config badge+ const badge = document.getElementById("config-badge");+ const configMatch = run.id.match(/(with_skill|without_skill|new_skill|old_skill)/);+ if (configMatch) {+ const config = configMatch[1];+ const isBaseline = config === "without_skill" || config === "old_skill";+ badge.textContent = config.replace(/_/g, " ");+ badge.className = "config-badge " + (isBaseline ? "config-baseline" : "config-primary");+ badge.style.display = "inline-block";+ } else {+ badge.style.display = "none";+ }++ // Outputs+ renderOutputs(run);++ // Previous outputs+ renderPrevOutputs(run);++ // Grades+ renderGrades(run);++ // Previous feedback+ const prevFb = (EMBEDDED_DATA.previous_feedback || {})[run.id];+ const prevEl = document.getElementById("prev-feedback");+ if (prevFb) {+ document.getElementById("prev-feedback-text").textContent = prevFb;+ prevEl.style.display = "block";+ } else {+ prevEl.style.display = "none";+ }++ // Feedback+ document.getElementById("feedback").value = feedbackMap[run.id] || "";+ document.getElementById("feedback-status").textContent = "";++ updateNavButtons();++ // Track visited runs and promote done button when all visited+ visitedRuns.add(index);+ const doneBtn = document.getElementById("done-btn");+ if (visitedRuns.size >= EMBEDDED_DATA.runs.length) {+ doneBtn.classList.add("ready");+ }++ // Scroll main content to top+ document.querySelector(".main").scrollTop = 0;+ }++ // ---- Render outputs ----+ function renderOutputs(run) {+ const container = document.getElementById("outputs-body");+ container.innerHTML = "";++ const outputs = run.outputs || [];+ if (outputs.length === 0) {+ container.innerHTML = '<div class="empty-state">No output files</div>';+ return;+ }++ for (const file of outputs) {+ const fileDiv = document.createElement("div");+ fileDiv.className = "output-file";++ // Always show file header with download link+ const header = document.createElement("div");+ header.className = "output-file-header";+ const nameSpan = document.createElement("span");+ nameSpan.textContent = file.name;+ header.appendChild(nameSpan);+ const dlBtn = document.createElement("a");+ dlBtn.className = "dl-btn";+ dlBtn.textContent = "Download";+ dlBtn.download = file.name;+ dlBtn.href = getDownloadUri(file);+ header.appendChild(dlBtn);+ fileDiv.appendChild(header);++ const content = document.createElement("div");+ content.className = "output-file-content";++ if (file.type === "text") {+ const pre = document.createElement("pre");+ pre.textContent = file.content;+ content.appendChild(pre);+ } else if (file.type === "image") {+ const img = document.createElement("img");+ img.src = file.data_uri;+ img.alt = file.name;+ content.appendChild(img);+ } else if (file.type === "pdf") {+ const iframe = document.createElement("iframe");+ iframe.src = file.data_uri;+ content.appendChild(iframe);+ } else if (file.type === "xlsx") {+ renderXlsx(content, file.data_b64);+ } else if (file.type === "binary") {+ const a = document.createElement("a");+ a.className = "download-link";+ a.href = file.data_uri;+ a.download = file.name;+ a.textContent = "Download " + file.name;+ content.appendChild(a);+ } else if (file.type === "error") {+ const pre = document.createElement("pre");+ pre.textContent = file.content;+ pre.style.color = "var(--red)";+ content.appendChild(pre);+ }++ fileDiv.appendChild(content);+ container.appendChild(fileDiv);+ }+ }++ // ---- XLSX rendering via SheetJS ----+ function renderXlsx(container, b64Data) {+ try {+ const raw = Uint8Array.from(atob(b64Data), c => c.charCodeAt(0));+ const wb = XLSX.read(raw, { type: "array" });++ for (let i = 0; i < wb.SheetNames.length; i++) {+ const sheetName = wb.SheetNames[i];+ const ws = wb.Sheets[sheetName];++ if (wb.SheetNames.length > 1) {+ const sheetLabel = document.createElement("div");+ sheetLabel.style.cssText =+ "font-weight:600; font-size:0.8rem; color:#b0aea5; margin-top:0.5rem; margin-bottom:0.25rem;";+ sheetLabel.textContent = "Sheet: " + sheetName;+ container.appendChild(sheetLabel);+ }++ const htmlStr = XLSX.utils.sheet_to_html(ws, { editable: false });+ const wrapper = document.createElement("div");+ wrapper.innerHTML = htmlStr;+ container.appendChild(wrapper);+ }+ } catch (err) {+ container.textContent = "Error rendering spreadsheet: " + err.message;+ }+ }++ // ---- Grades ----+ function renderGrades(run) {+ const section = document.getElementById("grades-section");+ const content = document.getElementById("grades-content");++ if (!run.grading) {+ section.style.display = "none";+ return;+ }++ const grading = run.grading;+ section.style.display = "block";+ // Reset to collapsed+ content.classList.remove("open");+ document.getElementById("grades-arrow").classList.remove("open");++ const summary = grading.summary || {};+ const expectations = grading.expectations || [];++ let html = '<div style="padding: 1rem;">';++ // Summary line+ const passRate = summary.pass_rate != null+ ? Math.round(summary.pass_rate * 100) + "%"+ : "?";+ const badgeClass = summary.pass_rate >= 0.8 ? "grade-pass" : summary.pass_rate >= 0.5 ? "" : "grade-fail";+ html += '<div class="grades-summary">';+ html += '<span class="grade-badge ' + badgeClass + '">' + passRate + '</span>';+ html += '<span>' + (summary.passed || 0) + ' passed, ' + (summary.failed || 0) + ' failed of ' + (summary.total || 0) + '</span>';+ html += '</div>';++ // Assertions list+ html += '<ul class="assertion-list">';+ for (const exp of expectations) {+ const statusClass = exp.passed ? "pass" : "fail";+ const statusIcon = exp.passed ? "\u2713" : "\u2717";+ html += '<li class="assertion-item">';+ html += '<span class="assertion-status ' + statusClass + '">' + statusIcon + '</span>';+ html += '<span>' + escapeHtml(exp.text) + '</span>';+ if (exp.evidence) {+ html += '<div class="assertion-evidence">' + escapeHtml(exp.evidence) + '</div>';+ }+ html += '</li>';+ }+ html += '</ul>';++ html += '</div>';+ content.innerHTML = html;+ }++ function toggleGrades() {+ const content = document.getElementById("grades-content");+ const arrow = document.getElementById("grades-arrow");+ content.classList.toggle("open");+ arrow.classList.toggle("open");+ }++ // ---- Previous outputs (collapsible) ----+ function renderPrevOutputs(run) {+ const section = document.getElementById("prev-outputs-section");+ const content = document.getElementById("prev-outputs-content");+ const prevOutputs = (EMBEDDED_DATA.previous_outputs || {})[run.id];++ if (!prevOutputs || prevOutputs.length === 0) {+ section.style.display = "none";+ return;+ }++ section.style.display = "block";+ // Reset to collapsed+ content.classList.remove("open");+ document.getElementById("prev-outputs-arrow").classList.remove("open");++ // Render the files into the content area+ content.innerHTML = "";+ const wrapper = document.createElement("div");+ wrapper.style.padding = "1rem";++ for (const file of prevOutputs) {+ const fileDiv = document.createElement("div");+ fileDiv.className = "output-file";++ const header = document.createElement("div");+ header.className = "output-file-header";+ const nameSpan = document.createElement("span");+ nameSpan.textContent = file.name;+ header.appendChild(nameSpan);+ const dlBtn = document.createElement("a");+ dlBtn.className = "dl-btn";+ dlBtn.textContent = "Download";+ dlBtn.download = file.name;+ dlBtn.href = getDownloadUri(file);+ header.appendChild(dlBtn);+ fileDiv.appendChild(header);++ const fc = document.createElement("div");+ fc.className = "output-file-content";++ if (file.type === "text") {+ const pre = document.createElement("pre");+ pre.textContent = file.content;+ fc.appendChild(pre);+ } else if (file.type === "image") {+ const img = document.createElement("img");+ img.src = file.data_uri;+ img.alt = file.name;+ fc.appendChild(img);+ } else if (file.type === "pdf") {+ const iframe = document.createElement("iframe");+ iframe.src = file.data_uri;+ fc.appendChild(iframe);+ } else if (file.type === "xlsx") {+ renderXlsx(fc, file.data_b64);+ } else if (file.type === "binary") {+ const a = document.createElement("a");+ a.className = "download-link";+ a.href = file.data_uri;+ a.download = file.name;+ a.textContent = "Download " + file.name;+ fc.appendChild(a);+ }++ fileDiv.appendChild(fc);+ wrapper.appendChild(fileDiv);+ }++ content.appendChild(wrapper);+ }++ function togglePrevOutputs() {+ const content = document.getElementById("prev-outputs-content");+ const arrow = document.getElementById("prev-outputs-arrow");+ content.classList.toggle("open");+ arrow.classList.toggle("open");+ }++ // ---- Feedback (saved to server -> feedback.json) ----+ function saveCurrentFeedback() {+ const run = EMBEDDED_DATA.runs[currentIndex];+ const text = document.getElementById("feedback").value;++ if (text.trim() === "") {+ delete feedbackMap[run.id];+ } else {+ feedbackMap[run.id] = text;+ }++ // Build reviews array from map+ const reviews = [];+ for (const [run_id, feedback] of Object.entries(feedbackMap)) {+ if (feedback.trim()) {+ reviews.push({ run_id, feedback, timestamp: new Date().toISOString() });+ }+ }++ fetch("/api/feedback", {+ method: "POST",+ headers: { "Content-Type": "application/json" },+ body: JSON.stringify({ reviews, status: "in_progress" }),+ }).then(() => {+ document.getElementById("feedback-status").textContent = "Saved";+ }).catch(() => {+ // Static mode or server unavailable — no-op on auto-save,+ // feedback will be downloaded on final submit+ document.getElementById("feedback-status").textContent = "Will download on submit";+ });+ }++ // ---- Done ----+ function showDoneDialog() {+ // Save current textarea to feedbackMap (but don't POST yet)+ const run = EMBEDDED_DATA.runs[currentIndex];+ const text = document.getElementById("feedback").value;+ if (text.trim() === "") {+ delete feedbackMap[run.id];+ } else {+ feedbackMap[run.id] = text;+ }++ // POST once with status: complete — include ALL runs so the model+ // can distinguish "no feedback" (looks good) from "not reviewed"+ const reviews = [];+ const ts = new Date().toISOString();+ for (const r of EMBEDDED_DATA.runs) {+ reviews.push({ run_id: r.id, feedback: feedbackMap[r.id] || "", timestamp: ts });+ }+ const payload = JSON.stringify({ reviews, status: "complete" }, null, 2);+ fetch("/api/feedback", {+ method: "POST",+ headers: { "Content-Type": "application/json" },+ body: payload,+ }).then(() => {+ document.getElementById("done-overlay").classList.add("visible");+ }).catch(() => {+ // Server not available (static mode) — download as file+ const blob = new Blob([payload], { type: "application/json" });+ const url = URL.createObjectURL(blob);+ const a = document.createElement("a");+ a.href = url;+ a.download = "feedback.json";+ a.click();+ URL.revokeObjectURL(url);+ document.getElementById("done-overlay").classList.add("visible");+ });+ }++ function closeDoneDialog() {+ // Reset status back to in_progress+ saveCurrentFeedback();+ document.getElementById("done-overlay").classList.remove("visible");+ }++ // ---- Toast ----+ function showToast(message) {+ const toast = document.getElementById("toast");+ toast.textContent = message;+ toast.classList.add("visible");+ setTimeout(() => toast.classList.remove("visible"), 2000);+ }++ // ---- Keyboard nav ----+ document.addEventListener("keydown", (e) => {+ // Don't capture when typing in textarea+ if (e.target.tagName === "TEXTAREA") return;++ if (e.key === "ArrowLeft" || e.key === "ArrowUp") {+ e.preventDefault();+ navigate(-1);+ } else if (e.key === "ArrowRight" || e.key === "ArrowDown") {+ e.preventDefault();+ navigate(1);+ }+ });++ // ---- Util ----+ function getDownloadUri(file) {+ if (file.data_uri) return file.data_uri;+ if (file.data_b64) return "data:application/octet-stream;base64," + file.data_b64;+ if (file.type === "text") return "data:text/plain;charset=utf-8," + encodeURIComponent(file.content);+ return "#";+ }++ function escapeHtml(text) {+ const div = document.createElement("div");+ div.textContent = text;+ return div.innerHTML;+ }++ // ---- View switching ----+ function switchView(view) {+ document.querySelectorAll(".view-tab").forEach(t => t.classList.remove("active"));+ document.querySelectorAll(".view-panel").forEach(p => p.classList.remove("active"));+ document.querySelector(`[onclick="switchView('${view}')"]`).classList.add("active");+ document.getElementById("panel-" + view).classList.add("active");+ }++ // ---- Benchmark rendering ----+ function renderBenchmark() {+ const data = EMBEDDED_DATA.benchmark;+ if (!data) return;++ // Show the tabs+ document.getElementById("view-tabs").style.display = "flex";++ const container = document.getElementById("benchmark-content");+ const summary = data.run_summary || {};+ const metadata = data.metadata || {};+ const notes = data.notes || [];++ let html = "";++ // Header+ html += "<h2 style='font-family: Poppins, sans-serif; margin-bottom: 0.5rem;'>Benchmark Results</h2>";+ html += "<p style='color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.25rem;'>";+ if (metadata.skill_name) html += "<strong>" + escapeHtml(metadata.skill_name) + "</strong> — ";+ if (metadata.timestamp) html += metadata.timestamp + " — ";+ if (metadata.evals_run) html += "Evals: " + metadata.evals_run.join(", ") + " — ";+ html += (metadata.runs_per_configuration || "?") + " runs per configuration";+ html += "</p>";++ // Summary table+ html += '<table class="benchmark-table">';++ function fmtStat(stat, pct) {+ if (!stat) return "—";+ const suffix = pct ? "%" : "";+ const m = pct ? (stat.mean * 100).toFixed(0) : stat.mean.toFixed(1);+ const s = pct ? (stat.stddev * 100).toFixed(0) : stat.stddev.toFixed(1);+ return m + suffix + " ± " + s + suffix;+ }++ function deltaClass(val) {+ if (!val) return "";+ const n = parseFloat(val);+ if (n > 0) return "benchmark-delta-positive";+ if (n < 0) return "benchmark-delta-negative";+ return "";+ }++ // Discover config names dynamically (everything except "delta")+ const configs = Object.keys(summary).filter(k => k !== "delta");+ const configA = configs[0] || "config_a";+ const configB = configs[1] || "config_b";+ const labelA = configA.replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());+ const labelB = configB.replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());+ const a = summary[configA] || {};+ const b = summary[configB] || {};+ const delta = summary.delta || {};++ html += "<thead><tr><th>Metric</th><th>" + escapeHtml(labelA) + "</th><th>" + escapeHtml(labelB) + "</th><th>Delta</th></tr></thead>";+ html += "<tbody>";++ html += "<tr><td><strong>Pass Rate</strong></td>";+ html += "<td>" + fmtStat(a.pass_rate, true) + "</td>";+ html += "<td>" + fmtStat(b.pass_rate, true) + "</td>";+ html += '<td class="' + deltaClass(delta.pass_rate) + '">' + (delta.pass_rate || "—") + "</td></tr>";++ // Time (only show row if data exists)+ if (a.time_seconds || b.time_seconds) {+ html += "<tr><td><strong>Time (s)</strong></td>";+ html += "<td>" + fmtStat(a.time_seconds, false) + "</td>";+ html += "<td>" + fmtStat(b.time_seconds, false) + "</td>";+ html += '<td class="' + deltaClass(delta.time_seconds) + '">' + (delta.time_seconds ? delta.time_seconds + "s" : "—") + "</td></tr>";+ }++ // Tokens (only show row if data exists)+ if (a.tokens || b.tokens) {+ html += "<tr><td><strong>Tokens</strong></td>";+ html += "<td>" + fmtStat(a.tokens, false) + "</td>";+ html += "<td>" + fmtStat(b.tokens, false) + "</td>";+ html += '<td class="' + deltaClass(delta.tokens) + '">' + (delta.tokens || "—") + "</td></tr>";+ }++ html += "</tbody></table>";++ // Per-eval breakdown (if runs data available)+ const runs = data.runs || [];+ if (runs.length > 0) {+ const evalIds = [...new Set(runs.map(r => r.eval_id))].sort((a, b) => a - b);++ html += "<h3 style='font-family: Poppins, sans-serif; margin-bottom: 0.75rem;'>Per-Eval Breakdown</h3>";++ const hasTime = runs.some(r => r.result && r.result.time_seconds != null);+ const hasErrors = runs.some(r => r.result && r.result.errors > 0);++ for (const evalId of evalIds) {+ const evalRuns = runs.filter(r => r.eval_id === evalId);+ const evalName = evalRuns[0] && evalRuns[0].eval_name ? evalRuns[0].eval_name : "Eval " + evalId;++ html += "<h4 style='font-family: Poppins, sans-serif; margin: 1rem 0 0.5rem; color: var(--text);'>" + escapeHtml(evalName) + "</h4>";+ html += '<table class="benchmark-table">';+ html += "<thead><tr><th>Config</th><th>Run</th><th>Pass Rate</th>";+ if (hasTime) html += "<th>Time (s)</th>";+ if (hasErrors) html += "<th>Crashes During Execution</th>";+ html += "</tr></thead>";+ html += "<tbody>";++ // Group by config and render with average rows+ const configGroups = [...new Set(evalRuns.map(r => r.configuration))];+ for (let ci = 0; ci < configGroups.length; ci++) {+ const config = configGroups[ci];+ const configRuns = evalRuns.filter(r => r.configuration === config);+ if (configRuns.length === 0) continue;++ const rowClass = ci === 0 ? "benchmark-row-with" : "benchmark-row-without";+ const configLabel = config.replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());++ for (const run of configRuns) {+ const r = run.result || {};+ const prClass = r.pass_rate >= 0.8 ? "benchmark-delta-positive" : r.pass_rate < 0.5 ? "benchmark-delta-negative" : "";+ html += '<tr class="' + rowClass + '">';+ html += "<td>" + configLabel + "</td>";+ html += "<td>" + run.run_number + "</td>";+ html += '<td class="' + prClass + '">' + ((r.pass_rate || 0) * 100).toFixed(0) + "% (" + (r.passed || 0) + "/" + (r.total || 0) + ")</td>";+ if (hasTime) html += "<td>" + (r.time_seconds != null ? r.time_seconds.toFixed(1) : "—") + "</td>";+ if (hasErrors) html += "<td>" + (r.errors || 0) + "</td>";+ html += "</tr>";+ }++ // Average row+ const rates = configRuns.map(r => (r.result || {}).pass_rate || 0);+ const avgRate = rates.reduce((a, b) => a + b, 0) / rates.length;+ const avgPrClass = avgRate >= 0.8 ? "benchmark-delta-positive" : avgRate < 0.5 ? "benchmark-delta-negative" : "";+ html += '<tr class="benchmark-row-avg ' + rowClass + '">';+ html += "<td>" + configLabel + "</td>";+ html += "<td>Avg</td>";+ html += '<td class="' + avgPrClass + '">' + (avgRate * 100).toFixed(0) + "%</td>";+ if (hasTime) {+ const times = configRuns.map(r => (r.result || {}).time_seconds).filter(t => t != null);+ html += "<td>" + (times.length ? (times.reduce((a, b) => a + b, 0) / times.length).toFixed(1) : "—") + "</td>";+ }+ if (hasErrors) html += "<td></td>";+ html += "</tr>";+ }+ html += "</tbody></table>";++ // Per-assertion detail for this eval+ const runsWithExpectations = {};+ for (const config of configGroups) {+ runsWithExpectations[config] = evalRuns.filter(r => r.configuration === config && r.expectations && r.expectations.length > 0);+ }+ const hasAnyExpectations = Object.values(runsWithExpectations).some(runs => runs.length > 0);+ if (hasAnyExpectations) {+ // Collect all unique assertion texts across all configs+ const allAssertions = [];+ const seen = new Set();+ for (const config of configGroups) {+ for (const run of runsWithExpectations[config]) {+ for (const exp of (run.expectations || [])) {+ if (!seen.has(exp.text)) {+ seen.add(exp.text);+ allAssertions.push(exp.text);+ }+ }+ }+ }++ html += '<table class="benchmark-table" style="margin-top: 0.5rem;">';+ html += "<thead><tr><th>Assertion</th>";+ for (const config of configGroups) {+ const label = config.replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());+ html += "<th>" + escapeHtml(label) + "</th>";+ }+ html += "</tr></thead><tbody>";++ for (const assertionText of allAssertions) {+ html += "<tr><td>" + escapeHtml(assertionText) + "</td>";++ for (const config of configGroups) {+ html += "<td>";+ for (const run of runsWithExpectations[config]) {+ const exp = (run.expectations || []).find(e => e.text === assertionText);+ if (exp) {+ const cls = exp.passed ? "benchmark-delta-positive" : "benchmark-delta-negative";+ const icon = exp.passed ? "\u2713" : "\u2717";+ html += '<span class="' + cls + '" title="Run ' + run.run_number + ': ' + escapeHtml(exp.evidence || "") + '">' + icon + "</span> ";+ } else {+ html += "— ";+ }+ }+ html += "</td>";+ }+ html += "</tr>";+ }+ html += "</tbody></table>";+ }+ }+ }++ // Notes+ if (notes.length > 0) {+ html += '<div class="benchmark-notes">';+ html += "<h3>Analysis Notes</h3>";+ html += "<ul>";+ for (const note of notes) {+ html += "<li>" + escapeHtml(note) + "</li>";+ }+ html += "</ul></div>";+ }++ container.innerHTML = html;+ }++ // ---- Start ----+ init();+ renderBenchmark();+ </script>+</body>+</html>diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/references/schemas.md b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/references/schemas.mdsimilarity index 96%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/references/schemas.mdrename to jiuwenclaw/resources/agent/workspace/skills/skill-creator/references/schemas.mdindex cea2fc3bd3..b6eeaa2d4a 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/references/schemas.md+++ b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/references/schemas.md@@ -1,430 +1,430 @@-# JSON Schemas--This document defines the JSON schemas used by skill-creator.-------## evals.json--Defines the evals for a skill. Located at `evals/evals.json` within the skill directory.--```json-{- "skill_name": "example-skill",- "evals": [- {- "id": 1,- "prompt": "User's example prompt",- "expected_output": "Description of expected result",- "files": ["evals/files/sample1.pdf"],- "expectations": [- "The output includes X",- "The skill used script Y"- ]- }- ]-}-```--**Fields:**-- `skill_name`: Name matching the skill's frontmatter-- `evals[].id`: Unique integer identifier-- `evals[].prompt`: The task to execute-- `evals[].expected_output`: Human-readable description of success-- `evals[].files`: Optional list of input file paths (relative to skill root)-- `evals[].expectations`: List of verifiable statements-------## history.json--Tracks version progression in Improve mode. Located at workspace root.--```json-{- "started_at": "2026-01-15T10:30:00Z",- "skill_name": "pdf",- "current_best": "v2",- "iterations": [- {- "version": "v0",- "parent": null,- "expectation_pass_rate": 0.65,- "grading_result": "baseline",- "is_current_best": false- },- {- "version": "v1",- "parent": "v0",- "expectation_pass_rate": 0.75,- "grading_result": "won",- "is_current_best": false- },- {- "version": "v2",- "parent": "v1",- "expectation_pass_rate": 0.85,- "grading_result": "won",- "is_current_best": true- }- ]-}-```--**Fields:**-- `started_at`: ISO timestamp of when improvement started-- `skill_name`: Name of the skill being improved-- `current_best`: Version identifier of the best performer-- `iterations[].version`: Version identifier (v0, v1, ...)-- `iterations[].parent`: Parent version this was derived from-- `iterations[].expectation_pass_rate`: Pass rate from grading-- `iterations[].grading_result`: "baseline", "won", "lost", or "tie"-- `iterations[].is_current_best`: Whether this is the current best version-------## grading.json--Output from the grader agent. Located at `<run-dir>/grading.json`.--```json-{- "expectations": [- {- "text": "The output includes the name 'John Smith'",- "passed": true,- "evidence": "Found in transcript Step 3: 'Extracted names: John Smith, Sarah Johnson'"- },- {- "text": "The spreadsheet has a SUM formula in cell B10",- "passed": false,- "evidence": "No spreadsheet was created. The output was a text file."- }- ],- "summary": {- "passed": 2,- "failed": 1,- "total": 3,- "pass_rate": 0.67- },- "execution_metrics": {- "tool_calls": {- "Read": 5,- "Write": 2,- "Bash": 8- },- "total_tool_calls": 15,- "total_steps": 6,- "errors_encountered": 0,- "output_chars": 12450,- "transcript_chars": 3200- },- "timing": {- "executor_duration_seconds": 165.0,- "grader_duration_seconds": 26.0,- "total_duration_seconds": 191.0- },- "claims": [- {- "claim": "The form has 12 fillable fields",- "type": "factual",- "verified": true,- "evidence": "Counted 12 fields in field_info.json"- }- ],- "user_notes_summary": {- "uncertainties": ["Used 2023 data, may be stale"],- "needs_review": [],- "workarounds": ["Fell back to text overlay for non-fillable fields"]- },- "eval_feedback": {- "suggestions": [- {- "assertion": "The output includes the name 'John Smith'",- "reason": "A hallucinated document that mentions the name would also pass"- }- ],- "overall": "Assertions check presence but not correctness."- }-}-```--**Fields:**-- `expectations[]`: Graded expectations with evidence-- `summary`: Aggregate pass/fail counts-- `execution_metrics`: Tool usage and output size (from executor's metrics.json)-- `timing`: Wall clock timing (from timing.json)-- `claims`: Extracted and verified claims from the output-- `user_notes_summary`: Issues flagged by the executor-- `eval_feedback`: (optional) Improvement suggestions for the evals, only present when the grader identifies issues worth raising-------## metrics.json--Output from the executor agent. Located at `<run-dir>/outputs/metrics.json`.--```json-{- "tool_calls": {- "Read": 5,- "Write": 2,- "Bash": 8,- "Edit": 1,- "Glob": 2,- "Grep": 0- },- "total_tool_calls": 18,- "total_steps": 6,- "files_created": ["filled_form.pdf", "field_values.json"],- "errors_encountered": 0,- "output_chars": 12450,- "transcript_chars": 3200-}-```--**Fields:**-- `tool_calls`: Count per tool type-- `total_tool_calls`: Sum of all tool calls-- `total_steps`: Number of major execution steps-- `files_created`: List of output files created-- `errors_encountered`: Number of errors during execution-- `output_chars`: Total character count of output files-- `transcript_chars`: Character count of transcript-------## timing.json--Wall clock timing for a run. Located at `<run-dir>/timing.json`.--**How to capture:** When a subagent task completes, the task notification includes `total_tokens` and `duration_ms`. Save these immediately — they are not persisted anywhere else and cannot be recovered after the fact.--```json-{- "total_tokens": 84852,- "duration_ms": 23332,- "total_duration_seconds": 23.3,- "executor_start": "2026-01-15T10:30:00Z",- "executor_end": "2026-01-15T10:32:45Z",- "executor_duration_seconds": 165.0,- "grader_start": "2026-01-15T10:32:46Z",- "grader_end": "2026-01-15T10:33:12Z",- "grader_duration_seconds": 26.0-}-```-------## benchmark.json--Output from Benchmark mode. Located at `benchmarks/<timestamp>/benchmark.json`.--```json-{- "metadata": {- "skill_name": "pdf",- "skill_path": "/path/to/pdf",- "executor_model": "claude-sonnet-4-20250514",- "analyzer_model": "most-capable-model",- "timestamp": "2026-01-15T10:30:00Z",- "evals_run": [1, 2, 3],- "runs_per_configuration": 3- },-- "runs": [- {- "eval_id": 1,- "eval_name": "Ocean",- "configuration": "with_skill",- "run_number": 1,- "result": {- "pass_rate": 0.85,- "passed": 6,- "failed": 1,- "total": 7,- "time_seconds": 42.5,- "tokens": 3800,- "tool_calls": 18,- "errors": 0- },- "expectations": [- {"text": "...", "passed": true, "evidence": "..."}- ],- "notes": [- "Used 2023 data, may be stale",- "Fell back to text overlay for non-fillable fields"- ]- }- ],-- "run_summary": {- "with_skill": {- "pass_rate": {"mean": 0.85, "stddev": 0.05, "min": 0.80, "max": 0.90},- "time_seconds": {"mean": 45.0, "stddev": 12.0, "min": 32.0, "max": 58.0},- "tokens": {"mean": 3800, "stddev": 400, "min": 3200, "max": 4100}- },- "without_skill": {- "pass_rate": {"mean": 0.35, "stddev": 0.08, "min": 0.28, "max": 0.45},- "time_seconds": {"mean": 32.0, "stddev": 8.0, "min": 24.0, "max": 42.0},- "tokens": {"mean": 2100, "stddev": 300, "min": 1800, "max": 2500}- },- "delta": {- "pass_rate": "+0.50",- "time_seconds": "+13.0",- "tokens": "+1700"- }- },-- "notes": [- "Assertion 'Output is a PDF file' passes 100% in both configurations - may not differentiate skill value",- "Eval 3 shows high variance (50% ± 40%) - may be flaky or model-dependent",- "Without-skill runs consistently fail on table extraction expectations",- "Skill adds 13s average execution time but improves pass rate by 50%"- ]-}-```--**Fields:**-- `metadata`: Information about the benchmark run- - `skill_name`: Name of the skill- - `timestamp`: When the benchmark was run- - `evals_run`: List of eval names or IDs- - `runs_per_configuration`: Number of runs per config (e.g. 3)-- `runs[]`: Individual run results- - `eval_id`: Numeric eval identifier- - `eval_name`: Human-readable eval name (used as section header in the viewer)- - `configuration`: Must be `"with_skill"` or `"without_skill"` (the viewer uses this exact string for grouping and color coding)- - `run_number`: Integer run number (1, 2, 3...)- - `result`: Nested object with `pass_rate`, `passed`, `total`, `time_seconds`, `tokens`, `errors`-- `run_summary`: Statistical aggregates per configuration- - `with_skill` / `without_skill`: Each contains `pass_rate`, `time_seconds`, `tokens` objects with `mean` and `stddev` fields- - `delta`: Difference strings like `"+0.50"`, `"+13.0"`, `"+1700"`-- `notes`: Freeform observations from the analyzer--**Important:** The viewer reads these field names exactly. Using `config` instead of `configuration`, or putting `pass_rate` at the top level of a run instead of nested under `result`, will cause the viewer to show empty/zero values. Always reference this schema when generating benchmark.json manually.-------## comparison.json--Output from blind comparator. Located at `<grading-dir>/comparison-N.json`.--```json-{- "winner": "A",- "reasoning": "Output A provides a complete solution with proper formatting and all required fields. Output B is missing the date field and has formatting inconsistencies.",- "rubric": {- "A": {- "content": {- "correctness": 5,- "completeness": 5,- "accuracy": 4- },- "structure": {- "organization": 4,- "formatting": 5,- "usability": 4- },- "content_score": 4.7,- "structure_score": 4.3,- "overall_score": 9.0- },- "B": {- "content": {- "correctness": 3,- "completeness": 2,- "accuracy": 3- },- "structure": {- "organization": 3,- "formatting": 2,- "usability": 3- },- "content_score": 2.7,- "structure_score": 2.7,- "overall_score": 5.4- }- },- "output_quality": {- "A": {- "score": 9,- "strengths": ["Complete solution", "Well-formatted", "All fields present"],- "weaknesses": ["Minor style inconsistency in header"]- },- "B": {- "score": 5,- "strengths": ["Readable output", "Correct basic structure"],- "weaknesses": ["Missing date field", "Formatting inconsistencies", "Partial data extraction"]- }- },- "expectation_results": {- "A": {- "passed": 4,- "total": 5,- "pass_rate": 0.80,- "details": [- {"text": "Output includes name", "passed": true}- ]- },- "B": {- "passed": 3,- "total": 5,- "pass_rate": 0.60,- "details": [- {"text": "Output includes name", "passed": true}- ]- }- }-}-```-------## analysis.json--Output from post-hoc analyzer. Located at `<grading-dir>/analysis.json`.--```json-{- "comparison_summary": {- "winner": "A",- "winner_skill": "path/to/winner/skill",- "loser_skill": "path/to/loser/skill",- "comparator_reasoning": "Brief summary of why comparator chose winner"- },- "winner_strengths": [- "Clear step-by-step instructions for handling multi-page documents",- "Included validation script that caught formatting errors"- ],- "loser_weaknesses": [- "Vague instruction 'process the document appropriately' led to inconsistent behavior",- "No script for validation, agent had to improvise"- ],- "instruction_following": {- "winner": {- "score": 9,- "issues": ["Minor: skipped optional logging step"]- },- "loser": {- "score": 6,- "issues": [- "Did not use the skill's formatting template",- "Invented own approach instead of following step 3"- ]- }- },- "improvement_suggestions": [- {- "priority": "high",- "category": "instructions",- "suggestion": "Replace 'process the document appropriately' with explicit steps",- "expected_impact": "Would eliminate ambiguity that caused inconsistent behavior"- }- ],- "transcript_insights": {- "winner_execution_pattern": "Read skill -> Followed 5-step process -> Used validation script",- "loser_execution_pattern": "Read skill -> Unclear on approach -> Tried 3 different methods"- }-}-```+# JSON Schemas++This document defines the JSON schemas used by skill-creator.++---++## evals.json++Defines the evals for a skill. Located at `evals/evals.json` within the skill directory.++```json+{+ "skill_name": "example-skill",+ "evals": [+ {+ "id": 1,+ "prompt": "User's example prompt",+ "expected_output": "Description of expected result",+ "files": ["evals/files/sample1.pdf"],+ "expectations": [+ "The output includes X",+ "The skill used script Y"+ ]+ }+ ]+}+```++**Fields:**+- `skill_name`: Name matching the skill's frontmatter+- `evals[].id`: Unique integer identifier+- `evals[].prompt`: The task to execute+- `evals[].expected_output`: Human-readable description of success+- `evals[].files`: Optional list of input file paths (relative to skill root)+- `evals[].expectations`: List of verifiable statements++---++## history.json++Tracks version progression in Improve mode. Located at workspace root.++```json+{+ "started_at": "2026-01-15T10:30:00Z",+ "skill_name": "pdf",+ "current_best": "v2",+ "iterations": [+ {+ "version": "v0",+ "parent": null,+ "expectation_pass_rate": 0.65,+ "grading_result": "baseline",+ "is_current_best": false+ },+ {+ "version": "v1",+ "parent": "v0",+ "expectation_pass_rate": 0.75,+ "grading_result": "won",+ "is_current_best": false+ },+ {+ "version": "v2",+ "parent": "v1",+ "expectation_pass_rate": 0.85,+ "grading_result": "won",+ "is_current_best": true+ }+ ]+}+```++**Fields:**+- `started_at`: ISO timestamp of when improvement started+- `skill_name`: Name of the skill being improved+- `current_best`: Version identifier of the best performer+- `iterations[].version`: Version identifier (v0, v1, ...)+- `iterations[].parent`: Parent version this was derived from+- `iterations[].expectation_pass_rate`: Pass rate from grading+- `iterations[].grading_result`: "baseline", "won", "lost", or "tie"+- `iterations[].is_current_best`: Whether this is the current best version++---++## grading.json++Output from the grader agent. Located at `<run-dir>/grading.json`.++```json+{+ "expectations": [+ {+ "text": "The output includes the name 'John Smith'",+ "passed": true,+ "evidence": "Found in transcript Step 3: 'Extracted names: John Smith, Sarah Johnson'"+ },+ {+ "text": "The spreadsheet has a SUM formula in cell B10",+ "passed": false,+ "evidence": "No spreadsheet was created. The output was a text file."+ }+ ],+ "summary": {+ "passed": 2,+ "failed": 1,+ "total": 3,+ "pass_rate": 0.67+ },+ "execution_metrics": {+ "tool_calls": {+ "Read": 5,+ "Write": 2,+ "Bash": 8+ },+ "total_tool_calls": 15,+ "total_steps": 6,+ "errors_encountered": 0,+ "output_chars": 12450,+ "transcript_chars": 3200+ },+ "timing": {+ "executor_duration_seconds": 165.0,+ "grader_duration_seconds": 26.0,+ "total_duration_seconds": 191.0+ },+ "claims": [+ {+ "claim": "The form has 12 fillable fields",+ "type": "factual",+ "verified": true,+ "evidence": "Counted 12 fields in field_info.json"+ }+ ],+ "user_notes_summary": {+ "uncertainties": ["Used 2023 data, may be stale"],+ "needs_review": [],+ "workarounds": ["Fell back to text overlay for non-fillable fields"]+ },+ "eval_feedback": {+ "suggestions": [+ {+ "assertion": "The output includes the name 'John Smith'",+ "reason": "A hallucinated document that mentions the name would also pass"+ }+ ],+ "overall": "Assertions check presence but not correctness."+ }+}+```++**Fields:**+- `expectations[]`: Graded expectations with evidence+- `summary`: Aggregate pass/fail counts+- `execution_metrics`: Tool usage and output size (from executor's metrics.json)+- `timing`: Wall clock timing (from timing.json)+- `claims`: Extracted and verified claims from the output+- `user_notes_summary`: Issues flagged by the executor+- `eval_feedback`: (optional) Improvement suggestions for the evals, only present when the grader identifies issues worth raising++---++## metrics.json++Output from the executor agent. Located at `<run-dir>/outputs/metrics.json`.++```json+{+ "tool_calls": {+ "Read": 5,+ "Write": 2,+ "Bash": 8,+ "Edit": 1,+ "Glob": 2,+ "Grep": 0+ },+ "total_tool_calls": 18,+ "total_steps": 6,+ "files_created": ["filled_form.pdf", "field_values.json"],+ "errors_encountered": 0,+ "output_chars": 12450,+ "transcript_chars": 3200+}+```++**Fields:**+- `tool_calls`: Count per tool type+- `total_tool_calls`: Sum of all tool calls+- `total_steps`: Number of major execution steps+- `files_created`: List of output files created+- `errors_encountered`: Number of errors during execution+- `output_chars`: Total character count of output files+- `transcript_chars`: Character count of transcript++---++## timing.json++Wall clock timing for a run. Located at `<run-dir>/timing.json`.++**How to capture:** When a subagent task completes, the task notification includes `total_tokens` and `duration_ms`. Save these immediately — they are not persisted anywhere else and cannot be recovered after the fact.++```json+{+ "total_tokens": 84852,+ "duration_ms": 23332,+ "total_duration_seconds": 23.3,+ "executor_start": "2026-01-15T10:30:00Z",+ "executor_end": "2026-01-15T10:32:45Z",+ "executor_duration_seconds": 165.0,+ "grader_start": "2026-01-15T10:32:46Z",+ "grader_end": "2026-01-15T10:33:12Z",+ "grader_duration_seconds": 26.0+}+```++---++## benchmark.json++Output from Benchmark mode. Located at `benchmarks/<timestamp>/benchmark.json`.++```json+{+ "metadata": {+ "skill_name": "pdf",+ "skill_path": "/path/to/pdf",+ "executor_model": "claude-sonnet-4-20250514",+ "analyzer_model": "most-capable-model",+ "timestamp": "2026-01-15T10:30:00Z",+ "evals_run": [1, 2, 3],+ "runs_per_configuration": 3+ },++ "runs": [+ {+ "eval_id": 1,+ "eval_name": "Ocean",+ "configuration": "with_skill",+ "run_number": 1,+ "result": {+ "pass_rate": 0.85,+ "passed": 6,+ "failed": 1,+ "total": 7,+ "time_seconds": 42.5,+ "tokens": 3800,+ "tool_calls": 18,+ "errors": 0+ },+ "expectations": [+ {"text": "...", "passed": true, "evidence": "..."}+ ],+ "notes": [+ "Used 2023 data, may be stale",+ "Fell back to text overlay for non-fillable fields"+ ]+ }+ ],++ "run_summary": {+ "with_skill": {+ "pass_rate": {"mean": 0.85, "stddev": 0.05, "min": 0.80, "max": 0.90},+ "time_seconds": {"mean": 45.0, "stddev": 12.0, "min": 32.0, "max": 58.0},+ "tokens": {"mean": 3800, "stddev": 400, "min": 3200, "max": 4100}+ },+ "without_skill": {+ "pass_rate": {"mean": 0.35, "stddev": 0.08, "min": 0.28, "max": 0.45},+ "time_seconds": {"mean": 32.0, "stddev": 8.0, "min": 24.0, "max": 42.0},+ "tokens": {"mean": 2100, "stddev": 300, "min": 1800, "max": 2500}+ },+ "delta": {+ "pass_rate": "+0.50",+ "time_seconds": "+13.0",+ "tokens": "+1700"+ }+ },++ "notes": [+ "Assertion 'Output is a PDF file' passes 100% in both configurations - may not differentiate skill value",+ "Eval 3 shows high variance (50% ± 40%) - may be flaky or model-dependent",+ "Without-skill runs consistently fail on table extraction expectations",+ "Skill adds 13s average execution time but improves pass rate by 50%"+ ]+}+```++**Fields:**+- `metadata`: Information about the benchmark run+ - `skill_name`: Name of the skill+ - `timestamp`: When the benchmark was run+ - `evals_run`: List of eval names or IDs+ - `runs_per_configuration`: Number of runs per config (e.g. 3)+- `runs[]`: Individual run results+ - `eval_id`: Numeric eval identifier+ - `eval_name`: Human-readable eval name (used as section header in the viewer)+ - `configuration`: Must be `"with_skill"` or `"without_skill"` (the viewer uses this exact string for grouping and color coding)+ - `run_number`: Integer run number (1, 2, 3...)+ - `result`: Nested object with `pass_rate`, `passed`, `total`, `time_seconds`, `tokens`, `errors`+- `run_summary`: Statistical aggregates per configuration+ - `with_skill` / `without_skill`: Each contains `pass_rate`, `time_seconds`, `tokens` objects with `mean` and `stddev` fields+ - `delta`: Difference strings like `"+0.50"`, `"+13.0"`, `"+1700"`+- `notes`: Freeform observations from the analyzer++**Important:** The viewer reads these field names exactly. Using `config` instead of `configuration`, or putting `pass_rate` at the top level of a run instead of nested under `result`, will cause the viewer to show empty/zero values. Always reference this schema when generating benchmark.json manually.++---++## comparison.json++Output from blind comparator. Located at `<grading-dir>/comparison-N.json`.++```json+{+ "winner": "A",+ "reasoning": "Output A provides a complete solution with proper formatting and all required fields. Output B is missing the date field and has formatting inconsistencies.",+ "rubric": {+ "A": {+ "content": {+ "correctness": 5,+ "completeness": 5,+ "accuracy": 4+ },+ "structure": {+ "organization": 4,+ "formatting": 5,+ "usability": 4+ },+ "content_score": 4.7,+ "structure_score": 4.3,+ "overall_score": 9.0+ },+ "B": {+ "content": {+ "correctness": 3,+ "completeness": 2,+ "accuracy": 3+ },+ "structure": {+ "organization": 3,+ "formatting": 2,+ "usability": 3+ },+ "content_score": 2.7,+ "structure_score": 2.7,+ "overall_score": 5.4+ }+ },+ "output_quality": {+ "A": {+ "score": 9,+ "strengths": ["Complete solution", "Well-formatted", "All fields present"],+ "weaknesses": ["Minor style inconsistency in header"]+ },+ "B": {+ "score": 5,+ "strengths": ["Readable output", "Correct basic structure"],+ "weaknesses": ["Missing date field", "Formatting inconsistencies", "Partial data extraction"]+ }+ },+ "expectation_results": {+ "A": {+ "passed": 4,+ "total": 5,+ "pass_rate": 0.80,+ "details": [+ {"text": "Output includes name", "passed": true}+ ]+ },+ "B": {+ "passed": 3,+ "total": 5,+ "pass_rate": 0.60,+ "details": [+ {"text": "Output includes name", "passed": true}+ ]+ }+ }+}+```++---++## analysis.json++Output from post-hoc analyzer. Located at `<grading-dir>/analysis.json`.++```json+{+ "comparison_summary": {+ "winner": "A",+ "winner_skill": "path/to/winner/skill",+ "loser_skill": "path/to/loser/skill",+ "comparator_reasoning": "Brief summary of why comparator chose winner"+ },+ "winner_strengths": [+ "Clear step-by-step instructions for handling multi-page documents",+ "Included validation script that caught formatting errors"+ ],+ "loser_weaknesses": [+ "Vague instruction 'process the document appropriately' led to inconsistent behavior",+ "No script for validation, agent had to improvise"+ ],+ "instruction_following": {+ "winner": {+ "score": 9,+ "issues": ["Minor: skipped optional logging step"]+ },+ "loser": {+ "score": 6,+ "issues": [+ "Did not use the skill's formatting template",+ "Invented own approach instead of following step 3"+ ]+ }+ },+ "improvement_suggestions": [+ {+ "priority": "high",+ "category": "instructions",+ "suggestion": "Replace 'process the document appropriately' with explicit steps",+ "expected_impact": "Would eliminate ambiguity that caused inconsistent behavior"+ }+ ],+ "transcript_insights": {+ "winner_execution_pattern": "Read skill -> Followed 5-step process -> Used validation script",+ "loser_execution_pattern": "Read skill -> Unclear on approach -> Tried 3 different methods"+ }+}+```diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/scripts/__init__.py b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/scripts/__init__.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/scripts/__init__.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-creator/scripts/__init__.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/scripts/aggregate_benchmark.py b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/scripts/aggregate_benchmark.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/scripts/aggregate_benchmark.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-creator/scripts/aggregate_benchmark.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/scripts/generate_report.py b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/scripts/generate_report.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/scripts/generate_report.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-creator/scripts/generate_report.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/scripts/improve_description.py b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/scripts/improve_description.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/scripts/improve_description.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-creator/scripts/improve_description.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/scripts/package_skill.py b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/scripts/package_skill.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/scripts/package_skill.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-creator/scripts/package_skill.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/scripts/quick_validate.py b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/scripts/quick_validate.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/scripts/quick_validate.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-creator/scripts/quick_validate.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/scripts/run_eval.py b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/scripts/run_eval.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/scripts/run_eval.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-creator/scripts/run_eval.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/scripts/run_loop.py b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/scripts/run_loop.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/scripts/run_loop.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-creator/scripts/run_loop.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/scripts/utils.py b/jiuwenclaw/resources/agent/workspace/skills/skill-creator/scripts/utils.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-creator/scripts/utils.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-creator/scripts/utils.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/SKILL.md b/jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/SKILL.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/SKILL.mdrename to jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/SKILL.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/reference/generator-worker-spec.md b/jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/reference/generator-worker-spec.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/reference/generator-worker-spec.mdrename to jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/reference/generator-worker-spec.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/reference/operator-playbook.md b/jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/reference/operator-playbook.mdsimilarity index 94%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/reference/operator-playbook.mdrename to jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/reference/operator-playbook.mdindex f4dff4a747..ef9352dc36 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/reference/operator-playbook.md+++ b/jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/reference/operator-playbook.md@@ -31,10 +31,10 @@ This replaces a manual **apply** / **Import** handoff: the driving agent performDo **not** assume a fixed home-directory prefix or legacy **`…/workspace/…`** segments. JiuwenClaw (and forks) may relocate data roots via config or environment; always prefer **whatever path helpers the host exposes** in the system prompt or tool context.-When **`get_agent_workspace_dir()`** / **`get_agent_skills_dir()`** / **`get_agent_root_dir()`** are named in the prompt, use them to build **absolute** paths for drafts, imports, and file tools. If only a virtual tree (e.g. `agent/jiuwenclaw_workspace/...`) is shown, map it through the host’s documented root before writing to disk.+When **`get_agent_workspace_dir()`** / **`get_agent_skills_dir()`** / **`get_agent_root_dir()`** are named in the prompt, use them to build **absolute** paths for drafts, imports, and file tools. If only a virtual tree (e.g. `agent/workspace/...`) is shown, map it through the host’s documented root before writing to disk.- **Draft staging:** **`skills-draft/<skill_name>/`** lives **under** the agent workspace directory (sibling to the runtime **`skills/`** folder), i.e. **`get_agent_workspace_dir() / "skills-draft" / <skill_name>`**. Create **`skills-draft`** if missing.-- **Installed skills:** user-installed packages land under **`get_agent_skills_dir() / <skill_name>`** (in stock JiuwenClaw this is **…/jiuwenclaw_workspace/skills/<skill_name>**, not **`…/agent/skills/`**).+- **Installed skills:** user-installed packages land under **`get_agent_skills_dir() / <skill_name>`** (in stock JiuwenSwarm this is **…/workspace/agent/workspace/skills/<skill_name>**, not **`…/agent/skills/`**).## Path conventions (typical product layout)@@ -80,7 +80,7 @@ Optionally run **`scripts/skill_gen/validator.py`** on the draft directory befor|------|------|| **`get_agent_skills_dir() / <name>`** (conceptually **`<agent_workspace>/skills/<name>/`**) | Installed skills (`SKILL.md`, optional `reference/`, `scripts/`, …). Runtime loads user-installed trees from here. || **`get_agent_workspace_dir() / "skills-draft" / <skill_name>`** | Staging: write the new package here, then **`skills.import_local`**. |-| **`jiuwenclaw/.../jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/`** (repo) | Built-in meta-skill template (`get_builtin_skills_dir()`). |+| **`jiuwenclaw/.../workspace/skills/skill-gen-4-enterprise-doc/`** (repo) | Built-in meta-skill template (`get_builtin_skills_dir()`). || **`skill-gen-4-enterprise-doc/scripts/`** | `skill_generator_cli.py` (`sop-text`, `url-fetch`); **`scripts/skill_gen/`** — Python extraction (`parse_sop_*`, prompts in `sop_parser.py`, `sop_chunk_merge.py`). |**`with_skill`–style evaluation** (if used) loads skills from the runtime **skills root** (**`get_agent_skills_dir()`** or the host-documented equivalent) only — promote before expecting the new skill to participate.diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/reference/sop-recovery-and-interview-fallback.md b/jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/reference/sop-recovery-and-interview-fallback.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/reference/sop-recovery-and-interview-fallback.mdrename to jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/reference/sop-recovery-and-interview-fallback.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/reference/sop-structure-pipeline.md b/jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/reference/sop-structure-pipeline.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/reference/sop-structure-pipeline.mdrename to jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/reference/sop-structure-pipeline.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/__init__.py b/jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/__init__.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/__init__.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/__init__.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/models.py b/jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/models.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/models.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/models.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/sop_chunk_merge.py b/jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/sop_chunk_merge.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/sop_chunk_merge.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/sop_chunk_merge.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/sop_fallback.py b/jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/sop_fallback.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/sop_fallback.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/sop_fallback.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/sop_parser.py b/jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/sop_parser.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/sop_parser.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/sop_parser.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/__init__.py b/jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/__init__.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/__init__.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/__init__.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/models.py b/jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/models.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/models.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/models.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/router.py b/jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/router.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/router.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/router.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/url_safety.py b/jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/url_safety.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/url_safety.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/url_safety.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/web_page.py b/jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/web_page.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/web_page.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/web_page.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/wechat_article.py b/jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/wechat_article.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/wechat_article.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/url_ingest/wechat_article.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/validator.py b/jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/validator.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/validator.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_gen/validator.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_generator_cli.py b/jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_generator_cli.pysimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_generator_cli.pyrename to jiuwenclaw/resources/agent/workspace/skills/skill-gen-4-enterprise-doc/scripts/skill_generator_cli.pydiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skvm-general/SKILL.md b/jiuwenclaw/resources/agent/workspace/skills/skvm-general/SKILL.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skvm-general/SKILL.mdrename to jiuwenclaw/resources/agent/workspace/skills/skvm-general/SKILL.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skvm-jit/SKILL.md b/jiuwenclaw/resources/agent/workspace/skills/skvm-jit/SKILL.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skvm-jit/SKILL.mdrename to jiuwenclaw/resources/agent/workspace/skills/skvm-jit/SKILL.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skvm-jit/adapter-skill-paths.md b/jiuwenclaw/resources/agent/workspace/skills/skvm-jit/adapter-skill-paths.mdsimilarity index 100%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/skvm-jit/adapter-skill-paths.mdrename to jiuwenclaw/resources/agent/workspace/skills/skvm-jit/adapter-skill-paths.mddiff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/SKILL.md b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/SKILL.mdsimilarity index 98%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/SKILL.mdrename to jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/SKILL.mdindex 63fcc77f92..849c6b98e7 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/SKILL.md+++ b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/SKILL.md@@ -1,314 +1,314 @@-----name: teamskill-creator-description: |- Creates, converts, or modifies Teamskills — the multi-role extension of the Skills standard (specialized roles + workflow + bind constraints).- Use when the user wants to author a multi-role agent team, convert a single-agent skill into one, or refactor an existing team.- Do NOT use for single-agent Skills — use create-skill instead.-version: "0.2"------# Teamskill Creator--Authoring tool for Teamskills — the multi-role extension of the Anthropic Skills standard. Encodes the Teamskill spec into a repeatable workflow with templates, decision trees, and an automated validator.--## Workflow--This skill has **three modes**. Pick one based on the user's request, then follow the matching pipeline:--| Mode | Trigger | Output |-|---|---|---|-| **CREATE** | User has a fresh need ("build a team for X") | New `<teamskill-name>/` directory with the full 5-file set |-| **CONVERT** | User points at an existing single-agent skill | Transformed `<teamskill-name>/` directory + a delta report explaining what the team adds |-| **MODIFY** | User edits an existing Teamskill (add/remove role, change workflow, adjust bind, fix validator errors) | Updated files in the existing `<teamskill-name>/` directory |--> **All three modes share Stages 2–6**. CONVERT differs only in Stage 1 (decomposition replaces fresh design). MODIFY skips Stage 0 and Stage 1 (justification and pattern are already settled — re-open them only if the change alters the pattern, e.g. adding a parallel role to a pipeline team), touches only the affected stages in 2–5, and **MUST run Stage 6 (validator) — this is the most-skipped, most-critical step in MODIFY mode**. See the [MODIFY impact matrix](#modify-impact-matrix) for which stages to re-run per change type.--### Stage 0: Triage — is a Teamskill even justified?--A Teamskill is **only justified** when at least one of these is true:--1. **Adversarial blind spot** — a single agent role-playing N personas produces converging outputs because it cannot escape its own analytical priors. Examples: PR review, security audit, design critique.-2. **Parallel decomposition gain** — N independent sub-tasks can run concurrently and the integration is non-trivial. Examples: multi-angle research, multi-perspective due diligence.-3. **Specialization pipeline with hard handoffs** — sequential stages with quality gates where blurring stage boundaries causes regressions. Examples: marketing copy (brief → draft → edit → audit), incident response (declare → triage → mitigate → postmortem).--**If none apply → STOP. Recommend a single-agent skill instead.** Teamskills cost more tokens, more wall-clock, and more authoring overhead. Do not build one out of novelty.--Ask the user: *"Which of these failure modes does a single agent hit on this task today?"* If they cannot answer, the Teamskill is premature.--### Stage 1a (CREATE only): Pattern selection--Pick the architectural pattern (A / B / C / mixed) based on Stage 0 justification. The detailed decision tree with worked examples is in [reference/pattern-selection.md](reference/pattern-selection.md). Quick reference:--| Pattern | When | Role count | Roles see each other? |-|---|---|---|---|-| **A. Adversarial / Cross-check** | Justification #1 (blind spot) | 2–4 | No — isolation is the value |-| **B. Parallel decomposition** | Justification #2 (independent sub-tasks) | 2–N (variable) | No until integration |-| **C. Specialization pipeline** | Justification #3 (sequential expert stages) | 3–5 | Each stage sees prior stage output |-| **Mixed (A+B / B+C / C+A)** | Multiple justifications stack | 4–6 | Pattern-by-stage |-| **Debate (Mixed B+A+C)** | #1 + #2 (blind spot + parallel breadth) | 3–N+1 | Phase-scoped: isolated → mutual |--Read [reference/pattern-selection.md](reference/pattern-selection.md) before committing — picking the wrong pattern is the most common authoring error.--### Stage 1b (CONVERT only): Decompose the existing skill--Read the source SKILL.md and identify natural role boundaries. Use this checklist:--1. **Find embedded personas** — does the skill ask one agent to "act as" multiple roles (e.g., "Persona 1: Saboteur / Persona 2: New Hire / Persona 3: Security Auditor")? Each embedded persona is a Teamskill role candidate.-2. **Find sequential stages with quality gates** — does the skill have phases like "first do X, then validate Y, then produce Z"? Each phase is a pipeline stage candidate.-3. **Find checklists that branch by category** — a checklist like "[ ] security [ ] performance [ ] readability" is parallel-decomposition fuel.-4. **Identify what's lost in single-agent form** — the answer becomes the Teamskill's "why" (the Stage 0 justification). If you cannot articulate this, the conversion is not worth it.--Full conversion methodology: [reference/conversion-guide.md](reference/conversion-guide.md).--### Stage 2: Role design (count depends on pattern, no overlap)--Default role counts by pattern (soft heuristics, not hard limits — see [reference/pattern-selection.md](reference/pattern-selection.md) Q4):--- **A. Adversarial / Cross-check**: 2–4 roles-- **B. Parallel decomposition**: 2–N roles (use `count: [min, max]` for elastic fan-out)-- **C. Specialization pipeline**: 3–5 stages-- **Mixed (A+B / A+C)**: 4–6 roles total--If you need more, prefer splitting into multiple sequential Teamskills over one mega-team.--For each role, write 5 mandatory sections:--1. `## Identity` — **first line MUST be a 1-line motto** that crystallizes the POV (e.g., *"I am trying to break this code in production."*). This is the #1 anti-convergence mechanism. 0–2 paragraphs of context after.-2. `## Success Criteria` — bullet list + a "Focus areas" line.-3. `## Boundary` — explicit `**Forbidden**:` (prevent role overlap) + `**Mandatory**:` (prevent laziness).-4. `## Output Schema` — Markdown or JSON template.-5. `## Inline Persona for Teammate` — full pasteable prompt (most adopting agents do NOT auto-load role files; the Leader must inline this into the dispatch prompt).--Detailed authoring guide with examples: [reference/role-design.md](reference/role-design.md).--**Anti-overlap test**: write each role's 1-line motto, then ask *"could one role's deliverable substitute for another's?"* If yes, the boundaries are blurred — redesign before proceeding.--**Output**: write each role as `roles/<id>.md` using [templates/role.md.template](templates/role.md.template) as the starting skeleton. Delete the `<!-- TEMPLATE NOTES -->` block before finalizing.--**Auto-matching: assign locally available skills and tools**--After all role files are written, automatically match each role with locally available skills and tools. This is a **silent sub-step** — no user interaction needed (already-installed skills have zero adoption cost).--1. **Scan local skills** — use whatever mechanism the host framework provides. Common approaches (non-exhaustive):- - **System prompt / context injection**: many frameworks inject an `available_skills` list at startup — this is the most reliable source.- - **Workspace-level convention scan**: glob for `**/SKILL.md` under known skill directories.- - **CLI query**: if the framework provides a skill listing command (e.g., `npx skills list -g`), use it.- - **Do NOT hardcode paths for a specific framework** — the Teamskill spec is framework-agnostic.-2. **Scan local tools** — probe CLI tools available in the current environment (e.g., `gh`, `python`, `rg`, `jq`, `curl`, `docker`). Use `where` (Windows) or `which` (Unix).-3. **Match and assign** — for each role, read its `purpose`, `Success Criteria`, and `Boundary`. Evaluate whether any discovered skill/tool would materially help fulfil the role's purpose (a match = removing it would force the role into a significantly weaker operating mode). Assign matches to the correct field with `source: local` in `dependencies.yaml`.-- **Classification rule — do NOT mix skills and tools:**- - `roles[].skills` → **Skills only**: items that have a `SKILL.md` (agent skills providing instructions/workflows). Examples: `web-research`, `code-review`, `canvas-design`.- - `roles[].tools` → **Tools only**: CLI executables, MCP servers, or shell commands. Examples: `gh`, `python`, `rg`, `docker`, `curl`.- - A CLI binary is NEVER a skill. A SKILL.md-based capability is NEVER a tool. If unsure, check: does it have a `SKILL.md`? → skill. Is it invoked via shell/MCP? → tool.--### Stage 3: Write `workflow.md` (mermaid + steps + gates)--Author `workflow.md` using [templates/workflow.md.template](templates/workflow.md.template) as the starting skeleton. Three mandatory sections:--1. `## Overview` — **mermaid `graph LR/TD`** showing Leader entry, parallel/sequential teammate nodes, decision diamonds (degraded mode branches), integration node, output node. Mermaid is the primary expression difference vs single-agent skills. **Debate pattern**: MUST keep the **inter-member communication preference** note from the template — do NOT delete it when replacing the mermaid placeholder.-2. `## Detailed Steps` — numbered steps; each step contains: executor / input / output / serial-or-parallel / **quality gate** (what to do if this step's output fails). The last step contains the final report format template.-3. `## Acceptance Criteria` — judgement of a successful single run.--Quality gates are the contract surface between stages — design them per [reference/role-design.md](reference/role-design.md) § Gate Design.--### Stage 4: Write `bind.md` (numbers + behavior + failure)--Author `bind.md` using [templates/bind.md.template](templates/bind.md.template) as the starting skeleton. Three mandatory sections:--1. `## Resource Constraints` — table with at least: `max_parallel_teammates`, `total_wall_clock_budget`, `total_token_budget`. Add per-role limits if asymmetric.-2. `## Behavioral Constraints` — **team-level** rules (Leader does not write content / teammates cannot see each other's output / Leader does not resolve contradictions / etc.). Distinct from per-role `Boundary`. **Debate pattern MUST include**: phase-scoped visibility rules (which rounds are isolated, which are mutually visible) AND the inter-member communication preference order (direct peer-to-peer > shared blackboard > Leader-relay).-3. `## Failure Handling` — must cover **(a)** teammate failure (timeout, malformed output, retry policy, how missing outputs appear in the report) and **(b)** input-overscale degradation (e.g., diff > 2000 LOC → degrade to single-role mode).--Heuristic: if a constraint has a number or an exception path, it belongs in `bind.md`. If it's the main flow, it belongs in `workflow.md`.--### Stage 5: Write `dependencies.yaml` + `SKILL.md`--The remaining two files. Write them last because they reference content produced in Stages 2–4.--**5a. `dependencies.yaml`** — use [templates/dependencies.yaml.template](templates/dependencies.yaml.template). This file codifies the **auto-matching results from Stage 2**, not a blank-slate design. Both `skills:` and `tools:` segments are mandatory — write `[]` if empty, but only after the auto-matching scan confirms no matches (signals "checked, confirmed none" — different from "never looked"). Each `roles[].skills` and `roles[].tools` declared in SKILL.md frontmatter MUST appear here (the validator enforces this).--**5b. `SKILL.md`** — use [templates/SKILL.md.template](templates/SKILL.md.template). This is the entry point that ties together all other files. Body MUST contain `## Workflow` + `## Roles` + `## Files`.--**Naming rules** (enforced by the validator):-- Directory name = `name` field in SKILL.md frontmatter (kebab-case, ends with `-team` by convention).-- Each `roles/<id>.md` filename MUST equal the corresponding `roles[].id` in SKILL.md frontmatter.-- All 5 files are mandatory (the validator fails on any missing file).--**Description discipline** (enforced by the validator — these are the most-violated rules):-- ≤ 4 lines, ≤ 500 chars total.-- 3-line structure only: WHAT / WHEN / NOT. Do NOT add a separate `Triggers:` line.-- NO synonym enumeration — modern semantic match handles all variants from one natural sentence.-- NO numeric scope thresholds (e.g. `">200 LOC"`) → those belong in `bind.md`.-- NO Stage 0 justification rationale → that belongs in the body's intro paragraph.-- Per-role `purpose:` field has a ≤150 char HARD CAP. Detail belongs in `roles/<id>.md`, not in SKILL.md frontmatter.--**Calibration benchmark**: aim for **≤ 500 chars** (platform hard cap: 1024). Teamskills are inherently more complex than single-agent skills — multi-role composition, workflow scope, and trigger scenarios may need more words. Stay concise, but don't sacrifice clarity for arbitrary brevity.--### Stage 6: Validate--Run the automated validator:--```bash-python scripts/validate_teamskill.py path/to/<teamskill-name>/-```--The validator checks:-- **Structural**: 5 files present, role file names match `roles[].id`, no orphan role files-- **Frontmatter**: `name` / `description` / `version` / `kind: team-skill` / `roles[]` present; each role has `id` + `purpose`; `name` == directory name-- **Section presence**: SKILL.md body has `## Workflow` / `## Roles` / `## Files`; each `roles/*.md` has all 5 mandatory sections; `workflow.md` has `## Overview` / `## Detailed Steps` / `## Acceptance Criteria` (and at least one mermaid block); `bind.md` has all 3 mandatory sections-- **Cross-file consistency**: every `roles[].skills` and `roles[].tools` in SKILL.md appears in `dependencies.yaml`; every `## Identity` in roles starts with a `> *"..."*` motto line-- **Output discipline**: `## Inline Persona for Teammate` present in each role file; `dependencies.yaml` skills/tools segments present even if empty--**Exit code 0 = compliant**. Non-zero exit prints the failing checks with file:line references.--The manual checklist (for design-time judgment calls the script cannot automate, like "is this content really redundant?") lives in [reference/compliance-checklist.md](reference/compliance-checklist.md). Read it before declaring the Teamskill done.--### Post-generation: Creation Summary + Community Enrichment--After Stage 6 passes, present a **creation summary** to the user. This is the natural point to assess capability coverage and offer community enrichment — the Teamskill is already complete and functional, so community search is a zero-risk enhancement.--**Summary format:**--```-Teamskill: <name>-Pattern: <A | B | C | Mixed>-Roles: <count> (<list of role ids>)-Validator: PASS-```--**Per-role capability coverage:**--| Role | Assigned skills/tools | Recommend community search? |-|---|---|---|-| `<role-id>` | `<matched skills/tools, or "none">` | `<Yes / No — with reason>` |--**Recommendation logic — default is to recommend:**--For each role, evaluate whether to recommend community skill search:--- **Recommend** (default) — any role that could benefit from a **domain-specific** community skill. This includes roles that already have generic utility skills (like `web-research` or `curl`) but lack **domain-specialized** skills. A generic skill is NOT a substitute for domain expertise — see the anti-pattern below.-- **Do NOT recommend** — only when the role is **inherently self-sufficient**: its task is pure reasoning, judgment, or text generation that would not benefit from any external skill or tool. Examples: an adversarial critic whose job is to find logical flaws, a copy-editor whose job is to refine prose. These roles operate entirely within the LLM's native capabilities.--**Design intent**: the agent is structurally biased toward skipping community search. Two common rationalizations:--1. *"The role has no skills → but it can function on LLM knowledge alone"* — wrong in most cases. A role *can* function, but a matching skill often dramatically improves output quality.-2. *"The role already has a generic skill (e.g. `web-research`) → covered"* — **equally wrong and harder to catch**. A generic information-retrieval skill does NOT substitute for a domain-specific operational skill. `web-research` can search the web; a Taobao shopping skill knows store tiers, coupon stacking rules, platform-specific risk signals, and API-level price tracking — capabilities that no amount of generic search can replicate.--The default must be **recommend**, with the burden of proof on **not** recommending. The test is: *"Does a domain-specific community skill exist that would give this role capabilities beyond what its current generic skills provide?"* If plausible → recommend.--> **Anti-pattern: "通用即覆盖" (generic = covered)**->-> In `ecommerce-compare-debate-team`, three platform shopper roles (`taobao-shopper`, `pinduoduo-shopper`, `jingdong-shopper`) each had `web-research` assigned. The agent concluded "already covered — no community search needed." This is wrong: `web-research` is general-purpose retrieval; it knows nothing about Taobao store tiers, PDD subsidy eligibility, or JD self-operated logistics. Community registries carry platform-specific shopping and buyer-agent skills that fill exactly this gap.->-> **Rule**: if a role's identity is tied to a specific platform or professional domain, a generic utility skill does NOT count as coverage — always recommend community search for domain-specific skills.--**High-signal scenarios — MUST recommend** (non-exhaustive):--- **Binary/office file output** (PPTX, DOCX, XLSX, PDF) — LLM cannot generate binary formats natively; needs a skill wrapping python-pptx / docx etc.-- **Diagram/chart rendering** (Mermaid, Excalidraw, matplotlib) — LLM can describe but cannot render visuals without a generation skill.-- **Specific file format parsing** (CSV, images, audio, JSON-LD) — specialized parsing/validation skill is far more reliable than raw LLM attempts.-- **Domain-specific platform / service interaction** (e-commerce platforms, social media, financial services, travel booking, healthcare systems, government portals, etc.) — community registries often have skills that encode platform-specific rules, workflows, API integrations, or operational knowledge that generic retrieval skills cannot replicate. Examples: 淘宝/天猫购物 skills with store-tier logic, 京东 price-tracking skills, 拼多多 deal-finding skills, 买手/personal-shopper skills. A role whose identity is tied to a specific platform or professional domain should **always** trigger a community search, even if generic skills like `web-research` are already assigned.--If any role hits these patterns and no **domain-specific** local skill covers it, recommend "Yes" — do not rationalize it away with "the role can still produce text instructions" or "generic retrieval already handles it."--**Community enrichment prompt:**--If one or more roles are marked "Recommend: Yes", ask:--> *"The following roles have no domain-specific skills and could benefit from community skill enhancement:*-> *[table: Role | Current skills (if any) | What domain-specific skill would help]*-> *Shall I search community skill registries? The Teamskill is already complete — this is an optional enhancement. (Y/N)"*--If user says **Yes**:--Read [reference/community-search.md](reference/community-search.md) and follow its full procedure. Quick summary:--1. **Derive search queries** from each role's `purpose`, `Success Criteria`, and `Output Schema` — generate 2–3 keyword variants per role (see §1 Keyword Derivation).-2. **Multi-source parallel search** — run both Tier 1 CLIs simultaneously:- - `npx skills find '<query>'` (skills.sh — keyword matching, install counts)- - `skillnet search '<query>' --mode vector` (SkillNet — semantic vector search, quality evaluation)- - If results are insufficient, escalate to Tier 2 web platforms (LLMBase, SkillsMP, LobeHub) and Tier 3 curated lists (awesome-agent-skills, awesome-claude-skills).-3. **Quality gates** — every candidate must pass: install count (≥ 1K preferred), source reputation, security rating, freshness (see §3).-4. **Role-skill fit test** — verify capability match and run the removal test: "would removing this skill significantly degrade the role's output?" (see §4).-5. **Present enrichment summary** to the user with the standardized format (see §5) — full transparency on what was searched, found, selected, and rejected.-6. Install approved skills, update `roles[].skills` in SKILL.md frontmatter + `dependencies.yaml` with `source: <community-url>`.-7. Re-run `python scripts/validate_teamskill.py` to confirm consistency.--If user says **No** → done. The Teamskill is fully functional as-is.--**Decision rules:**-- **Default: recommend** — empty `skills: []` = recommend community search; **also recommend** when a role only has generic utility skills (e.g. `web-research`) but lacks domain-specific skills matching its identity. Burden of proof is on NOT recommending.-- Prefer local over community — never search for capabilities already covered by a **domain-equivalent** local skill. A generic retrieval skill does NOT count as domain coverage.-- Per-role soft limit ≤ 1 community skill — if a role needs 2+, it may be too broad (consider splitting).-- Team-level soft limit: community deps ≤ role count — exceeding this signals over-engineering.-- Never force a dependency — mark `required: false` if the role can function without it.--## Roles--This skill has no Teamskill roles itself — it is a **single-agent skill** that authors Teamskills. The agent loading this skill plays the author/architect role.--## Files--| File | What it contains | When to read |-|---|---|---|-| [reference/pattern-selection.md](reference/pattern-selection.md) | A/B/C/Mixed pattern decision tree with worked examples | Stage 1a (before committing to a pattern) |-| [reference/role-design.md](reference/role-design.md) | How to author the 5 mandatory role sections; gate design between stages; anti-convergence techniques | Stage 2 + Stage 3 |-| [reference/conversion-guide.md](reference/conversion-guide.md) | Step-by-step methodology for converting a single-agent skill into a Teamskill, with a worked example | Stage 1b (CONVERT mode only) |-| [reference/compliance-checklist.md](reference/compliance-checklist.md) | Responsibility-attribution tests + manual-review checklist; explains what the validator can and cannot catch | Stage 6 (after the script passes) |-| [reference/community-search.md](reference/community-search.md) | Multi-source search strategy (keyword derivation, quality gates, role-skill fit test) for finding community skills | Post-generation (community enrichment step) |-| [templates/](templates/) | 5 file skeletons with placeholders and inline guidance comments | Stages 2–5 (each stage references its template) |-| [scripts/validate_teamskill.py](scripts/validate_teamskill.py) | Automated structural + frontmatter + section + cross-file consistency checks | Stage 6 (run on every Teamskill before declaring done) |--## Common pitfalls--Detailed pitfall analysis is in the reference files — read them during the corresponding stage:--- **Role authoring mistakes** (motto, boundary, persona): [reference/role-design.md](reference/role-design.md) § Putting it together: a role file checklist-- **Content quality judgment calls** (anti-convergence, gate strength, bind numbers): [reference/compliance-checklist.md](reference/compliance-checklist.md) Part B-- **Pattern selection errors** (council of clones, pipeline without gates, decomposition without disjointness): [reference/pattern-selection.md](reference/pattern-selection.md) § Anti-patterns--The three most common **structural** mistakes (caught by the validator, but worth internalizing):--1. **Skipping auto-matching in Stage 2** — jumping from role design to empty `skills: []` / `tools: []` without scanning locally available skills/tools. Fix: always run the auto-matching sub-step; empty lists are valid only after the scan confirms no matches.-2. **`roles[].skills` declared in SKILL.md but missing from `dependencies.yaml`** — silent contract violation. Fix: run the validator.-3. **Mermaid in SKILL.md body** — duplicating the diagram from `workflow.md`. Mermaid belongs only in `workflow.md`.--## Quick start--For a CREATE request:--1. Confirm Stage 0 justification with the user (which failure mode does single-agent hit?)-2. Read [reference/pattern-selection.md](reference/pattern-selection.md) and pick A / B / C / mixed-3. Write all `roles/<id>.md` files (motto, boundary, schema, inline persona) + auto-match local skills/tools-4. Write `workflow.md` → `bind.md` → `dependencies.yaml` → `SKILL.md` (each using its template)-5. Run `python scripts/validate_teamskill.py <teamskill-name>/` until exit 0-6. Present creation summary with per-role capability coverage → recommend community search for roles lacking **domain-specific** skills (default: recommend; generic utility skills do NOT satisfy the threshold)-7. Manual review with [reference/compliance-checklist.md](reference/compliance-checklist.md)--For a CONVERT request:--1. Read the source single-agent SKILL.md-2. Apply [reference/conversion-guide.md](reference/conversion-guide.md) decomposition checklist-3. Articulate "what is lost in single-agent form" — this is the Stage 0 justification-4. Continue from CREATE step 2 (pattern selection) onward-5. Add a `MIGRATION.md` (optional) to the new Teamskill explaining the source skill, the decomposition rationale, and the team-vs-single delta--For a MODIFY request:--1. Identify the change type from the impact matrix below-2. Re-run the indicated stages; apply edits honoring the section + structure rules (mottos, Forbidden+Mandatory, Inline Persona, gates, numeric bind constraints)-3. Run `python scripts/validate_teamskill.py <teamskill-name>/` — **Stage 6 is mandatory regardless of edit size**--#### MODIFY impact matrix--| Change type | Re-run stages | Files to update |-|---|---|---|-| Edit role Identity / Boundary / Schema | Stage 2 (affected role only) | `roles/<id>.md` |-| Add or remove a role | Stage 1a + 2 + 3 + 4 + 5 | All 5 files |-| Change workflow steps / topology | Stage 3 | `workflow.md` + `bind.md` (if constraints change) |-| Change bind constraints | Stage 4 | `bind.md` |-| Change dependencies | Stage 2 (auto-match) + 5 | `dependencies.yaml` + `SKILL.md` frontmatter |-| Edit SKILL.md description / purpose | Stage 5b | `SKILL.md` |--All rows require **Stage 6 (validator)** as the final step.+---+name: teamskill-creator+description: |+ Creates, converts, or modifies Teamskills — the multi-role extension of the Skills standard (specialized roles + workflow + bind constraints).+ Use when the user wants to author a multi-role agent team, convert a single-agent skill into one, or refactor an existing team.+ Do NOT use for single-agent Skills — use create-skill instead.+version: "0.2"+---++# Teamskill Creator++Authoring tool for Teamskills — the multi-role extension of the Anthropic Skills standard. Encodes the Teamskill spec into a repeatable workflow with templates, decision trees, and an automated validator.++## Workflow++This skill has **three modes**. Pick one based on the user's request, then follow the matching pipeline:++| Mode | Trigger | Output |+|---|---|---|+| **CREATE** | User has a fresh need ("build a team for X") | New `<teamskill-name>/` directory with the full 5-file set |+| **CONVERT** | User points at an existing single-agent skill | Transformed `<teamskill-name>/` directory + a delta report explaining what the team adds |+| **MODIFY** | User edits an existing Teamskill (add/remove role, change workflow, adjust bind, fix validator errors) | Updated files in the existing `<teamskill-name>/` directory |++> **All three modes share Stages 2–6**. CONVERT differs only in Stage 1 (decomposition replaces fresh design). MODIFY skips Stage 0 and Stage 1 (justification and pattern are already settled — re-open them only if the change alters the pattern, e.g. adding a parallel role to a pipeline team), touches only the affected stages in 2–5, and **MUST run Stage 6 (validator) — this is the most-skipped, most-critical step in MODIFY mode**. See the [MODIFY impact matrix](#modify-impact-matrix) for which stages to re-run per change type.++### Stage 0: Triage — is a Teamskill even justified?++A Teamskill is **only justified** when at least one of these is true:++1. **Adversarial blind spot** — a single agent role-playing N personas produces converging outputs because it cannot escape its own analytical priors. Examples: PR review, security audit, design critique.+2. **Parallel decomposition gain** — N independent sub-tasks can run concurrently and the integration is non-trivial. Examples: multi-angle research, multi-perspective due diligence.+3. **Specialization pipeline with hard handoffs** — sequential stages with quality gates where blurring stage boundaries causes regressions. Examples: marketing copy (brief → draft → edit → audit), incident response (declare → triage → mitigate → postmortem).++**If none apply → STOP. Recommend a single-agent skill instead.** Teamskills cost more tokens, more wall-clock, and more authoring overhead. Do not build one out of novelty.++Ask the user: *"Which of these failure modes does a single agent hit on this task today?"* If they cannot answer, the Teamskill is premature.++### Stage 1a (CREATE only): Pattern selection++Pick the architectural pattern (A / B / C / mixed) based on Stage 0 justification. The detailed decision tree with worked examples is in [reference/pattern-selection.md](reference/pattern-selection.md). Quick reference:++| Pattern | When | Role count | Roles see each other? |+|---|---|---|---|+| **A. Adversarial / Cross-check** | Justification #1 (blind spot) | 2–4 | No — isolation is the value |+| **B. Parallel decomposition** | Justification #2 (independent sub-tasks) | 2–N (variable) | No until integration |+| **C. Specialization pipeline** | Justification #3 (sequential expert stages) | 3–5 | Each stage sees prior stage output |+| **Mixed (A+B / B+C / C+A)** | Multiple justifications stack | 4–6 | Pattern-by-stage |+| **Debate (Mixed B+A+C)** | #1 + #2 (blind spot + parallel breadth) | 3–N+1 | Phase-scoped: isolated → mutual |++Read [reference/pattern-selection.md](reference/pattern-selection.md) before committing — picking the wrong pattern is the most common authoring error.++### Stage 1b (CONVERT only): Decompose the existing skill++Read the source SKILL.md and identify natural role boundaries. Use this checklist:++1. **Find embedded personas** — does the skill ask one agent to "act as" multiple roles (e.g., "Persona 1: Saboteur / Persona 2: New Hire / Persona 3: Security Auditor")? Each embedded persona is a Teamskill role candidate.+2. **Find sequential stages with quality gates** — does the skill have phases like "first do X, then validate Y, then produce Z"? Each phase is a pipeline stage candidate.+3. **Find checklists that branch by category** — a checklist like "[ ] security [ ] performance [ ] readability" is parallel-decomposition fuel.+4. **Identify what's lost in single-agent form** — the answer becomes the Teamskill's "why" (the Stage 0 justification). If you cannot articulate this, the conversion is not worth it.++Full conversion methodology: [reference/conversion-guide.md](reference/conversion-guide.md).++### Stage 2: Role design (count depends on pattern, no overlap)++Default role counts by pattern (soft heuristics, not hard limits — see [reference/pattern-selection.md](reference/pattern-selection.md) Q4):++- **A. Adversarial / Cross-check**: 2–4 roles+- **B. Parallel decomposition**: 2–N roles (use `count: [min, max]` for elastic fan-out)+- **C. Specialization pipeline**: 3–5 stages+- **Mixed (A+B / A+C)**: 4–6 roles total++If you need more, prefer splitting into multiple sequential Teamskills over one mega-team.++For each role, write 5 mandatory sections:++1. `## Identity` — **first line MUST be a 1-line motto** that crystallizes the POV (e.g., *"I am trying to break this code in production."*). This is the #1 anti-convergence mechanism. 0–2 paragraphs of context after.+2. `## Success Criteria` — bullet list + a "Focus areas" line.+3. `## Boundary` — explicit `**Forbidden**:` (prevent role overlap) + `**Mandatory**:` (prevent laziness).+4. `## Output Schema` — Markdown or JSON template.+5. `## Inline Persona for Teammate` — full pasteable prompt (most adopting agents do NOT auto-load role files; the Leader must inline this into the dispatch prompt).++Detailed authoring guide with examples: [reference/role-design.md](reference/role-design.md).++**Anti-overlap test**: write each role's 1-line motto, then ask *"could one role's deliverable substitute for another's?"* If yes, the boundaries are blurred — redesign before proceeding.++**Output**: write each role as `roles/<id>.md` using [templates/role.md.template](templates/role.md.template) as the starting skeleton. Delete the `<!-- TEMPLATE NOTES -->` block before finalizing.++**Auto-matching: assign locally available skills and tools**++After all role files are written, automatically match each role with locally available skills and tools. This is a **silent sub-step** — no user interaction needed (already-installed skills have zero adoption cost).++1. **Scan local skills** — use whatever mechanism the host framework provides. Common approaches (non-exhaustive):+ - **System prompt / context injection**: many frameworks inject an `available_skills` list at startup — this is the most reliable source.+ - **Workspace-level convention scan**: glob for `**/SKILL.md` under known skill directories.+ - **CLI query**: if the framework provides a skill listing command (e.g., `npx skills list -g`), use it.+ - **Do NOT hardcode paths for a specific framework** — the Teamskill spec is framework-agnostic.+2. **Scan local tools** — probe CLI tools available in the current environment (e.g., `gh`, `python`, `rg`, `jq`, `curl`, `docker`). Use `where` (Windows) or `which` (Unix).+3. **Match and assign** — for each role, read its `purpose`, `Success Criteria`, and `Boundary`. Evaluate whether any discovered skill/tool would materially help fulfil the role's purpose (a match = removing it would force the role into a significantly weaker operating mode). Assign matches to the correct field with `source: local` in `dependencies.yaml`.++ **Classification rule — do NOT mix skills and tools:**+ - `roles[].skills` → **Skills only**: items that have a `SKILL.md` (agent skills providing instructions/workflows). Examples: `web-research`, `code-review`, `canvas-design`.+ - `roles[].tools` → **Tools only**: CLI executables, MCP servers, or shell commands. Examples: `gh`, `python`, `rg`, `docker`, `curl`.+ - A CLI binary is NEVER a skill. A SKILL.md-based capability is NEVER a tool. If unsure, check: does it have a `SKILL.md`? → skill. Is it invoked via shell/MCP? → tool.++### Stage 3: Write `workflow.md` (mermaid + steps + gates)++Author `workflow.md` using [templates/workflow.md.template](templates/workflow.md.template) as the starting skeleton. Three mandatory sections:++1. `## Overview` — **mermaid `graph LR/TD`** showing Leader entry, parallel/sequential teammate nodes, decision diamonds (degraded mode branches), integration node, output node. Mermaid is the primary expression difference vs single-agent skills. **Debate pattern**: MUST keep the **inter-member communication preference** note from the template — do NOT delete it when replacing the mermaid placeholder.+2. `## Detailed Steps` — numbered steps; each step contains: executor / input / output / serial-or-parallel / **quality gate** (what to do if this step's output fails). The last step contains the final report format template.+3. `## Acceptance Criteria` — judgement of a successful single run.++Quality gates are the contract surface between stages — design them per [reference/role-design.md](reference/role-design.md) § Gate Design.++### Stage 4: Write `bind.md` (numbers + behavior + failure)++Author `bind.md` using [templates/bind.md.template](templates/bind.md.template) as the starting skeleton. Three mandatory sections:++1. `## Resource Constraints` — table with at least: `max_parallel_teammates`, `total_wall_clock_budget`, `total_token_budget`. Add per-role limits if asymmetric.+2. `## Behavioral Constraints` — **team-level** rules (Leader does not write content / teammates cannot see each other's output / Leader does not resolve contradictions / etc.). Distinct from per-role `Boundary`. **Debate pattern MUST include**: phase-scoped visibility rules (which rounds are isolated, which are mutually visible) AND the inter-member communication preference order (direct peer-to-peer > shared blackboard > Leader-relay).+3. `## Failure Handling` — must cover **(a)** teammate failure (timeout, malformed output, retry policy, how missing outputs appear in the report) and **(b)** input-overscale degradation (e.g., diff > 2000 LOC → degrade to single-role mode).++Heuristic: if a constraint has a number or an exception path, it belongs in `bind.md`. If it's the main flow, it belongs in `workflow.md`.++### Stage 5: Write `dependencies.yaml` + `SKILL.md`++The remaining two files. Write them last because they reference content produced in Stages 2–4.++**5a. `dependencies.yaml`** — use [templates/dependencies.yaml.template](templates/dependencies.yaml.template). This file codifies the **auto-matching results from Stage 2**, not a blank-slate design. Both `skills:` and `tools:` segments are mandatory — write `[]` if empty, but only after the auto-matching scan confirms no matches (signals "checked, confirmed none" — different from "never looked"). Each `roles[].skills` and `roles[].tools` declared in SKILL.md frontmatter MUST appear here (the validator enforces this).++**5b. `SKILL.md`** — use [templates/SKILL.md.template](templates/SKILL.md.template). This is the entry point that ties together all other files. Body MUST contain `## Workflow` + `## Roles` + `## Files`.++**Naming rules** (enforced by the validator):+- Directory name = `name` field in SKILL.md frontmatter (kebab-case, ends with `-team` by convention).+- Each `roles/<id>.md` filename MUST equal the corresponding `roles[].id` in SKILL.md frontmatter.+- All 5 files are mandatory (the validator fails on any missing file).++**Description discipline** (enforced by the validator — these are the most-violated rules):+- ≤ 4 lines, ≤ 500 chars total.+- 3-line structure only: WHAT / WHEN / NOT. Do NOT add a separate `Triggers:` line.+- NO synonym enumeration — modern semantic match handles all variants from one natural sentence.+- NO numeric scope thresholds (e.g. `">200 LOC"`) → those belong in `bind.md`.+- NO Stage 0 justification rationale → that belongs in the body's intro paragraph.+- Per-role `purpose:` field has a ≤150 char HARD CAP. Detail belongs in `roles/<id>.md`, not in SKILL.md frontmatter.++**Calibration benchmark**: aim for **≤ 500 chars** (platform hard cap: 1024). Teamskills are inherently more complex than single-agent skills — multi-role composition, workflow scope, and trigger scenarios may need more words. Stay concise, but don't sacrifice clarity for arbitrary brevity.++### Stage 6: Validate++Run the automated validator:++```bash+python scripts/validate_teamskill.py path/to/<teamskill-name>/+```++The validator checks:+- **Structural**: 5 files present, role file names match `roles[].id`, no orphan role files+- **Frontmatter**: `name` / `description` / `version` / `kind: team-skill` / `roles[]` present; each role has `id` + `purpose`; `name` == directory name+- **Section presence**: SKILL.md body has `## Workflow` / `## Roles` / `## Files`; each `roles/*.md` has all 5 mandatory sections; `workflow.md` has `## Overview` / `## Detailed Steps` / `## Acceptance Criteria` (and at least one mermaid block); `bind.md` has all 3 mandatory sections+- **Cross-file consistency**: every `roles[].skills` and `roles[].tools` in SKILL.md appears in `dependencies.yaml`; every `## Identity` in roles starts with a `> *"..."*` motto line+- **Output discipline**: `## Inline Persona for Teammate` present in each role file; `dependencies.yaml` skills/tools segments present even if empty++**Exit code 0 = compliant**. Non-zero exit prints the failing checks with file:line references.++The manual checklist (for design-time judgment calls the script cannot automate, like "is this content really redundant?") lives in [reference/compliance-checklist.md](reference/compliance-checklist.md). Read it before declaring the Teamskill done.++### Post-generation: Creation Summary + Community Enrichment++After Stage 6 passes, present a **creation summary** to the user. This is the natural point to assess capability coverage and offer community enrichment — the Teamskill is already complete and functional, so community search is a zero-risk enhancement.++**Summary format:**++```+Teamskill: <name>+Pattern: <A | B | C | Mixed>+Roles: <count> (<list of role ids>)+Validator: PASS+```++**Per-role capability coverage:**++| Role | Assigned skills/tools | Recommend community search? |+|---|---|---|+| `<role-id>` | `<matched skills/tools, or "none">` | `<Yes / No — with reason>` |++**Recommendation logic — default is to recommend:**++For each role, evaluate whether to recommend community skill search:++- **Recommend** (default) — any role that could benefit from a **domain-specific** community skill. This includes roles that already have generic utility skills (like `web-research` or `curl`) but lack **domain-specialized** skills. A generic skill is NOT a substitute for domain expertise — see the anti-pattern below.+- **Do NOT recommend** — only when the role is **inherently self-sufficient**: its task is pure reasoning, judgment, or text generation that would not benefit from any external skill or tool. Examples: an adversarial critic whose job is to find logical flaws, a copy-editor whose job is to refine prose. These roles operate entirely within the LLM's native capabilities.++**Design intent**: the agent is structurally biased toward skipping community search. Two common rationalizations:++1. *"The role has no skills → but it can function on LLM knowledge alone"* — wrong in most cases. A role *can* function, but a matching skill often dramatically improves output quality.+2. *"The role already has a generic skill (e.g. `web-research`) → covered"* — **equally wrong and harder to catch**. A generic information-retrieval skill does NOT substitute for a domain-specific operational skill. `web-research` can search the web; a Taobao shopping skill knows store tiers, coupon stacking rules, platform-specific risk signals, and API-level price tracking — capabilities that no amount of generic search can replicate.++The default must be **recommend**, with the burden of proof on **not** recommending. The test is: *"Does a domain-specific community skill exist that would give this role capabilities beyond what its current generic skills provide?"* If plausible → recommend.++> **Anti-pattern: "通用即覆盖" (generic = covered)**+>+> In `ecommerce-compare-debate-team`, three platform shopper roles (`taobao-shopper`, `pinduoduo-shopper`, `jingdong-shopper`) each had `web-research` assigned. The agent concluded "already covered — no community search needed." This is wrong: `web-research` is general-purpose retrieval; it knows nothing about Taobao store tiers, PDD subsidy eligibility, or JD self-operated logistics. Community registries carry platform-specific shopping and buyer-agent skills that fill exactly this gap.+>+> **Rule**: if a role's identity is tied to a specific platform or professional domain, a generic utility skill does NOT count as coverage — always recommend community search for domain-specific skills.++**High-signal scenarios — MUST recommend** (non-exhaustive):++- **Binary/office file output** (PPTX, DOCX, XLSX, PDF) — LLM cannot generate binary formats natively; needs a skill wrapping python-pptx / docx etc.+- **Diagram/chart rendering** (Mermaid, Excalidraw, matplotlib) — LLM can describe but cannot render visuals without a generation skill.+- **Specific file format parsing** (CSV, images, audio, JSON-LD) — specialized parsing/validation skill is far more reliable than raw LLM attempts.+- **Domain-specific platform / service interaction** (e-commerce platforms, social media, financial services, travel booking, healthcare systems, government portals, etc.) — community registries often have skills that encode platform-specific rules, workflows, API integrations, or operational knowledge that generic retrieval skills cannot replicate. Examples: 淘宝/天猫购物 skills with store-tier logic, 京东 price-tracking skills, 拼多多 deal-finding skills, 买手/personal-shopper skills. A role whose identity is tied to a specific platform or professional domain should **always** trigger a community search, even if generic skills like `web-research` are already assigned.++If any role hits these patterns and no **domain-specific** local skill covers it, recommend "Yes" — do not rationalize it away with "the role can still produce text instructions" or "generic retrieval already handles it."++**Community enrichment prompt:**++If one or more roles are marked "Recommend: Yes", ask:++> *"The following roles have no domain-specific skills and could benefit from community skill enhancement:*+> *[table: Role | Current skills (if any) | What domain-specific skill would help]*+> *Shall I search community skill registries? The Teamskill is already complete — this is an optional enhancement. (Y/N)"*++If user says **Yes**:++Read [reference/community-search.md](reference/community-search.md) and follow its full procedure. Quick summary:++1. **Derive search queries** from each role's `purpose`, `Success Criteria`, and `Output Schema` — generate 2–3 keyword variants per role (see §1 Keyword Derivation).+2. **Multi-source parallel search** — run both Tier 1 CLIs simultaneously:+ - `npx skills find '<query>'` (skills.sh — keyword matching, install counts)+ - `skillnet search '<query>' --mode vector` (SkillNet — semantic vector search, quality evaluation)+ - If results are insufficient, escalate to Tier 2 web platforms (LLMBase, SkillsMP, LobeHub) and Tier 3 curated lists (awesome-agent-skills, awesome-claude-skills).+3. **Quality gates** — every candidate must pass: install count (≥ 1K preferred), source reputation, security rating, freshness (see §3).+4. **Role-skill fit test** — verify capability match and run the removal test: "would removing this skill significantly degrade the role's output?" (see §4).+5. **Present enrichment summary** to the user with the standardized format (see §5) — full transparency on what was searched, found, selected, and rejected.+6. Install approved skills, update `roles[].skills` in SKILL.md frontmatter + `dependencies.yaml` with `source: <community-url>`.+7. Re-run `python scripts/validate_teamskill.py` to confirm consistency.++If user says **No** → done. The Teamskill is fully functional as-is.++**Decision rules:**+- **Default: recommend** — empty `skills: []` = recommend community search; **also recommend** when a role only has generic utility skills (e.g. `web-research`) but lacks domain-specific skills matching its identity. Burden of proof is on NOT recommending.+- Prefer local over community — never search for capabilities already covered by a **domain-equivalent** local skill. A generic retrieval skill does NOT count as domain coverage.+- Per-role soft limit ≤ 1 community skill — if a role needs 2+, it may be too broad (consider splitting).+- Team-level soft limit: community deps ≤ role count — exceeding this signals over-engineering.+- Never force a dependency — mark `required: false` if the role can function without it.++## Roles++This skill has no Teamskill roles itself — it is a **single-agent skill** that authors Teamskills. The agent loading this skill plays the author/architect role.++## Files++| File | What it contains | When to read |+|---|---|---|+| [reference/pattern-selection.md](reference/pattern-selection.md) | A/B/C/Mixed pattern decision tree with worked examples | Stage 1a (before committing to a pattern) |+| [reference/role-design.md](reference/role-design.md) | How to author the 5 mandatory role sections; gate design between stages; anti-convergence techniques | Stage 2 + Stage 3 |+| [reference/conversion-guide.md](reference/conversion-guide.md) | Step-by-step methodology for converting a single-agent skill into a Teamskill, with a worked example | Stage 1b (CONVERT mode only) |+| [reference/compliance-checklist.md](reference/compliance-checklist.md) | Responsibility-attribution tests + manual-review checklist; explains what the validator can and cannot catch | Stage 6 (after the script passes) |+| [reference/community-search.md](reference/community-search.md) | Multi-source search strategy (keyword derivation, quality gates, role-skill fit test) for finding community skills | Post-generation (community enrichment step) |+| [templates/](templates/) | 5 file skeletons with placeholders and inline guidance comments | Stages 2–5 (each stage references its template) |+| [scripts/validate_teamskill.py](scripts/validate_teamskill.py) | Automated structural + frontmatter + section + cross-file consistency checks | Stage 6 (run on every Teamskill before declaring done) |++## Common pitfalls++Detailed pitfall analysis is in the reference files — read them during the corresponding stage:++- **Role authoring mistakes** (motto, boundary, persona): [reference/role-design.md](reference/role-design.md) § Putting it together: a role file checklist+- **Content quality judgment calls** (anti-convergence, gate strength, bind numbers): [reference/compliance-checklist.md](reference/compliance-checklist.md) Part B+- **Pattern selection errors** (council of clones, pipeline without gates, decomposition without disjointness): [reference/pattern-selection.md](reference/pattern-selection.md) § Anti-patterns++The three most common **structural** mistakes (caught by the validator, but worth internalizing):++1. **Skipping auto-matching in Stage 2** — jumping from role design to empty `skills: []` / `tools: []` without scanning locally available skills/tools. Fix: always run the auto-matching sub-step; empty lists are valid only after the scan confirms no matches.+2. **`roles[].skills` declared in SKILL.md but missing from `dependencies.yaml`** — silent contract violation. Fix: run the validator.+3. **Mermaid in SKILL.md body** — duplicating the diagram from `workflow.md`. Mermaid belongs only in `workflow.md`.++## Quick start++For a CREATE request:++1. Confirm Stage 0 justification with the user (which failure mode does single-agent hit?)+2. Read [reference/pattern-selection.md](reference/pattern-selection.md) and pick A / B / C / mixed+3. Write all `roles/<id>.md` files (motto, boundary, schema, inline persona) + auto-match local skills/tools+4. Write `workflow.md` → `bind.md` → `dependencies.yaml` → `SKILL.md` (each using its template)+5. Run `python scripts/validate_teamskill.py <teamskill-name>/` until exit 0+6. Present creation summary with per-role capability coverage → recommend community search for roles lacking **domain-specific** skills (default: recommend; generic utility skills do NOT satisfy the threshold)+7. Manual review with [reference/compliance-checklist.md](reference/compliance-checklist.md)++For a CONVERT request:++1. Read the source single-agent SKILL.md+2. Apply [reference/conversion-guide.md](reference/conversion-guide.md) decomposition checklist+3. Articulate "what is lost in single-agent form" — this is the Stage 0 justification+4. Continue from CREATE step 2 (pattern selection) onward+5. Add a `MIGRATION.md` (optional) to the new Teamskill explaining the source skill, the decomposition rationale, and the team-vs-single delta++For a MODIFY request:++1. Identify the change type from the impact matrix below+2. Re-run the indicated stages; apply edits honoring the section + structure rules (mottos, Forbidden+Mandatory, Inline Persona, gates, numeric bind constraints)+3. Run `python scripts/validate_teamskill.py <teamskill-name>/` — **Stage 6 is mandatory regardless of edit size**++#### MODIFY impact matrix++| Change type | Re-run stages | Files to update |+|---|---|---|+| Edit role Identity / Boundary / Schema | Stage 2 (affected role only) | `roles/<id>.md` |+| Add or remove a role | Stage 1a + 2 + 3 + 4 + 5 | All 5 files |+| Change workflow steps / topology | Stage 3 | `workflow.md` + `bind.md` (if constraints change) |+| Change bind constraints | Stage 4 | `bind.md` |+| Change dependencies | Stage 2 (auto-match) + 5 | `dependencies.yaml` + `SKILL.md` frontmatter |+| Edit SKILL.md description / purpose | Stage 5b | `SKILL.md` |++All rows require **Stage 6 (validator)** as the final step.diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/reference/community-search.md b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/reference/community-search.mdsimilarity index 98%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/reference/community-search.mdrename to jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/reference/community-search.mdindex 727a82e3a9..2ac8c26ecf 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/reference/community-search.md+++ b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/reference/community-search.md@@ -1,177 +1,177 @@-# Community Skill Search Guide--How to find, evaluate, and install community skills for Teamskill roles. Read this file when executing the Post-generation community enrichment step.--## 1. Keyword Derivation--The #1 failure mode is bad search queries. Do NOT freestyle keywords — derive them systematically from the role spec.--### Extraction sources (in priority order)--For each role that needs a community skill, read these fields and extract terms:--1. **`purpose` field** (SKILL.md frontmatter) — the most compressed description of what the role does. Extract the **verb** (generate, parse, render, analyze, review, audit) and the **object** (diagram, pptx, security, performance).-2. **`Success Criteria`** (roles/\<id\>.md) — look for deliverable types and quality dimensions. Example: "Produces an Excalidraw JSON diagram" → search terms: `excalidraw`, `diagram`.-3. **`Output Schema`** (roles/\<id\>.md) — if the output is a specific file format, that format IS the search term. Example: output is `.pptx` → search `pptx` or `presentation`.--### Query formulation rules--- **Structure**: `<capability-verb> <domain-noun>` — e.g., `generate pptx`, `review security`, `parse csv`.-- **Always generate 2–3 query variants** per role. Use synonyms and specificity levels:- - Specific: `excalidraw diagram`- - Broader: `diagram generation`- - Domain: `architecture visualization`-- **English only** — all major registries index in English. Translate Chinese terms before searching.-- **Avoid generic terms alone** — `code`, `review`, `write` are too broad. Always pair with a domain noun.-- **Include output format when applicable** — `pptx`, `docx`, `xlsx`, `pdf`, `svg`, `mermaid` are high-signal terms that dramatically narrow results.--### Worked example--Role: a "diagram-renderer" whose purpose is "Render architecture diagrams as Excalidraw JSON files."--| Source | Extracted terms |-|---|---|-| purpose | render, architecture, diagram, excalidraw, JSON |-| Success Criteria | "valid Excalidraw JSON", "auto-layout" |-| Output Schema | `.excalidraw` file |--Generated queries:-1. `excalidraw diagram` (specific)-2. `architecture diagram` (broader)-3. `canvas design` (alternative — Excalidraw skills sometimes use "canvas" in their name)--## 2. Multi-Source Search Strategy--Do NOT rely on a single registry. Use the two CLI sources **in parallel**, then cross-verify on web platforms.--### Tier 1: CLI Search (parallel — run both)--| Source | CLI | Search command | Install command | Strength |-|---|---|---|---|---|-| **skills.sh** | `npx skills` (Node) | `npx skills find '<query>'` | `npx skills add <owner/repo@skill> -g -y` | Largest install-count dataset, security scores |-| **SkillNet** | `skillnet` (Python: `pip install skillnet-ai`) | `skillnet search '<query>' --mode vector` | `skillnet download <url> -d ./skills` | **Semantic vector search** — finds results even when keywords don't exactly match |--**Why both**: skills.sh uses keyword matching and may miss relevant skills when your query terms don't match the skill's title/description verbatim. SkillNet uses vector similarity and finds semantically related skills even with imperfect queries. They index overlapping but not identical skill sets.--**Windows note**: on Windows, wrap `npx` commands in `powershell -Command "..."` to avoid empty output. `skillnet` (Python) works natively in any terminal.--### Tier 2: Web Verification + Broader Search--After CLI search returns candidates, or if CLI results are poor, use these web platforms:--| Source | URL | Use for |-|---|---|---|-| **LLMBase** | [llmbase.ai/skills/](https://llmbase.ai/skills/) | Verify install counts + security ratings (Safe/Medium/Critical); Top Sources ranking |-| **SkillsMP** | [skillsmp.com](https://skillsmp.com) | Broadest GitHub index (425K+); AI-powered search; category filtering |-| **LobeHub** | [lobehub.com/skills](https://lobehub.com/skills) | Community feedback; alternative categorization |-| **SkillNet Web** | [skillnet.openkg.cn](http://skillnet.openkg.cn/) | Browse curated collections; skill relationship graph |-| **skills.sh Leaderboard** | [skills.sh](https://skills.sh/) | Quick scan of top-installed skills by category |--### Tier 3: Curated Lists (high signal-to-noise fallback)--When CLI + web search return no good matches, browse these human-curated lists:--| Source | URL | Coverage |-|---|---|---|-| **awesome-agent-skills** | [github.com/heilcheng/awesome-agent-skills](https://github.com/heilcheng/awesome-agent-skills) | Cross-agent (Claude, Cursor, Copilot), tutorials + directories |-| **awesome-claude-skills** | [github.com/ComposioHQ/awesome-claude-skills](https://github.com/ComposioHQ/awesome-claude-skills) | Claude ecosystem deep-dive |-| **Antigravity awesome-skills** | [github.com/antigravity-ai/awesome-skills](https://github.com/antigravity-ai/awesome-skills) | 1200+ skills organized by **role bundles** (Web Wizard, Security Engineer, etc.) — particularly useful for Teamskill roles since the bundles map to role archetypes |--### Search procedure (step by step)--```-1. Derive 2–3 query variants per role (§1 above)-2. Run BOTH Tier 1 CLIs in parallel with each query variant- - npx skills find '<query>'- - skillnet search '<query>' --mode vector-3. Collect unique candidates from both sources-4. If < 2 candidates found → try Tier 2 web platforms with the same queries-5. If still < 2 candidates → browse Tier 3 curated lists by role archetype-6. Apply quality gates (§3 below) to all candidates-7. Apply role-fit test (§4 below) to surviving candidates-```--## 3. Quality Gates--Do NOT install a skill just because it appeared in search results. Every candidate MUST pass these gates:--### Gate 1: Install Count--| Threshold | Action |-|---|---|-| ≥ 10K installs | **Strong signal** — use with confidence |-| 1K–10K installs | **Moderate** — acceptable if source is reputable |-| 100–1K installs | **Weak** — only if no better alternative exists AND source passes Gate 2 |-| < 100 installs | **Reject** — too risky for a dependency |--Where to check: skills.sh leaderboard, LLMBase skill page, `npx skills` output (shows install count).--### Gate 2: Source Reputation--Prefer skills from known, maintained sources:--**Trusted sources** (non-exhaustive):-- `vercel-labs/agent-skills` — React, Next.js, web design-- `anthropics/skills` — frontend design, document processing (pdf, pptx)-- `microsoft/azure-skills` — cloud, infrastructure-- `firebase/agent-skills` — Firebase ecosystem-- `supabase/agent-skills` — database, backend-- `coreyhaines31/marketingskills` — marketing, SEO, copywriting-- `remotion-dev/skills` — video generation-- `google-labs-code/stitch-skills` — Google design system-- `expo/skills`, `flutter/skills` — mobile development--**Caution signals**:-- Unknown author with no GitHub profile-- Repository with < 50 stars-- No commits in the last 6 months-- Skill description is vague or generic--### Gate 3: Security Rating--Check the security rating on LLMBase or skills.sh:--| Rating | Action |-|---|---|-| **Safe** | Install freely |-| **Medium** | Acceptable — review the skill content before installing |-| **Critical** | Do NOT install unless explicitly approved by the user. Flag in the enrichment summary |--### Gate 4: Freshness--Check the source repository's last commit date. Skills based on framework best practices become stale quickly.--| Last updated | Action |-|---|---|-| Within 3 months | Current |-| 3–6 months | Acceptable |-| > 6 months | Flag as potentially stale — verify the content still applies |--## 4. Role-Skill Fit Test--After a candidate passes quality gates, evaluate whether it actually fits the role. Ask:--1. **Capability match**: Does this skill provide a capability the role's `Success Criteria` requires? If the skill teaches "React best practices" but the role produces "security audit reports," it's not a fit — even if both mention "code."-2. **Removal test**: If you removed this skill, would the role's output quality **significantly** drop? "Significantly" means: the role would produce noticeably worse deliverables, not just slightly less polished ones. If the answer is "no," don't install.-3. **Overlap test**: Does this skill's capability overlap with another role's assigned skill? Cross-role skill sharing is a code smell — each skill should enhance exactly one role.-4. **Format necessity**: If the role outputs a specific file format (PPTX, XLSX, Excalidraw JSON), the skill MUST handle that format's generation/manipulation. A skill that only provides "guidelines" without generation capability is not sufficient.--## 5. Enrichment Summary Format--After completing the search, present results in this format:--```-## Community Skill Search Results--| Role | Query used | Candidates found | Selected | Install count | Security | Reason |-|---|---|---|---|---|---|---|-| <role-id> | <best query> | <N total> | <skill name or "none"> | <count> | <Safe/Med/Crit> | <1-line fit rationale> |--### Install commands-<for each selected skill, the exact install command>--### Skipped candidates-<for each rejected candidate: name, rejection reason (failed which gate)>-```--This format gives the user full transparency on what was searched, what was found, and why each decision was made.+# Community Skill Search Guide++How to find, evaluate, and install community skills for Teamskill roles. Read this file when executing the Post-generation community enrichment step.++## 1. Keyword Derivation++The #1 failure mode is bad search queries. Do NOT freestyle keywords — derive them systematically from the role spec.++### Extraction sources (in priority order)++For each role that needs a community skill, read these fields and extract terms:++1. **`purpose` field** (SKILL.md frontmatter) — the most compressed description of what the role does. Extract the **verb** (generate, parse, render, analyze, review, audit) and the **object** (diagram, pptx, security, performance).+2. **`Success Criteria`** (roles/\<id\>.md) — look for deliverable types and quality dimensions. Example: "Produces an Excalidraw JSON diagram" → search terms: `excalidraw`, `diagram`.+3. **`Output Schema`** (roles/\<id\>.md) — if the output is a specific file format, that format IS the search term. Example: output is `.pptx` → search `pptx` or `presentation`.++### Query formulation rules++- **Structure**: `<capability-verb> <domain-noun>` — e.g., `generate pptx`, `review security`, `parse csv`.+- **Always generate 2–3 query variants** per role. Use synonyms and specificity levels:+ - Specific: `excalidraw diagram`+ - Broader: `diagram generation`+ - Domain: `architecture visualization`+- **English only** — all major registries index in English. Translate Chinese terms before searching.+- **Avoid generic terms alone** — `code`, `review`, `write` are too broad. Always pair with a domain noun.+- **Include output format when applicable** — `pptx`, `docx`, `xlsx`, `pdf`, `svg`, `mermaid` are high-signal terms that dramatically narrow results.++### Worked example++Role: a "diagram-renderer" whose purpose is "Render architecture diagrams as Excalidraw JSON files."++| Source | Extracted terms |+|---|---|+| purpose | render, architecture, diagram, excalidraw, JSON |+| Success Criteria | "valid Excalidraw JSON", "auto-layout" |+| Output Schema | `.excalidraw` file |++Generated queries:+1. `excalidraw diagram` (specific)+2. `architecture diagram` (broader)+3. `canvas design` (alternative — Excalidraw skills sometimes use "canvas" in their name)++## 2. Multi-Source Search Strategy++Do NOT rely on a single registry. Use the two CLI sources **in parallel**, then cross-verify on web platforms.++### Tier 1: CLI Search (parallel — run both)++| Source | CLI | Search command | Install command | Strength |+|---|---|---|---|---|+| **skills.sh** | `npx skills` (Node) | `npx skills find '<query>'` | `npx skills add <owner/repo@skill> -g -y` | Largest install-count dataset, security scores |+| **SkillNet** | `skillnet` (Python: `pip install skillnet-ai`) | `skillnet search '<query>' --mode vector` | `skillnet download <url> -d ./skills` | **Semantic vector search** — finds results even when keywords don't exactly match |++**Why both**: skills.sh uses keyword matching and may miss relevant skills when your query terms don't match the skill's title/description verbatim. SkillNet uses vector similarity and finds semantically related skills even with imperfect queries. They index overlapping but not identical skill sets.++**Windows note**: on Windows, wrap `npx` commands in `powershell -Command "..."` to avoid empty output. `skillnet` (Python) works natively in any terminal.++### Tier 2: Web Verification + Broader Search++After CLI search returns candidates, or if CLI results are poor, use these web platforms:++| Source | URL | Use for |+|---|---|---|+| **LLMBase** | [llmbase.ai/skills/](https://llmbase.ai/skills/) | Verify install counts + security ratings (Safe/Medium/Critical); Top Sources ranking |+| **SkillsMP** | [skillsmp.com](https://skillsmp.com) | Broadest GitHub index (425K+); AI-powered search; category filtering |+| **LobeHub** | [lobehub.com/skills](https://lobehub.com/skills) | Community feedback; alternative categorization |+| **SkillNet Web** | [skillnet.openkg.cn](http://skillnet.openkg.cn/) | Browse curated collections; skill relationship graph |+| **skills.sh Leaderboard** | [skills.sh](https://skills.sh/) | Quick scan of top-installed skills by category |++### Tier 3: Curated Lists (high signal-to-noise fallback)++When CLI + web search return no good matches, browse these human-curated lists:++| Source | URL | Coverage |+|---|---|---|+| **awesome-agent-skills** | [github.com/heilcheng/awesome-agent-skills](https://github.com/heilcheng/awesome-agent-skills) | Cross-agent (Claude, Cursor, Copilot), tutorials + directories |+| **awesome-claude-skills** | [github.com/ComposioHQ/awesome-claude-skills](https://github.com/ComposioHQ/awesome-claude-skills) | Claude ecosystem deep-dive |+| **Antigravity awesome-skills** | [github.com/antigravity-ai/awesome-skills](https://github.com/antigravity-ai/awesome-skills) | 1200+ skills organized by **role bundles** (Web Wizard, Security Engineer, etc.) — particularly useful for Teamskill roles since the bundles map to role archetypes |++### Search procedure (step by step)++```+1. Derive 2–3 query variants per role (§1 above)+2. Run BOTH Tier 1 CLIs in parallel with each query variant+ - npx skills find '<query>'+ - skillnet search '<query>' --mode vector+3. Collect unique candidates from both sources+4. If < 2 candidates found → try Tier 2 web platforms with the same queries+5. If still < 2 candidates → browse Tier 3 curated lists by role archetype+6. Apply quality gates (§3 below) to all candidates+7. Apply role-fit test (§4 below) to surviving candidates+```++## 3. Quality Gates++Do NOT install a skill just because it appeared in search results. Every candidate MUST pass these gates:++### Gate 1: Install Count++| Threshold | Action |+|---|---|+| ≥ 10K installs | **Strong signal** — use with confidence |+| 1K–10K installs | **Moderate** — acceptable if source is reputable |+| 100–1K installs | **Weak** — only if no better alternative exists AND source passes Gate 2 |+| < 100 installs | **Reject** — too risky for a dependency |++Where to check: skills.sh leaderboard, LLMBase skill page, `npx skills` output (shows install count).++### Gate 2: Source Reputation++Prefer skills from known, maintained sources:++**Trusted sources** (non-exhaustive):+- `vercel-labs/agent-skills` — React, Next.js, web design+- `anthropics/skills` — frontend design, document processing (pdf, pptx)+- `microsoft/azure-skills` — cloud, infrastructure+- `firebase/agent-skills` — Firebase ecosystem+- `supabase/agent-skills` — database, backend+- `coreyhaines31/marketingskills` — marketing, SEO, copywriting+- `remotion-dev/skills` — video generation+- `google-labs-code/stitch-skills` — Google design system+- `expo/skills`, `flutter/skills` — mobile development++**Caution signals**:+- Unknown author with no GitHub profile+- Repository with < 50 stars+- No commits in the last 6 months+- Skill description is vague or generic++### Gate 3: Security Rating++Check the security rating on LLMBase or skills.sh:++| Rating | Action |+|---|---|+| **Safe** | Install freely |+| **Medium** | Acceptable — review the skill content before installing |+| **Critical** | Do NOT install unless explicitly approved by the user. Flag in the enrichment summary |++### Gate 4: Freshness++Check the source repository's last commit date. Skills based on framework best practices become stale quickly.++| Last updated | Action |+|---|---|+| Within 3 months | Current |+| 3–6 months | Acceptable |+| > 6 months | Flag as potentially stale — verify the content still applies |++## 4. Role-Skill Fit Test++After a candidate passes quality gates, evaluate whether it actually fits the role. Ask:++1. **Capability match**: Does this skill provide a capability the role's `Success Criteria` requires? If the skill teaches "React best practices" but the role produces "security audit reports," it's not a fit — even if both mention "code."+2. **Removal test**: If you removed this skill, would the role's output quality **significantly** drop? "Significantly" means: the role would produce noticeably worse deliverables, not just slightly less polished ones. If the answer is "no," don't install.+3. **Overlap test**: Does this skill's capability overlap with another role's assigned skill? Cross-role skill sharing is a code smell — each skill should enhance exactly one role.+4. **Format necessity**: If the role outputs a specific file format (PPTX, XLSX, Excalidraw JSON), the skill MUST handle that format's generation/manipulation. A skill that only provides "guidelines" without generation capability is not sufficient.++## 5. Enrichment Summary Format++After completing the search, present results in this format:++```+## Community Skill Search Results++| Role | Query used | Candidates found | Selected | Install count | Security | Reason |+|---|---|---|---|---|---|---|+| <role-id> | <best query> | <N total> | <skill name or "none"> | <count> | <Safe/Med/Crit> | <1-line fit rationale> |++### Install commands+<for each selected skill, the exact install command>++### Skipped candidates+<for each rejected candidate: name, rejection reason (failed which gate)>+```++This format gives the user full transparency on what was searched, what was found, and why each decision was made.diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/reference/compliance-checklist.md b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/reference/compliance-checklist.mdsimilarity index 98%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/reference/compliance-checklist.mdrename to jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/reference/compliance-checklist.mdindex ecc2e55581..99b073f13a 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/reference/compliance-checklist.md+++ b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/reference/compliance-checklist.md@@ -1,180 +1,180 @@-# Compliance Checklist--> Read in **Stage 6** after the validator script passes. The script catches structural / frontmatter / section-presence / cross-file errors. This checklist catches **judgment calls the script cannot automate** — the responsibility-attribution tests that decide whether new fields belong in the spec, plus content-quality checks.--## What the validator script catches (do not duplicate here)--The validator handles:-- Five-file structure (SKILL.md / roles/ / workflow.md / bind.md / dependencies.yaml)-- Frontmatter required fields (`name`, `description`, `version`, `kind: team-skill`, `roles[]`)-- Each `roles[].id` has matching `roles/<id>.md`-- Each role file has the 5 mandatory sections-- Each Identity starts with `> *"..."*`-- `workflow.md` has Overview/Detailed Steps/Acceptance Criteria + at least one mermaid block-- `bind.md` has Resource Constraints / Behavioral Constraints / Failure Handling-- `dependencies.yaml` has both `skills:` and `tools:` segments-- Every `roles[].skills` and `roles[].tools` declared in SKILL.md appears in dependencies.yaml--If the script reports failures, fix them first. **This checklist starts where the script ends.**-------## Part A: Responsibility-attribution tests--For each new section / field / rule you introduce beyond the templates, run these tests. Any candidate that fails one or more tests should be rejected or moved out of the spec.--### Test 1 — Consumer-and-time check (run BEFORE any redundancy claim)--Before declaring two things "redundant", verify their **consumers and timing** are the same.--- `description` (system-prompt-time, decides trigger) vs `## Workflow` (already-triggered Agent reading body) → different consumers → NOT redundant.-- `## Workflow` in SKILL.md (prose summary) vs `workflow.md` (full mermaid + steps) → same consumer (Leader), different depth → NOT redundant; SKILL.md links to workflow.md.-- mermaid in SKILL.md body vs mermaid in workflow.md → SAME consumer (reader visualizing flow) → REDUNDANT → keep only in workflow.md.--### Test 2 — Registry / store concern?--If the candidate field is about discovery, recommendation, download counts, tier, popularity → **registry concern, not Teamskill spec**. Examples: `tier`, `downloads`, `category` for browsing.--### Test 3 — Runtime / framework concern?--If the candidate field is about how the framework wires dependencies, dispatches teammates, or implements messaging → **framework concern, not Teamskill spec**. Examples: `teammate_mode`, `install_command`, message format. The Teamskill MAY declare a **preference order** for inter-member communication (e.g., direct peer-to-peer > shared blackboard > Leader-relay), but MUST NOT mandate a specific mechanism.--### Test 4 — Tutorial / docs concern?--If the candidate content is long-form examples, anti-patterns, common pitfalls — and it's NOT actionable at runtime → **docs concern**. Move to `examples/` directory or external README. **Exception**: short bullet-style guidance in templates is fine.--### Test 5 — Already in git / filesystem metadata?--If the candidate field is mtime, author, commit history, file size → **already in git / FS**. Do not duplicate.--### Test 6 — Already defined elsewhere?--After Test 1 (consumer-and-time check), if two locations carry the same content for the same consumer at the same time → keep one, delete the other.--### Test 7 — Internal implementation leaking?--If the candidate field exposes session IDs, internal trace handles, framework-specific identifiers → **leak**. Hide it.--### Test 8 — Machine-verifiable?--If the field is purely human-written prose with no machine-checkable correctness → **risky**. Keep only if the value-to-verifiability ratio is high. Most natural-language sections are accepted because their value is high; new fields should justify themselves.--### Test 9 — Future-use safety net--Before deleting a long-unused field, consider whether a planned future field would give it new purpose. Leave it as **optional** if uncertain. Do not judge a field in isolation when the surrounding spec is still evolving.-------## Part B: Content-quality manual checks (judgement calls)--The validator confirms structure exists. These checks confirm the structure is **good**:--### B1. Identity mottos — anti-convergence--Read all role mottos as a list. Apply this test:--> *"If I shuffled these mottos and asked a reader to assign each motto to a role file, could they do it correctly without context?"*--If yes → mottos are distinctive. If no → roles will converge in output. Rewrite the offending mottos using [role-design.md](role-design.md) § Anti-convergence techniques.--### B2. Boundary completeness--For each role, read its `Boundary` and ask:--- **Forbidden**: does the list mention every sibling role's territory? (For A/B patterns where overlap is the risk.)-- **Mandatory**: does the list prevent silent under-delivery? (For roles that might output "looks fine" or skip slices.)--A `Boundary` with only Forbidden tends to produce empty findings. A `Boundary` with only Mandatory tends to produce role overlap. Both halves work as opposing forces.--### B3. Inline Persona self-containment--For each role's `## Inline Persona for Teammate`, do this test:--> *"If I copy-pasted this prompt verbatim into a fresh agent with no other context, could it produce a valid output that matches the schema?"*--Common gaps:-- Persona references "the team" or "the Leader" without explaining → opaque to a teammate-- Persona mentions methodology (STRIDE, SCQA) without defining it → teammate might not know it-- Placeholders like `{INPUT}` are present but not labeled → unclear what to fill in-- Output format described in prose but not shown as a literal template → teammate guesses structure--### B4. Workflow gates have teeth--For each step in `workflow.md > Detailed Steps`, verify:--- The step has a **quality gate** declared (pass criteria + fail action).-- The fail action is **specific** ("retry once, then mark missing in report" — not "handle failure").-- For C-pattern stage transitions, `bind.md` declares "Stage N+1 MUST refuse to start if gate FAIL".--A workflow without enforceable gates is just prose; the team will skip steps under load.--### B5. Bind numbers are real--Check `bind.md > Resource Constraints` numbers against the workflow:--- `max_parallel_teammates` ≥ the largest parallel fan-out in the mermaid diagram-- `total_wall_clock_budget` ≥ sum of sequential stage budgets-- `total_token_budget` ≥ rough estimate of (per-role tokens × N roles)--Numbers that don't match the workflow are theater.--### B6. Failure handling covers both required scenarios--`Failure Handling` MUST cover:--- (a) **Teammate failure** — timeout, malformed output, retry policy, missing-output reporting-- (b) **Input over-scale degradation** — what triggers degraded mode, what the degraded mode does, how the user is warned--Re-read your `Failure Handling` and confirm both are present. Most authoring errors omit (b).--### B7. dependencies.yaml has user-facing `purpose` lines--Each `skills[]` and `tools[]` entry has a `purpose` field that is **human-readable** and **explains the consequence of missing**:--- Good: `purpose: locate symbols and call sites in the diff`-- Bad: `purpose: code-search dependency`-- Bad: `purpose: required for the skill`--The `purpose` field is shown to the user during pre-flight checks when a dependency is missing. Write it for that audience.--### B8. SKILL.md description is a real trigger--Read the `description` and ask:--- Does it state **WHEN** to use? ("Use when: ...")-- Does it state **WHEN NOT** to use? ("DO NOT use for: ...")-- Does it list 1–3 **trigger phrases** that the agent should recognize?-- Is it 1–5 lines (system prompts hard-cap descriptions)?--A description that omits "when not to use" causes the skill to over-trigger. A description without trigger phrases causes the skill to under-trigger.-------## Part C: Cross-Teamskill consistency (only when publishing multiple together)--When publishing a batch of Teamskills as a coherent set:--- [ ] Naming convention: all Teamskills end with `-team` suffix-- [ ] Frontmatter `version` consistent across the batch-- [ ] Description structure follows the same template ("Use when..." / "DO NOT use for..." / "Triggers...")-- [ ] No two Teamskills overlap in trigger conditions (they would compete in the trigger system)-- [ ] All Teamskills produce structurally similar Final Reports (tiered, schema-based) so users learn one mental model--Cross-Teamskill consistency is a usability concern, not a per-skill compliance rule.-------## Final sign-off ritual--Once all above checks pass, write a 2-line sign-off in the conversation (not in any file):--```-Teamskill: <name>-Pattern: <A | B | C | A+B | B+C | C+A | C+B+A | Debate>-Roles: <count> (<list of role ids>)-Validator: PASS-Manual checks: PASS (all responsibility-attribution and content-quality tests)-Justification: <1-line Stage 0 reason this team beats single-agent>-```--This forces a final articulation of the Teamskill's reason to exist.+# Compliance Checklist++> Read in **Stage 6** after the validator script passes. The script catches structural / frontmatter / section-presence / cross-file errors. This checklist catches **judgment calls the script cannot automate** — the responsibility-attribution tests that decide whether new fields belong in the spec, plus content-quality checks.++## What the validator script catches (do not duplicate here)++The validator handles:+- Five-file structure (SKILL.md / roles/ / workflow.md / bind.md / dependencies.yaml)+- Frontmatter required fields (`name`, `description`, `version`, `kind: team-skill`, `roles[]`)+- Each `roles[].id` has matching `roles/<id>.md`+- Each role file has the 5 mandatory sections+- Each Identity starts with `> *"..."*`+- `workflow.md` has Overview/Detailed Steps/Acceptance Criteria + at least one mermaid block+- `bind.md` has Resource Constraints / Behavioral Constraints / Failure Handling+- `dependencies.yaml` has both `skills:` and `tools:` segments+- Every `roles[].skills` and `roles[].tools` declared in SKILL.md appears in dependencies.yaml++If the script reports failures, fix them first. **This checklist starts where the script ends.**++---++## Part A: Responsibility-attribution tests++For each new section / field / rule you introduce beyond the templates, run these tests. Any candidate that fails one or more tests should be rejected or moved out of the spec.++### Test 1 — Consumer-and-time check (run BEFORE any redundancy claim)++Before declaring two things "redundant", verify their **consumers and timing** are the same.++- `description` (system-prompt-time, decides trigger) vs `## Workflow` (already-triggered Agent reading body) → different consumers → NOT redundant.+- `## Workflow` in SKILL.md (prose summary) vs `workflow.md` (full mermaid + steps) → same consumer (Leader), different depth → NOT redundant; SKILL.md links to workflow.md.+- mermaid in SKILL.md body vs mermaid in workflow.md → SAME consumer (reader visualizing flow) → REDUNDANT → keep only in workflow.md.++### Test 2 — Registry / store concern?++If the candidate field is about discovery, recommendation, download counts, tier, popularity → **registry concern, not Teamskill spec**. Examples: `tier`, `downloads`, `category` for browsing.++### Test 3 — Runtime / framework concern?++If the candidate field is about how the framework wires dependencies, dispatches teammates, or implements messaging → **framework concern, not Teamskill spec**. Examples: `teammate_mode`, `install_command`, message format. The Teamskill MAY declare a **preference order** for inter-member communication (e.g., direct peer-to-peer > shared blackboard > Leader-relay), but MUST NOT mandate a specific mechanism.++### Test 4 — Tutorial / docs concern?++If the candidate content is long-form examples, anti-patterns, common pitfalls — and it's NOT actionable at runtime → **docs concern**. Move to `examples/` directory or external README. **Exception**: short bullet-style guidance in templates is fine.++### Test 5 — Already in git / filesystem metadata?++If the candidate field is mtime, author, commit history, file size → **already in git / FS**. Do not duplicate.++### Test 6 — Already defined elsewhere?++After Test 1 (consumer-and-time check), if two locations carry the same content for the same consumer at the same time → keep one, delete the other.++### Test 7 — Internal implementation leaking?++If the candidate field exposes session IDs, internal trace handles, framework-specific identifiers → **leak**. Hide it.++### Test 8 — Machine-verifiable?++If the field is purely human-written prose with no machine-checkable correctness → **risky**. Keep only if the value-to-verifiability ratio is high. Most natural-language sections are accepted because their value is high; new fields should justify themselves.++### Test 9 — Future-use safety net++Before deleting a long-unused field, consider whether a planned future field would give it new purpose. Leave it as **optional** if uncertain. Do not judge a field in isolation when the surrounding spec is still evolving.++---++## Part B: Content-quality manual checks (judgement calls)++The validator confirms structure exists. These checks confirm the structure is **good**:++### B1. Identity mottos — anti-convergence++Read all role mottos as a list. Apply this test:++> *"If I shuffled these mottos and asked a reader to assign each motto to a role file, could they do it correctly without context?"*++If yes → mottos are distinctive. If no → roles will converge in output. Rewrite the offending mottos using [role-design.md](role-design.md) § Anti-convergence techniques.++### B2. Boundary completeness++For each role, read its `Boundary` and ask:++- **Forbidden**: does the list mention every sibling role's territory? (For A/B patterns where overlap is the risk.)+- **Mandatory**: does the list prevent silent under-delivery? (For roles that might output "looks fine" or skip slices.)++A `Boundary` with only Forbidden tends to produce empty findings. A `Boundary` with only Mandatory tends to produce role overlap. Both halves work as opposing forces.++### B3. Inline Persona self-containment++For each role's `## Inline Persona for Teammate`, do this test:++> *"If I copy-pasted this prompt verbatim into a fresh agent with no other context, could it produce a valid output that matches the schema?"*++Common gaps:+- Persona references "the team" or "the Leader" without explaining → opaque to a teammate+- Persona mentions methodology (STRIDE, SCQA) without defining it → teammate might not know it+- Placeholders like `{INPUT}` are present but not labeled → unclear what to fill in+- Output format described in prose but not shown as a literal template → teammate guesses structure++### B4. Workflow gates have teeth++For each step in `workflow.md > Detailed Steps`, verify:++- The step has a **quality gate** declared (pass criteria + fail action).+- The fail action is **specific** ("retry once, then mark missing in report" — not "handle failure").+- For C-pattern stage transitions, `bind.md` declares "Stage N+1 MUST refuse to start if gate FAIL".++A workflow without enforceable gates is just prose; the team will skip steps under load.++### B5. Bind numbers are real++Check `bind.md > Resource Constraints` numbers against the workflow:++- `max_parallel_teammates` ≥ the largest parallel fan-out in the mermaid diagram+- `total_wall_clock_budget` ≥ sum of sequential stage budgets+- `total_token_budget` ≥ rough estimate of (per-role tokens × N roles)++Numbers that don't match the workflow are theater.++### B6. Failure handling covers both required scenarios++`Failure Handling` MUST cover:++- (a) **Teammate failure** — timeout, malformed output, retry policy, missing-output reporting+- (b) **Input over-scale degradation** — what triggers degraded mode, what the degraded mode does, how the user is warned++Re-read your `Failure Handling` and confirm both are present. Most authoring errors omit (b).++### B7. dependencies.yaml has user-facing `purpose` lines++Each `skills[]` and `tools[]` entry has a `purpose` field that is **human-readable** and **explains the consequence of missing**:++- Good: `purpose: locate symbols and call sites in the diff`+- Bad: `purpose: code-search dependency`+- Bad: `purpose: required for the skill`++The `purpose` field is shown to the user during pre-flight checks when a dependency is missing. Write it for that audience.++### B8. SKILL.md description is a real trigger++Read the `description` and ask:++- Does it state **WHEN** to use? ("Use when: ...")+- Does it state **WHEN NOT** to use? ("DO NOT use for: ...")+- Does it list 1–3 **trigger phrases** that the agent should recognize?+- Is it 1–5 lines (system prompts hard-cap descriptions)?++A description that omits "when not to use" causes the skill to over-trigger. A description without trigger phrases causes the skill to under-trigger.++---++## Part C: Cross-Teamskill consistency (only when publishing multiple together)++When publishing a batch of Teamskills as a coherent set:++- [ ] Naming convention: all Teamskills end with `-team` suffix+- [ ] Frontmatter `version` consistent across the batch+- [ ] Description structure follows the same template ("Use when..." / "DO NOT use for..." / "Triggers...")+- [ ] No two Teamskills overlap in trigger conditions (they would compete in the trigger system)+- [ ] All Teamskills produce structurally similar Final Reports (tiered, schema-based) so users learn one mental model++Cross-Teamskill consistency is a usability concern, not a per-skill compliance rule.++---++## Final sign-off ritual++Once all above checks pass, write a 2-line sign-off in the conversation (not in any file):++```+Teamskill: <name>+Pattern: <A | B | C | A+B | B+C | C+A | C+B+A | Debate>+Roles: <count> (<list of role ids>)+Validator: PASS+Manual checks: PASS (all responsibility-attribution and content-quality tests)+Justification: <1-line Stage 0 reason this team beats single-agent>+```++This forces a final articulation of the Teamskill's reason to exist.diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/reference/conversion-guide.md b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/reference/conversion-guide.mdsimilarity index 98%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/reference/conversion-guide.mdrename to jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/reference/conversion-guide.mdindex 6177c6e1be..2c4415e885 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/reference/conversion-guide.md+++ b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/reference/conversion-guide.md@@ -1,167 +1,167 @@-# Conversion Guide: Single-agent Skill → Teamskill--> Read this in **Stage 1b** when the user points at an existing single-agent skill and asks to convert it. After this stage, return to the main SKILL.md workflow at Stage 1a (pattern selection) onward.--## When NOT to convert--Conversion is only worth it if you can answer **"yes"** to at least one of these:--1. **The source skill embeds 2+ personas inside one prompt** (e.g., `adversarial-reviewer` has Saboteur + New Hire + Security Auditor inside one SKILL.md). The single agent cannot truly hold multiple POVs simultaneously — outputs converge. → **A-pattern conversion.**-2. **The source skill has 3+ checklist categories that are independently investigable** (e.g., a security skill with separate auth / input-validation / dependency / config sections). Running these in parallel buys both wall-clock and depth per slice. → **B-pattern conversion.**-3. **The source skill describes a sequential workflow with quality steps** (e.g., a copywriting skill that says "first write a brief, then draft, then edit, then audit"). Single agents cut corners on phase boundaries. Enforcing them via separate roles + gates lifts quality. → **C-pattern conversion.**--If none apply: **stop**. Tell the user the skill is already well-suited to a single agent. Conversion would add overhead without clear benefit.--## Conversion pipeline (5 steps)--### Step 1: Read the source skill end-to-end--Look for these structural signals:--| Signal in source skill | Maps to |-|---|---|-| `## Persona 1 / ## Persona 2 / ...` sections | A-pattern roles (1 per persona) |-| `## Checklist: A / B / C / ...` sections | B-pattern roles (1 per disjoint category) |-| `## Step 1 / ## Step 2 / ...` workflow with explicit deliverables | C-pattern stages (1 per step with handoff) |-| `## Anti-patterns` enumerating common single-agent failures | Each anti-pattern hints at the team value (what the team prevents) |-| `MUST find at least N issues` or similar forced-output rules | These become role-level `Boundary > Mandatory` |-| `Inspection process: 1. ... 2. ... 3. ...` | These become Inline Persona steps |--### Step 2: Articulate "what is lost in single-agent form"--Write a one-paragraph **conversion rationale** answering:--> *"Today, when a single agent runs this skill, what does it systematically miss or under-deliver on?"*--If you cannot answer crisply, conversion is premature. Examples of crisp answers:--- **`adversarial-reviewer` → `pr-review-team`**: "The single agent role-plays 3 personas serially, but its outputs converge because it cannot escape its own analytical priors. Independent parallel agents produce genuinely different findings."-- A multi-stage incident-response skill → team form: "The single agent skips the postmortem after mitigation succeeds, because the user's perceived crisis is over. Separating roles + gating mitigation→postmortem enforces the discipline."-- A copywriting skill → team form: "The single agent collapses brief and copy into one pass, losing the audit trail and the discipline of editing without rewriting."--This rationale becomes the Stage 0 justification and gets cited in the new Teamskill's SKILL.md `description` (use case) + workflow.md Overview.--### Step 3: Decompose into roles--Apply the heuristics from Step 1 to extract role candidates. Then run the **disjointness test**:--For each pair of role candidates (A, B), ask: *"Could one role's deliverable substitute for the other's?"*--- If yes for any pair → roles overlap → merge or redesign.-- If no for all pairs → decomposition is clean, proceed.--Record each role as a tuple: `(id, motto, success criteria 1-liner, methodology)`.--### Step 4: Pick the pattern--Use [pattern-selection.md](pattern-selection.md). For converted skills, the pattern is usually obvious from Step 1's structural signals:--| Source signal dominant | Pattern |-|---|---|-| Multiple personas in one SKILL.md | A |-| Multiple disjoint checklists | B |-| Multi-step workflow with deliverables | C |-| Personas + checklists | A + B |-| Multi-step workflow with adversarial review at one step | C + A |-| Multi-step workflow with parallel research at one step | C + B |--### Step 5: Generate the new Teamskill via the standard pipeline--Continue from main SKILL.md **Stage 2 onward** (Role design → Workflow → Bind → Dependencies → Templates → Validate).--When filling in templates, **port content from the source skill aggressively**:--| Source skill content | Goes to |-|---|---|-| Persona descriptions | `roles/<id>.md` `## Identity` (rewrite first line as 1-line motto!) |-| Per-persona "Inspection Process" or steps | `roles/<id>.md` `## Inline Persona for Teammate` |-| `MUST find` rules / forced output rules | `roles/<id>.md` `## Boundary > Mandatory` |-| Output format templates | `roles/<id>.md` `## Output Schema` |-| Workflow / sequence descriptions | `workflow.md` `## Detailed Steps` |-| Anti-patterns / pitfalls | `bind.md` `## Behavioral Constraints` (if team-level) or `## Failure Handling` (if recovery-related) |-| Tool lists (`gh`, `grep`, `python`) | `roles[].tools` in SKILL.md frontmatter + `dependencies.yaml` `tools` segment |-| Required Skills (cross-references) | `roles[].skills` in SKILL.md frontmatter + `dependencies.yaml` `skills` segment with `source: <URL>` if external |--## Worked example: `adversarial-reviewer` → `pr-review-team`--This is the canonical conversion. Walk through it as a template.--### Source structure--A real public single-agent skill `adversarial-reviewer` (an engineering-team skill that runs 3 review personas serially inside a single SKILL.md):--```-----name: adversarial-reviewer-description: Reviews PRs by running 3 internal personas...------## Persona 1: The Saboteur-Mindset: ...-Priorities: ...-Review Process: ...-MUST-Find Rule: ...--## Persona 2: The New Hire-Mindset: ...-Priorities: ...-...--## Persona 3: The Security Auditor-Mindset: ...-Priorities: ...-...--## Severity Table-- BLOCK / SIGNIFICANT-RISK / ACCEPTABLE-RISK / LOW-RISK--## Output Format-...-```--### Conversion steps applied--1. **Read end-to-end** → 3 distinct personas with distinct mindsets, distinct priorities, distinct MUST-find rules. Severity table is shared. Output format is shared.--2. **Articulate loss** → "A single agent serially role-playing 3 personas converges to similar findings because it cannot drop its priors between persona switches. Independent parallel agents produce genuinely different findings; running them in isolation is the value."--3. **Decompose** → 3 roles emerge naturally: `code-reviewer` (forward review of quality/test coverage; New Hire-flavored), `critique-adversarial` (Saboteur), `architect` (Security Auditor + cross-cutting). Disjointness check: each role has a distinct domain (quality / risks / architecture). PASS.--4. **Pattern** → A (parallel adversarial). Add Architect for cross-cutting view.--5. **Generate**:- - Each persona's Mindset → role's `## Identity` 1-line motto (rewrite the prose Mindset into a single quotable sentence).- - Each persona's Priorities → role's `## Success Criteria` "Focus areas" line.- - Each persona's MUST-Find Rule → role's `## Boundary > Mandatory`.- - Severity Table → shared `## Output Schema` Verdict enum across all 3 roles.- - Output Format → role-specific `## Output Schema` template.- - The 3 personas' Inspection Process content → each role's `## Inline Persona for Teammate`.- - New file: `workflow.md` with mermaid showing parallel dispatch + Leader integration node.- - New file: `bind.md` with `max_parallel_teammates: 3`, `total_token_budget: 200k`, "Leader does not write review content", "Teammates MUST NOT see each other's output".- - New file: `dependencies.yaml` with `gh` (required) and `grep` (required) — preserved from source skill's tool list.--### Result--`pr-review-team`. The conversion preserves all source content while adding:--- **True parallelism** (3 isolated agents instead of 1 serial agent)-- **Anti-overlap boundaries** (each role's `**Forbidden**:` block names the other roles)-- **Quality gates** (workflow surfaces contradictions verbatim instead of letting one agent silently mediate)-- **Resource accounting** (`bind.md` makes the 3× token cost explicit)-------## Conversion compliance checklist--Before declaring a conversion done, verify:--- [ ] **Stage 0 justification written** (1 paragraph: "what is lost in single-agent form")-- [ ] **Pattern picked** with reference to source signals (Step 1 table)-- [ ] **All source persona Mindsets** rewritten as 1-line mottos-- [ ] **All source MUST-Find rules** ported into role `Boundary > Mandatory`-- [ ] **All source Output Formats** preserved in role `Output Schema`-- [ ] **All source tools** declared in `roles[].tools` + `dependencies.yaml > tools`-- [ ] **All source cross-referenced Skills** declared in `roles[].skills` + `dependencies.yaml > skills`-- [ ] **`bind.md` Behavioral Constraints** explicitly state isolation rule (A-pattern teams)-- [ ] **Validator passes** on the new Teamskill directory-- [ ] **Optional: `MIGRATION.md`** at the root of the new Teamskill, documenting the source skill, the conversion rationale, and the team-vs-single delta (useful for the user to understand what they gained)+# Conversion Guide: Single-agent Skill → Teamskill++> Read this in **Stage 1b** when the user points at an existing single-agent skill and asks to convert it. After this stage, return to the main SKILL.md workflow at Stage 1a (pattern selection) onward.++## When NOT to convert++Conversion is only worth it if you can answer **"yes"** to at least one of these:++1. **The source skill embeds 2+ personas inside one prompt** (e.g., `adversarial-reviewer` has Saboteur + New Hire + Security Auditor inside one SKILL.md). The single agent cannot truly hold multiple POVs simultaneously — outputs converge. → **A-pattern conversion.**+2. **The source skill has 3+ checklist categories that are independently investigable** (e.g., a security skill with separate auth / input-validation / dependency / config sections). Running these in parallel buys both wall-clock and depth per slice. → **B-pattern conversion.**+3. **The source skill describes a sequential workflow with quality steps** (e.g., a copywriting skill that says "first write a brief, then draft, then edit, then audit"). Single agents cut corners on phase boundaries. Enforcing them via separate roles + gates lifts quality. → **C-pattern conversion.**++If none apply: **stop**. Tell the user the skill is already well-suited to a single agent. Conversion would add overhead without clear benefit.++## Conversion pipeline (5 steps)++### Step 1: Read the source skill end-to-end++Look for these structural signals:++| Signal in source skill | Maps to |+|---|---|+| `## Persona 1 / ## Persona 2 / ...` sections | A-pattern roles (1 per persona) |+| `## Checklist: A / B / C / ...` sections | B-pattern roles (1 per disjoint category) |+| `## Step 1 / ## Step 2 / ...` workflow with explicit deliverables | C-pattern stages (1 per step with handoff) |+| `## Anti-patterns` enumerating common single-agent failures | Each anti-pattern hints at the team value (what the team prevents) |+| `MUST find at least N issues` or similar forced-output rules | These become role-level `Boundary > Mandatory` |+| `Inspection process: 1. ... 2. ... 3. ...` | These become Inline Persona steps |++### Step 2: Articulate "what is lost in single-agent form"++Write a one-paragraph **conversion rationale** answering:++> *"Today, when a single agent runs this skill, what does it systematically miss or under-deliver on?"*++If you cannot answer crisply, conversion is premature. Examples of crisp answers:++- **`adversarial-reviewer` → `pr-review-team`**: "The single agent role-plays 3 personas serially, but its outputs converge because it cannot escape its own analytical priors. Independent parallel agents produce genuinely different findings."+- A multi-stage incident-response skill → team form: "The single agent skips the postmortem after mitigation succeeds, because the user's perceived crisis is over. Separating roles + gating mitigation→postmortem enforces the discipline."+- A copywriting skill → team form: "The single agent collapses brief and copy into one pass, losing the audit trail and the discipline of editing without rewriting."++This rationale becomes the Stage 0 justification and gets cited in the new Teamskill's SKILL.md `description` (use case) + workflow.md Overview.++### Step 3: Decompose into roles++Apply the heuristics from Step 1 to extract role candidates. Then run the **disjointness test**:++For each pair of role candidates (A, B), ask: *"Could one role's deliverable substitute for the other's?"*++- If yes for any pair → roles overlap → merge or redesign.+- If no for all pairs → decomposition is clean, proceed.++Record each role as a tuple: `(id, motto, success criteria 1-liner, methodology)`.++### Step 4: Pick the pattern++Use [pattern-selection.md](pattern-selection.md). For converted skills, the pattern is usually obvious from Step 1's structural signals:++| Source signal dominant | Pattern |+|---|---|+| Multiple personas in one SKILL.md | A |+| Multiple disjoint checklists | B |+| Multi-step workflow with deliverables | C |+| Personas + checklists | A + B |+| Multi-step workflow with adversarial review at one step | C + A |+| Multi-step workflow with parallel research at one step | C + B |++### Step 5: Generate the new Teamskill via the standard pipeline++Continue from main SKILL.md **Stage 2 onward** (Role design → Workflow → Bind → Dependencies → Templates → Validate).++When filling in templates, **port content from the source skill aggressively**:++| Source skill content | Goes to |+|---|---|+| Persona descriptions | `roles/<id>.md` `## Identity` (rewrite first line as 1-line motto!) |+| Per-persona "Inspection Process" or steps | `roles/<id>.md` `## Inline Persona for Teammate` |+| `MUST find` rules / forced output rules | `roles/<id>.md` `## Boundary > Mandatory` |+| Output format templates | `roles/<id>.md` `## Output Schema` |+| Workflow / sequence descriptions | `workflow.md` `## Detailed Steps` |+| Anti-patterns / pitfalls | `bind.md` `## Behavioral Constraints` (if team-level) or `## Failure Handling` (if recovery-related) |+| Tool lists (`gh`, `grep`, `python`) | `roles[].tools` in SKILL.md frontmatter + `dependencies.yaml` `tools` segment |+| Required Skills (cross-references) | `roles[].skills` in SKILL.md frontmatter + `dependencies.yaml` `skills` segment with `source: <URL>` if external |++## Worked example: `adversarial-reviewer` → `pr-review-team`++This is the canonical conversion. Walk through it as a template.++### Source structure++A real public single-agent skill `adversarial-reviewer` (an engineering-team skill that runs 3 review personas serially inside a single SKILL.md):++```+---+name: adversarial-reviewer+description: Reviews PRs by running 3 internal personas...+---++## Persona 1: The Saboteur+Mindset: ...+Priorities: ...+Review Process: ...+MUST-Find Rule: ...++## Persona 2: The New Hire+Mindset: ...+Priorities: ...+...++## Persona 3: The Security Auditor+Mindset: ...+Priorities: ...+...++## Severity Table+- BLOCK / SIGNIFICANT-RISK / ACCEPTABLE-RISK / LOW-RISK++## Output Format+...+```++### Conversion steps applied++1. **Read end-to-end** → 3 distinct personas with distinct mindsets, distinct priorities, distinct MUST-find rules. Severity table is shared. Output format is shared.++2. **Articulate loss** → "A single agent serially role-playing 3 personas converges to similar findings because it cannot drop its priors between persona switches. Independent parallel agents produce genuinely different findings; running them in isolation is the value."++3. **Decompose** → 3 roles emerge naturally: `code-reviewer` (forward review of quality/test coverage; New Hire-flavored), `critique-adversarial` (Saboteur), `architect` (Security Auditor + cross-cutting). Disjointness check: each role has a distinct domain (quality / risks / architecture). PASS.++4. **Pattern** → A (parallel adversarial). Add Architect for cross-cutting view.++5. **Generate**:+ - Each persona's Mindset → role's `## Identity` 1-line motto (rewrite the prose Mindset into a single quotable sentence).+ - Each persona's Priorities → role's `## Success Criteria` "Focus areas" line.+ - Each persona's MUST-Find Rule → role's `## Boundary > Mandatory`.+ - Severity Table → shared `## Output Schema` Verdict enum across all 3 roles.+ - Output Format → role-specific `## Output Schema` template.+ - The 3 personas' Inspection Process content → each role's `## Inline Persona for Teammate`.+ - New file: `workflow.md` with mermaid showing parallel dispatch + Leader integration node.+ - New file: `bind.md` with `max_parallel_teammates: 3`, `total_token_budget: 200k`, "Leader does not write review content", "Teammates MUST NOT see each other's output".+ - New file: `dependencies.yaml` with `gh` (required) and `grep` (required) — preserved from source skill's tool list.++### Result++`pr-review-team`. The conversion preserves all source content while adding:++- **True parallelism** (3 isolated agents instead of 1 serial agent)+- **Anti-overlap boundaries** (each role's `**Forbidden**:` block names the other roles)+- **Quality gates** (workflow surfaces contradictions verbatim instead of letting one agent silently mediate)+- **Resource accounting** (`bind.md` makes the 3× token cost explicit)++---++## Conversion compliance checklist++Before declaring a conversion done, verify:++- [ ] **Stage 0 justification written** (1 paragraph: "what is lost in single-agent form")+- [ ] **Pattern picked** with reference to source signals (Step 1 table)+- [ ] **All source persona Mindsets** rewritten as 1-line mottos+- [ ] **All source MUST-Find rules** ported into role `Boundary > Mandatory`+- [ ] **All source Output Formats** preserved in role `Output Schema`+- [ ] **All source tools** declared in `roles[].tools` + `dependencies.yaml > tools`+- [ ] **All source cross-referenced Skills** declared in `roles[].skills` + `dependencies.yaml > skills`+- [ ] **`bind.md` Behavioral Constraints** explicitly state isolation rule (A-pattern teams)+- [ ] **Validator passes** on the new Teamskill directory+- [ ] **Optional: `MIGRATION.md`** at the root of the new Teamskill, documenting the source skill, the conversion rationale, and the team-vs-single delta (useful for the user to understand what they gained)diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/reference/pattern-selection.md b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/reference/pattern-selection.mdsimilarity index 98%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/reference/pattern-selection.mdrename to jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/reference/pattern-selection.mdindex 76b6461744..c9dfaea43e 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/reference/pattern-selection.md+++ b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/reference/pattern-selection.md@@ -1,182 +1,182 @@-# Pattern Selection Guide--> Read this in **Stage 1a** of the SKILL.md workflow, before writing any role files. Picking the wrong pattern is the most common authoring error — patterns dictate role count, isolation rules, integration logic, and `bind.md` failure modes.--## The three primitive patterns--### A. Adversarial / Cross-check--**Use when**: a single agent role-playing N personas converges to similar conclusions because it cannot escape its own priors. The value of the team is **disagreement surfaced as evidence**.--**Shape**: 2–4 roles, run **in parallel**, **isolated** (no cross-visibility), Leader **surfaces contradictions** rather than resolving them.--> When adversarial tension needs **mutual visibility** (e.g., structured debate with rebuttal rounds), use the [Debate mixed pattern](#debate-b--cross-exam--c) instead of standalone A.--**Identity test**: each role's 1-line motto should be **mutually antagonistic**. If two mottos could be spoken by the same person, the roles will converge.--**Example mottos that work** (from `pr-review-team`):-- Code reviewer: *"I am looking for what this code does well and how to ship it."*-- Adversarial critic: *"I am trying to break this change before it reaches production."*-- Architect: *"I care about whether this fits the system five years from now."*--**Example mottos that fail** (would converge):-- Reviewer A: *"I look for bugs and security issues."*-- Reviewer B: *"I look for security issues and bugs."*--**Integration rule**: ≥2 roles agree → MUST-FIX. 1 role flags + others silent → SHOULD-FIX. Roles directly contradict → surface verbatim, **do not mediate**.--**Examples**: `pr-review-team`, `paper-peer-review-team`, `contract-review-team` (buyer counsel vs seller counsel + neutral reviewer).--### B. Parallel decomposition--**Use when**: the task naturally splits into N independent sub-tasks that can run concurrently and the integration is non-trivial. The value of the team is **wall-clock speedup + breadth coverage**.--**Shape**: 2–N roles (often variable count via `count: [min, max]` in frontmatter), run **in parallel**, each role works on a **disjoint slice** of the input/problem space, Leader **integrates** by composition (not by judgment).--**Disjointness test**: each role must have a non-overlapping "assignment" (an angle, a category, a region, a layer). If two roles could produce the same finding, the decomposition is broken.--**Example assignments that work** (from `research-to-ppt-team`):-- Angle researcher #1: market dynamics-- Angle researcher #2: technology landscape-- Angle researcher #3: regulatory environment--**Example assignments that fail** (overlap):-- Researcher #1: "all things related to the topic"-- Researcher #2: "key information about the topic"--**Integration rule**: collect outputs by slice, deduplicate cross-slice findings, flag gaps where coverage is missing.--**Examples**: pure-B is rare in practice; usually combined with A or C. See `systematic-debug-team` (B for parallel hypothesis generation across distinct theory classes).--### C. Specialization pipeline--**Use when**: the task has **sequential expert stages** with **strict handoff contracts**, and blurring stage boundaries causes regressions (e.g., the editor rewriting the strategist's brief, the mitigator skipping triage). The value of the team is **enforced discipline + quality gates**.--**Shape**: 3–5 roles, run **sequentially**, each stage **sees prior stage output** but **cannot rewrite it**, **quality gates between stages** with explicit pass/fail criteria.--**Boundary test**: each role must have an explicit `**Forbidden**: do NOT redo upstream work` clause. Without it, roles drift back into earlier stages.--**Example stage chain** (from `marketing-copy-team`):-- Stage 1 brief-strategist → produces strategy brief (gate: brief approved)-- Stage 2 copywriter → produces draft (gate: draft matches brief)-- Stage 3 copy-editor → enhances draft (gate: no rewrites of brief or draft structure)-- Stage 4 conversion-auditor → audits final (gate: meets conversion criteria or kicks back)--**Gate rule**: a stage outputs a structured deliverable; the next stage refuses to start unless the gate passes; failed gates trigger explicit retry / kick-back paths declared in `bind.md` Failure Handling.--**Examples**: `marketing-copy-team`, `incident-response-team`, `seo-growth-team`.--## Mixed patterns (when to combine)--Most non-trivial Teamskills combine 2 patterns. The combinations and their use cases:--### A + B (parallel adversarial)--**Use when**: you need both adversarial breadth AND parallel coverage. Multiple parallel investigators with non-overlapping assignments + an adversarial reviewer at the end.--**Example**: `systematic-debug-team` (3 parallel hypothesis-generators with forced theory-class diversity + 1 evidence collector + 1 adversarial root-cause-analyst + 1 fix-validator).--**Example**: `security-audit-team` (3 parallel auditors: threat-modeler / vulnerability-scanner / dependency-auditor + 1 adversarial attack-chain-synthesizer who must connect their findings into exploit paths).--### B + C (parallel research → pipeline finalization)--**Use when**: parallel breadth is needed early, then a sequential editorial pipeline finalizes the output.--**Example**: `research-to-ppt-team` (2–4 parallel angle-researchers → 1 content-curator → 1 slide-designer).--### C + A (pipeline with adversarial gate)--**Use when**: a sequential pipeline benefits from an adversarial reviewer at one or more gates.--**Example**: `design-review-team` (analyst → critic → architect, where critic is the adversarial slot).--**Example**: `travel-planning-team` (planner-builder produces itinerary; budget-optimizer and experience-maximizer adversarially critique it; logistics-validator ratifies feasibility).--### C + B + A (full stack)--**Use when**: a hard quality gate at entry, then parallel multi-method analysis, then adversarial critique. Reserved for high-stakes analysis pipelines.--**Example**: `data-analysis-team` (Stage 0: data-quality-auditor as hard gate → Stage 1: 3 parallel analysts (descriptive / inferential / causal) → Stage 2: 1 adversarial critique-reviewer).--### Debate (B → Cross-exam → C)--**Use when**: roles need to first produce independent positions (isolation prevents premature alignment), then **rebut each other's specific claims** with mutual visibility, then a separate role synthesizes the resolution preserving unresolved disputes.--**Shape**: 2–N roles produce `POSITION` in parallel isolation → each role receives others' prior-round output and produces structured `CROSS_EXAM` in parallel with mutual visibility → 1 synthesizer/judge produces `DECISION`.--**Key distinction from standalone A**: pure A keeps roles permanently isolated — the value is independent judgment that never cross-contaminates. Debate **phase-scopes** the isolation: Round 1 isolated, Round 2+ mutually visible. The adversarial value comes from **structured clash on specific claims**, not permanent blindness.--**Rounds**: Debate supports 1–N cross-exam rounds (each round = all roles receive prior round's outputs and produce structured responses). Round count is a **resource/quality tradeoff** — declare it in `bind.md`, not here. Most scenarios converge in 1–2 rounds.--**Visibility semantics**: the Teamskill declares **who sees whose output at which phase**. How this is delivered is a **framework-level implementation choice**, not a Teamskill concern — but with a **recommended preference order**: (1) **direct peer-to-peer exchange** (most efficient, lowest information distortion); (2) shared blackboard / shared state; (3) Leader-relay (fallback when the framework does not support peer communication). Frameworks SHOULD implement the highest-priority mechanism they support.--**Example**: `china-ecommerce-compare-debate-team` (3 platform experts produce isolated position papers → cross-exam with mutual visibility → value-synthesizer produces verdict with unresolved disputes preserved).--## Decision tree--```-Q1. Does a single agent systematically miss something on this task today?- NO → Stop. Build a single-agent skill with create-skill instead.- YES → Q2.--Q2. What does it miss?- (a) Adversarial blind spots / convergent self-review → A- (b) Breadth / parallel coverage of independent slices → B- (c) Discipline at handoffs in a multi-stage pipeline → C- (d) Adversarial exchange requiring mutual visibility (debate/rebuttal)- → Mixed: Debate (B → Cross-exam → C)--Q3. Does it miss only ONE of (a)/(b)/(c)?- YES → Use that single pattern.- NO → Combine: A+B / B+C / C+A / C+B+A.- Order matters — pipelines flow stages first, then place A or B- inside specific stages where the value is highest.--Q4. How many roles? (authoring defaults, not hard limits)- A pattern: 2-4 roles (past 4, contradictions combinatorially explode)- B pattern: 2-N roles (use count: [min, max]; only real cap is bind.md token budget)- C pattern: 3-5 stages (past 5, stages tend to be mergeable)- Mixed: 4-6 roles (past 6, integration becomes the bottleneck)--Q5. How does Leader integrate outputs?- A: surface contradictions, do NOT mediate- B: compose by slice, flag coverage gaps- C: enforce gates, kick back on failure- Mixed: stage-by-stage; the pattern of the LAST stage dictates final integration-```--## Anti-patterns--### "Council of clones"--Three roles with the same Identity prose and only nominal name differences. Their outputs converge. Symptom: roles all say "looks good" or all flag the same trivial issues.--**Fix**: rewrite Identity mottos to be mutually antagonistic. Re-read [role-design.md](role-design.md) § Anti-Convergence Techniques.--### "Pipeline that nobody follows"--C-pattern declared, but stages have no quality gates. Result: stages bleed into each other; the editor rewrites the brief; the mitigator skips triage.--**Fix**: every stage transition needs a gate definition with explicit pass/fail criteria, and every role's `Boundary` must have `**Forbidden**: do NOT redo upstream stage X` clauses.--### "Decomposition without disjointness"--B-pattern declared, but roles overlap on the problem space. Result: 3 researchers all return the same top-3 findings.--**Fix**: assign each role a non-overlapping slice **at dispatch time** (the Leader picks slices from a fixed list and passes the assignment as a parameter to the Inline Persona).--### "Mixed pattern justified by ambition"--Combining A+B+C because "more is better". Result: 6 roles, 3 integration nodes, and nobody can debug it.--**Fix**: only combine patterns when each one is independently justified by Stage 0. If C+B alone solves the problem, do not add A.--## How to record the pattern in the Teamskill--The spec **does not have a `pattern: A/B/C` frontmatter field** — declaring the pattern as a string would duplicate what the mermaid diagram already expresses, and the diagram is more precise. Instead, the pattern is expressed implicitly through:--1. **`workflow.md` mermaid diagram** — parallel branches = A or B, sequential chain = C, mixed shapes = mixed.-2. **`roles[]` purpose lines** — adversarial roles say "adversarial", "critic", "challenger"; pipeline stages number themselves or chain explicitly.-3. **`bind.md` Behavioral Constraints** — A-pattern teams have "teammates MUST NOT see each other's output"; C-pattern teams have "no rewriting upstream stage output".--You may add a brief `## Pattern` note in `workflow.md` `## Overview` if it aids the reader, but it is not required by the spec.+# Pattern Selection Guide++> Read this in **Stage 1a** of the SKILL.md workflow, before writing any role files. Picking the wrong pattern is the most common authoring error — patterns dictate role count, isolation rules, integration logic, and `bind.md` failure modes.++## The three primitive patterns++### A. Adversarial / Cross-check++**Use when**: a single agent role-playing N personas converges to similar conclusions because it cannot escape its own priors. The value of the team is **disagreement surfaced as evidence**.++**Shape**: 2–4 roles, run **in parallel**, **isolated** (no cross-visibility), Leader **surfaces contradictions** rather than resolving them.++> When adversarial tension needs **mutual visibility** (e.g., structured debate with rebuttal rounds), use the [Debate mixed pattern](#debate-b--cross-exam--c) instead of standalone A.++**Identity test**: each role's 1-line motto should be **mutually antagonistic**. If two mottos could be spoken by the same person, the roles will converge.++**Example mottos that work** (from `pr-review-team`):+- Code reviewer: *"I am looking for what this code does well and how to ship it."*+- Adversarial critic: *"I am trying to break this change before it reaches production."*+- Architect: *"I care about whether this fits the system five years from now."*++**Example mottos that fail** (would converge):+- Reviewer A: *"I look for bugs and security issues."*+- Reviewer B: *"I look for security issues and bugs."*++**Integration rule**: ≥2 roles agree → MUST-FIX. 1 role flags + others silent → SHOULD-FIX. Roles directly contradict → surface verbatim, **do not mediate**.++**Examples**: `pr-review-team`, `paper-peer-review-team`, `contract-review-team` (buyer counsel vs seller counsel + neutral reviewer).++### B. Parallel decomposition++**Use when**: the task naturally splits into N independent sub-tasks that can run concurrently and the integration is non-trivial. The value of the team is **wall-clock speedup + breadth coverage**.++**Shape**: 2–N roles (often variable count via `count: [min, max]` in frontmatter), run **in parallel**, each role works on a **disjoint slice** of the input/problem space, Leader **integrates** by composition (not by judgment).++**Disjointness test**: each role must have a non-overlapping "assignment" (an angle, a category, a region, a layer). If two roles could produce the same finding, the decomposition is broken.++**Example assignments that work** (from `research-to-ppt-team`):+- Angle researcher #1: market dynamics+- Angle researcher #2: technology landscape+- Angle researcher #3: regulatory environment++**Example assignments that fail** (overlap):+- Researcher #1: "all things related to the topic"+- Researcher #2: "key information about the topic"++**Integration rule**: collect outputs by slice, deduplicate cross-slice findings, flag gaps where coverage is missing.++**Examples**: pure-B is rare in practice; usually combined with A or C. See `systematic-debug-team` (B for parallel hypothesis generation across distinct theory classes).++### C. Specialization pipeline++**Use when**: the task has **sequential expert stages** with **strict handoff contracts**, and blurring stage boundaries causes regressions (e.g., the editor rewriting the strategist's brief, the mitigator skipping triage). The value of the team is **enforced discipline + quality gates**.++**Shape**: 3–5 roles, run **sequentially**, each stage **sees prior stage output** but **cannot rewrite it**, **quality gates between stages** with explicit pass/fail criteria.++**Boundary test**: each role must have an explicit `**Forbidden**: do NOT redo upstream work` clause. Without it, roles drift back into earlier stages.++**Example stage chain** (from `marketing-copy-team`):+- Stage 1 brief-strategist → produces strategy brief (gate: brief approved)+- Stage 2 copywriter → produces draft (gate: draft matches brief)+- Stage 3 copy-editor → enhances draft (gate: no rewrites of brief or draft structure)+- Stage 4 conversion-auditor → audits final (gate: meets conversion criteria or kicks back)++**Gate rule**: a stage outputs a structured deliverable; the next stage refuses to start unless the gate passes; failed gates trigger explicit retry / kick-back paths declared in `bind.md` Failure Handling.++**Examples**: `marketing-copy-team`, `incident-response-team`, `seo-growth-team`.++## Mixed patterns (when to combine)++Most non-trivial Teamskills combine 2 patterns. The combinations and their use cases:++### A + B (parallel adversarial)++**Use when**: you need both adversarial breadth AND parallel coverage. Multiple parallel investigators with non-overlapping assignments + an adversarial reviewer at the end.++**Example**: `systematic-debug-team` (3 parallel hypothesis-generators with forced theory-class diversity + 1 evidence collector + 1 adversarial root-cause-analyst + 1 fix-validator).++**Example**: `security-audit-team` (3 parallel auditors: threat-modeler / vulnerability-scanner / dependency-auditor + 1 adversarial attack-chain-synthesizer who must connect their findings into exploit paths).++### B + C (parallel research → pipeline finalization)++**Use when**: parallel breadth is needed early, then a sequential editorial pipeline finalizes the output.++**Example**: `research-to-ppt-team` (2–4 parallel angle-researchers → 1 content-curator → 1 slide-designer).++### C + A (pipeline with adversarial gate)++**Use when**: a sequential pipeline benefits from an adversarial reviewer at one or more gates.++**Example**: `design-review-team` (analyst → critic → architect, where critic is the adversarial slot).++**Example**: `travel-planning-team` (planner-builder produces itinerary; budget-optimizer and experience-maximizer adversarially critique it; logistics-validator ratifies feasibility).++### C + B + A (full stack)++**Use when**: a hard quality gate at entry, then parallel multi-method analysis, then adversarial critique. Reserved for high-stakes analysis pipelines.++**Example**: `data-analysis-team` (Stage 0: data-quality-auditor as hard gate → Stage 1: 3 parallel analysts (descriptive / inferential / causal) → Stage 2: 1 adversarial critique-reviewer).++### Debate (B → Cross-exam → C)++**Use when**: roles need to first produce independent positions (isolation prevents premature alignment), then **rebut each other's specific claims** with mutual visibility, then a separate role synthesizes the resolution preserving unresolved disputes.++**Shape**: 2–N roles produce `POSITION` in parallel isolation → each role receives others' prior-round output and produces structured `CROSS_EXAM` in parallel with mutual visibility → 1 synthesizer/judge produces `DECISION`.++**Key distinction from standalone A**: pure A keeps roles permanently isolated — the value is independent judgment that never cross-contaminates. Debate **phase-scopes** the isolation: Round 1 isolated, Round 2+ mutually visible. The adversarial value comes from **structured clash on specific claims**, not permanent blindness.++**Rounds**: Debate supports 1–N cross-exam rounds (each round = all roles receive prior round's outputs and produce structured responses). Round count is a **resource/quality tradeoff** — declare it in `bind.md`, not here. Most scenarios converge in 1–2 rounds.++**Visibility semantics**: the Teamskill declares **who sees whose output at which phase**. How this is delivered is a **framework-level implementation choice**, not a Teamskill concern — but with a **recommended preference order**: (1) **direct peer-to-peer exchange** (most efficient, lowest information distortion); (2) shared blackboard / shared state; (3) Leader-relay (fallback when the framework does not support peer communication). Frameworks SHOULD implement the highest-priority mechanism they support.++**Example**: `china-ecommerce-compare-debate-team` (3 platform experts produce isolated position papers → cross-exam with mutual visibility → value-synthesizer produces verdict with unresolved disputes preserved).++## Decision tree++```+Q1. Does a single agent systematically miss something on this task today?+ NO → Stop. Build a single-agent skill with create-skill instead.+ YES → Q2.++Q2. What does it miss?+ (a) Adversarial blind spots / convergent self-review → A+ (b) Breadth / parallel coverage of independent slices → B+ (c) Discipline at handoffs in a multi-stage pipeline → C+ (d) Adversarial exchange requiring mutual visibility (debate/rebuttal)+ → Mixed: Debate (B → Cross-exam → C)++Q3. Does it miss only ONE of (a)/(b)/(c)?+ YES → Use that single pattern.+ NO → Combine: A+B / B+C / C+A / C+B+A.+ Order matters — pipelines flow stages first, then place A or B+ inside specific stages where the value is highest.++Q4. How many roles? (authoring defaults, not hard limits)+ A pattern: 2-4 roles (past 4, contradictions combinatorially explode)+ B pattern: 2-N roles (use count: [min, max]; only real cap is bind.md token budget)+ C pattern: 3-5 stages (past 5, stages tend to be mergeable)+ Mixed: 4-6 roles (past 6, integration becomes the bottleneck)++Q5. How does Leader integrate outputs?+ A: surface contradictions, do NOT mediate+ B: compose by slice, flag coverage gaps+ C: enforce gates, kick back on failure+ Mixed: stage-by-stage; the pattern of the LAST stage dictates final integration+```++## Anti-patterns++### "Council of clones"++Three roles with the same Identity prose and only nominal name differences. Their outputs converge. Symptom: roles all say "looks good" or all flag the same trivial issues.++**Fix**: rewrite Identity mottos to be mutually antagonistic. Re-read [role-design.md](role-design.md) § Anti-Convergence Techniques.++### "Pipeline that nobody follows"++C-pattern declared, but stages have no quality gates. Result: stages bleed into each other; the editor rewrites the brief; the mitigator skips triage.++**Fix**: every stage transition needs a gate definition with explicit pass/fail criteria, and every role's `Boundary` must have `**Forbidden**: do NOT redo upstream stage X` clauses.++### "Decomposition without disjointness"++B-pattern declared, but roles overlap on the problem space. Result: 3 researchers all return the same top-3 findings.++**Fix**: assign each role a non-overlapping slice **at dispatch time** (the Leader picks slices from a fixed list and passes the assignment as a parameter to the Inline Persona).++### "Mixed pattern justified by ambition"++Combining A+B+C because "more is better". Result: 6 roles, 3 integration nodes, and nobody can debug it.++**Fix**: only combine patterns when each one is independently justified by Stage 0. If C+B alone solves the problem, do not add A.++## How to record the pattern in the Teamskill++The spec **does not have a `pattern: A/B/C` frontmatter field** — declaring the pattern as a string would duplicate what the mermaid diagram already expresses, and the diagram is more precise. Instead, the pattern is expressed implicitly through:++1. **`workflow.md` mermaid diagram** — parallel branches = A or B, sequential chain = C, mixed shapes = mixed.+2. **`roles[]` purpose lines** — adversarial roles say "adversarial", "critic", "challenger"; pipeline stages number themselves or chain explicitly.+3. **`bind.md` Behavioral Constraints** — A-pattern teams have "teammates MUST NOT see each other's output"; C-pattern teams have "no rewriting upstream stage output".++You may add a brief `## Pattern` note in `workflow.md` `## Overview` if it aids the reader, but it is not required by the spec.diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/reference/role-design.md b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/reference/role-design.mdsimilarity index 97%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/reference/role-design.mdrename to jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/reference/role-design.mdindex efd089e557..4185ebf434 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/reference/role-design.md+++ b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/reference/role-design.md@@ -1,299 +1,299 @@-# Role Design Guide--> Read this in **Stage 2** (and revisit during Stage 3 for gate design). This file teaches how to author a single `roles/<id>.md` file that passes both spec compliance and the anti-convergence test.--## The 5 mandatory sections--Every role file starts with an `# Role: <Name>` H1 title, then MUST contain exactly these 5 sections, in order:--1. `## Identity` — POV with mandatory 1-line motto first-2. `## Success Criteria` — what success looks like + focus areas-3. `## Boundary` — Forbidden + Mandatory-4. `## Output Schema` — structured output template-5. `## Inline Persona for Teammate` — pasteable prompt--The validator script enforces section presence. The judgment-call quality of each section is what this guide is about.-------## Section 1: Identity--### Hard rule: first line is a 1-line motto--The motto is the **#1 anti-convergence mechanism** in the spec. Without it, prose Identity sections cause sibling roles to converge in output. The motto must:--- Be a **single sentence** in `> *"..."*` blockquote-italic format-- Be **first-person** (this is the role speaking)-- Be **mutually antagonistic** with sibling roles in an A-pattern team-- Crystallize a **point of view**, not a job title--**Good mottos**:--```markdown-> *"I am trying to break this code in production."*-> *"I am the user. I want to ship value, not perfect code."*-> *"I care about whether this fits the system five years from now."*-> *"I will refuse the deal if even one term smells wrong."*-> *"I am the data. I will tell you what is true even if it disappoints you."*-```--**Bad mottos** (and why):--| Bad | Why |-|---|---|-| *"I am a senior security engineer."* | Job title, not POV — could be said by 100 different roles |-| *"I find bugs and security issues."* | Capability description — converges with any reviewer role |-| *"I help the user."* | Vacuous — every role helps the user |-| Multi-sentence motto | Dilutes the POV — must be ONE sentence |-| Third-person ("This role looks for...") | Loses the in-character voice |--### After the motto: 0–2 paragraphs of context--Optional. Use these paragraphs to:--- Name the methodology the role applies (STRIDE, OWASP Top 10, SCQA, 5-Whys, etc.)-- Specify the role's "default mode" (skeptical / generous / adversarial / clinical)-- Explain the role's "when called in" — under what conditions does this POV add value--**Do not use these paragraphs to**:-- Repeat the Success Criteria — that's the next section, do not duplicate it here-- List checklists (those go in `Inline Persona`, where the teammate actually sees them)-------## Section 2: Success Criteria--### Format--```markdown-## Success Criteria--- [Concrete deliverable 1]-- [Concrete deliverable 2]-- [Concrete deliverable 3]--**Focus areas**: [comma-separated list of what this role should prioritize examining]-```--### Quality bar--Each bullet should be **observable** — a reviewer should be able to look at the role's output and check ✓/✗ against it. Avoid:--| Vague | Concrete |-|---|---|-| "Provides good analysis" | "Returns at least 1 concrete failure scenario with evidence" |-| "Considers all angles" | "Coverage spans security / performance / readability — flagged separately" |-| "Helps the user" | "Output uses the schema in § Output Schema, no missing required fields" |--The "Focus areas" line tells the role what to prioritize examining — keep it tight, 5–10 comma-separated items.-------## Section 3: Boundary--### Format (mandatory split)--```markdown-## Boundary--**Forbidden** (prevent role overlap):-- Do NOT [thing that another role does]-- Do NOT [thing that drifts upstream/downstream in the pipeline]--**Mandatory**:-- You MUST [thing the role tends to skip when it sees nothing obvious]-- You MUST [output discipline that the schema enforces]-```--### Why both halves are required--- **Forbidden** prevents **lateral drift** — in A/B patterns, roles bleed into each other's territory; in C patterns, stages drift upstream/downstream.-- **Mandatory** prevents **silent under-delivery** — adversarial roles default to "looks fine" when they cannot find obvious issues; coverage roles skip slices when the slice seems empty.--A role with only Forbidden tends to output empty findings. A role with only Mandatory tends to encroach on siblings. Both halves work as opposing forces.--### Examples--**A-pattern role** (`pr-review-team` adversarial-critic):--```markdown-**Forbidden**:-- Do NOT critique style or readability — that's the Code Reviewer's job.-- Do NOT propose architectural redesigns — that's the Architect's job.--**Mandatory**:-- You MUST find at least 1 concrete failure scenario.- If you found nothing, you didn't look hard enough — recheck error paths and edge cases.-```--**C-pattern role** (`marketing-copy-team` copy-editor):--```markdown-**Forbidden**:-- Do NOT rewrite the strategy brief — the brief-strategist's output is the source of truth.-- Do NOT change the message hierarchy from the copywriter's draft.-- Do NOT add new value propositions not in the original brief.--**Mandatory**:-- You MUST preserve the brief's audience, tone, and CTA intent.-- You MUST track every edit as accept/reject so the audit stage can verify provenance.-```-------## Section 4: Output Schema--### Format--```markdown-## Output Schema--\`\`\`markdown-## Role: <Role Name>--### <Section 1>-- [...]--### <Section 2>-- [...]--### Verdict / Decision / Output-- <enum: BLOCK / SHIP / KICK-BACK / ...>-\`\`\`-```--### Why a schema (not free text)--- **Leader integration depends on parseable structure** — A-pattern Leaders count agreements, B-pattern Leaders compose by slice, C-pattern Leaders check gates. All three need predictable output shapes.-- **Schemas force the role to commit** — a role that returns "here are some thoughts" lets the Leader off the hook. A role that must produce a `Verdict: BLOCK / SIGNIFICANT-RISK / ACCEPTABLE-RISK / LOW-RISK` is forced to take a position.--### Schema design rules--1. Always include a **Verdict / Decision / Output** terminal section that uses an **enum**, not free text. The Leader uses this for routing/integration.-2. Use **JSON** instead of Markdown if the output is consumed programmatically (rare for Teamskills — most consumers are LLMs reading Markdown).-3. Match the schema 1:1 with what `Inline Persona` tells the teammate to produce. Drift between the two = teammate output that doesn't match the schema = Leader integration failure.-------## Section 5: Inline Persona for Teammate--### Why this section exists--> Most adopting agents do NOT auto-load role files when dispatching teammates. The Leader must extract this section verbatim and inline it into the dispatch prompt. **Without this section, Teamskills do not run on the majority of adopting agents.**--### Format--```markdown-## Inline Persona for Teammate--\`\`\`-ROLE: <Role Name> in a Teamskill.--[1-2 sentences: who you are, what your default mode is]--[1-2 sentences: what you must produce, the Mandatory + Forbidden in plain prose]--INPUTS YOU WILL RECEIVE:-- <input 1>: {INPUT_1_PLACEHOLDER}-- <input 2>: {INPUT_2_PLACEHOLDER}--OUTPUT FORMAT (use exactly this structure):-## Role: <Role Name>-### <Section 1>-- ...-### Verdict-- <enum value>-\`\`\`-```--### Quality rules--1. **Self-contained** — the teammate has no access to the parent context, the role file, the workflow, or the bind file. Everything needed to perform the role must be in this prompt.-2. **Use placeholders** — `{PR_DIFF}`, `{TOPIC}`, `{ANGLE_ASSIGNMENT}`, `{PRIOR_STAGE_OUTPUT}` are filled in by the Leader at dispatch time. Make them obvious.-3. **Reproduce the Output Schema verbatim** — do not paraphrase; the teammate's output must match what the Leader expects.-4. **Keep it < 50 lines** — longer personas indicate the role is doing too much; consider splitting.-------## Anti-convergence techniques--When 2+ roles in an A-pattern team risk producing similar outputs, apply these techniques:--### Technique 1: Forced theory class assignment--Each role is assigned a **fixed category** at dispatch time. Used in `systematic-debug-team`:--- Hypothesis-generator-1 → "Data/State theories only"-- Hypothesis-generator-2 → "Concurrency/Timing theories only"-- Hypothesis-generator-3 → "Environment/Configuration theories only"--The Inline Persona contains: *"You are restricted to {THEORY_CLASS} hypotheses. Do not propose hypotheses outside this class."*--### Technique 2: Antagonistic mottos--Make each role's Identity motto explicitly contradict its siblings. See the "Bad mottos" table above for what to avoid.--### Technique 3: Different methodologies, same input--Each role applies a **different framework** to the same input:--- Threat-modeler → STRIDE-- Vulnerability-scanner → OWASP Top 10-- Dependency-auditor → CVE database + license audit--The methodology constrains the output shape, preventing convergence.--### Technique 4: Adversarial dispatch order (rare)--For C-patterns with an adversarial gate, dispatch the adversary **after** seeing the prior stage's output, with explicit instruction to disagree. Used in `data-analysis-team` critique-reviewer: *"Your job is to find the analysis's failure modes, not to validate it."*-------## Gate design (for C-patterns and pipeline stages)--A quality gate sits between two stages and decides whether stage N's output is good enough to pass to stage N+1.--### Gate components--Every gate has 4 parts (declared in `workflow.md` Detailed Steps):--1. **Trigger** — when does the gate run? (Always after stage N completes; sometimes only on certain stage outcomes.)-2. **Pass criteria** — explicit, observable, ideally count-based (e.g., "brief contains all 5 mandatory sections").-3. **Fail action** — kick back to which stage? Retry how many times? Escalate to user when?-4. **Bypass conditions** (optional) — when can the user override the gate?--### Gate examples--**Brief gate** (`marketing-copy-team`, between Stage 1 and Stage 2):--> **Pass criteria**: brief contains audience definition, value proposition, message hierarchy, CTA, success metrics. All 5 sections must be present and ≥3 sentences each.-> **Fail action**: kick back to brief-strategist with the missing sections listed. Max 2 retries; on 3rd failure, surface to user with partial brief and ask how to proceed.--**Data quality gate** (`data-analysis-team`, before Stage 1 starts):--> **Pass criteria**: Data Quality Score (DQS) ≥ 0.7 across completeness, consistency, validity. GO verdict from data-quality-auditor.-> **Fail action** (NO-GO): halt the pipeline. Return DQS report to user with specific defects. Do not allow analysts to start.--### Gate anti-patterns--| Anti-pattern | Symptom | Fix |-|---|---|---|-| "Looks good to me" gate | Subjective; passes everything | Replace with count-based / enum-based criteria |-| Gate without retry policy | Pipeline halts on first failure | Add max retries + escalation rule |-| Gate that the next stage ignores | Stage N+1 starts even on FAIL | `bind.md` must declare "Stage N+1 MUST refuse to run if gate FAIL" |-| Gate redundant with `Boundary` | Forbidden rule in role file + Pass criteria in workflow say the same thing | Pick one — Boundary if it's per-role behavior, gate if it's per-stage transition |-------## Putting it together: a role file checklist--Before declaring a role file done, verify:--- [ ] First line of `## Identity` is a `> *"..."*` motto (1 sentence, first-person, distinctive POV)-- [ ] Motto is mutually antagonistic with sibling roles in A-patterns / disjoint in B-patterns / non-overlapping in C-patterns-- [ ] `## Success Criteria` has 3–6 observable bullets + a "Focus areas" line-- [ ] `## Boundary` has BOTH `**Forbidden**:` and `**Mandatory**:` blocks-- [ ] `## Output Schema` has a terminal `Verdict / Decision / Output` enum-- [ ] `## Inline Persona for Teammate` is self-contained, uses placeholders, reproduces the schema, < 50 lines-- [ ] No section duplicates content from another section-- [ ] Role file size: ~80–200 lines (significantly more = role doing too much; less = role under-specified)+# Role Design Guide++> Read this in **Stage 2** (and revisit during Stage 3 for gate design). This file teaches how to author a single `roles/<id>.md` file that passes both spec compliance and the anti-convergence test.++## The 5 mandatory sections++Every role file starts with an `# Role: <Name>` H1 title, then MUST contain exactly these 5 sections, in order:++1. `## Identity` — POV with mandatory 1-line motto first+2. `## Success Criteria` — what success looks like + focus areas+3. `## Boundary` — Forbidden + Mandatory+4. `## Output Schema` — structured output template+5. `## Inline Persona for Teammate` — pasteable prompt++The validator script enforces section presence. The judgment-call quality of each section is what this guide is about.++---++## Section 1: Identity++### Hard rule: first line is a 1-line motto++The motto is the **#1 anti-convergence mechanism** in the spec. Without it, prose Identity sections cause sibling roles to converge in output. The motto must:++- Be a **single sentence** in `> *"..."*` blockquote-italic format+- Be **first-person** (this is the role speaking)+- Be **mutually antagonistic** with sibling roles in an A-pattern team+- Crystallize a **point of view**, not a job title++**Good mottos**:++```markdown+> *"I am trying to break this code in production."*+> *"I am the user. I want to ship value, not perfect code."*+> *"I care about whether this fits the system five years from now."*+> *"I will refuse the deal if even one term smells wrong."*+> *"I am the data. I will tell you what is true even if it disappoints you."*+```++**Bad mottos** (and why):++| Bad | Why |+|---|---|+| *"I am a senior security engineer."* | Job title, not POV — could be said by 100 different roles |+| *"I find bugs and security issues."* | Capability description — converges with any reviewer role |+| *"I help the user."* | Vacuous — every role helps the user |+| Multi-sentence motto | Dilutes the POV — must be ONE sentence |+| Third-person ("This role looks for...") | Loses the in-character voice |++### After the motto: 0–2 paragraphs of context++Optional. Use these paragraphs to:++- Name the methodology the role applies (STRIDE, OWASP Top 10, SCQA, 5-Whys, etc.)+- Specify the role's "default mode" (skeptical / generous / adversarial / clinical)+- Explain the role's "when called in" — under what conditions does this POV add value++**Do not use these paragraphs to**:+- Repeat the Success Criteria — that's the next section, do not duplicate it here+- List checklists (those go in `Inline Persona`, where the teammate actually sees them)++---++## Section 2: Success Criteria++### Format++```markdown+## Success Criteria++- [Concrete deliverable 1]+- [Concrete deliverable 2]+- [Concrete deliverable 3]++**Focus areas**: [comma-separated list of what this role should prioritize examining]+```++### Quality bar++Each bullet should be **observable** — a reviewer should be able to look at the role's output and check ✓/✗ against it. Avoid:++| Vague | Concrete |+|---|---|+| "Provides good analysis" | "Returns at least 1 concrete failure scenario with evidence" |+| "Considers all angles" | "Coverage spans security / performance / readability — flagged separately" |+| "Helps the user" | "Output uses the schema in § Output Schema, no missing required fields" |++The "Focus areas" line tells the role what to prioritize examining — keep it tight, 5–10 comma-separated items.++---++## Section 3: Boundary++### Format (mandatory split)++```markdown+## Boundary++**Forbidden** (prevent role overlap):+- Do NOT [thing that another role does]+- Do NOT [thing that drifts upstream/downstream in the pipeline]++**Mandatory**:+- You MUST [thing the role tends to skip when it sees nothing obvious]+- You MUST [output discipline that the schema enforces]+```++### Why both halves are required++- **Forbidden** prevents **lateral drift** — in A/B patterns, roles bleed into each other's territory; in C patterns, stages drift upstream/downstream.+- **Mandatory** prevents **silent under-delivery** — adversarial roles default to "looks fine" when they cannot find obvious issues; coverage roles skip slices when the slice seems empty.++A role with only Forbidden tends to output empty findings. A role with only Mandatory tends to encroach on siblings. Both halves work as opposing forces.++### Examples++**A-pattern role** (`pr-review-team` adversarial-critic):++```markdown+**Forbidden**:+- Do NOT critique style or readability — that's the Code Reviewer's job.+- Do NOT propose architectural redesigns — that's the Architect's job.++**Mandatory**:+- You MUST find at least 1 concrete failure scenario.+ If you found nothing, you didn't look hard enough — recheck error paths and edge cases.+```++**C-pattern role** (`marketing-copy-team` copy-editor):++```markdown+**Forbidden**:+- Do NOT rewrite the strategy brief — the brief-strategist's output is the source of truth.+- Do NOT change the message hierarchy from the copywriter's draft.+- Do NOT add new value propositions not in the original brief.++**Mandatory**:+- You MUST preserve the brief's audience, tone, and CTA intent.+- You MUST track every edit as accept/reject so the audit stage can verify provenance.+```++---++## Section 4: Output Schema++### Format++```markdown+## Output Schema++\`\`\`markdown+## Role: <Role Name>++### <Section 1>+- [...]++### <Section 2>+- [...]++### Verdict / Decision / Output+- <enum: BLOCK / SHIP / KICK-BACK / ...>+\`\`\`+```++### Why a schema (not free text)++- **Leader integration depends on parseable structure** — A-pattern Leaders count agreements, B-pattern Leaders compose by slice, C-pattern Leaders check gates. All three need predictable output shapes.+- **Schemas force the role to commit** — a role that returns "here are some thoughts" lets the Leader off the hook. A role that must produce a `Verdict: BLOCK / SIGNIFICANT-RISK / ACCEPTABLE-RISK / LOW-RISK` is forced to take a position.++### Schema design rules++1. Always include a **Verdict / Decision / Output** terminal section that uses an **enum**, not free text. The Leader uses this for routing/integration.+2. Use **JSON** instead of Markdown if the output is consumed programmatically (rare for Teamskills — most consumers are LLMs reading Markdown).+3. Match the schema 1:1 with what `Inline Persona` tells the teammate to produce. Drift between the two = teammate output that doesn't match the schema = Leader integration failure.++---++## Section 5: Inline Persona for Teammate++### Why this section exists++> Most adopting agents do NOT auto-load role files when dispatching teammates. The Leader must extract this section verbatim and inline it into the dispatch prompt. **Without this section, Teamskills do not run on the majority of adopting agents.**++### Format++```markdown+## Inline Persona for Teammate++\`\`\`+ROLE: <Role Name> in a Teamskill.++[1-2 sentences: who you are, what your default mode is]++[1-2 sentences: what you must produce, the Mandatory + Forbidden in plain prose]++INPUTS YOU WILL RECEIVE:+- <input 1>: {INPUT_1_PLACEHOLDER}+- <input 2>: {INPUT_2_PLACEHOLDER}++OUTPUT FORMAT (use exactly this structure):+## Role: <Role Name>+### <Section 1>+- ...+### Verdict+- <enum value>+\`\`\`+```++### Quality rules++1. **Self-contained** — the teammate has no access to the parent context, the role file, the workflow, or the bind file. Everything needed to perform the role must be in this prompt.+2. **Use placeholders** — `{PR_DIFF}`, `{TOPIC}`, `{ANGLE_ASSIGNMENT}`, `{PRIOR_STAGE_OUTPUT}` are filled in by the Leader at dispatch time. Make them obvious.+3. **Reproduce the Output Schema verbatim** — do not paraphrase; the teammate's output must match what the Leader expects.+4. **Keep it < 50 lines** — longer personas indicate the role is doing too much; consider splitting.++---++## Anti-convergence techniques++When 2+ roles in an A-pattern team risk producing similar outputs, apply these techniques:++### Technique 1: Forced theory class assignment++Each role is assigned a **fixed category** at dispatch time. Used in `systematic-debug-team`:++- Hypothesis-generator-1 → "Data/State theories only"+- Hypothesis-generator-2 → "Concurrency/Timing theories only"+- Hypothesis-generator-3 → "Environment/Configuration theories only"++The Inline Persona contains: *"You are restricted to {THEORY_CLASS} hypotheses. Do not propose hypotheses outside this class."*++### Technique 2: Antagonistic mottos++Make each role's Identity motto explicitly contradict its siblings. See the "Bad mottos" table above for what to avoid.++### Technique 3: Different methodologies, same input++Each role applies a **different framework** to the same input:++- Threat-modeler → STRIDE+- Vulnerability-scanner → OWASP Top 10+- Dependency-auditor → CVE database + license audit++The methodology constrains the output shape, preventing convergence.++### Technique 4: Adversarial dispatch order (rare)++For C-patterns with an adversarial gate, dispatch the adversary **after** seeing the prior stage's output, with explicit instruction to disagree. Used in `data-analysis-team` critique-reviewer: *"Your job is to find the analysis's failure modes, not to validate it."*++---++## Gate design (for C-patterns and pipeline stages)++A quality gate sits between two stages and decides whether stage N's output is good enough to pass to stage N+1.++### Gate components++Every gate has 4 parts (declared in `workflow.md` Detailed Steps):++1. **Trigger** — when does the gate run? (Always after stage N completes; sometimes only on certain stage outcomes.)+2. **Pass criteria** — explicit, observable, ideally count-based (e.g., "brief contains all 5 mandatory sections").+3. **Fail action** — kick back to which stage? Retry how many times? Escalate to user when?+4. **Bypass conditions** (optional) — when can the user override the gate?++### Gate examples++**Brief gate** (`marketing-copy-team`, between Stage 1 and Stage 2):++> **Pass criteria**: brief contains audience definition, value proposition, message hierarchy, CTA, success metrics. All 5 sections must be present and ≥3 sentences each.+> **Fail action**: kick back to brief-strategist with the missing sections listed. Max 2 retries; on 3rd failure, surface to user with partial brief and ask how to proceed.++**Data quality gate** (`data-analysis-team`, before Stage 1 starts):++> **Pass criteria**: Data Quality Score (DQS) ≥ 0.7 across completeness, consistency, validity. GO verdict from data-quality-auditor.+> **Fail action** (NO-GO): halt the pipeline. Return DQS report to user with specific defects. Do not allow analysts to start.++### Gate anti-patterns++| Anti-pattern | Symptom | Fix |+|---|---|---|+| "Looks good to me" gate | Subjective; passes everything | Replace with count-based / enum-based criteria |+| Gate without retry policy | Pipeline halts on first failure | Add max retries + escalation rule |+| Gate that the next stage ignores | Stage N+1 starts even on FAIL | `bind.md` must declare "Stage N+1 MUST refuse to run if gate FAIL" |+| Gate redundant with `Boundary` | Forbidden rule in role file + Pass criteria in workflow say the same thing | Pick one — Boundary if it's per-role behavior, gate if it's per-stage transition |++---++## Putting it together: a role file checklist++Before declaring a role file done, verify:++- [ ] First line of `## Identity` is a `> *"..."*` motto (1 sentence, first-person, distinctive POV)+- [ ] Motto is mutually antagonistic with sibling roles in A-patterns / disjoint in B-patterns / non-overlapping in C-patterns+- [ ] `## Success Criteria` has 3–6 observable bullets + a "Focus areas" line+- [ ] `## Boundary` has BOTH `**Forbidden**:` and `**Mandatory**:` blocks+- [ ] `## Output Schema` has a terminal `Verdict / Decision / Output` enum+- [ ] `## Inline Persona for Teammate` is self-contained, uses placeholders, reproduces the schema, < 50 lines+- [ ] No section duplicates content from another section+- [ ] Role file size: ~80–200 lines (significantly more = role doing too much; less = role under-specified)diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/scripts/validate_teamskill.py b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/scripts/validate_teamskill.pysimilarity index 97%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/scripts/validate_teamskill.pyrename to jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/scripts/validate_teamskill.pyindex 4327889af1..70e4b39f37 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/scripts/validate_teamskill.py+++ b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/scripts/validate_teamskill.py@@ -1,537 +1,537 @@-#!/usr/bin/env python3-"""-validate_teamskill.py — Compliance checker for Teamskills (v0.1 spec).--Usage:- python validate_teamskill.py <path/to/teamskill-name/>--Exit codes:- 0 = PASS (no errors; warnings may still print)- 1 = FAIL (one or more errors)- 2 = USAGE error (bad arguments, missing PyYAML, etc.)--Requires: PyYAML (pip install pyyaml)--What this script catches (deterministic):- - 5-file structure (SKILL.md, roles/, workflow.md, bind.md, dependencies.yaml)- - Frontmatter required fields + types- - `name` field equals directory name- - roles/<id>.md exists for every roles[].id; no orphan role files- - Each role file has the 5 mandatory sections (## Identity / Success Criteria /- Boundary / Output Schema / Inline Persona for Teammate)- - Each `## Identity` body's first non-blank line matches motto pattern `> *"..."*`- - Each `## Boundary` contains both **Forbidden** and **Mandatory** markers- - SKILL.md body has ## Workflow / ## Roles / ## Files- - workflow.md has ## Overview / ## Detailed Steps / ## Acceptance Criteria- and at least one ```mermaid``` block- - bind.md has ## Resource Constraints / ## Behavioral Constraints / ## Failure Handling- - dependencies.yaml has both `skills:` and `tools:` keys (even if empty)- - Every roles[].skills / roles[].tools in SKILL.md appears in dependencies.yaml--What this script does NOT catch (judgment calls — see reference/compliance-checklist.md):- - Whether mottos are mutually antagonistic (anti-convergence quality)- - Whether Boundary lists really cover all sibling territories- - Whether bind.md numbers actually match the workflow's needs- - Whether the Teamskill is even justified vs a single-agent skill (Stage 0)-"""--from __future__ import annotations--import logging-import sys-import re-from pathlib import Path-from typing import Any--logging.basicConfig(level=logging.INFO, format="%(message)s")-logger = logging.getLogger(__name__)--try:- import yaml-except ImportError:- logger.info("[USAGE ERROR] PyYAML is required. Install with: pip install pyyaml")- sys.exit(2)---# ----------------------------------------------------------------------------# Result accumulator-# -----------------------------------------------------------------------------class Report:- def __init__(self) -> None:- self.errors: list[str] = []- self.warnings: list[str] = []-- def err(self, file: str, msg: str) -> None:- self.errors.append(f" [ERROR] {file}: {msg}")-- def warn(self, file: str, msg: str) -> None:- self.warnings.append(f" [WARN] {file}: {msg}")-- def passed(self) -> bool:- return not self.errors-- def emit(self) -> None:- if self.errors:- logger.info("\nERRORS:")- for e in self.errors:- logger.info(e)- if self.warnings:- logger.info("\nWARNINGS:")- for w in self.warnings:- logger.info(w)- if self.passed():- logger.info("\n[PASS] %s warning(s), 0 error(s).", len(self.warnings))- else:- logger.info(- "\n[FAIL] %s error(s), %s warning(s).",- len(self.errors),- len(self.warnings),- )---# ----------------------------------------------------------------------------# Frontmatter + section parsing helpers-# -----------------------------------------------------------------------------FRONTMATTER_RE = re.compile(r"^---\s*\n(.*?)\n---\s*\n(.*)$", re.DOTALL)---def split_frontmatter(text: str) -> tuple[dict[str, Any] | None, str]:- """Split a Markdown file into (frontmatter_dict, body_str)."""- m = FRONTMATTER_RE.match(text)- if not m:- return None, text- try:- fm = yaml.safe_load(m.group(1)) or {}- except yaml.YAMLError as e:- raise ValueError(f"frontmatter YAML parse error: {e}") from e- return fm, m.group(2)---def find_h2_sections(body: str) -> dict[str, int]:- """Return mapping of `## Section Title` -> line number (1-indexed)."""- sections: dict[str, int] = {}- for i, line in enumerate(body.splitlines(), 1):- m = re.match(r"^##\s+(.+?)\s*$", line)- if m:- sections[m.group(1).strip()] = i- return sections---def section_body(body: str, header: str) -> str | None:- """Return the body text under `## <header>` up to the next `## ` heading or EOF."""- lines = body.splitlines()- start: int | None = None- for i, line in enumerate(lines):- if re.match(rf"^##\s+{re.escape(header)}\s*$", line):- start = i + 1- break- if start is None:- return None- end = len(lines)- for j in range(start, len(lines)):- if re.match(r"^##\s+\S", lines[j]):- end = j- break- return "\n".join(lines[start:end])---# ----------------------------------------------------------------------------# Per-file validators-# -----------------------------------------------------------------------------def validate_skill_md(path: Path, report: Report) -> tuple[dict | None, list[str]]:- """Validate <root>/SKILL.md. Returns (frontmatter, role_ids_declared)."""- if not path.exists():- report.err("SKILL.md", "missing — required by the 5-file structure")- return None, []-- text = path.read_text(encoding="utf-8")-- try:- fm, body = split_frontmatter(text)- except ValueError as e:- report.err("SKILL.md", str(e))- return None, []-- if fm is None:- report.err("SKILL.md", "missing YAML frontmatter (--- ... ---)")- return None, []-- # Required frontmatter fields- for field in ("name", "description", "version", "kind", "roles"):- if field not in fm:- report.err("SKILL.md", f"frontmatter missing required field `{field}`")-- if fm.get("kind") != "team-skill":- report.err("SKILL.md", f"frontmatter `kind` must be `team-skill` (got: {fm.get('kind')!r})")-- # name == directory name- dir_name = path.parent.name- if fm.get("name") != dir_name:- report.err(- "SKILL.md",- f"frontmatter `name` ({fm.get('name')!r}) must equal directory name ({dir_name!r})",- )-- # description discipline (the trigger blob the model reads BEFORE loading the body)- desc = fm.get("description")- if isinstance(desc, str) and desc.strip():- desc_chars = len(desc.strip())- desc_lines = [ln for ln in desc.strip().splitlines() if ln.strip()]- if desc_chars > 500:- report.warn(- "SKILL.md",- f"description is {desc_chars} chars — HARD CAP is 500 (platform limit: 1024). "- "Strip synonym enumeration / scope thresholds / Stage-0 rationale; see "- "../teamskill-creator/SKILL.md Stage 5 for the discipline rules.",- )- if len(desc_lines) > 4:- report.warn(- "SKILL.md",- f"description has {len(desc_lines)} non-blank lines — HARD CAP is 4. "- "Use 3-line structure: WHAT / WHEN / NOT.",- )- if re.search(r"^\s*Triggers\s*:", desc, re.MULTILINE | re.IGNORECASE):- report.warn(- "SKILL.md",- "description contains a `Triggers:` line — DEPRECATED. Merge synonym phrases "- "into one natural-language `Use when` sentence; semantic match handles variants.",- )-- # roles[] structure- role_ids: list[str] = []- roles = fm.get("roles", [])- if not isinstance(roles, list) or not roles:- report.err("SKILL.md", "frontmatter `roles` must be a non-empty list")- else:- for i, role in enumerate(roles):- if not isinstance(role, dict):- report.err("SKILL.md", f"roles[{i}] must be an object")- continue- if "id" not in role:- report.err("SKILL.md", f"roles[{i}] missing required field `id`")- else:- role_ids.append(role["id"])- if "purpose" not in role:- report.err("SKILL.md", f"roles[{i}] (id={role.get('id')!r}) missing required field `purpose`")- else:- # Per-role purpose is a 1-line summary; details go in roles/<id>.md- purpose = role.get("purpose") or ""- if isinstance(purpose, str) and len(purpose) > 150:- report.warn(- "SKILL.md",- f"roles[{i}] (id={role.get('id')!r}) `purpose` is {len(purpose)} "- f"chars — HARD CAP is 150. Move detail into roles/{role.get('id')}.md.",- )-- # Check if all roles have empty skills and tools (suggests auto-matching was skipped)- if isinstance(roles, list) and roles:- all_empty = all(- (not role.get("skills")) and (not role.get("tools"))- for role in roles- if isinstance(role, dict)- )- if all_empty and len(role_ids) > 0:- report.warn(- "SKILL.md",- "all roles have empty `skills` and `tools` — was Stage 2 auto-matching run? "- "Empty lists are valid only when the local scan confirms no matches. "- "Run the auto-matching sub-step in Stage 2 before declaring no dependencies.",- )-- # Body required sections- sections = find_h2_sections(body)- for required in ("Workflow", "Roles", "Files"):- if required not in sections:- report.err("SKILL.md", f"body missing required section `## {required}`")-- # Anti-pattern: redundant sections that the description / workflow.md already cover- for deprecated in ("When to Use", "Anti-Patterns", "Output Format"):- if deprecated in sections:- report.warn(- "SKILL.md",- f"body contains `## {deprecated}` which is already covered by `description` "- "or `workflow.md` — remove to avoid duplication",- )-- # Anti-pattern: mermaid in SKILL.md body (redundant with workflow.md)- if re.search(r"```mermaid", body):- report.warn(- "SKILL.md",- "body contains a ```mermaid``` block — keep mermaid only in workflow.md to "- "avoid duplication",- )-- return fm, role_ids---def validate_role_file(path: Path, role_id: str, report: Report) -> dict[str, list[str]]:- """Validate one roles/<id>.md.-- Returns extracted role-level skills/tools (currently unused — declared in- SKILL.md frontmatter).- """- file_label = f"roles/{role_id}.md"- if not path.exists():- report.err(- file_label,- f"missing — required because SKILL.md frontmatter declares roles[].id = {role_id!r}",- )- return {}-- text = path.read_text(encoding="utf-8")- sections = find_h2_sections(text)-- required_sections = (- "Identity",- "Success Criteria",- "Boundary",- "Output Schema",- "Inline Persona for Teammate",- )- for s in required_sections:- if s not in sections:- report.err(file_label, f"missing required section `## {s}`")-- # Identity must start with a 1-line motto: > *"..."*- identity_body = section_body(text, "Identity")- if identity_body is not None:- first_nonblank = next((ln.strip() for ln in identity_body.splitlines() if ln.strip()), "")- # Accept either > *"..."* or > *'...'* (italic blockquote with quotes)- motto_pattern = re.compile(r'^>\s*\*["\'].+["\']\*\s*$')- if not motto_pattern.match(first_nonblank):- report.err(- file_label,- "## Identity first non-blank line must be a 1-line motto in "- f"`> *\"...\"*` format. Got: {first_nonblank[:80]!r}",- )-- # Boundary must contain BOTH Forbidden and Mandatory markers- # Accept common variations: **Forbidden**, **禁止**, **Forbidden actions**, etc.- boundary_body = section_body(text, "Boundary")- if boundary_body is not None:- has_forbidden = re.search(r"\*\*(Forbidden|禁止)\*\*", boundary_body) is not None- has_mandatory = re.search(r"\*\*(Mandatory|必须|必做)\*\*", boundary_body) is not None- if not has_forbidden:- report.err(file_label, "## Boundary missing `**Forbidden**` (or `**禁止**`) block")- if not has_mandatory:- report.err(- file_label,- "## Boundary missing `**Mandatory**` (or `**必须**` / `**必做**`) block",- )-- # Inline Persona must be non-trivially long (sanity check — empty section is the- # most common authoring error)- persona_body = section_body(text, "Inline Persona for Teammate")- if persona_body is not None and len(persona_body.strip()) < 100:- report.warn(- file_label,- f"## Inline Persona for Teammate is suspiciously short ({len(persona_body.strip())} chars). "- "It must be a self-contained pasteable prompt — see reference/role-design.md.",- )-- # Anti-pattern: section names that should be merged into the 5 mandatory sections- for deprecated in ("Mindset", "Priorities", "Inspection Process", "MUST-Find Rule", "Inline Persona for Sub-Agent"):- if deprecated in sections:- if deprecated == "Inline Persona for Sub-Agent":- report.err(- file_label,- "uses old `## Inline Persona for Sub-Agent` heading — rename to "- "`## Inline Persona for Teammate`",- )- else:- report.warn(- file_label,- f"contains `## {deprecated}` — merge it into one of the 5 mandatory "- "sections (Identity / Success Criteria / Boundary / Output Schema / "- "Inline Persona for Teammate)",- )-- return {}---def validate_workflow_md(path: Path, report: Report) -> None:- if not path.exists():- report.err("workflow.md", "missing — required by the 5-file structure")- return-- text = path.read_text(encoding="utf-8")- sections = find_h2_sections(text)-- for required in ("Overview", "Detailed Steps", "Acceptance Criteria"):- if required not in sections:- report.err("workflow.md", f"missing required section `## {required}`")-- # Mermaid is required in workflow.md — the primary expression difference from single-agent skills- if not re.search(r"```mermaid", text):- report.err(- "workflow.md",- "missing ```mermaid``` block — workflow.md must contain at least one mermaid diagram",- )---def validate_bind_md(path: Path, report: Report) -> None:- if not path.exists():- report.err("bind.md", "missing — required by the 5-file structure")- return-- text = path.read_text(encoding="utf-8")- sections = find_h2_sections(text)-- for required in ("Resource Constraints", "Behavioral Constraints", "Failure Handling"):- if required not in sections:- report.err("bind.md", f"missing required section `## {required}`")-- # Resource Constraints should mention the 3 baseline items- rc_body = section_body(text, "Resource Constraints")- if rc_body is not None:- for required_item in ("max_parallel_teammates", "total_wall_clock_budget", "total_token_budget"):- if required_item not in rc_body:- report.warn(- "bind.md",- f"## Resource Constraints does not mention `{required_item}` — "- "recommended as a baseline item",- )---def validate_dependencies_yaml(path: Path, report: Report) -> dict[str, list[str]]:- """Returns {'skills': [names], 'tools': [names]} for cross-file consistency check."""- if not path.exists():- report.err(- "dependencies.yaml",- "missing — required by the 5-file structure (write `skills: []` / `tools: []` "- "if no deps)",- )- return {"skills": [], "tools": []}-- text = path.read_text(encoding="utf-8")-- try:- data = yaml.safe_load(text) or {}- except yaml.YAMLError as e:- report.err("dependencies.yaml", f"YAML parse error: {e}")- return {"skills": [], "tools": []}-- if not isinstance(data, dict):- report.err("dependencies.yaml", "root must be a mapping with `skills` and `tools` keys")- return {"skills": [], "tools": []}-- declared = {"skills": [], "tools": []}-- for segment in ("skills", "tools"):- if segment not in data:- report.err("dependencies.yaml", f"missing required `{segment}:` segment (write `{segment}: []` if empty)")- continue-- entries = data[segment]- if entries is None:- entries = []- if not isinstance(entries, list):- report.err("dependencies.yaml", f"`{segment}:` must be a list (or `[]`)")- continue-- required_fields = {- "skills": ("name", "source", "required", "purpose"),- "tools": ("name", "required", "purpose"),- }[segment]-- for i, entry in enumerate(entries):- if not isinstance(entry, dict):- report.err("dependencies.yaml", f"{segment}[{i}] must be an object")- continue- for field in required_fields:- if field not in entry:- report.err(- "dependencies.yaml",- f"{segment}[{i}] (name={entry.get('name')!r}) missing required field "- f"`{field}`",- )- if segment in declared and "name" in entry:- declared[segment].append(entry["name"])-- return declared---# ----------------------------------------------------------------------------# Cross-file consistency-# -----------------------------------------------------------------------------def cross_check_skills_tools(skill_fm: dict, declared: dict[str, list[str]], report: Report) -> None:- """Every roles[].skills / roles[].tools in SKILL.md must appear in dependencies.yaml."""- for role in skill_fm.get("roles", []):- if not isinstance(role, dict):- continue- role_id = role.get("id", "?")- for kind, segment in (("skills", "skills"), ("tools", "tools")):- for item in role.get(kind, []) or []:- if item not in declared[segment]:- report.err(- "dependencies.yaml",- f"`{item}` is declared in SKILL.md `roles[id={role_id!r}].{kind}` "- f"but missing from `{segment}:` segment",- )---def check_orphan_role_files(roles_dir: Path, declared_role_ids: list[str], report: Report) -> None:- if not roles_dir.exists():- return- for f in roles_dir.glob("*.md"):- role_id = f.stem- if role_id not in declared_role_ids:- report.warn(- "roles/",- f"orphan file `roles/{f.name}` — not declared in SKILL.md frontmatter `roles[]`",- )---# ----------------------------------------------------------------------------# Main-# -----------------------------------------------------------------------------def validate(root: Path) -> int:- if not root.exists() or not root.is_dir():- logger.info("[USAGE ERROR] %s is not a directory", root)- return 2-- logger.info("Validating Teamskill: %s\n", root.resolve())-- report = Report()-- # 1. SKILL.md- skill_fm, role_ids = validate_skill_md(root / "SKILL.md", report)-- # 2. roles/<id>.md- roles_dir = root / "roles"- if not roles_dir.exists():- report.err("roles/", "directory missing — required by the 5-file structure")- else:- for role_id in role_ids:- validate_role_file(roles_dir / f"{role_id}.md", role_id, report)- check_orphan_role_files(roles_dir, role_ids, report)-- # 3. workflow.md- validate_workflow_md(root / "workflow.md", report)-- # 4. bind.md- validate_bind_md(root / "bind.md", report)-- # 5. dependencies.yaml + cross-check- declared = validate_dependencies_yaml(root / "dependencies.yaml", report)- if skill_fm is not None:- cross_check_skills_tools(skill_fm, declared, report)-- report.emit()- return 0 if report.passed() else 1---def main() -> int:- if len(sys.argv) != 2:- logger.info(__doc__)- return 2- return validate(Path(sys.argv[1]))---if __name__ == "__main__":- sys.exit(main())+#!/usr/bin/env python3+"""+validate_teamskill.py — Compliance checker for Teamskills (v0.1 spec).++Usage:+ python validate_teamskill.py <path/to/teamskill-name/>++Exit codes:+ 0 = PASS (no errors; warnings may still print)+ 1 = FAIL (one or more errors)+ 2 = USAGE error (bad arguments, missing PyYAML, etc.)++Requires: PyYAML (pip install pyyaml)++What this script catches (deterministic):+ - 5-file structure (SKILL.md, roles/, workflow.md, bind.md, dependencies.yaml)+ - Frontmatter required fields + types+ - `name` field equals directory name+ - roles/<id>.md exists for every roles[].id; no orphan role files+ - Each role file has the 5 mandatory sections (## Identity / Success Criteria /+ Boundary / Output Schema / Inline Persona for Teammate)+ - Each `## Identity` body's first non-blank line matches motto pattern `> *"..."*`+ - Each `## Boundary` contains both **Forbidden** and **Mandatory** markers+ - SKILL.md body has ## Workflow / ## Roles / ## Files+ - workflow.md has ## Overview / ## Detailed Steps / ## Acceptance Criteria+ and at least one ```mermaid``` block+ - bind.md has ## Resource Constraints / ## Behavioral Constraints / ## Failure Handling+ - dependencies.yaml has both `skills:` and `tools:` keys (even if empty)+ - Every roles[].skills / roles[].tools in SKILL.md appears in dependencies.yaml++What this script does NOT catch (judgment calls — see reference/compliance-checklist.md):+ - Whether mottos are mutually antagonistic (anti-convergence quality)+ - Whether Boundary lists really cover all sibling territories+ - Whether bind.md numbers actually match the workflow's needs+ - Whether the Teamskill is even justified vs a single-agent skill (Stage 0)+"""++from __future__ import annotations++import logging+import sys+import re+from pathlib import Path+from typing import Any++logging.basicConfig(level=logging.INFO, format="%(message)s")+logger = logging.getLogger(__name__)++try:+ import yaml+except ImportError:+ logger.info("[USAGE ERROR] PyYAML is required. Install with: pip install pyyaml")+ sys.exit(2)+++# ---------------------------------------------------------------------------+# Result accumulator+# ---------------------------------------------------------------------------++class Report:+ def __init__(self) -> None:+ self.errors: list[str] = []+ self.warnings: list[str] = []++ def err(self, file: str, msg: str) -> None:+ self.errors.append(f" [ERROR] {file}: {msg}")++ def warn(self, file: str, msg: str) -> None:+ self.warnings.append(f" [WARN] {file}: {msg}")++ def passed(self) -> bool:+ return not self.errors++ def emit(self) -> None:+ if self.errors:+ logger.info("\nERRORS:")+ for e in self.errors:+ logger.info(e)+ if self.warnings:+ logger.info("\nWARNINGS:")+ for w in self.warnings:+ logger.info(w)+ if self.passed():+ logger.info("\n[PASS] %s warning(s), 0 error(s).", len(self.warnings))+ else:+ logger.info(+ "\n[FAIL] %s error(s), %s warning(s).",+ len(self.errors),+ len(self.warnings),+ )+++# ---------------------------------------------------------------------------+# Frontmatter + section parsing helpers+# ---------------------------------------------------------------------------++FRONTMATTER_RE = re.compile(r"^---\s*\n(.*?)\n---\s*\n(.*)$", re.DOTALL)+++def split_frontmatter(text: str) -> tuple[dict[str, Any] | None, str]:+ """Split a Markdown file into (frontmatter_dict, body_str)."""+ m = FRONTMATTER_RE.match(text)+ if not m:+ return None, text+ try:+ fm = yaml.safe_load(m.group(1)) or {}+ except yaml.YAMLError as e:+ raise ValueError(f"frontmatter YAML parse error: {e}") from e+ return fm, m.group(2)+++def find_h2_sections(body: str) -> dict[str, int]:+ """Return mapping of `## Section Title` -> line number (1-indexed)."""+ sections: dict[str, int] = {}+ for i, line in enumerate(body.splitlines(), 1):+ m = re.match(r"^##\s+(.+?)\s*$", line)+ if m:+ sections[m.group(1).strip()] = i+ return sections+++def section_body(body: str, header: str) -> str | None:+ """Return the body text under `## <header>` up to the next `## ` heading or EOF."""+ lines = body.splitlines()+ start: int | None = None+ for i, line in enumerate(lines):+ if re.match(rf"^##\s+{re.escape(header)}\s*$", line):+ start = i + 1+ break+ if start is None:+ return None+ end = len(lines)+ for j in range(start, len(lines)):+ if re.match(r"^##\s+\S", lines[j]):+ end = j+ break+ return "\n".join(lines[start:end])+++# ---------------------------------------------------------------------------+# Per-file validators+# ---------------------------------------------------------------------------++def validate_skill_md(path: Path, report: Report) -> tuple[dict | None, list[str]]:+ """Validate <root>/SKILL.md. Returns (frontmatter, role_ids_declared)."""+ if not path.exists():+ report.err("SKILL.md", "missing — required by the 5-file structure")+ return None, []++ text = path.read_text(encoding="utf-8")++ try:+ fm, body = split_frontmatter(text)+ except ValueError as e:+ report.err("SKILL.md", str(e))+ return None, []++ if fm is None:+ report.err("SKILL.md", "missing YAML frontmatter (--- ... ---)")+ return None, []++ # Required frontmatter fields+ for field in ("name", "description", "version", "kind", "roles"):+ if field not in fm:+ report.err("SKILL.md", f"frontmatter missing required field `{field}`")++ if fm.get("kind") != "team-skill":+ report.err("SKILL.md", f"frontmatter `kind` must be `team-skill` (got: {fm.get('kind')!r})")++ # name == directory name+ dir_name = path.parent.name+ if fm.get("name") != dir_name:+ report.err(+ "SKILL.md",+ f"frontmatter `name` ({fm.get('name')!r}) must equal directory name ({dir_name!r})",+ )++ # description discipline (the trigger blob the model reads BEFORE loading the body)+ desc = fm.get("description")+ if isinstance(desc, str) and desc.strip():+ desc_chars = len(desc.strip())+ desc_lines = [ln for ln in desc.strip().splitlines() if ln.strip()]+ if desc_chars > 500:+ report.warn(+ "SKILL.md",+ f"description is {desc_chars} chars — HARD CAP is 500 (platform limit: 1024). "+ "Strip synonym enumeration / scope thresholds / Stage-0 rationale; see "+ "../teamskill-creator/SKILL.md Stage 5 for the discipline rules.",+ )+ if len(desc_lines) > 4:+ report.warn(+ "SKILL.md",+ f"description has {len(desc_lines)} non-blank lines — HARD CAP is 4. "+ "Use 3-line structure: WHAT / WHEN / NOT.",+ )+ if re.search(r"^\s*Triggers\s*:", desc, re.MULTILINE | re.IGNORECASE):+ report.warn(+ "SKILL.md",+ "description contains a `Triggers:` line — DEPRECATED. Merge synonym phrases "+ "into one natural-language `Use when` sentence; semantic match handles variants.",+ )++ # roles[] structure+ role_ids: list[str] = []+ roles = fm.get("roles", [])+ if not isinstance(roles, list) or not roles:+ report.err("SKILL.md", "frontmatter `roles` must be a non-empty list")+ else:+ for i, role in enumerate(roles):+ if not isinstance(role, dict):+ report.err("SKILL.md", f"roles[{i}] must be an object")+ continue+ if "id" not in role:+ report.err("SKILL.md", f"roles[{i}] missing required field `id`")+ else:+ role_ids.append(role["id"])+ if "purpose" not in role:+ report.err("SKILL.md", f"roles[{i}] (id={role.get('id')!r}) missing required field `purpose`")+ else:+ # Per-role purpose is a 1-line summary; details go in roles/<id>.md+ purpose = role.get("purpose") or ""+ if isinstance(purpose, str) and len(purpose) > 150:+ report.warn(+ "SKILL.md",+ f"roles[{i}] (id={role.get('id')!r}) `purpose` is {len(purpose)} "+ f"chars — HARD CAP is 150. Move detail into roles/{role.get('id')}.md.",+ )++ # Check if all roles have empty skills and tools (suggests auto-matching was skipped)+ if isinstance(roles, list) and roles:+ all_empty = all(+ (not role.get("skills")) and (not role.get("tools"))+ for role in roles+ if isinstance(role, dict)+ )+ if all_empty and len(role_ids) > 0:+ report.warn(+ "SKILL.md",+ "all roles have empty `skills` and `tools` — was Stage 2 auto-matching run? "+ "Empty lists are valid only when the local scan confirms no matches. "+ "Run the auto-matching sub-step in Stage 2 before declaring no dependencies.",+ )++ # Body required sections+ sections = find_h2_sections(body)+ for required in ("Workflow", "Roles", "Files"):+ if required not in sections:+ report.err("SKILL.md", f"body missing required section `## {required}`")++ # Anti-pattern: redundant sections that the description / workflow.md already cover+ for deprecated in ("When to Use", "Anti-Patterns", "Output Format"):+ if deprecated in sections:+ report.warn(+ "SKILL.md",+ f"body contains `## {deprecated}` which is already covered by `description` "+ "or `workflow.md` — remove to avoid duplication",+ )++ # Anti-pattern: mermaid in SKILL.md body (redundant with workflow.md)+ if re.search(r"```mermaid", body):+ report.warn(+ "SKILL.md",+ "body contains a ```mermaid``` block — keep mermaid only in workflow.md to "+ "avoid duplication",+ )++ return fm, role_ids+++def validate_role_file(path: Path, role_id: str, report: Report) -> dict[str, list[str]]:+ """Validate one roles/<id>.md.++ Returns extracted role-level skills/tools (currently unused — declared in+ SKILL.md frontmatter).+ """+ file_label = f"roles/{role_id}.md"+ if not path.exists():+ report.err(+ file_label,+ f"missing — required because SKILL.md frontmatter declares roles[].id = {role_id!r}",+ )+ return {}++ text = path.read_text(encoding="utf-8")+ sections = find_h2_sections(text)++ required_sections = (+ "Identity",+ "Success Criteria",+ "Boundary",+ "Output Schema",+ "Inline Persona for Teammate",+ )+ for s in required_sections:+ if s not in sections:+ report.err(file_label, f"missing required section `## {s}`")++ # Identity must start with a 1-line motto: > *"..."*+ identity_body = section_body(text, "Identity")+ if identity_body is not None:+ first_nonblank = next((ln.strip() for ln in identity_body.splitlines() if ln.strip()), "")+ # Accept either > *"..."* or > *'...'* (italic blockquote with quotes)+ motto_pattern = re.compile(r'^>\s*\*["\'].+["\']\*\s*$')+ if not motto_pattern.match(first_nonblank):+ report.err(+ file_label,+ "## Identity first non-blank line must be a 1-line motto in "+ f"`> *\"...\"*` format. Got: {first_nonblank[:80]!r}",+ )++ # Boundary must contain BOTH Forbidden and Mandatory markers+ # Accept common variations: **Forbidden**, **禁止**, **Forbidden actions**, etc.+ boundary_body = section_body(text, "Boundary")+ if boundary_body is not None:+ has_forbidden = re.search(r"\*\*(Forbidden|禁止)\*\*", boundary_body) is not None+ has_mandatory = re.search(r"\*\*(Mandatory|必须|必做)\*\*", boundary_body) is not None+ if not has_forbidden:+ report.err(file_label, "## Boundary missing `**Forbidden**` (or `**禁止**`) block")+ if not has_mandatory:+ report.err(+ file_label,+ "## Boundary missing `**Mandatory**` (or `**必须**` / `**必做**`) block",+ )++ # Inline Persona must be non-trivially long (sanity check — empty section is the+ # most common authoring error)+ persona_body = section_body(text, "Inline Persona for Teammate")+ if persona_body is not None and len(persona_body.strip()) < 100:+ report.warn(+ file_label,+ f"## Inline Persona for Teammate is suspiciously short ({len(persona_body.strip())} chars). "+ "It must be a self-contained pasteable prompt — see reference/role-design.md.",+ )++ # Anti-pattern: section names that should be merged into the 5 mandatory sections+ for deprecated in ("Mindset", "Priorities", "Inspection Process", "MUST-Find Rule", "Inline Persona for Sub-Agent"):+ if deprecated in sections:+ if deprecated == "Inline Persona for Sub-Agent":+ report.err(+ file_label,+ "uses old `## Inline Persona for Sub-Agent` heading — rename to "+ "`## Inline Persona for Teammate`",+ )+ else:+ report.warn(+ file_label,+ f"contains `## {deprecated}` — merge it into one of the 5 mandatory "+ "sections (Identity / Success Criteria / Boundary / Output Schema / "+ "Inline Persona for Teammate)",+ )++ return {}+++def validate_workflow_md(path: Path, report: Report) -> None:+ if not path.exists():+ report.err("workflow.md", "missing — required by the 5-file structure")+ return++ text = path.read_text(encoding="utf-8")+ sections = find_h2_sections(text)++ for required in ("Overview", "Detailed Steps", "Acceptance Criteria"):+ if required not in sections:+ report.err("workflow.md", f"missing required section `## {required}`")++ # Mermaid is required in workflow.md — the primary expression difference from single-agent skills+ if not re.search(r"```mermaid", text):+ report.err(+ "workflow.md",+ "missing ```mermaid``` block — workflow.md must contain at least one mermaid diagram",+ )+++def validate_bind_md(path: Path, report: Report) -> None:+ if not path.exists():+ report.err("bind.md", "missing — required by the 5-file structure")+ return++ text = path.read_text(encoding="utf-8")+ sections = find_h2_sections(text)++ for required in ("Resource Constraints", "Behavioral Constraints", "Failure Handling"):+ if required not in sections:+ report.err("bind.md", f"missing required section `## {required}`")++ # Resource Constraints should mention the 3 baseline items+ rc_body = section_body(text, "Resource Constraints")+ if rc_body is not None:+ for required_item in ("max_parallel_teammates", "total_wall_clock_budget", "total_token_budget"):+ if required_item not in rc_body:+ report.warn(+ "bind.md",+ f"## Resource Constraints does not mention `{required_item}` — "+ "recommended as a baseline item",+ )+++def validate_dependencies_yaml(path: Path, report: Report) -> dict[str, list[str]]:+ """Returns {'skills': [names], 'tools': [names]} for cross-file consistency check."""+ if not path.exists():+ report.err(+ "dependencies.yaml",+ "missing — required by the 5-file structure (write `skills: []` / `tools: []` "+ "if no deps)",+ )+ return {"skills": [], "tools": []}++ text = path.read_text(encoding="utf-8")++ try:+ data = yaml.safe_load(text) or {}+ except yaml.YAMLError as e:+ report.err("dependencies.yaml", f"YAML parse error: {e}")+ return {"skills": [], "tools": []}++ if not isinstance(data, dict):+ report.err("dependencies.yaml", "root must be a mapping with `skills` and `tools` keys")+ return {"skills": [], "tools": []}++ declared = {"skills": [], "tools": []}++ for segment in ("skills", "tools"):+ if segment not in data:+ report.err("dependencies.yaml", f"missing required `{segment}:` segment (write `{segment}: []` if empty)")+ continue++ entries = data[segment]+ if entries is None:+ entries = []+ if not isinstance(entries, list):+ report.err("dependencies.yaml", f"`{segment}:` must be a list (or `[]`)")+ continue++ required_fields = {+ "skills": ("name", "source", "required", "purpose"),+ "tools": ("name", "required", "purpose"),+ }[segment]++ for i, entry in enumerate(entries):+ if not isinstance(entry, dict):+ report.err("dependencies.yaml", f"{segment}[{i}] must be an object")+ continue+ for field in required_fields:+ if field not in entry:+ report.err(+ "dependencies.yaml",+ f"{segment}[{i}] (name={entry.get('name')!r}) missing required field "+ f"`{field}`",+ )+ if segment in declared and "name" in entry:+ declared[segment].append(entry["name"])++ return declared+++# ---------------------------------------------------------------------------+# Cross-file consistency+# ---------------------------------------------------------------------------++def cross_check_skills_tools(skill_fm: dict, declared: dict[str, list[str]], report: Report) -> None:+ """Every roles[].skills / roles[].tools in SKILL.md must appear in dependencies.yaml."""+ for role in skill_fm.get("roles", []):+ if not isinstance(role, dict):+ continue+ role_id = role.get("id", "?")+ for kind, segment in (("skills", "skills"), ("tools", "tools")):+ for item in role.get(kind, []) or []:+ if item not in declared[segment]:+ report.err(+ "dependencies.yaml",+ f"`{item}` is declared in SKILL.md `roles[id={role_id!r}].{kind}` "+ f"but missing from `{segment}:` segment",+ )+++def check_orphan_role_files(roles_dir: Path, declared_role_ids: list[str], report: Report) -> None:+ if not roles_dir.exists():+ return+ for f in roles_dir.glob("*.md"):+ role_id = f.stem+ if role_id not in declared_role_ids:+ report.warn(+ "roles/",+ f"orphan file `roles/{f.name}` — not declared in SKILL.md frontmatter `roles[]`",+ )+++# ---------------------------------------------------------------------------+# Main+# ---------------------------------------------------------------------------++def validate(root: Path) -> int:+ if not root.exists() or not root.is_dir():+ logger.info("[USAGE ERROR] %s is not a directory", root)+ return 2++ logger.info("Validating Teamskill: %s\n", root.resolve())++ report = Report()++ # 1. SKILL.md+ skill_fm, role_ids = validate_skill_md(root / "SKILL.md", report)++ # 2. roles/<id>.md+ roles_dir = root / "roles"+ if not roles_dir.exists():+ report.err("roles/", "directory missing — required by the 5-file structure")+ else:+ for role_id in role_ids:+ validate_role_file(roles_dir / f"{role_id}.md", role_id, report)+ check_orphan_role_files(roles_dir, role_ids, report)++ # 3. workflow.md+ validate_workflow_md(root / "workflow.md", report)++ # 4. bind.md+ validate_bind_md(root / "bind.md", report)++ # 5. dependencies.yaml + cross-check+ declared = validate_dependencies_yaml(root / "dependencies.yaml", report)+ if skill_fm is not None:+ cross_check_skills_tools(skill_fm, declared, report)++ report.emit()+ return 0 if report.passed() else 1+++def main() -> int:+ if len(sys.argv) != 2:+ logger.info(__doc__)+ return 2+ return validate(Path(sys.argv[1]))+++if __name__ == "__main__":+ sys.exit(main())diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/templates/SKILL.md.template b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/templates/SKILL.md.templatesimilarity index 98%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/templates/SKILL.md.templaterename to jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/templates/SKILL.md.templateindex 18b2bf756b..c48a944ba7 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/templates/SKILL.md.template+++ b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/templates/SKILL.md.template@@ -1,99 +1,99 @@-----name: <teamskill-name>-description: |- <One-line WHAT: this Teamskill does X via N-role pattern Y. e.g., "3-role adversarial PR review (Reviewer + Critic + Architect) that surfaces inter-role conflicts instead of papering over them">.- Use when <one-line WHEN: the natural-language situation that should trigger — do NOT enumerate synonym phrases; semantic match handles variants>.- Do NOT use for <one-line NOT: explicit non-cases that prevent over-firing on adjacent skills>.-version: "0.1"-kind: team-skill-roles:- - id: <role-id-1>- purpose: <≤150 chars HARD CAP: 1-line role responsibility — what this role does and why. Detail belongs in roles/<id>.md, not here>- skills: [<dependent-skill-name>] # populated from Stage 2 auto-matching; mirror in dependencies.yaml- tools: [<tool-name>] # populated from Stage 2 auto-matching; mirror in dependencies.yaml- - id: <role-id-2>- purpose: <...>- skills: [] # [] = Stage 2 auto-matching confirmed no skill matches for this role- tools: []- - id: <role-id-3>- purpose: <...>------# <Teamskill Display Name>--<1-2 sentences: an in-context introduction for an Agent that has already triggered this skill. Different from `description` (which gates the trigger). State the team's pattern (parallel adversarial / sequential pipeline / mixed) and the single failure mode it solves.>--## Workflow--<Describe the protocol in natural language. Use numbered steps. Step 0 MUST be dependency pre-flight.>--0. **Pre-flight: check dependencies** — read [dependencies.yaml](dependencies.yaml) and verify.- Report missing items: `required: true` = likely fails without it; `required: false` = degraded but functional. **User decides** whether to proceed.- The team can run on inline-persona-only mode if all skills are missing.- Note: dependencies were populated during authoring via Stage 2 auto-matching (local scan) and optional post-generation community enrichment. Each entry's `source` field indicates origin (`local` or community URL).--1. **<Step name>** — <executor (Leader / role-id) / input / action>. <Conditions, links to- detail files: see [bind.md](bind.md) § <Section> for limits, see [workflow.md](workflow.md)- for the full step.>--2. **<Step name>** — <...>--3. **<Step name>** — <...>--4. **Final: emit <Report Name>** — <what the report contains>. <Decision rule for any- ambiguity, e.g., "Leader surfaces contradictions verbatim, never mediates".>--## Roles--| id | Purpose | When dispatched | Input | Key dependencies | Role file |-|---|---|---|---|---|---|-| <role-id-1> | <1-line purpose> | <every run / on condition X / parallel with Y> | <what this role receives> | <skill / tool> | [roles/<role-id-1>.md](roles/<role-id-1>.md) |-| <role-id-2> | <...> | <...> | <...> | <...> | [roles/<role-id-2>.md](roles/<role-id-2>.md) |-| <role-id-3> | <...> | <...> | <...> | <...> | [roles/<role-id-3>.md](roles/<role-id-3>.md) |--> Before dispatching each teammate, read the corresponding role file and extract the-> `## Inline Persona for Teammate` section — paste it directly into the dispatch prompt.-> Most adopting agents do NOT auto-load role files for teammates.--## Files--| File | What it contains | When to read |-|---|---|---|-| [workflow.md](workflow.md) | Mermaid diagram, step-by-step protocol, integration rules, Final Report format | Before first dispatch — the complete playbook |-| [bind.md](bind.md) | Resource limits, behavioral constraints, failure handling and degraded modes | When hitting limits, handling failures, or needing degraded-mode rules |-| [roles/\*.md](roles/) | Per-role identity, success criteria, output schema, Inline Persona for Teammate | Before dispatching each teammate — extract Inline Persona |-| [dependencies.yaml](dependencies.yaml) | External skills and tools required to run | **Startup** — verify deps, report missing items, user decides go/no-go |--<!---TEMPLATE NOTES (delete before publishing):--1. `description` is a TRIGGER read by the model BEFORE loading the body.- HARD RULES (the validator enforces these):- - ≤ 4 lines, ≤ 500 chars total.- - 3-line structure only: WHAT / WHEN / NOT. Do NOT add a separate `Triggers:` line.- - NO synonym enumeration. Modern semantic match handles "评审 PR / review this PR /- team review / 多角色评审" from a single natural sentence. Listing 5+ phrases- wastes tokens and signals to the validator that the WHAT line is unclear.- - NO scope thresholds with numbers (e.g. ">200 LOC"). Those belong in bind.md.- - NO Stage 0 justification rationale (e.g. "replaces the failure mode where...").- That belongs in the body intro paragraph.- Calibration benchmark: see ../SKILL.md frontmatter for a compliant example.--2. The first heading paragraph below the frontmatter is for an ALREADY-TRIGGERED Agent- (more room — 1-2 sentences stating pattern + the failure mode this team solves).- Different consumer + different timing from `description` — both are needed.--3. SKILL.md body MUST contain `## Workflow` + `## Roles` + `## Files`.- Do NOT add `## When to Use` (already covered by description).- Do NOT add `## Anti-Patterns` (already covered by description's "Do NOT use for").- Do NOT add a mermaid diagram here — it belongs only in workflow.md.--4. The Roles table should include "When dispatched" / "Input" / "Key dependencies"- columns to augment the structured `roles[]` frontmatter with runtime info.--5. Step 0 (dependency pre-flight) is MANDATORY. The Agent reports → user decides go/no-go.- The Agent does NOT make the go/no-go call itself.--6. Per-role `purpose:` field has a ≤150-char HARD CAP (validator enforces).- Detail goes in roles/<id>.md, not here.--->+---+name: <teamskill-name>+description: |+ <One-line WHAT: this Teamskill does X via N-role pattern Y. e.g., "3-role adversarial PR review (Reviewer + Critic + Architect) that surfaces inter-role conflicts instead of papering over them">.+ Use when <one-line WHEN: the natural-language situation that should trigger — do NOT enumerate synonym phrases; semantic match handles variants>.+ Do NOT use for <one-line NOT: explicit non-cases that prevent over-firing on adjacent skills>.+version: "0.1"+kind: team-skill+roles:+ - id: <role-id-1>+ purpose: <≤150 chars HARD CAP: 1-line role responsibility — what this role does and why. Detail belongs in roles/<id>.md, not here>+ skills: [<dependent-skill-name>] # populated from Stage 2 auto-matching; mirror in dependencies.yaml+ tools: [<tool-name>] # populated from Stage 2 auto-matching; mirror in dependencies.yaml+ - id: <role-id-2>+ purpose: <...>+ skills: [] # [] = Stage 2 auto-matching confirmed no skill matches for this role+ tools: []+ - id: <role-id-3>+ purpose: <...>+---++# <Teamskill Display Name>++<1-2 sentences: an in-context introduction for an Agent that has already triggered this skill. Different from `description` (which gates the trigger). State the team's pattern (parallel adversarial / sequential pipeline / mixed) and the single failure mode it solves.>++## Workflow++<Describe the protocol in natural language. Use numbered steps. Step 0 MUST be dependency pre-flight.>++0. **Pre-flight: check dependencies** — read [dependencies.yaml](dependencies.yaml) and verify.+ Report missing items: `required: true` = likely fails without it; `required: false` = degraded but functional. **User decides** whether to proceed.+ The team can run on inline-persona-only mode if all skills are missing.+ Note: dependencies were populated during authoring via Stage 2 auto-matching (local scan) and optional post-generation community enrichment. Each entry's `source` field indicates origin (`local` or community URL).++1. **<Step name>** — <executor (Leader / role-id) / input / action>. <Conditions, links to+ detail files: see [bind.md](bind.md) § <Section> for limits, see [workflow.md](workflow.md)+ for the full step.>++2. **<Step name>** — <...>++3. **<Step name>** — <...>++4. **Final: emit <Report Name>** — <what the report contains>. <Decision rule for any+ ambiguity, e.g., "Leader surfaces contradictions verbatim, never mediates".>++## Roles++| id | Purpose | When dispatched | Input | Key dependencies | Role file |+|---|---|---|---|---|---|+| <role-id-1> | <1-line purpose> | <every run / on condition X / parallel with Y> | <what this role receives> | <skill / tool> | [roles/<role-id-1>.md](roles/<role-id-1>.md) |+| <role-id-2> | <...> | <...> | <...> | <...> | [roles/<role-id-2>.md](roles/<role-id-2>.md) |+| <role-id-3> | <...> | <...> | <...> | <...> | [roles/<role-id-3>.md](roles/<role-id-3>.md) |++> Before dispatching each teammate, read the corresponding role file and extract the+> `## Inline Persona for Teammate` section — paste it directly into the dispatch prompt.+> Most adopting agents do NOT auto-load role files for teammates.++## Files++| File | What it contains | When to read |+|---|---|---|+| [workflow.md](workflow.md) | Mermaid diagram, step-by-step protocol, integration rules, Final Report format | Before first dispatch — the complete playbook |+| [bind.md](bind.md) | Resource limits, behavioral constraints, failure handling and degraded modes | When hitting limits, handling failures, or needing degraded-mode rules |+| [roles/\*.md](roles/) | Per-role identity, success criteria, output schema, Inline Persona for Teammate | Before dispatching each teammate — extract Inline Persona |+| [dependencies.yaml](dependencies.yaml) | External skills and tools required to run | **Startup** — verify deps, report missing items, user decides go/no-go |++<!--+TEMPLATE NOTES (delete before publishing):++1. `description` is a TRIGGER read by the model BEFORE loading the body.+ HARD RULES (the validator enforces these):+ - ≤ 4 lines, ≤ 500 chars total.+ - 3-line structure only: WHAT / WHEN / NOT. Do NOT add a separate `Triggers:` line.+ - NO synonym enumeration. Modern semantic match handles "评审 PR / review this PR /+ team review / 多角色评审" from a single natural sentence. Listing 5+ phrases+ wastes tokens and signals to the validator that the WHAT line is unclear.+ - NO scope thresholds with numbers (e.g. ">200 LOC"). Those belong in bind.md.+ - NO Stage 0 justification rationale (e.g. "replaces the failure mode where...").+ That belongs in the body intro paragraph.+ Calibration benchmark: see ../SKILL.md frontmatter for a compliant example.++2. The first heading paragraph below the frontmatter is for an ALREADY-TRIGGERED Agent+ (more room — 1-2 sentences stating pattern + the failure mode this team solves).+ Different consumer + different timing from `description` — both are needed.++3. SKILL.md body MUST contain `## Workflow` + `## Roles` + `## Files`.+ Do NOT add `## When to Use` (already covered by description).+ Do NOT add `## Anti-Patterns` (already covered by description's "Do NOT use for").+ Do NOT add a mermaid diagram here — it belongs only in workflow.md.++4. The Roles table should include "When dispatched" / "Input" / "Key dependencies"+ columns to augment the structured `roles[]` frontmatter with runtime info.++5. Step 0 (dependency pre-flight) is MANDATORY. The Agent reports → user decides go/no-go.+ The Agent does NOT make the go/no-go call itself.++6. Per-role `purpose:` field has a ≤150-char HARD CAP (validator enforces).+ Detail goes in roles/<id>.md, not here.+-->diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/templates/bind.md.template b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/templates/bind.md.templatesimilarity index 98%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/templates/bind.md.templaterename to jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/templates/bind.md.templateindex df05c52576..c6ee8f4690 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/templates/bind.md.template+++ b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/templates/bind.md.template@@ -1,79 +1,79 @@-# Execution Guardrails--## Resource Constraints--| Item | Limit | Reason |-|---|---|---|-| `max_parallel_teammates` | <e.g., 3> | <e.g., matches the parallel fan-out in workflow.md mermaid> |-| `total_wall_clock_budget` | <e.g., 10 min> | <e.g., upper bound for one full run including all sequential stages> |-| `total_token_budget` | <e.g., 200k tokens> | <e.g., budget across all roles; prevents one teammate from exhausting context> |-| `<per_role_token_budget>` (optional) | <e.g., 60k per role> | <only if asymmetric — e.g., the curator role gets more than analysts> |-| `<per_role_wall_clock>` (optional) | <e.g., 3 min per role> | <only if asymmetric> |-| `debate_rounds` (Debate pattern only) | <e.g., 1–2> | Cross-exam round count; each round ≈ linear token growth |--## Behavioral Constraints--<Team-level rules — distinct from per-role Boundary which constrains a single role.-Behavioral Constraints govern what Leader and the team-as-a-whole must / must not do.>--- **Leader-as-orchestrator only**: the Leader dispatches teammates and integrates outputs.- The Leader does NOT write findings, run analyses, or substitute any role's work.-- <Pattern-specific isolation rule:- A-pattern: "Teammates MUST NOT see each other's output during their work — isolation is the value of adversarial review."- C-pattern: "Each stage MUST NOT modify upstream stage outputs — only enhance / annotate."- B-pattern: "Each parallel role works on its assigned slice ONLY — slices are dispatch-time fixed, not negotiated."- Debate-pattern: "Round 1 teammates are isolated (no cross-visibility). Round 2+ teammates receive prior-round outputs from all other roles (mutual visibility). The Teamskill declares who sees whose output at which phase; how it is delivered is a framework-level choice with recommended preference: (1) direct peer-to-peer exchange; (2) shared blackboard; (3) Leader-relay as fallback.">-- **Contradiction handling**: when roles disagree, Leader surfaces contradictions verbatim- in the Final Report. Leader NEVER mediates / picks a winner / averages opinions.- Resolution is the human user's call.-- <Domain-specific behavioral rule, e.g., "no live-system testing without authorization"- for security-audit-team, "blameless language only" for incident-response-team, etc.>--## Failure Handling--### (a) Teammate failure--| Failure mode | Response |-|---|---|-| Teammate timeout | Retry once (single retry only). On 2nd timeout, mark role's section in the Final Report as `[ROLE MISSING — teammate timed out]` and proceed with the remaining roles' outputs. |-| Malformed teammate output (does not match Output Schema) | Re-dispatch with the schema explicitly inlined and a "your previous output was malformed" preamble. Max 1 retry. On 2nd malformed output, mark as `[ROLE MISSING — malformed output]` and proceed. |-| Teammate refuses (e.g., claims it cannot find anything for an A-pattern adversarial role) | Re-dispatch with the role's `Boundary > Mandatory` rule restated. If it still refuses, mark as `[ROLE INCONCLUSIVE]` and surface verbatim in the report. |--### (b) Input over-scale degradation--| Trigger condition | Degraded mode |-|---|---|-| <e.g., diff > 2000 LOC> | <e.g., fall back to single-role mode using only the most critical role; warn the user before starting> |-| <e.g., topic too narrow for B-pattern decomposition> | <e.g., reduce to 1 role; warn user that the team's value is reduced> |-| <e.g., critical dependency missing per pre-flight> | <e.g., user already chose to proceed in Step 0 — record the missing dep in the Final Report> |--### Escalation rules--- If 50%+ of roles return `[ROLE MISSING]`, the run is **FAILED** — emit a partial report with explicit "FAILED: insufficient role coverage" header and surface to user.-- If `total_wall_clock_budget` is exceeded, halt all in-flight teammates, emit whatever partial outputs exist, and tag the report `INCOMPLETE: budget exceeded`.-- If `total_token_budget` is exceeded mid-run, halt new dispatches, allow in-flight to complete, emit partial report tagged `INCOMPLETE: token budget exceeded`.--<!---TEMPLATE NOTES (delete before publishing):--1. Resource Constraints MUST contain at least:- - max_parallel_teammates (matches workflow.md fan-out)- - total_wall_clock_budget (upper bound for one run)- - total_token_budget (across all roles)- Add per-role limits ONLY if asymmetric (most teams are symmetric — keep it simple).--2. Behavioral Constraints govern THE TEAM as a whole.- Per-role rules belong in roles/<id>.md `## Boundary`.- Heuristic: if the rule mentions the Leader or "all teammates", it goes here.--3. Failure Handling MUST cover BOTH (a) teammate failure AND (b) input overscale.- Most authoring errors omit (b). Add concrete numeric triggers for (b).--4. The "Escalation rules" subsection is optional but useful — it covers what happens- when multiple failures stack on top of each other.--5. Heuristic for what goes in bind.md vs workflow.md:- - Numbers (budgets, retry counts, thresholds) → bind.md- - Exception paths and degraded modes → bind.md- - Main flow steps → workflow.md--->+# Execution Guardrails++## Resource Constraints++| Item | Limit | Reason |+|---|---|---|+| `max_parallel_teammates` | <e.g., 3> | <e.g., matches the parallel fan-out in workflow.md mermaid> |+| `total_wall_clock_budget` | <e.g., 10 min> | <e.g., upper bound for one full run including all sequential stages> |+| `total_token_budget` | <e.g., 200k tokens> | <e.g., budget across all roles; prevents one teammate from exhausting context> |+| `<per_role_token_budget>` (optional) | <e.g., 60k per role> | <only if asymmetric — e.g., the curator role gets more than analysts> |+| `<per_role_wall_clock>` (optional) | <e.g., 3 min per role> | <only if asymmetric> |+| `debate_rounds` (Debate pattern only) | <e.g., 1–2> | Cross-exam round count; each round ≈ linear token growth |++## Behavioral Constraints++<Team-level rules — distinct from per-role Boundary which constrains a single role.+Behavioral Constraints govern what Leader and the team-as-a-whole must / must not do.>++- **Leader-as-orchestrator only**: the Leader dispatches teammates and integrates outputs.+ The Leader does NOT write findings, run analyses, or substitute any role's work.+- <Pattern-specific isolation rule:+ A-pattern: "Teammates MUST NOT see each other's output during their work — isolation is the value of adversarial review."+ C-pattern: "Each stage MUST NOT modify upstream stage outputs — only enhance / annotate."+ B-pattern: "Each parallel role works on its assigned slice ONLY — slices are dispatch-time fixed, not negotiated."+ Debate-pattern: "Round 1 teammates are isolated (no cross-visibility). Round 2+ teammates receive prior-round outputs from all other roles (mutual visibility). The Teamskill declares who sees whose output at which phase; how it is delivered is a framework-level choice with recommended preference: (1) direct peer-to-peer exchange; (2) shared blackboard; (3) Leader-relay as fallback.">+- **Contradiction handling**: when roles disagree, Leader surfaces contradictions verbatim+ in the Final Report. Leader NEVER mediates / picks a winner / averages opinions.+ Resolution is the human user's call.+- <Domain-specific behavioral rule, e.g., "no live-system testing without authorization"+ for security-audit-team, "blameless language only" for incident-response-team, etc.>++## Failure Handling++### (a) Teammate failure++| Failure mode | Response |+|---|---|+| Teammate timeout | Retry once (single retry only). On 2nd timeout, mark role's section in the Final Report as `[ROLE MISSING — teammate timed out]` and proceed with the remaining roles' outputs. |+| Malformed teammate output (does not match Output Schema) | Re-dispatch with the schema explicitly inlined and a "your previous output was malformed" preamble. Max 1 retry. On 2nd malformed output, mark as `[ROLE MISSING — malformed output]` and proceed. |+| Teammate refuses (e.g., claims it cannot find anything for an A-pattern adversarial role) | Re-dispatch with the role's `Boundary > Mandatory` rule restated. If it still refuses, mark as `[ROLE INCONCLUSIVE]` and surface verbatim in the report. |++### (b) Input over-scale degradation++| Trigger condition | Degraded mode |+|---|---|+| <e.g., diff > 2000 LOC> | <e.g., fall back to single-role mode using only the most critical role; warn the user before starting> |+| <e.g., topic too narrow for B-pattern decomposition> | <e.g., reduce to 1 role; warn user that the team's value is reduced> |+| <e.g., critical dependency missing per pre-flight> | <e.g., user already chose to proceed in Step 0 — record the missing dep in the Final Report> |++### Escalation rules++- If 50%+ of roles return `[ROLE MISSING]`, the run is **FAILED** — emit a partial report with explicit "FAILED: insufficient role coverage" header and surface to user.+- If `total_wall_clock_budget` is exceeded, halt all in-flight teammates, emit whatever partial outputs exist, and tag the report `INCOMPLETE: budget exceeded`.+- If `total_token_budget` is exceeded mid-run, halt new dispatches, allow in-flight to complete, emit partial report tagged `INCOMPLETE: token budget exceeded`.++<!--+TEMPLATE NOTES (delete before publishing):++1. Resource Constraints MUST contain at least:+ - max_parallel_teammates (matches workflow.md fan-out)+ - total_wall_clock_budget (upper bound for one run)+ - total_token_budget (across all roles)+ Add per-role limits ONLY if asymmetric (most teams are symmetric — keep it simple).++2. Behavioral Constraints govern THE TEAM as a whole.+ Per-role rules belong in roles/<id>.md `## Boundary`.+ Heuristic: if the rule mentions the Leader or "all teammates", it goes here.++3. Failure Handling MUST cover BOTH (a) teammate failure AND (b) input overscale.+ Most authoring errors omit (b). Add concrete numeric triggers for (b).++4. The "Escalation rules" subsection is optional but useful — it covers what happens+ when multiple failures stack on top of each other.++5. Heuristic for what goes in bind.md vs workflow.md:+ - Numbers (budgets, retry counts, thresholds) → bind.md+ - Exception paths and degraded modes → bind.md+ - Main flow steps → workflow.md+-->diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/templates/dependencies.yaml.template b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/templates/dependencies.yaml.templatesimilarity index 97%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/templates/dependencies.yaml.templaterename to jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/templates/dependencies.yaml.templateindex 846a6ee33d..028a42ea8c 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/templates/dependencies.yaml.template+++ b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/templates/dependencies.yaml.template@@ -1,52 +1,52 @@-# dependencies.yaml — Teamskill startup dependency check-#-# Agent reads this file in SKILL.md Workflow Step 0 (pre-flight).-# Each entry is checked. Results are reported to the user, who decides go/no-go.-#-# THIS FILE IS POPULATED FROM STAGE 2 AUTO-MATCHING RESULTS.-# Do NOT fill it from scratch — it codifies what was discovered during the-# local scan in Stage 2 (and optional post-generation community enrichment).-#-# RULES:-# - Both `skills:` and `tools:` segments are MANDATORY (write `[]` if empty).-# - Empty lists are valid ONLY when the auto-matching scan confirms no matches-# — they signal "checked, confirmed none", which is different from "never looked".-# - Every entry in `roles[].skills` and `roles[].tools` (in SKILL.md frontmatter)-# MUST appear here. The validator script enforces this consistency.-# - `purpose` is shown to the user when the dep is missing — write user-facing-# prose explaining the consequence, not internal jargon.--skills:- # --- Local skills (discovered in Stage 2 auto-matching) ---- - name: <skill-name-1>- source: local # found in .claude/skills/ or .cursor/skills/ locally- required: true # true = run will likely fail without; false = degraded mode.- purpose: <one-line user-facing explanation of what this skill does for the team>-- # --- Community skills (added via post-generation community enrichment, user-authorized) ---- - name: <skill-name-2>- source: "https://github.com/<org>/<repo>" # community URL where this skill was installed from- required: false- purpose: <e.g., "Visualize cross-module dependency impact (skipped if unavailable)">-- # Use `skills: []` ONLY after Stage 2 auto-matching confirms no skill matches for any role.--tools:- # --- Local tools (probed in Stage 2 auto-matching via `where`/`which`) ---- - name: <tool-name-1> # e.g., gh, rg, python, jq, curl, docker- required: true- purpose: <one-line user-facing explanation>-- - name: <tool-name-2>- required: false- purpose: <one-line user-facing explanation>-- # Use `tools: []` ONLY after Stage 2 auto-matching confirms no tool matches for any role.--# EXAMPLES OF VALID EMPTY SEGMENTS (after auto-matching yields no matches):-#-# skills: []-# tools: []-#-# An empty list signals "checked, confirmed no dependency of this type" — DIFFERENT-# from omitting the segment, which is a spec violation.+# dependencies.yaml — Teamskill startup dependency check+#+# Agent reads this file in SKILL.md Workflow Step 0 (pre-flight).+# Each entry is checked. Results are reported to the user, who decides go/no-go.+#+# THIS FILE IS POPULATED FROM STAGE 2 AUTO-MATCHING RESULTS.+# Do NOT fill it from scratch — it codifies what was discovered during the+# local scan in Stage 2 (and optional post-generation community enrichment).+#+# RULES:+# - Both `skills:` and `tools:` segments are MANDATORY (write `[]` if empty).+# - Empty lists are valid ONLY when the auto-matching scan confirms no matches+# — they signal "checked, confirmed none", which is different from "never looked".+# - Every entry in `roles[].skills` and `roles[].tools` (in SKILL.md frontmatter)+# MUST appear here. The validator script enforces this consistency.+# - `purpose` is shown to the user when the dep is missing — write user-facing+# prose explaining the consequence, not internal jargon.++skills:+ # --- Local skills (discovered in Stage 2 auto-matching) ---+ - name: <skill-name-1>+ source: local # found in .claude/skills/ or .cursor/skills/ locally+ required: true # true = run will likely fail without; false = degraded mode.+ purpose: <one-line user-facing explanation of what this skill does for the team>++ # --- Community skills (added via post-generation community enrichment, user-authorized) ---+ - name: <skill-name-2>+ source: "https://github.com/<org>/<repo>" # community URL where this skill was installed from+ required: false+ purpose: <e.g., "Visualize cross-module dependency impact (skipped if unavailable)">++ # Use `skills: []` ONLY after Stage 2 auto-matching confirms no skill matches for any role.++tools:+ # --- Local tools (probed in Stage 2 auto-matching via `where`/`which`) ---+ - name: <tool-name-1> # e.g., gh, rg, python, jq, curl, docker+ required: true+ purpose: <one-line user-facing explanation>++ - name: <tool-name-2>+ required: false+ purpose: <one-line user-facing explanation>++ # Use `tools: []` ONLY after Stage 2 auto-matching confirms no tool matches for any role.++# EXAMPLES OF VALID EMPTY SEGMENTS (after auto-matching yields no matches):+#+# skills: []+# tools: []+#+# An empty list signals "checked, confirmed no dependency of this type" — DIFFERENT+# from omitting the segment, which is a spec violation.diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/templates/role.md.template b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/templates/role.md.templatesimilarity index 97%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/templates/role.md.templaterename to jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/templates/role.md.templateindex e6db5ac0fd..73fd6023de 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/templates/role.md.template+++ b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/templates/role.md.template@@ -1,106 +1,106 @@-# Role: <Display Name>--## Identity--> *"<One-sentence first-person motto that crystallizes this role's POV. Must be mutually antagonistic with sibling roles in A-patterns / non-overlapping in B-patterns / stage-distinct in C-patterns. Examples: 'I am trying to break this code in production.' / 'I will refuse the deal if even one term smells wrong.' / 'I am the data — I will tell you what is true even if it disappoints you.'>"*--<Optional 0-2 paragraphs after the motto. Use them to: (a) name the methodology this-role applies (STRIDE / OWASP / SCQA / 5-Whys / etc.); (b) declare the role's default-mode (skeptical / generous / adversarial / clinical); (c) explain when this POV adds-value. DO NOT repeat Success Criteria here — that's the next section.>--## Success Criteria--- <Concrete observable deliverable 1 — a reviewer can check ✓/✗ against it>-- <Concrete observable deliverable 2>-- <Concrete observable deliverable 3>-- <...>--**Focus areas**: <comma-separated list of what this role should prioritize examining,-e.g., "error paths, retry logic, concurrent access, downstream consumers, OWASP-relevant-patterns, implicit type conversions, resource leaks">.--## Boundary--<!-- Anchor keywords: use **Forbidden** or **禁止**, and **Mandatory** or **必须**/**必做** — the validator matches these. -->-**Forbidden** (prevent role overlap):-- Do NOT <thing that another role does — name the sibling role explicitly>-- Do NOT <thing that drifts upstream/downstream in the pipeline>-- Do NOT <thing that lets the role escape its assigned slice / methodology>--**Mandatory**:-- You MUST <thing the role tends to skip when it sees nothing obvious>.- <Add 1 sentence on what to do if you find nothing — usually "look harder".>-- You MUST <output discipline that the schema enforces>.-- You MUST <discipline specific to this role's methodology>.--## Output Schema--```markdown-## Role: <Display Name>--### <Section 1 — e.g., Findings / Hypotheses / Recommendations>-- <[item] [severity / category / confidence]>-- <...>--### <Section 2 — e.g., Evidence / Citations / Caveats>-- <...>--### <Verdict / Decision / Output>-- <ENUM: e.g., BLOCK / SIGNIFICANT-RISK / ACCEPTABLE-RISK / LOW-RISK>-```--## Inline Persona for Teammate--```-ROLE: <Display Name> in a Teamskill.--You are <1-sentence in-character description matching the Identity motto>.-<1-2 sentences: your default mode, what you prioritize examining>.--You MUST <Mandatory rule 1>.-You MUST <Mandatory rule 2>.-You MUST NOT <Forbidden rule 1>.-You MUST NOT <Forbidden rule 2>.--INPUTS YOU WILL RECEIVE:-- <input 1>: {INPUT_1_PLACEHOLDER}-- <input 2>: {INPUT_2_PLACEHOLDER}-- <input 3, optional>: {INPUT_3_PLACEHOLDER}--OUTPUT FORMAT (use exactly this structure, no preamble, no postscript):--## Role: <Display Name>--### <Section 1>-- <bullet point per finding>--### <Section 2>-- <bullet point per item>--### <Verdict / Decision / Output>-- <ENUM value from: A | B | C | D>-```--<!---TEMPLATE NOTES (delete before publishing):--1. The motto on the FIRST LINE of `## Identity` is the #1 anti-convergence mechanism.- Format MUST be: > *"single-sentence first-person motto."*- Without it, prose Identity sections cause sibling roles to converge in output.--2. `## Boundary` MUST contain BOTH a Forbidden block and a Mandatory block.- Accepted anchor keywords: **Forbidden** / **禁止**, **Mandatory** / **必须** / **必做**.- Forbidden alone → roles output "looks fine".- Mandatory alone → roles overlap with siblings.--3. `## Inline Persona for Teammate` MUST be self-contained — the teammate has NO access- to this role file, the team SKILL.md, the workflow, or the bind file. Everything the- teammate needs to play the role MUST be in this prompt.--4. `## Output Schema` and the OUTPUT FORMAT inside Inline Persona MUST match. Drift- between them = teammate output that doesn't match Leader's parser = integration failure.--5. Recommended file size: 80-200 lines. Significantly larger = role doing too much- (split into 2 roles). Significantly smaller = role under-specified.--->+# Role: <Display Name>++## Identity++> *"<One-sentence first-person motto that crystallizes this role's POV. Must be mutually antagonistic with sibling roles in A-patterns / non-overlapping in B-patterns / stage-distinct in C-patterns. Examples: 'I am trying to break this code in production.' / 'I will refuse the deal if even one term smells wrong.' / 'I am the data — I will tell you what is true even if it disappoints you.'>"*++<Optional 0-2 paragraphs after the motto. Use them to: (a) name the methodology this+role applies (STRIDE / OWASP / SCQA / 5-Whys / etc.); (b) declare the role's default+mode (skeptical / generous / adversarial / clinical); (c) explain when this POV adds+value. DO NOT repeat Success Criteria here — that's the next section.>++## Success Criteria++- <Concrete observable deliverable 1 — a reviewer can check ✓/✗ against it>+- <Concrete observable deliverable 2>+- <Concrete observable deliverable 3>+- <...>++**Focus areas**: <comma-separated list of what this role should prioritize examining,+e.g., "error paths, retry logic, concurrent access, downstream consumers, OWASP-relevant+patterns, implicit type conversions, resource leaks">.++## Boundary++<!-- Anchor keywords: use **Forbidden** or **禁止**, and **Mandatory** or **必须**/**必做** — the validator matches these. -->+**Forbidden** (prevent role overlap):+- Do NOT <thing that another role does — name the sibling role explicitly>+- Do NOT <thing that drifts upstream/downstream in the pipeline>+- Do NOT <thing that lets the role escape its assigned slice / methodology>++**Mandatory**:+- You MUST <thing the role tends to skip when it sees nothing obvious>.+ <Add 1 sentence on what to do if you find nothing — usually "look harder".>+- You MUST <output discipline that the schema enforces>.+- You MUST <discipline specific to this role's methodology>.++## Output Schema++```markdown+## Role: <Display Name>++### <Section 1 — e.g., Findings / Hypotheses / Recommendations>+- <[item] [severity / category / confidence]>+- <...>++### <Section 2 — e.g., Evidence / Citations / Caveats>+- <...>++### <Verdict / Decision / Output>+- <ENUM: e.g., BLOCK / SIGNIFICANT-RISK / ACCEPTABLE-RISK / LOW-RISK>+```++## Inline Persona for Teammate++```+ROLE: <Display Name> in a Teamskill.++You are <1-sentence in-character description matching the Identity motto>.+<1-2 sentences: your default mode, what you prioritize examining>.++You MUST <Mandatory rule 1>.+You MUST <Mandatory rule 2>.+You MUST NOT <Forbidden rule 1>.+You MUST NOT <Forbidden rule 2>.++INPUTS YOU WILL RECEIVE:+- <input 1>: {INPUT_1_PLACEHOLDER}+- <input 2>: {INPUT_2_PLACEHOLDER}+- <input 3, optional>: {INPUT_3_PLACEHOLDER}++OUTPUT FORMAT (use exactly this structure, no preamble, no postscript):++## Role: <Display Name>++### <Section 1>+- <bullet point per finding>++### <Section 2>+- <bullet point per item>++### <Verdict / Decision / Output>+- <ENUM value from: A | B | C | D>+```++<!--+TEMPLATE NOTES (delete before publishing):++1. The motto on the FIRST LINE of `## Identity` is the #1 anti-convergence mechanism.+ Format MUST be: > *"single-sentence first-person motto."*+ Without it, prose Identity sections cause sibling roles to converge in output.++2. `## Boundary` MUST contain BOTH a Forbidden block and a Mandatory block.+ Accepted anchor keywords: **Forbidden** / **禁止**, **Mandatory** / **必须** / **必做**.+ Forbidden alone → roles output "looks fine".+ Mandatory alone → roles overlap with siblings.++3. `## Inline Persona for Teammate` MUST be self-contained — the teammate has NO access+ to this role file, the team SKILL.md, the workflow, or the bind file. Everything the+ teammate needs to play the role MUST be in this prompt.++4. `## Output Schema` and the OUTPUT FORMAT inside Inline Persona MUST match. Drift+ between them = teammate output that doesn't match Leader's parser = integration failure.++5. Recommended file size: 80-200 lines. Significantly larger = role doing too much+ (split into 2 roles). Significantly smaller = role under-specified.+-->diff --git a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/templates/workflow.md.template b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/templates/workflow.md.templatesimilarity index 97%rename from jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/templates/workflow.md.templaterename to jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/templates/workflow.md.templateindex 5461fd4bfa..c81909e96a 100644--- a/jiuwenclaw/resources/agent/jiuwenclaw_workspace/skills/teamskill-creator/templates/workflow.md.template+++ b/jiuwenclaw/resources/agent/workspace/skills/teamskill-creator/templates/workflow.md.template@@ -1,138 +1,138 @@-# Workflow: <One-line task pipeline summary>--## Overview--```mermaid-graph LR- A[Leader: Pre-flight + Context] --> B{Input scale OK?}- B -- No --> C[Degraded Mode<br/>see bind.md]- B -- Yes --> D[role-id-1]- B -- Yes --> E[role-id-2]- B -- Yes --> F[role-id-3]- D --> G[Leader: Integrate]- E --> G- F --> G- G --> H[Final Report]-```--<Replace the diagram above with one that matches your team's pattern:--- A-pattern (parallel adversarial): all roles fan out from Leader, then fan in to Integrate.-- B-pattern (parallel decomposition): same shape as A; integration node composes by slice.-- C-pattern (specialization pipeline): linear chain `Leader → Stage 1 → gate → Stage 2 → gate → ...`-- Mixed: combine; e.g., C+A places an adversarial fan-out inside one stage.-- Debate pattern (B → Cross-exam → C): Round1 fan-out (isolated) → relay node- (visibility switch point) → Round2 fan-out (mutual visibility) → synthesizer → final.- The relay node represents WHERE visibility changes, not HOW — delivery mechanism is- a framework-level choice with recommended preference: (1) direct peer-to-peer;- (2) shared blackboard; (3) Leader-relay as fallback.- For multi-round debate, annotate `×N rounds (see bind.md)` on the relay→Round2 edge- instead of duplicating the fan-out block.--Include decision diamonds for degraded mode triggers (linked to bind.md § Failure Handling).-Include retry loops (back-edges) if roles can be re-dispatched on failure.>--<If Debate pattern, keep the following note (delete this instruction line, keep the content):>--- **Inter-member communication preference** (Debate pattern): this Teamskill declares **who sees whose output at which phase** (visibility semantics). Frameworks SHOULD implement the highest-priority delivery mechanism they support: **(1) direct peer-to-peer exchange** (most efficient) > **(2) shared blackboard** > **(3) Leader-relay** (fallback). See [bind.md](bind.md) § Behavioral Constraints for phase-scoped visibility rules.--## Detailed Steps--### Step 0 — Pre-flight: dependency check--- **Executor**: Leader-- **Input**: [dependencies.yaml](dependencies.yaml)-- **Action**: verify each `skills[]` and `tools[]` entry is available-- **Output**: pre-flight report to user-- **Quality gate**: user decides go/no-go on missing items (Agent does NOT auto-decide)--### Step 1 — <Step name>--- **Executor**: <Leader / role-id>-- **Input**: <what this step receives>-- **Action**: <what happens, in 1-3 sentences>-- **Output**: <structured deliverable name + brief shape>-- **Serial / Parallel**: <if parallel, list which roles run together>-- **Quality gate**: <pass criteria — count-based or enum-based, never "looks good"; fail action — kick back to which step / how many retries / when to escalate>--### Step 2 — <Step name>--- **Executor**: <...>-- **Input**: <...>-- **Action**: <...>-- **Output**: <...>-- **Serial / Parallel**: <...>-- **Quality gate**: <...>--### Step 3 — <Step name>--- **Executor**: <...>-- **Input**: <...>-- **Action**: <...>-- **Output**: <...>-- **Serial / Parallel**: <...>-- **Quality gate**: <...>--### Step N — Final: emit <Report Name>--- **Executor**: Leader-- **Input**: outputs from all upstream steps-- **Action**: <integration logic — A: surface contradictions verbatim; B: compose by slice; C: validate gates>-- **Output**: <Report Name> in the format below--#### Final Report Format--```markdown-# <Report Name>--## Summary-<1-3 sentence overview>--## <Tier 1 — e.g., MUST-FIX / Critical Findings / GO-NO-GO Verdict>-- <item> — <evidence reference>--## <Tier 2 — e.g., SHOULD-FIX / Recommendations>-- <item>--## <Tier 3 — e.g., FYI / Observations>-- <item>--## Contradictions (A-pattern only — surfaced verbatim, NOT mediated)-- <Role X said "...", Role Y said "..." — human decides>--## Coverage Map (B-pattern only)-- Slice 1: <covered by role X>-- Slice 2: <covered by role Y>-- Gaps: <slices nobody covered, if any>--## Unresolved Disputes (Debate-pattern — preserved from cross-exam, NOT mediated)-- <Claim by Role X> vs <Counter by Role Y> — <synthesizer's assessment + what user should verify>-```--## Acceptance Criteria--- All roles returned outputs matching their `## Output Schema` (no malformed responses).-- Final Report contains all mandatory tiers.-- <Pattern-specific check, e.g., "All A-pattern contradictions surfaced verbatim, none mediated by Leader" / "All C-pattern gates passed or explicit kick-back recorded" / "All Debate-pattern unresolved disputes preserved with cross-exam context, not silently dropped">.-- <Coverage check, e.g., "All B-pattern slices accounted for in the Coverage Map">.--<!---TEMPLATE NOTES (delete before publishing):--1. Mermaid is REQUIRED in `## Overview` — the primary expression difference from- single-agent skills (which are linear and need no diagram).- Use `graph LR` for wide pipelines, `graph TD` for tall ones.--2. EVERY step's `Quality gate` MUST be specific. "Looks good" is not a gate.- Use count-based ("≥3 sections present"), enum-based ("Verdict in {GO, NO-GO}"),- or schema-based ("matches Output Schema") criteria.--3. Quality gates live INSIDE the steps (not in a separate `## Quality Gates` section).- A gate is a property of a step, not an independent concept.--4. The Final Report Format is defined HERE (in the last step) — NOT in SKILL.md.- Defining it in two places creates drift.--5. Acceptance Criteria judges a SUCCESSFUL SINGLE RUN. It is NOT a per-step gate.- Failures of acceptance criteria → bind.md § Failure Handling.--->+# Workflow: <One-line task pipeline summary>++## Overview++```mermaid+graph LR+ A[Leader: Pre-flight + Context] --> B{Input scale OK?}+ B -- No --> C[Degraded Mode<br/>see bind.md]+ B -- Yes --> D[role-id-1]+ B -- Yes --> E[role-id-2]+ B -- Yes --> F[role-id-3]+ D --> G[Leader: Integrate]+ E --> G+ F --> G+ G --> H[Final Report]+```++<Replace the diagram above with one that matches your team's pattern:++- A-pattern (parallel adversarial): all roles fan out from Leader, then fan in to Integrate.+- B-pattern (parallel decomposition): same shape as A; integration node composes by slice.+- C-pattern (specialization pipeline): linear chain `Leader → Stage 1 → gate → Stage 2 → gate → ...`+- Mixed: combine; e.g., C+A places an adversarial fan-out inside one stage.+- Debate pattern (B → Cross-exam → C): Round1 fan-out (isolated) → relay node+ (visibility switch point) → Round2 fan-out (mutual visibility) → synthesizer → final.+ The relay node represents WHERE visibility changes, not HOW — delivery mechanism is+ a framework-level choice with recommended preference: (1) direct peer-to-peer;+ (2) shared blackboard; (3) Leader-relay as fallback.+ For multi-round debate, annotate `×N rounds (see bind.md)` on the relay→Round2 edge+ instead of duplicating the fan-out block.++Include decision diamonds for degraded mode triggers (linked to bind.md § Failure Handling).+Include retry loops (back-edges) if roles can be re-dispatched on failure.>++<If Debate pattern, keep the following note (delete this instruction line, keep the content):>++- **Inter-member communication preference** (Debate pattern): this Teamskill declares **who sees whose output at which phase** (visibility semantics). Frameworks SHOULD implement the highest-priority delivery mechanism they support: **(1) direct peer-to-peer exchange** (most efficient) > **(2) shared blackboard** > **(3) Leader-relay** (fallback). See [bind.md](bind.md) § Behavioral Constraints for phase-scoped visibility rules.++## Detailed Steps++### Step 0 — Pre-flight: dependency check++- **Executor**: Leader+- **Input**: [dependencies.yaml](dependencies.yaml)+- **Action**: verify each `skills[]` and `tools[]` entry is available+- **Output**: pre-flight report to user+- **Quality gate**: user decides go/no-go on missing items (Agent does NOT auto-decide)++### Step 1 — <Step name>++- **Executor**: <Leader / role-id>+- **Input**: <what this step receives>+- **Action**: <what happens, in 1-3 sentences>+- **Output**: <structured deliverable name + brief shape>+- **Serial / Parallel**: <if parallel, list which roles run together>+- **Quality gate**: <pass criteria — count-based or enum-based, never "looks good"; fail action — kick back to which step / how many retries / when to escalate>++### Step 2 — <Step name>++- **Executor**: <...>+- **Input**: <...>+- **Action**: <...>+- **Output**: <...>+- **Serial / Parallel**: <...>+- **Quality gate**: <...>++### Step 3 — <Step name>++- **Executor**: <...>+- **Input**: <...>+- **Action**: <...>+- **Output**: <...>+- **Serial / Parallel**: <...>+- **Quality gate**: <...>++### Step N — Final: emit <Report Name>++- **Executor**: Leader+- **Input**: outputs from all upstream steps+- **Action**: <integration logic — A: surface contradictions verbatim; B: compose by slice; C: validate gates>+- **Output**: <Report Name> in the format below++#### Final Report Format++```markdown+# <Report Name>++## Summary+<1-3 sentence overview>++## <Tier 1 — e.g., MUST-FIX / Critical Findings / GO-NO-GO Verdict>+- <item> — <evidence reference>++## <Tier 2 — e.g., SHOULD-FIX / Recommendations>+- <item>++## <Tier 3 — e.g., FYI / Observations>+- <item>++## Contradictions (A-pattern only — surfaced verbatim, NOT mediated)+- <Role X said "...", Role Y said "..." — human decides>++## Coverage Map (B-pattern only)+- Slice 1: <covered by role X>+- Slice 2: <covered by role Y>+- Gaps: <slices nobody covered, if any>++## Unresolved Disputes (Debate-pattern — preserved from cross-exam, NOT mediated)+- <Claim by Role X> vs <Counter by Role Y> — <synthesizer's assessment + what user should verify>+```++## Acceptance Criteria++- All roles returned outputs matching their `## Output Schema` (no malformed responses).+- Final Report contains all mandatory tiers.+- <Pattern-specific check, e.g., "All A-pattern contradictions surfaced verbatim, none mediated by Leader" / "All C-pattern gates passed or explicit kick-back recorded" / "All Debate-pattern unresolved disputes preserved with cross-exam context, not silently dropped">.+- <Coverage check, e.g., "All B-pattern slices accounted for in the Coverage Map">.++<!--+TEMPLATE NOTES (delete before publishing):++1. Mermaid is REQUIRED in `## Overview` — the primary expression difference from+ single-agent skills (which are linear and need no diagram).+ Use `graph LR` for wide pipelines, `graph TD` for tall ones.++2. EVERY step's `Quality gate` MUST be specific. "Looks good" is not a gate.+ Use count-based ("≥3 sections present"), enum-based ("Verdict in {GO, NO-GO}"),+ or schema-based ("matches Output Schema") criteria.++3. Quality gates live INSIDE the steps (not in a separate `## Quality Gates` section).+ A gate is a property of a step, not an independent concept.++4. The Final Report Format is defined HERE (in the last step) — NOT in SKILL.md.+ Defining it in two places creates drift.++5. Acceptance Criteria judges a SUCCESSFUL SINGLE RUN. It is NOT a per-step gate.+ Failures of acceptance criteria → bind.md § Failure Handling.+-->diff --git a/jiuwenclaw/resources/builtin_rules.yaml b/jiuwenclaw/resources/builtin_rules.yamlindex d4a92359f5..af6d4f4e35 100644--- a/jiuwenclaw/resources/builtin_rules.yaml+++ b/jiuwenclaw/resources/builtin_rules.yaml@@ -1,7 +1,7 @@# jiuwenclaw built-in shell high-risk rules.#-# 运行时可放在与 config.yaml 同目录:~/.jiuwenclaw/config/builtin_rules.yaml(优先加载);+# 运行时可放在与 config.yaml 同目录:~/.jiuwenswarm/config/builtin_rules.yaml(优先加载);# 若不存在则使用包内本文件。## This file stores built-in parameter-level rules in the shell guardraildiff --git a/jiuwenclaw/resources/config.team.distributed.leader.yaml b/jiuwenclaw/resources/config.team.distributed.leader.yamlindex 00192554b8..f527146813 100644--- a/jiuwenclaw/resources/config.team.distributed.leader.yaml+++ b/jiuwenclaw/resources/config.team.distributed.leader.yaml@@ -1,7 +1,7 @@# 前端显示语言:zh(中文)/ en(英文),与 Web 界面语言切换同步preferred_language: zh-# 日志目录:~/.jiuwenclaw/agent/.logs/+# 日志目录:~/.jiuwenswarm/agent/.logs/# gateway.log / channel.log / agent_server.log 按源码路径分流;full.log 为汇总。# level:未单独指定时的默认级别。console_level:控制台;可省略则用 level。# 环境变量 LOG_LEVEL 仅覆盖控制台级别(不覆盖各日志文件)。@@ -89,18 +89,18 @@ memory:# 依赖顶层 embed 段提供 embedding 配置(不单独配置 api_key)openjiuwen:kv_type: shelve # shelve | in_memory | sqlite- kv_path: ${MEMORY_KV_PATH:-} # 默认 ~/.jiuwenclaw/memory/ltm/kv+ kv_path: ${MEMORY_KV_PATH:-} # 默认 ~/.jiuwenswarm/memory/ltm/kvvector_type: chroma # chroma- vector_persist_dir: ${MEMORY_VECTOR_DIR:-} # 默认 ~/.jiuwenclaw/memory/ltm/chroma+ vector_persist_dir: ${MEMORY_VECTOR_DIR:-} # 默认 ~/.jiuwenswarm/memory/ltm/chromadb_type: sqlite- db_path: ${MEMORY_DB_PATH:-} # 默认 ~/.jiuwenclaw/memory/ltm/ltm.db+ db_path: ${MEMORY_DB_PATH:-} # 默认 ~/.jiuwenswarm/memory/ltm/ltm.db# -- Mem0(云端事实抽取+语义检索)--# 生效条件:provider='mem0'# 必填:api_key(从 mem0.ai 获取)mem0:api_key: ${MEM0_API_KEY:-}- user_id: ${MEM0_USER_ID:-jiuwenclaw-user}+ user_id: ${MEM0_USER_ID:-jiuwenswarm-user}agent_id: ${MEM0_AGENT_ID:-jiuwenclaw}rerank: true # 搜索结果重排序(更准但更慢)@@ -622,8 +622,8 @@ updater:repo_owner: CharlieZhao95repo_name: jiuwenclawrelease_api_url: ""- asset_name_pattern: "jiuwenclaw-setup-{version}.exe"- sha256_name_pattern: "jiuwenclaw-setup-{version}.exe.sha256"+ asset_name_pattern: "jiuwenswarm-setup-{version}.exe"+ sha256_name_pattern: "jiuwenswarm-setup-{version}.exe.sha256"timeout_seconds: 20extensions:@@ -634,7 +634,7 @@ extensions:team:# Distributed leader template. Copy this file to- # <LEADER_HOME>/.jiuwenclaw/config/config.yaml and adjust registry/storage/ports.+ # <LEADER_HOME>/.jiuwenswarm/config/config.yaml and adjust registry/storage/ports.runtime:mode: distributedrole: leaderdiff --git a/jiuwenclaw/resources/config.team.distributed.teammate.yaml b/jiuwenclaw/resources/config.team.distributed.teammate.yamlindex 002fc6ae3d..a4a5582db2 100644--- a/jiuwenclaw/resources/config.team.distributed.teammate.yaml+++ b/jiuwenclaw/resources/config.team.distributed.teammate.yaml@@ -1,7 +1,7 @@# 前端显示语言:zh(中文)/ en(英文),与 Web 界面语言切换同步preferred_language: zh-# 日志目录:~/.jiuwenclaw/agent/.logs/+# 日志目录:~/.jiuwenswarm/agent/.logs/# gateway.log / channel.log / agent_server.log 按源码路径分流;full.log 为汇总。# level:未单独指定时的默认级别。console_level:控制台;可省略则用 level。# 环境变量 LOG_LEVEL 仅覆盖控制台级别(不覆盖各日志文件)。@@ -89,18 +89,18 @@ memory:# 依赖顶层 embed 段提供 embedding 配置(不单独配置 api_key)openjiuwen:kv_type: shelve # shelve | in_memory | sqlite- kv_path: ${MEMORY_KV_PATH:-} # 默认 ~/.jiuwenclaw/memory/ltm/kv+ kv_path: ${MEMORY_KV_PATH:-} # 默认 ~/.jiuwenswarm/memory/ltm/kvvector_type: chroma # chroma- vector_persist_dir: ${MEMORY_VECTOR_DIR:-} # 默认 ~/.jiuwenclaw/memory/ltm/chroma+ vector_persist_dir: ${MEMORY_VECTOR_DIR:-} # 默认 ~/.jiuwenswarm/memory/ltm/chromadb_type: sqlite- db_path: ${MEMORY_DB_PATH:-} # 默认 ~/.jiuwenclaw/memory/ltm/ltm.db+ db_path: ${MEMORY_DB_PATH:-} # 默认 ~/.jiuwenswarm/memory/ltm/ltm.db# -- Mem0(云端事实抽取+语义检索)--# 生效条件:provider='mem0'# 必填:api_key(从 mem0.ai 获取)mem0:api_key: ${MEM0_API_KEY:-}- user_id: ${MEM0_USER_ID:-jiuwenclaw-user}+ user_id: ${MEM0_USER_ID:-jiuwenswarm-user}agent_id: ${MEM0_AGENT_ID:-jiuwenclaw}rerank: true # 搜索结果重排序(更准但更慢)@@ -622,8 +622,8 @@ updater:repo_owner: CharlieZhao95repo_name: jiuwenclawrelease_api_url: ""- asset_name_pattern: "jiuwenclaw-setup-{version}.exe"- sha256_name_pattern: "jiuwenclaw-setup-{version}.exe.sha256"+ asset_name_pattern: "jiuwenswarm-setup-{version}.exe"+ sha256_name_pattern: "jiuwenswarm-setup-{version}.exe.sha256"timeout_seconds: 20extensions:@@ -634,7 +634,7 @@ extensions:team:# Distributed teammate template. Copy this file to- # <TEAMMATE_HOME>/.jiuwenclaw/config/config.yaml and adjust registry/storage/ports.+ # <TEAMMATE_HOME>/.jiuwenswarm/config/config.yaml and adjust registry/storage/ports.runtime:mode: distributedrole: teammatediff --git a/jiuwenclaw/resources/config.yaml b/jiuwenclaw/resources/config.yamlindex 0a186a6d8b..702e06696a 100644--- a/jiuwenclaw/resources/config.yaml+++ b/jiuwenclaw/resources/config.yaml@@ -1,7 +1,7 @@# 前端显示语言:zh(中文)/ en(英文),与 Web 界面语言切换同步preferred_language: zh-# 日志目录:~/.jiuwenclaw/agent/.logs/+# 日志目录:~/.jiuwenswarm/agent/.logs/# gateway.log / channel.log / agent_server.log 按源码路径分流;full.log 为汇总。# level:未单独指定时的默认级别。console_level:控制台;可省略则用 level。# 环境变量 LOG_LEVEL 仅覆盖控制台级别(不覆盖各日志文件)。@@ -89,18 +89,18 @@ memory:# 依赖顶层 embed 段提供 embedding 配置(不单独配置 api_key)openjiuwen:kv_type: shelve # shelve | in_memory | sqlite- kv_path: ${MEMORY_KV_PATH:-} # 默认 ~/.jiuwenclaw/memory/ltm/kv+ kv_path: ${MEMORY_KV_PATH:-} # 默认 ~/.jiuwenswarm/memory/ltm/kvvector_type: chroma # chroma- vector_persist_dir: ${MEMORY_VECTOR_DIR:-} # 默认 ~/.jiuwenclaw/memory/ltm/chroma+ vector_persist_dir: ${MEMORY_VECTOR_DIR:-} # 默认 ~/.jiuwenswarm/memory/ltm/chromadb_type: sqlite- db_path: ${MEMORY_DB_PATH:-} # 默认 ~/.jiuwenclaw/memory/ltm/ltm.db+ db_path: ${MEMORY_DB_PATH:-} # 默认 ~/.jiuwenswarm/memory/ltm/ltm.db# -- Mem0(云端事实抽取+语义检索)--# 生效条件:provider='mem0'# 必填:api_key(从 mem0.ai 获取)mem0:api_key: ${MEM0_API_KEY:-}- user_id: ${MEM0_USER_ID:-jiuwenclaw-user}+ user_id: ${MEM0_USER_ID:-jiuwenswarm-user}agent_id: ${MEM0_AGENT_ID:-jiuwenclaw}rerank: true # 搜索结果重排序(更准但更慢)@@ -627,8 +627,8 @@ updater:repo_owner: CharlieZhao95repo_name: jiuwenclawrelease_api_url: ""- asset_name_pattern: "jiuwenclaw-setup-{version}.exe"- sha256_name_pattern: "jiuwenclaw-setup-{version}.exe.sha256"+ asset_name_pattern: "jiuwenswarm-setup-{version}.exe"+ sha256_name_pattern: "jiuwenswarm-setup-{version}.exe.sha256"timeout_seconds: 20extensions:diff --git a/jiuwenclaw/scripts/generate-agent-folders.js b/jiuwenclaw/scripts/generate-agent-folders.jsindex 971bde5391..687996a84a 100644--- a/jiuwenclaw/scripts/generate-agent-folders.js+++ b/jiuwenclaw/scripts/generate-agent-folders.js@@ -15,7 +15,7 @@ if (!agentRoot) {process.exit(1);}-const outputPath = path.join(agentRoot, 'jiuwenclaw_workspace', 'agent-data.json');+const outputPath = path.join(agentRoot, 'workspace', 'agent-data.json');console.log('扫描目录:', agentRoot);diff --git a/jiuwenclaw/scripts/watch-folders.js b/jiuwenclaw/scripts/watch-folders.jsindex aa4c5a9980..a31d3379d6 100644--- a/jiuwenclaw/scripts/watch-folders.js+++ b/jiuwenclaw/scripts/watch-folders.js@@ -22,14 +22,14 @@ generate();const chokidar = require('chokidar');// 优先使用环境变量,支持多实例-const envWorkspace = process.env.JIUWENCLAW_DATA_DIR;+const envWorkspace = process.env.JIUWENSWARM_DATA_DIR;const homeDir = process.env.USERPROFILE || process.env.HOME || '';let userAgentDir = '';if (envWorkspace) {userAgentDir = path.join(envWorkspace, 'agent');} else if (homeDir) {- userAgentDir = path.join(homeDir, '.jiuwenclaw', 'agent');+ userAgentDir = path.join(homeDir, '.jiuwenswarm', 'agent');}const fallbackRepoAgentDir = path.join(__dirname, '../resources/agent');diff --git a/jiuwenclaw/server/app_agentserver.py b/jiuwenclaw/server/app_agentserver.pyindex 85e59e89bd..0007ae297d 100644--- a/jiuwenclaw/server/app_agentserver.py+++ b/jiuwenclaw/server/app_agentserver.py@@ -6,7 +6,7 @@ This process only starts:- AgentWebSocketServer (ws server for Gateway)Gateway should be started separately and connect to this ws server.-Both processes share the same user workspace directory (~/.jiuwenclaw).+Both processes share the same user workspace directory (~/.jiuwenswarm).Supports ``--dotenv <path>`` for multi-instance isolation."""@@ -25,7 +25,7 @@ from openjiuwen.core.common.logging import LogManager# --- Early --dotenv parsing (before jiuwenclaw imports) ---from jiuwenclaw.dotenv_early import parse_dotenv_early-parse_dotenv_early("jiuwenclaw-agentserver")+parse_dotenv_early("jiuwenswarm-agentserver")# --- Now safe to import jiuwenclaw modules ---from jiuwenclaw.common.utils import (@@ -40,8 +40,8 @@ from jiuwenclaw.common.utils import (# Ensure workspace initialized_workspace_dir = get_user_workspace_dir()_config_file = _workspace_dir / "config" / "config.yaml"-_new_workspace = _workspace_dir / "agent" / "jiuwenclaw_workspace"-_old_workspace = _workspace_dir / "agent" / "workspace"+_new_workspace = _workspace_dir / "agent" / "workspace"+_old_workspace = _workspace_dir / "agent" / "jiuwenclaw_workspace"# Initialize if config doesn't exist, or if legacy workspace exists but new doesn't (migration)if not _config_file.exists() or (_old_workspace.exists() and not _new_workspace.exists()):@@ -191,7 +191,7 @@ def main() -> None:from jiuwenclaw.dotenv_early import get_parsed_dotenvparser = argparse.ArgumentParser(- prog="jiuwenclaw-agentserver",+ prog="jiuwenswarm-agentserver",description="Start JiuwenClaw AgentServer (standalone process for Gateway to connect).",)parser.add_argument(diff --git a/jiuwenclaw/server/runtime/skill/skill_manager.py b/jiuwenclaw/server/runtime/skill/skill_manager.pyindex 3ac1e262a0..8d6d247239 100644--- a/jiuwenclaw/server/runtime/skill/skill_manager.py+++ b/jiuwenclaw/server/runtime/skill/skill_manager.py@@ -2530,7 +2530,7 @@ class SkillManager:@staticmethoddef _generate_agent_data_for_workspace(workspace_root: Path) -> None:- """Generate agent/jiuwenclaw_workspace/agent-data.json from agent tree."""+ """Generate agent/workspace/agent-data.json from agent tree."""agent_root = workspace_root.resolve()output_path = (agent_root / "agent-data.json").resolve()root_folder_key = "__root__"diff --git a/jiuwenclaw/server/runtime/skill/skilldev/DESIGN.md b/jiuwenclaw/server/runtime/skill/skilldev/DESIGN.mdindex 8ebc0fe277..c4ff3b3503 100644--- a/jiuwenclaw/server/runtime/skill/skilldev/DESIGN.md+++ b/jiuwenclaw/server/runtime/skill/skilldev/DESIGN.md@@ -496,7 +496,7 @@ DescOptimizeIteration # 描述优化的单轮迭代结果**存储路径**:```-~/.jiuwenclaw/agent/workspace/skilldev/{task_id}/state.json+~/.jiuwenswarm/agent/workspace/skilldev/{task_id}/state.json```**核心接口**:@@ -515,7 +515,7 @@ store.list_tasks() # 列出所有有效 task_id**目录结构**:```-~/.jiuwenclaw/agent/workspace/skilldev/{task_id}/+~/.jiuwenswarm/agent/workspace/skilldev/{task_id}/├── state.json ← StateStore 的 checkpoint 文件├── resources/ ← 上传的资源文件(解压后的原始内容)├── skill/ ← 生成的 Skill 目录(Agent 的写入区)@@ -684,7 +684,7 @@ class MyStageHandler(StageHandler):### 决策五:工作区路径统一**Why**:SkillDev 的任务目录必须在 JiuWenClaw 的统一工作区下,避免数据散落在系统各处。-**约定**:`~/.jiuwenclaw/agent/workspace/skilldev/{task_id}/`,由 `get_workspace_dir() / "skilldev"` 构造。+**约定**:`~/.jiuwenswarm/agent/workspace/skilldev/{task_id}/`,由 `get_workspace_dir() / "skilldev"` 构造。---diff --git a/jiuwenclaw/server/runtime/skill/skilldev/store.py b/jiuwenclaw/server/runtime/skill/skilldev/store.pyindex 934b9dbcb7..4a638b283f 100644--- a/jiuwenclaw/server/runtime/skill/skilldev/store.py+++ b/jiuwenclaw/server/runtime/skill/skilldev/store.py@@ -30,7 +30,7 @@ class StateStore:"""Args:base_dir: SkillDev 工作区根目录,约定为 get_workspace_dir() / "skilldev"- 即 ~/.jiuwenclaw/agent/workspace/skilldev/+ 即 ~/.jiuwenswarm/agent/workspace/skilldev/"""self._base_dir = base_dirdiff --git a/jiuwenclaw/server/runtime/skill/skilldev/workspace.py b/jiuwenclaw/server/runtime/skill/skilldev/workspace.pyindex bc85a19762..70b5796307 100644--- a/jiuwenclaw/server/runtime/skill/skilldev/workspace.py+++ b/jiuwenclaw/server/runtime/skill/skilldev/workspace.py@@ -5,7 +5,7 @@职责:提供每个 task_id 的隔离工作区目录,并维护标准目录结构。目录结构(单机本地模式):- ~/.jiuwenclaw/agent/workspace/skilldev/{task_id}/+ ~/.jiuwenswarm/agent/workspace/skilldev/{task_id}/├── state.json ← StateStore checkpoint├── resources/ ← 上传的资源文件(解压后)├── skill/ ← 生成的 skill 目录@@ -39,7 +39,7 @@ class WorkspaceProvider:"""Args:base_dir: SkillDev 工作区根目录,约定为 get_workspace_dir() / "skilldev"- 即 ~/.jiuwenclaw/agent/workspace/skilldev/+ 即 ~/.jiuwenswarm/agent/workspace/skilldev/"""self._base_dir = base_dirdiff --git a/jiuwenclaw/server/utils/diff_service.py b/jiuwenclaw/server/utils/diff_service.pyindex b75a2293e3..573ebf93f0 100644--- a/jiuwenclaw/server/utils/diff_service.py+++ b/jiuwenclaw/server/utils/diff_service.py@@ -171,7 +171,7 @@ class DiffService:get_user_workspace_dir() / ".agent_history" / f"file_ops_{self._agent_id}.json",]- # session-specific file_ops(如 file_ops_jiuwenclaw_tui_xxx.json)+ # session-specific file_ops(如 file_ops_jiuwenswarm_tui_xxx.json)if session_id:for base_dir in (get_agent_workspace_dir(), get_user_workspace_dir()):hist_dir = base_dir / ".agent_history"diff --git a/jiuwenclaw/start_services.py b/jiuwenclaw/start_services.pyindex 4aa5aea048..79ef781f5a 100644--- a/jiuwenclaw/start_services.py+++ b/jiuwenclaw/start_services.py@@ -24,7 +24,7 @@ from pathlib import Path# --- Early --dotenv parsing (before jiuwenclaw imports) ---from jiuwenclaw.dotenv_early import parse_dotenv_early-parse_dotenv_early("jiuwenclaw-start")+parse_dotenv_early("jiuwenswarm-start")# --- Now safe to import jiuwenclaw modules ---from jiuwenclaw.common.utils import get_root_dir, get_user_workspace_dir, is_package_installation@@ -50,7 +50,7 @@ from jiuwenclaw.instance_manager import (# Runtime data root:# - source mode: repository root-# - package mode: ~/.jiuwenclaw+# - package mode: ~/.jiuwenswarmDATA_ROOT = get_root_dir()# Package source root:@@ -59,7 +59,7 @@ DATA_ROOT = get_root_dir()PACKAGE_DIR = Path(__file__).resolve().parent# Frontend dev project root (contains package.json)-WEB_DEV_DIR = PACKAGE_DIR / "web"+WEB_DEV_DIR = PACKAGE_DIR / "channels" / "web" / "frontend"# =============================================================================@@ -115,7 +115,7 @@ class InstanceCommand:self.config = get_instance_config(self.name)if self.config is None:print(f"[start_services] ERROR: Instance '{self.name}' not found in instances.yaml")- print(f"[start_services] Run 'jiuwenclaw-init --name {self.name}' to create it.")+ print(f"[start_services] Run 'jiuwenswarm-init --name {self.name}' to create it.")return 1# Get current status@@ -132,7 +132,7 @@ class InstanceCommand:return 1if not self.config.workspace.exists():print(f"[start_services] ERROR: Workspace directory not found: {self.config.workspace}")- print(f"[start_services] Run 'jiuwenclaw-init --name {self.name}' to create it.")+ print(f"[start_services] Run 'jiuwenswarm-init --name {self.name}' to create it.")return 1return None@@ -407,7 +407,7 @@ def _action_list() -> int:if not statuses:print("[start_services] No instances configured.")- print("[start_services] Run 'jiuwenclaw-init' to initialize default instance.")+ print("[start_services] Run 'jiuwenswarm-init' to initialize default instance.")return 0# Print table headerdiff --git a/packages/jiuwenclaw-tui/MANIFEST.in b/packages/jiuwenclaw-tui/MANIFEST.indeleted file mode 100644index 3ce4fb1fe1..0000000000--- a/packages/jiuwenclaw-tui/MANIFEST.in+++ /dev/null@@ -1 +0,0 @@-recursive-include jiuwenclaw_tui/resources *diff --git a/packages/jiuwenclaw-tui/jiuwenclaw_tui/resources/__init__.py b/packages/jiuwenclaw-tui/jiuwenclaw_tui/resources/__init__.pydeleted file mode 100644index 71314f8199..0000000000--- a/packages/jiuwenclaw-tui/jiuwenclaw_tui/resources/__init__.py+++ /dev/null@@ -1 +0,0 @@-"""Packaged native binaries for jiuwenclaw-tui."""\ No newline at end of filediff --git a/packages/jiuwenswarm-tui/MANIFEST.in b/packages/jiuwenswarm-tui/MANIFEST.innew file mode 100644index 0000000000..1cf5ee91d8--- /dev/null+++ b/packages/jiuwenswarm-tui/MANIFEST.in@@ -0,0 +1 @@+recursive-include jiuwenswarm_tui/resources *diff --git a/packages/jiuwenclaw-tui/jiuwenclaw_tui/__init__.py b/packages/jiuwenswarm-tui/jiuwenswarm_tui/__init__.pysimilarity index 100%rename from packages/jiuwenclaw-tui/jiuwenclaw_tui/__init__.pyrename to packages/jiuwenswarm-tui/jiuwenswarm_tui/__init__.pydiff --git a/packages/jiuwenclaw-tui/jiuwenclaw_tui/app.py b/packages/jiuwenswarm-tui/jiuwenswarm_tui/app.pysimilarity index 91%rename from packages/jiuwenclaw-tui/jiuwenclaw_tui/app.pyrename to packages/jiuwenswarm-tui/jiuwenswarm_tui/app.pyindex 4c35baea22..818698084d 100644--- a/packages/jiuwenclaw-tui/jiuwenclaw_tui/app.py+++ b/packages/jiuwenswarm-tui/jiuwenswarm_tui/app.py@@ -30,7 +30,7 @@ def _platform_tag() -> str:def _binary_name() -> str:- return "jiuwenclaw-tui.exe" if os.name == "nt" else "jiuwenclaw-tui"+ return "jiuwenswarm-tui.exe" if os.name == "nt" else "jiuwenswarm-tui"def _resource_binary_path() -> Path:@@ -64,7 +64,7 @@ def main() -> None:raise SystemExit("\n".join([- f"jiuwenclaw-tui binary not found for platform: {_platform_tag()}",+ f"jiuwenswarm-tui binary not found for platform: {_platform_tag()}",f"expected path: {binary}","build it with: python scripts/build_tui.py --target current",]diff --git a/packages/jiuwenswarm-tui/jiuwenswarm_tui/resources/__init__.py b/packages/jiuwenswarm-tui/jiuwenswarm_tui/resources/__init__.pynew file mode 100644index 0000000000..96e010db50--- /dev/null+++ b/packages/jiuwenswarm-tui/jiuwenswarm_tui/resources/__init__.py@@ -0,0 +1 @@+"""Packaged native binaries for jiuwenswarm-tui."""\ No newline at end of filediff --git a/packages/jiuwenclaw-tui/pyproject.toml b/packages/jiuwenswarm-tui/pyproject.tomlsimilarity index 82%rename from packages/jiuwenclaw-tui/pyproject.tomlrename to packages/jiuwenswarm-tui/pyproject.tomlindex 9582b501a5..c325e45ebe 100644--- a/packages/jiuwenclaw-tui/pyproject.toml+++ b/packages/jiuwenswarm-tui/pyproject.toml@@ -3,7 +3,7 @@ requires = ["setuptools>=61.0", "wheel"]build-backend = "setuptools.build_meta"[project]-name = "jiuwenclaw-tui"+name = "jiuwenswarm-tui"version = "0.1.11"description = "Native terminal UI launcher for JiuwenClaw"requires-python = ">=3.11,<3.14"@@ -13,7 +13,7 @@ classifiers = [][project.scripts]-jiuwenclaw-tui = "jiuwenclaw_tui.app:main"+jiuwenswarm-tui = "jiuwenswarm_tui.app:main"[tool.setuptools]py-modules = []@@ -21,12 +21,12 @@ include-package-data = true[tool.setuptools.packages.find]where = ["."]-include = ["jiuwenclaw_tui*"]+include = ["jiuwenswarm_tui*"]namespaces = false[tool.setuptools.package-data]"*" = ["LICENSE"]-jiuwenclaw_tui = [+jiuwenswarm_tui = ["resources/**/*","resources/*",]\ No newline at end of filediff --git a/packages/jiuwenclaw-tui/setup.py b/packages/jiuwenswarm-tui/setup.pysimilarity index 100%rename from packages/jiuwenclaw-tui/setup.pyrename to packages/jiuwenswarm-tui/setup.pydiff --git a/pyproject.toml b/pyproject.tomlindex 262812a77f..342b88b704 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -42,7 +42,7 @@ dependencies = [[project.optional-dependencies]desktop = ["pywebview>=5.4"]dev = ["pyinstaller>=6.0.0", "pywebview>=5.4"]-tui = ["jiuwenclaw-tui==0.1.11"]+tui = ["jiuwenswarm-tui==0.1.11"]distribute = ["openjiuwen[postgres,zmq]"]shell-ast = ["tree-sitter>=0.25.0,<0.26.0",@@ -60,15 +60,15 @@ test = [][project.scripts]-jiuwenclaw-app = "jiuwenclaw.app:main"-jiuwenclaw-agentserver = "jiuwenclaw.server.app_agentserver:main"-jiuwenclaw-gateway = "jiuwenclaw.gateway.app_gateway:main"-jiuwenclaw-web = "jiuwenclaw.channels.web.app_web:main"-jiuwenclaw-start = "jiuwenclaw.start_services:main"-jiuwenclaw-init = "jiuwenclaw.init_workspace:main"-jiuwenclaw-desktop = "jiuwenclaw.channels.desktop.desktop_app:main"-jiuwenclaw-tui = "jiuwenclaw.channels.acp.app_acp:main"-jiuwenclaw-acp = "jiuwenclaw.gateway.channel_manager.protocol.acp.acp_connect:main"+jiuwenswarm-app = "jiuwenclaw.app:main"+jiuwenswarm-agentserver = "jiuwenclaw.server.app_agentserver:main"+jiuwenswarm-gateway = "jiuwenclaw.gateway.app_gateway:main"+jiuwenswarm-web = "jiuwenclaw.channels.web.app_web:main"+jiuwenswarm-start = "jiuwenclaw.start_services:main"+jiuwenswarm-init = "jiuwenclaw.init_workspace:main"+jiuwenswarm-desktop = "jiuwenclaw.channels.desktop.desktop_app:main"+jiuwenswarm-tui = "jiuwenclaw.channels.acp.app_acp:main"+jiuwenswarm-acp = "jiuwenclaw.gateway.channel_manager.protocol.acp.acp_connect:main"[tool.setuptools]# 入口脚本现在是 jiuwenclaw 包内的一部分,不需要 py-modules@@ -96,7 +96,7 @@ jiuwenclaw = [jiuwenclaw = ["channels/web/frontend/node_modules/**", "channels/web/frontend/node_modules/*"][tool.uv.sources]-jiuwenclaw-tui = { path = "./packages/jiuwenclaw-tui" }+jiuwenswarm-tui = { path = "./packages/jiuwenswarm-tui" }[dependency-groups]dev = [diff --git a/scripts/build_python_packages.py b/scripts/build_python_packages.pyindex 66fb0c3b03..696d18bb51 100644--- a/scripts/build_python_packages.py+++ b/scripts/build_python_packages.py@@ -10,7 +10,7 @@ from pathlib import PathROOT = Path(__file__).resolve().parents[1]-SIDECAR_ROOT = ROOT / "packages" / "jiuwenclaw-tui"+SIDECAR_ROOT = ROOT / "packages" / "jiuwenswarm-tui"SIDE_CAR_DIST = SIDECAR_ROOT / "dist"TUI_ROOT = ROOT / "jiuwenclaw" / "channels" / "tui" / "frontend"@@ -43,7 +43,7 @@ def clean_root() -> None:def clean_sidecar() -> None:- for relative in ("dist", "build", "jiuwenclaw_tui.egg-info"):+ for relative in ("dist", "build", "jiuwenswarm_tui.egg-info"):remove_path(SIDECAR_ROOT / relative)@@ -53,7 +53,7 @@ def build_root_wheel() -> None:def build_sidecar_wheel(platform_tag: str | None = None) -> None:- for relative in ("build", "jiuwenclaw_tui.egg-info"):+ for relative in ("build", "jiuwenswarm_tui.egg-info"):remove_path(SIDECAR_ROOT / relative)env = os.environ.copy()if platform_tag:@@ -121,8 +121,8 @@ def main() -> None:)parser.add_argument("--out-dir",- default="./packages/jiuwenclaw-tui/dist",- help="Directory to output the built TUI binary (default: ./packages/jiuwenclaw-tui/dist)",+ default="./packages/jiuwenswarm-tui/dist",+ help="Directory to output the built TUI binary (default: ./packages/jiuwenswarm-tui/dist)",)parser.add_argument("--skip-binary",@@ -137,7 +137,7 @@ def main() -> None:parser.add_argument("--skip-sidecar",action="store_true",- help="Skip building the jiuwenclaw-tui sidecar wheel",+ help="Skip building the jiuwenswarm-tui sidecar wheel",)parser.add_argument("--clean",diff --git a/scripts/build_tui.py b/scripts/build_tui.pyindex 7a1ea3912f..96cd04d692 100644--- a/scripts/build_tui.py+++ b/scripts/build_tui.py@@ -11,7 +11,7 @@ from pathlib import PathROOT = Path(__file__).resolve().parents[1]TUI_ENTRY = ROOT / "jiuwenclaw" / "channels" / "tui" / "frontend" / "src" / "index.ts"-OUTPUT_ROOT = ROOT / "packages" / "jiuwenclaw-tui" / "jiuwenclaw_tui" / "resources" / "tui-bin"+OUTPUT_ROOT = ROOT / "packages" / "jiuwenswarm-tui" / "jiuwenswarm_tui" / "resources" / "tui-bin"TARGETS = {"linux-x64": "bun-linux-x64",@@ -39,7 +39,7 @@ def current_platform_key() -> str:def output_binary_name(platform_key: str) -> str:- return "jiuwenclaw-tui.exe" if platform_key.startswith("windows-") else "jiuwenclaw-tui"+ return "jiuwenswarm-tui.exe" if platform_key.startswith("windows-") else "jiuwenswarm-tui"def resolve_requested_targets(raw: str) -> list[str]:@@ -96,7 +96,7 @@ def build_target(platform_key: str) -> Path:def main() -> None:- parser = argparse.ArgumentParser(description="Build jiuwenclaw-tui native binaries with Bun.")+ parser = argparse.ArgumentParser(description="Build jiuwenswarm-tui native binaries with Bun.")parser.add_argument("--target",default="current",@@ -110,7 +110,7 @@ def main() -> None:args = parser.parse_args()if shutil.which("bun") is None:- raise SystemExit("bun is required to build jiuwenclaw-tui binaries")+ raise SystemExit("bun is required to build jiuwenswarm-tui binaries")if not TUI_ENTRY.exists():raise SystemExit(f"CLI entry not found: {TUI_ENTRY}")diff --git a/scripts/jiuwenclaw.iss b/scripts/jiuwenclaw.issindex c76fa1eebb..53120fa2f2 100644--- a/scripts/jiuwenclaw.iss+++ b/scripts/jiuwenclaw.iss@@ -27,7 +27,7 @@ ArchitecturesInstallIn64BitMode=x64compatibleDisableProgramGroupPage=yesSetupLogging=yesOutputDir=..\dist\installer-OutputBaseFilename=jiuwenclaw-setup-{#MyAppVersion}+OutputBaseFilename=jiuwenswarm-setup-{#MyAppVersion}UninstallDisplayIcon={app}\{#MyAppExeName}; 如果后续补了 ico,可以取消下面两行注释并指向同一图标文件@@ -58,5 +58,5 @@ Filename: "{app}\{#MyAppExeName}"; Description: "启动 {#MyAppName}"; Flags: no[Code]function UserWorkspaceDir(): string;begin- Result := ExpandConstant('{userappdata}') + '\..\.jiuwenclaw';+ Result := ExpandConstant('{userappdata}') + '\..\.jiuwenswarm';end;diff --git a/tests/system_tests/conftest.py b/tests/system_tests/conftest.pyindex 56c91a38a1..58005246ec 100644--- a/tests/system_tests/conftest.py+++ b/tests/system_tests/conftest.py@@ -156,7 +156,7 @@ def verify_workspace_structure():Example:def test_something(verify_workspace_structure):- workspace = Path("~/.jiuwenclaw").expanduser()+ workspace = Path("~/.jiuwenswarm").expanduser()verify_workspace_structure(workspace, language="zh")"""diff --git a/tests/system_tests/test_init_workspace.py b/tests/system_tests/test_init_workspace.pyindex 2e4ce2a4ef..1027961f72 100644--- a/tests/system_tests/test_init_workspace.py+++ b/tests/system_tests/test_init_workspace.py@@ -1,6 +1,6 @@# Copyright (c) Huawei Technologies Co., Ltd. 2026. All rights reserved.-"""System tests for jiuwenclaw-init command.+"""System tests for jiuwenswarm-init command.These tests verify the initialization process of the JiuwenClaw workspace,including directory creation, file copying, and configuration generation.@@ -53,7 +53,7 @@ class TestResolvePreferredLanguage:"""Test _resolve_preferred_language with explicit language parameter."""from jiuwenclaw.common.utils import _resolve_preferred_language- workspace_dir = temp_home / ".jiuwenclaw"+ workspace_dir = temp_home / ".jiuwenswarm"workspace_dir.mkdir(parents=True, exist_ok=True)(workspace_dir / "config").mkdir(parents=True, exist_ok=True)@@ -71,7 +71,7 @@ class TestResolvePreferredLanguage:"""Test _resolve_preferred_language defaults to 'zh' when no config exists."""from jiuwenclaw.common.utils import _resolve_preferred_language- workspace_dir = temp_home / ".jiuwenclaw"+ workspace_dir = temp_home / ".jiuwenswarm"workspace_dir.mkdir(parents=True, exist_ok=True)(workspace_dir / "config").mkdir(parents=True, exist_ok=True)@@ -255,11 +255,11 @@ class TestInitWorkspaceMain:class TestInitCLI:- """Test jiuwenclaw-init command line interface."""+ """Test jiuwenswarm-init command line interface."""@staticmethoddef test_cli_init_command():- """Test jiuwenclaw-init as a subprocess command."""+ """Test jiuwenswarm-init as a subprocess command."""# This test requires the package to be installed# Skip if not in development mode or if package not availablepytest.skip("CLI integration test - requires full package installation")@@ -279,7 +279,7 @@ class TestInitIntegration:def test_full_initialization_flow():"""Test full initialization flow with prepare_workspace().- NOTE: This test will create files in the actual ~/.jiuwenclaw directory.+ NOTE: This test will create files in the actual ~/.jiuwenswarm directory.Only run this test manually or in isolated environments."""pytest.skip("Integration test - requires manual execution in isolated environment")@@ -288,7 +288,7 @@ class TestInitIntegration:def test_config_file_content():"""Test config.yaml content after initialization.- NOTE: This test will create files in the actual ~/.jiuwenclaw directory.+ NOTE: This test will create files in the actual ~/.jiuwenswarm directory."""pytest.skip("Integration test - requires manual execution in isolated environment")@@ -296,6 +296,6 @@ class TestInitIntegration:def test_agent_templates_copied():"""Test agent templates are copied correctly.- NOTE: This test will create files in the actual ~/.jiuwenclaw directory.+ NOTE: This test will create files in the actual ~/.jiuwenswarm directory."""pytest.skip("Integration test - requires manual execution in isolated environment")diff --git a/tests/system_tests/test_system_prompt_live_capture.py b/tests/system_tests/test_system_prompt_live_capture.pyindex 8a46391817..e6d85c0f6c 100644--- a/tests/system_tests/test_system_prompt_live_capture.py+++ b/tests/system_tests/test_system_prompt_live_capture.py@@ -5,7 +5,7 @@ Walks the full runtime path:create_instance() → process_message_impl() → Runner.run_agent()→ rails before_model_call → LLM_INPUT callback captures messages-Reads real ~/.jiuwenclaw/config/config.yaml for model configuration.+Reads real ~/.jiuwenswarm/config/config.yaml for model configuration.Outputs:tests/system_tests/output/system_prompt_live_capture.jsontests/system_tests/output/system_prompt_live_capture.txt@@ -70,7 +70,7 @@ def _sync_prompt_workspace_templates(language: str) -> None:if not str(home_dir).startswith("/tmp/"):return- workspace_dir = home_dir / ".jiuwenclaw" / "agent" / "jiuwenclaw_workspace"+ workspace_dir = home_dir / ".jiuwenswarm" / "agent" / "workspace"if not workspace_dir.exists():return@@ -79,7 +79,7 @@ def _sync_prompt_workspace_templates(language: str) -> None:/ "jiuwenclaw"/ "resources"/ "agent"- / "jiuwenclaw_workspace"+ / "workspace")suffix = "ZH" if language == "zh" else "EN"file_map = [diff --git a/tests/unit_tests/agentserver/test_agentserver_acp.py b/tests/unit_tests/agentserver/test_agentserver_acp.pyindex 1999a1f345..5f8fa30abe 100644--- a/tests/unit_tests/agentserver/test_agentserver_acp.py+++ b/tests/unit_tests/agentserver/test_agentserver_acp.py@@ -182,14 +182,14 @@ def test_parse_stream_chunk_serializes_team_runtime_enum_kind():parsed = parse_stream_chunk({"type": "team.runtime_ready",- "activation_kind": RunActionKind.WARM_RECOVER,+ "activation_kind": RunActionKind.NEW_TEAM_IN_SESSION,"team_name": "demo-team",})assert parsed == {"event_type": "team.runtime_ready",- "activation_kind": RunActionKind.WARM_RECOVER.value,+ "activation_kind": RunActionKind.NEW_TEAM_IN_SESSION.value,"team_name": "demo-team",}@@ -245,7 +245,7 @@ def test_sync_team_identity_metadata_skips_recover_kinds(monkeypatch):session_id="team_sess_001",mode="team",ready_team_name="new-team",- activation_kind=RunActionKind.WARM_RECOVER.value,+ activation_kind=RunActionKind.NEW_TEAM_IN_SESSION.value,)assert updates == []diff --git a/tests/unit_tests/agentserver/test_system_prompt_restructure.py b/tests/unit_tests/agentserver/test_system_prompt_restructure.pyindex 85ddd6edc0..2b32966b4b 100644--- a/tests/unit_tests/agentserver/test_system_prompt_restructure.py+++ b/tests/unit_tests/agentserver/test_system_prompt_restructure.py@@ -90,7 +90,7 @@ def test_resolve_enable_task_loop_can_be_called_on_class(monkeypatch):def test_deep_adapter_subagents_includes_optional_browser_and_configured_research():adapter = _TestableJiuWenClawDeepAdapter()- adapter.set_workspace_dir("/tmp/jiuwenclaw-workspace")+ adapter.set_workspace_dir("/tmp/jiuwenswarm-workspace")model = object()config = {"max_iterations": 9,@@ -117,13 +117,13 @@ def test_deep_adapter_subagents_includes_optional_browser_and_configured_researcassert subagents == ["research_spec", "browser_spec"]mock_research.assert_called_once_with(model,- workspace="/tmp/jiuwenclaw-workspace",+ workspace="/tmp/jiuwenswarm-workspace",language="cn",max_iterations=9,)mock_browser.assert_called_once_with(model,- workspace="/tmp/jiuwenclaw-workspace",+ workspace="/tmp/jiuwenswarm-workspace",language="cn",max_iterations=7,)@@ -131,7 +131,7 @@ def test_deep_adapter_subagents_includes_optional_browser_and_configured_researcdef test_deep_adapter_subagents_omits_research_without_explicit_enable():adapter = _TestableJiuWenClawDeepAdapter()- adapter.set_workspace_dir("/tmp/jiuwenclaw-workspace")+ adapter.set_workspace_dir("/tmp/jiuwenswarm-workspace")model = object()config = {"max_iterations": 9}diff --git a/tests/unit_tests/test_instance_manager.py b/tests/unit_tests/test_instance_manager.pyindex 9f2dc270c0..aafc1af610 100644--- a/tests/unit_tests/test_instance_manager.py+++ b/tests/unit_tests/test_instance_manager.py@@ -359,7 +359,7 @@ class TestBootstrapEnv:assert env_path.exists()content = env_path.read_text()- assert "JIUWENCLAW_DATA_DIR" in content+ assert "JIUWENSWARM_DATA_DIR" in contentassert "JIUWENCLAW_INSTANCE=alice" in contentassert "AGENT_SERVER_PORT=19092" in contentdiff --git a/tests/unit_tests/test_utils.py b/tests/unit_tests/test_utils.pyindex 06220d21ec..a91626de65 100644--- a/tests/unit_tests/test_utils.py+++ b/tests/unit_tests/test_utils.py@@ -130,30 +130,30 @@ class TestConstants:"""Test get_user_workspace_dir is defined."""assert hasattr(utils, "get_user_workspace_dir")assert isinstance(utils.get_user_workspace_dir(), Path)- assert ".jiuwenclaw" in str(utils.get_user_workspace_dir())+ assert ".jiuwenswarm" in str(utils.get_user_workspace_dir())class TestMultiInstanceEnvVars:"""Test environment variable support for multi-instance isolation (Phase 1)."""@staticmethod- def test_jiuwenclaw_workspace_env_var():- """Test JIUWENCLAW_DATA_DIR environment variable overrides default workspace."""+ def test_workspace_env_var():+ """Test JIUWENSWARM_DATA_DIR environment variable overrides default workspace."""# Reset cache before test - must reset _workspace_base_dir for workspace testssetattr(utils, '_workspace_base_dir', None)setattr(utils, '_user_home', None)- original_env = os.environ.pop("JIUWENCLAW_DATA_DIR", None)+ original_env = os.environ.pop("JIUWENSWARM_DATA_DIR", None)original_home_env = os.environ.pop("JIUWENCLAW_HOME", None)try:# Test default behaviordefault_workspace = utils.get_user_workspace_dir()- assert ".jiuwenclaw" in str(default_workspace)+ assert ".jiuwenswarm" in str(default_workspace)# Reset cache and set env varsetattr(utils, '_workspace_base_dir', None)setattr(utils, '_user_home', None)- os.environ["JIUWENCLAW_DATA_DIR"] = "/custom/workspace/path"+ os.environ["JIUWENSWARM_DATA_DIR"] = "/custom/workspace/path"custom_workspace = utils.get_user_workspace_dir()# Use Path comparison for cross-platform compatibilityassert custom_workspace == Path("/custom/workspace/path")@@ -161,9 +161,9 @@ class TestMultiInstanceEnvVars:# Cleanupsetattr(utils, '_workspace_base_dir', None)setattr(utils, '_user_home', None)- os.environ.pop("JIUWENCLAW_DATA_DIR", None)+ os.environ.pop("JIUWENSWARM_DATA_DIR", None)if original_env:- os.environ["JIUWENCLAW_DATA_DIR"] = original_env+ os.environ["JIUWENSWARM_DATA_DIR"] = original_envif original_home_env:os.environ["JIUWENCLAW_HOME"] = original_home_env@@ -173,7 +173,7 @@ class TestMultiInstanceEnvVars:# Reset cache before testsetattr(utils, '_user_home', None)original_home_env = os.environ.pop("JIUWENCLAW_HOME", None)- original_workspace_env = os.environ.pop("JIUWENCLAW_DATA_DIR", None)+ original_workspace_env = os.environ.pop("JIUWENSWARM_DATA_DIR", None)try:# Set JIUWENCLAW_HOME@@ -191,38 +191,38 @@ class TestMultiInstanceEnvVars:# Cleanupsetattr(utils, '_user_home', None)os.environ.pop("JIUWENCLAW_HOME", None)- os.environ.pop("JIUWENCLAW_DATA_DIR", None)+ os.environ.pop("JIUWENSWARM_DATA_DIR", None)if original_home_env:os.environ["JIUWENCLAW_HOME"] = original_home_envif original_workspace_env:- os.environ["JIUWENCLAW_DATA_DIR"] = original_workspace_env+ os.environ["JIUWENSWARM_DATA_DIR"] = original_workspace_env@staticmethoddef test_workspace_priority_over_home():- """Test JIUWENCLAW_DATA_DIR takes priority over JIUWENCLAW_HOME for workspace."""+ """Test JIUWENSWARM_DATA_DIR takes priority over JIUWENCLAW_HOME for workspace."""# Reset both caches - _workspace_base_dir is used by get_user_workspace_dirsetattr(utils, '_workspace_base_dir', None)setattr(utils, '_user_home', None)original_home_env = os.environ.pop("JIUWENCLAW_HOME", None)- original_workspace_env = os.environ.pop("JIUWENCLAW_DATA_DIR", None)+ original_workspace_env = os.environ.pop("JIUWENSWARM_DATA_DIR", None)try:# Set both env varsos.environ["JIUWENCLAW_HOME"] = "/home/a"- os.environ["JIUWENCLAW_DATA_DIR"] = "/workspace/b"+ os.environ["JIUWENSWARM_DATA_DIR"] = "/workspace/b"- # Workspace should use JIUWENCLAW_DATA_DIR directly, not derive from HOME+ # Workspace should use JIUWENSWARM_DATA_DIR directly, not derive from HOMEworkspace = utils.get_user_workspace_dir()assert workspace == Path("/workspace/b")finally:setattr(utils, '_workspace_base_dir', None)setattr(utils, '_user_home', None)os.environ.pop("JIUWENCLAW_HOME", None)- os.environ.pop("JIUWENCLAW_DATA_DIR", None)+ os.environ.pop("JIUWENSWARM_DATA_DIR", None)if original_home_env:os.environ["JIUWENCLAW_HOME"] = original_home_envif original_workspace_env:- os.environ["JIUWENCLAW_DATA_DIR"] = original_workspace_env+ os.environ["JIUWENSWARM_DATA_DIR"] = original_workspace_envclass TestHardcodedPathsPhase2:@@ -249,7 +249,7 @@ class TestHardcodedPathsPhase2:@staticmethoddef test_task_tools_path_structure():- """Test task_tools.py path uses jiuwenclaw_workspace (migrated from legacy workspace)."""+ """Test task_tools.py path uses workspace (migrated from legacy jiuwenclaw_workspace)."""# Reset caches to ensure clean state after previous testssetattr(utils, '_user_home', None)setattr(utils, '_initialized', False)@@ -261,7 +261,7 @@ class TestHardcodedPathsPhase2:from jiuwenclaw.common.utils import get_user_workspace_dirworkspace = get_user_workspace_dir()- expected_path = workspace / "agent" / "jiuwenclaw_workspace" / "task-data.json"+ expected_path = workspace / "agent" / "workspace" / "task-data.json"actual_path = Path(_get_task_data_path())assert str(actual_path.resolve()) == str(expected_path.resolve()), \@@ -280,7 +280,7 @@ class TestHardcodedPathsPhase2:from jiuwenclaw.common.utils import get_deepagent_user_md_path, get_user_workspace_dirworkspace = get_user_workspace_dir()- expected_path = workspace / "agent" / "jiuwenclaw_workspace" / "USER.md"+ expected_path = workspace / "agent" / "workspace" / "USER.md"actual_path = get_deepagent_user_md_path()assert str(actual_path.resolve()) == str(expected_path.resolve()), \@@ -300,7 +300,7 @@ class TestAdditionalHardcodedPaths:from jiuwenclaw.common.utils import get_user_workspace_dirworkspace = get_user_workspace_dir()- expected_path = workspace / "agent" / "jiuwenclaw_workspace" / "extensions"+ expected_path = workspace / "agent" / "workspace" / "extensions"rail_manager = RailManager()extensions_dir = getattr(rail_manager, '_extensions_dir')@@ -330,7 +330,7 @@ class TestAdditionalHardcodedPaths:from jiuwenclaw.common.utils import get_interactions_dir, get_user_workspace_dirworkspace = get_user_workspace_dir()- expected_path = workspace / "agent" / "jiuwenclaw_workspace" / "interactions"+ expected_path = workspace / "agent" / "workspace" / "interactions"actual_path = get_interactions_dir()assert str(actual_path.resolve()) == str(expected_path.resolve()), \diff --git a/uv.lock b/uv.lockindex 0497e2d8e1..403d80cf94 100644--- a/uv.lock+++ b/uv.lock@@ -2333,7 +2333,7 @@ wheels = [[[package]]name = "openjiuwen"version = "0.1.12"-source = { git = "https://gitcode.com/openJiuwen/agent-core.git?rev=develop#7eef494cdc14cc6e3593c9ce10dc6858bc502a32" }+source = { git = "https://gitcode.com/openJiuwen/agent-core.git?rev=develop#30e894061ef93aec9bbd379ab7e1e4dab0eb5e1a" }dependencies = [{ name = "aiofiles" },{ name = "aiohttp" },