/harness-share:harness-exportfrom harness-share
Exports installed skills from all supported AI tool locations (Cursor, Copilot, Windsurf, etc.) into a shareable harness.yaml file in Harness Protocol v1 format.
Ships in harness-share. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are helping the user capture their current harness-kit setup into a harness.yaml file they can share with teammates or commit to their dotfiles repo.
This file follows the Harness Protocol v1 format — the open spec at harnessprotocol.ai. It is backward-compatible with harness-import (which handles both old and new formats).
Follow these steps in order. Do not skip any step.
Scan every skill directory across all 8 supported targets. Each subdirectory inside these directories is an installed skill:
~/.claude/skills/ — Claude Code global skills.cursor/skills/ — Cursor project-local skills.github/skills/ — Copilot project-local skills.agents/skills/ — Codex, and the agentskills.io standard shared location.opencode/skills/ — OpenCode project-local skills.windsurf/skills/ — Windsurf project-local skills.gemini/skills/ — Gemini CLI project-local skills.junie/skills/ — Junie project-local skillsls ~/.claude/skills/ 2>/dev/null
ls .cursor/skills/ 2>/dev/null
ls .github/skills/ 2>/dev/null
ls .agents/skills/ 2>/dev/null
ls .opencode/skills/ 2>/dev/null
ls .windsurf/skills/ 2>/dev/null
ls .gemini/skills/ 2>/dev/null
ls .junie/skills/ 2>/dev/null
Collect the directory names from each location. Deduplicate by skill name across locations — if the same skill name appears in multiple directories, count it once. Track which platforms each skill was found in.
Show the user the combined result:
Found skills across AI tools:
Claude Code (~/.claude/skills/): research, explain, orient
Cursor (.cursor/skills/): research, explain
Copilot (.github/skills/): research
Codex (.agents/skills/): (none)
OpenCode (.opencode/skills/): (none)
Windsurf (.windsurf/skills/): research
Gemini CLI (.gemini/skills/): (none)
Junie (.junie/skills/): (none)
Unique skills: research, explain, orient
Use this deduplicated list as your list of installed plugin names for the steps that follow.
If all eight directories are empty or missing, tell the user: "No installed skills found in any supported location. Nothing to export." and stop.
Tell the user what skills you found, then ask:
"I found these installed skills: [list]. A couple of quick questions:
For each plugin, which repo is it from? Format:
owner/repo— for exampleharnessprotocol/harness-kit. If a plugin is from harness-kit, just say so and I'll fill it in.What name and description should I give this harness profile? (optional — press enter to skip)
Do you have any MCP servers, env variables, or CLAUDE.md instructions you'd like to include? (optional)
Note: MCP server detection is automatic — Step 2.6 will scan every project-level MCP config file and ask you separately. You only need to answer about MCP here if you have MCP servers in a non-standard location not covered by those files.
If you've only added harness-kit plugins, just say so."
Wait for the user's response before proceeding.
Check whether any cross-platform instruction files exist and contain harness-generated marker blocks:
grep -l "<!-- BEGIN harness:" .cursor/rules/harness.mdc .github/copilot-instructions.md AGENTS.md 2>/dev/null
Claude Code instruction files (CLAUDE.md, AGENT.md, SOUL.md) are intentionally excluded — they are managed by the user directly and are not cross-platform sources for export. AGENTS.md is the shared operational-instructions file for Codex, OpenCode, Windsurf, Gemini CLI, and Junie — one file covers all five, so a single match there represents that whole family, not five separate sources.
If any matching files are found, tell the user what was found and ask. List all slots found in each file — a file may contain multiple harness marker blocks:
"I also found harness-generated instruction content in these files:
.cursor/rules/harness.mdc(containsmy-harness:operationalandmy-harness:behavioralblocks).github/copilot-instructions.md(containsmy-harness:operationalblock)AGENTS.md(containsmy-harness:operationalblock)Would you like me to include the
operationalandbehavioralinstruction content in the export?"
(List only the files that actually exist and contain marker blocks — substitute the real profile name from the markers in place of my-harness.)
If the user says yes:
<!-- BEGIN harness:{name}:{slot} --> and <!-- END harness:{name}:{slot} --> marker from those files.instructions: section in harness.yaml (Step 4).If the user says no, skip — do not include instruction content from cross-platform files.
If no harness marker blocks are found in any cross-platform file, skip this step silently.
Scan these project-level MCP config files:
cat .mcp.json 2>/dev/null
cat .cursor/mcp.json 2>/dev/null
cat .vscode/mcp.json 2>/dev/null
cat opencode.json 2>/dev/null
cat .gemini/settings.json 2>/dev/null
cat .junie/mcp/mcp.json 2>/dev/null
Codex and Windsurf are intentionally excluded — neither has a project-level MCP config file (Codex uses ~/.codex/config.toml, Windsurf uses a global ~/.codeium/windsurf/mcp_config.json), so there's nothing project-local to scan for either.
Each file uses the same JSON structure with a top-level mcpServers key. Merge all mcpServers entries across all files found. Deduplicate by server name:
Show the user a summary:
Found MCP servers:
postgres (in .mcp.json and .cursor/mcp.json — same config)
filesystem (in .mcp.json only)
"Would you like to include these in the export? (all / pick / none)"
If the user selects all or pick (and picks at least one), store the chosen servers to write to the mcp-servers: section in harness.yaml (Step 4). Convert from JSON format back to harness YAML format: JSON key type → YAML key transport.
If the user selects none, or if no MCP config files are found, skip this step.
For each installed skill, determine its source repo:
Known harness-kit plugins (source: harnessprotocol/harness-kit):
| Plugin | Description |
|---|---|
| explain | Layered explanations of files, functions, directories, or concepts |
| research | Process any source into a structured, compounding knowledge base |
| lineage | Column-level lineage tracing through SQL, Kafka, Spark, and JDBC |
| orient | Topic-focused session orientation across graph, knowledge, and research |
| capture | Capture session information into a staging file for later reflection |
| review | Code review for a branch, PR, or path — severity labels and cross-file analysis |
| docgen | Generate or update README, API docs, architecture overview, or changelog |
| harness-export | Export your installed plugins to a shareable harness.yaml |
| harness-import | Import a harness.yaml and interactively select plugins to install |
| harness-validate | Validate a harness.yaml file against the Harness Protocol v1 JSON Schema |
| harness-compile | Compile harness.yaml to native config files for Claude Code, Cursor, Copilot, Codex, OpenCode, Windsurf, Gemini CLI, and Junie |
| harness-sync | Sync AI tool configuration across all 8 supported targets |
| open-pr | Pre-flight checks and PR creation: run tests, open a PR, code review, and check CI |
| merge-pr | PR merge workflow: verify CI and review status, sync with base, confirm, squash merge, and clean up |
| pr-sweep | Cross-repo PR sweep: triage all open PRs, run code reviews, merge what's ready, fix quick CI blockers, and report |
For any installed skill not in this table, ask the user:
"I see
[name]installed but don't recognize it. Whatowner/repois it from, and what does it do in one sentence?"
Write harness.yaml to the current directory (or a path the user specifies). Use the Harness Protocol v1 format:
$schema: https://harnessprotocol.ai/schema/v1/harness.schema.json
version: "1"
# Profile identity (optional but recommended)
metadata:
name: my-harness
description: My personal harness configuration.
plugins:
- name: explain
source: harnessprotocol/harness-kit
description: Layered explanations of files, functions, directories, or concepts
# additional plugins follow the same structure
With MCP servers (include only if user provided them):
mcp-servers:
postgres:
transport: stdio
command: uvx
args:
- mcp-server-postgres
- ${DB_CONNECTION_STRING}
With env declarations (include only if user has env vars):
env:
- name: DB_CONNECTION_STRING
description: PostgreSQL connection string.
required: true
sensitive: true
With instructions (include only if user wants to bundle CLAUDE.md/AGENT.md content):
instructions:
operational: |
Your operational instructions here.
import-mode: merge
Rules:
version must be the string "1" (quoted), not the integer 1source is owner/repo — no marketplace: key, no marketplaces: sectionmcp-servers, env, instructions, and permissions sections if the user provided content for theminstructions: sectionmcp-servers: section (using YAML transport: key, not JSON type:)metadata if the user skipped the name/description questionsharness-export or harness-import in the output unless the user explicitly asksTell the user where the file was written:
"Saved to
harness.yaml. To compile it to your other tools' config files, run/harness-compile --target <tools>(or--target allfor every supported tool: Claude Code, Cursor, Copilot, Codex, OpenCode, Windsurf, Gemini CLI, Junie).To share with teammates: commit it to your dotfiles repo. They can import it with
/harness-importinside Claude Code, or with the shell fallback:curl -fsSL https://raw.githubusercontent.com/harnessprotocol/harness-kit/main/harness-restore.sh | bash -s -- harness.yaml ```"
| Mistake | Fix |
|---|---|
Using version: 1 (integer) | Must be version: "1" (string) — this is what distinguishes the protocol format |
Using marketplace: harness-kit | Protocol format uses source: harnessprotocol/harness-kit — no marketplaces: section |
Including harness-export and harness-import in the output | Only include plugins the user actually uses |
| Writing to a path without confirming | Write to ./harness.yaml by default. If user specified a path in the invocation, use that |
Adding mcp-servers: / env: / instructions: as empty sections | Only include these sections when the user has actual content to put in them |
Treating one AGENTS.md match as five separate instruction sources | It's one shared file for the Codex/OpenCode/Windsurf/Gemini/Junie family — extract it once |
Scanning opencode.json/.gemini/settings.json/.junie/mcp/mcp.json for Codex or Windsurf | Neither has a project-level MCP file at all — don't invent one to scan |
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub harnessprotocol/harness-kit --plugin harness-share5 skills in this plugin
/harness-compileUse when user invokes /harness-compile or wants to compile a harness.yaml into native config files for Claude Code, Cursor, GitHub Copilot, Codex, OpenCode, Windsurf, Gemini CLI, or JetBrains Junie. Generates CLAUDE.md, AGENT.md, .mcp.json, .cursor/rules/, .vscode/mcp.json, AGENTS.md, and related files from a single harness.yaml source. Supports --target, --dry-run, and --clean flags./harness-importUse when user invokes /harness-import or wants to install plugins from a shared harness.yaml config file. Reads the config, presents each plugin interactively, and generates the Claude Code install commands for the ones the user selects. Handles both Harness Protocol v1 format (version: "1") and the legacy format (version: 1)./harness-syncUse when user invokes /harness-sync or wants to sync AI tool configurations across any of the 8 supported targets (Claude Code, Cursor, GitHub Copilot, Codex, OpenCode, Windsurf, Gemini CLI, Junie). Inventories installed skills, instruction blocks, and MCP configs on all detected platforms, reports divergence, and lets the user push or pull changes. Push path reuses harness-compile logic. Pull path updates harness.yaml and recompiles. Never overwrites without explicit confirmation./harness-validateUse when user invokes /harness-validate or wants to check whether a harness.yaml file is valid according to the Harness Protocol v1 JSON Schema. Reports validation errors with field paths and helpful fix suggestions.Other plugins' skills for the same job