agent-workspace-init
Initialize or extend a tool-agnostic agent workspace at any repository depth. Discovers current layout state, asks which coding agents to configure from a known list, then bootstraps, adopts, migrates, extends clients, or adds a skill/agent/rule/tool/doc under .agents/ with thin client adapters. Use when creating AGENTS.md and .agents/, migrating duplicated client folders, or adding artifacts without copying into .claude or .cursor.
- License 许可
- Apache-2.0
- 最近更新
- 2026-08-24
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- agent-workspace-init
- description
- Initialize or extend a tool-agnostic agent workspace at any repository depth. Discovers current layout state, asks which coding agents to configure from a known list, then bootstraps, adopts, migrates, extends clients, or adds a skill/agent/rule/tool/doc under .agents/ with thin client adapters. Use when creating AGENTS.md and .agents/, migrating duplicated client folders, or adding artifacts without copying into .claude or .cursor.
02 资源文件 4
- 参考文档references/clients.md1.9 KB
- 参考文档references/mapping.md3.3 KB
- 参考文档references/modes.md1.5 KB
- 参考文档references/templates.md1.3 KB
03 SKILL.md 正文
Agent workspace init
Goal
Make a chosen directory a maintainable tool-agnostic agent workspace (or extend an existing one): one canonical AGENTS.md + .agents/ tree, thin client adapters, no duplicated skill/agent/rule bodies under vendor folders.
Required reading
Checkpoints before writes
- Resolve workspace root (user path or ask). Default: git top-level of the current working directory.
- Detect git top-level vs workspace root. If nested, note DiscoveryRisk for non-MCP adapters (see clients.md).
- Inventory:
AGENTS.md,.agents/**,.claude/**,.cursor/**,.codex/**, and sibling workspace candidates under the git root. Also inventory git-root.mcp.json,.cursor/mcp.json, and.codex/config.toml. - Classify state:
empty|guidance-only|partial|healthy|conflicted(modes.md). - Ask which clients to configure from the known catalog (multiselect). Default:
claude-code,cursor,codex. - Ask whether shared MCP JSON is wanted (
mcp.jsonShared). MCP discovery files always land at the git repository root, even when the workspace root is nested. - Select mode:
bootstrap|adopt|migrate|extend-clients|add-artifact. Confirm with the user when migrating/adopting or when state is conflicted. - Present a short file plan (create / link / move). Wait for confirmation before destructive moves.
- Apply changes. Write
.agents/workspace.jsonfor selected clients and MCP flag. Create skills/agents/rules adapters at the workspace root; create or update MCP discovery only under the git repository root. - Copy or refresh
.agents/tools/verify-agent-workspace.shfrom this plugin’sscripts/verify-agent-workspace.sh. - Run:
bash .agents/tools/verify-agent-workspace.sh .
(from the workspace root). Fix failures before finishing.
12. Hand off: run skill agent-workspace-audit on the same path.
Must refuse
- Writing skill, agent, or rule bodies into
.claude/or.cursor/(symlinks and native settings only). - Symlinking settings files (for example
.claude/settings.json). - Placing
.mcp.json,.cursor/mcp.json, or.codex/config.tomlunder a nested workspace root. - Claiming Windows symlink support.
- Inventing undocumented Tier A adapters for Tier B/custom clients.
- Silent deletes during adopt/migrate.
add-artifact
Ask which kind: skill package, agent role (.md + .toml if codex selected), rule pair, tool script, or doc. Create only under .agents/. Update contributing docs if a new category appears. Refuse if the name already exists unless the user asked to overwrite.
Done when
Verify script passes for the selected clients, workspace.json matches the choice, DiscoveryRisk (if any) is reported, and the user is pointed at agent-workspace-audit.
04 同仓库更多 Skills
agent-workspace-audit
Audit a tool-agnostic agent workspace at any repository depth. Verifies AGENTS.md, .agents/ layout, workspace.json clients, relative symlinks, Codex TOML role pairs, repo-root-only MCP discovery, and contributing docs. Use check, report, or fix-safe modes after init or when changing adapters. Does not bootstrap a new layout.
stateful-skill
Design new Agent Skills or convert existing linear skills into durable, interruptible workflows backed by authoritative external JSON state and bounded runtime context. Use when a skill must resume across sessions or context compaction, branch from explicit state, checkpoint multi-stage work, preserve key decisions for later judgment, recover safely after interruptions, or distinguish resumable and terminal states.
sample-check
Fixture skill for the nested workspace example. Prints that the package workspace is reachable.
movie-metadata-refresh
Refresh local movie metadata files and verify the catalog. Use when the repository's movie data needs normalization or its generated index must be rebuilt.