Currently, the desloppify skill is only available as a Claude Code skill when working inside the desloppify repo itself, or after running update-skill (which downloads from GitHub per-project). The setup command makes it globally available on any machine right after pip install desloppify, using bundled files — no network required.
Key distinction from update-skill:
update-skill = per-project, downloads latest from GitHub, installs relative to project root
setup = machine-wide global install from bundled package data, installs to ~/ paths. Works offline.
Who reads global skill files? The AI tools themselves (Claude Code, Cursor, etc.) discover and load skills from home-directory paths. Desloppify's own find_installed_skill() currently only checks project-relative paths — the plan extends discovery to also check global paths so the scan workflow doesn't emit false "no skill document found" warnings.
Step 1: Bundle skill data in the package
Create desloppify/data/global/ with __init__.py and all overlay files.
Files to create:
desloppify/data/__init__.py (empty, makes it a package for importlib.resources)
desloppify/data/global/__init__.py (empty)
desloppify/data/global/SKILL.md — copy of docs/SKILL.md (the base skill)
desloppify/data/global/CLAUDE.md — copy of docs/CLAUDE.md
desloppify/data/global/CURSOR.md — copy of docs/CURSOR.md
desloppify/data/global/CODEX.md — copy of docs/CODEX.md
desloppify/data/global/WINDSURF.md — copy of docs/WINDSURF.md
desloppify/data/global/GEMINI.md — copy of docs/GEMINI.md
desloppify/data/global/HERMES.md — copy of
Assistant
docs/HERMES.md
Bundle all overlays so --local can assemble the correct interface-specific AGENTS.md.
Update pyproject.toml to include the new package data:
Create a GLOBAL_TARGETS dict in desloppify/app/commands/setup/cmd.py with explicit documentation of where each path comes from:
python
# Global install paths — where each AI tool discovers user-level skills.
#
# These paths are NOT validated by the desloppify repo itself; they depend
# on external tool behavior. Sources:
#
# claude: Claude Code reads ~/.claude/skills/<name>/SKILL.md
# (same relative structure as the project-level .claude/skills/
# path already in SKILL_TARGETS, but rooted at $HOME)
# cursor: Cursor reads ~/.cursor/rules/<name>.md for global rules
# (project-level equivalent: .cursor/rules/ in SKILL_TARGETS)
#
# The setup command validates that the parent tool directory exists (~/.claude/,
# ~/.cursor/) before writing, so it won't create orphan files for tools the
# user hasn't installed.
GLOBAL_TARGETS: dict[str, tuple[str, str, str]] = {
# interface → (path relative to ~/, overlay name, tool config dir to check)
"claude": (".claude/skills/desloppify/SKILL.md", "CLAUDE", ".claude"),
"cursor": (".cursor/rules/desloppify.md", "CURSOR", ".cursor"),
}
Pre-flight validation
Before writing each target, check that the tool's config directory exists at Path.home() / tool_config_dir. If it doesn't:
Single interface mode (--interface claude): raise CommandError with "~/.claude/ not found — Claude Code doesn't appear to be installed."
All-targets mode (no --interface): skip that target with a yellow warning: "Skipping claude (~/.claude/ not found)" and continue with other targets. If all targets are skipped, error with: "No supported AI tools detected. Install Claude Code or Cursor first, or use --interface to force."
This ensures we never silently write files into directories that no tool will ever read.
Codex is excluded from global targets for now. The existing SKILL_TARGETS maps codex to .agents/skills/ (project-relative), while runner_failures.py references ~/.codex/skills — these are inconsistent. The --interface codex flag will emit a clear message: "Codex global skill path is not yet confirmed. Use desloppify update-skill codex for per-project install."
Step 3: Create the setup command module
Create desloppify/app/commands/setup/__init__.py and desloppify/app/commands/setup/cmd.py.
Global mode (default: desloppify setup)
Logic:
Read bundled files via importlib.resources.files('desloppify.data.global')
For each target in GLOBAL_TARGETS:
a. Check Path.home() / tool_config_dir exists (pre-flight, see Step 2)
b. Assemble base SKILL.md + interface overlay (reuse _build_section from update_skill)
c. Resolve Path.home() / rel_path, create parent directories
d. Write file via safe_write_text
Print summary: which targets installed, which skipped, full paths written
Support --interface flag to install only one target (e.g. desloppify setup --interface claude).
Local mode (desloppify setup --local)
Uses project root, not cwd. Consistent with the rest of the codebase: get_project_root() resolves the install target, so running from a subdirectory still writes to the correct location.
Requires --interface to pick the overlay. Because AGENTS.md is a shared target for windsurf, gemini, and hermes — each with distinct overlay content (e.g., Hermes has delegate_task instructions, Windsurf/Gemini have different workflows) — the command must know which overlay to apply.
Logic:
Require --interface when --local is set. Error with clear message if omitted: "AGENTS.md is shared by multiple interfaces. Specify one: --interface windsurf|gemini|hermes"
Read bundled SKILL.md + the specified overlay
Assemble with _build_section
Resolve get_project_root() / "AGENTS.md"
If AGENTS.md already exists, use _replace_section (begin/end markers) to replace only the desloppify section, preserving other content
If new file, write the assembled content directly
Print what was written and where
Shared logic reuse
Import directly from update_skill.cmd:
_build_section() — assembles base + overlay
_replace_section() — section replacement for shared files
_ensure_frontmatter_first() — for targets that need it
Step 4: Wire up CLI parser and registry
parser_groups_admin.py — add:
python
def _add_setup_parser(sub) -> None:
p = sub.add_parser(
"setup",
help="Install desloppify skill globally for AI coding assistants",
)
p.add_argument(
"--local",
action="store_true",
help="Install AGENTS.md in project root instead of global paths",
)
p.add_argument(
"--interface",
default=None,
help="Install for a specific interface only (global: claude, cursor; local: windsurf, gemini, hermes)",
)
parser.py — import and call _add_setup_parser(sub).
registry.py — add "setup": cmd_setup to the handlers dict.
Step 5: Extend skill discovery to cover global installs
Addresses the scan workflow gap. Currently find_installed_skill() only searches project-relative paths, and auto_update_skill() in agent_context.py:420-426 calls it to decide whether to print "No skill document found." After desloppify setup, a user with a global install but no per-project install would still see that false warning during every scan.
Changes to desloppify/app/skill_docs.py:
Add GLOBAL_SKILL_SEARCH_PATHS (paths relative to Path.home()):
Add find_global_skill() -> SkillInstall | None — same logic as find_installed_skill() but searches Path.home() / path instead of get_project_root() / path. Returns a SkillInstall with rel_path prefixed by ~/ for display purposes.
Update check_skill_version() to also check global installs. If no project-local install is found but a stale global install exists, warn: "Your global desloppify skill is outdated (vN, current vM). Run: desloppify setup"
Changes to desloppify/app/commands/scan/reporting/agent_context.py:
Modify the post-check in auto_update_skill() (lines 419-432):
python
install = skill_docs_mod.find_installed_skill()
if not install:
# Check global install before warning.
global_install = skill_docs_mod.find_global_skill()
if global_install and not global_install.stale:
return # Global install is current — no warning needed.
elif global_install and global_install.stale:
print(
f"Global skill document is outdated "
f"(v{global_install.version}, current v{skill_docs_mod.SKILL_VERSION}). "
f"Run: desloppify setup"
)
else:
names = ", ".join(sorted(skill_docs_mod.SKILL_TARGETS))
print(
f"No skill document found. Install one for better workflow guidance: "
f"desloppify update-skill <{names}>"
)
elif install.stale:
print(
f"Skill document is outdated "
f"(v{install.version}, current v{skill_docs_mod.SKILL_VERSION}). "
f"Run: desloppify update-skill"
)
Do NOT change _try_auto_update_skill()'s auto-download behavior. Auto-update remains project-scoped. Global installs are updated explicitly via desloppify setup.
Step 6: Tests
Create desloppify/tests/commands/test_setup.py:
Global install: mock Path.home() to a temp dir (with .claude/ and .cursor/ subdirs pre-created), run cmd_setup, verify files created at expected paths with correct content and version markers
Global single interface: --interface claude creates only the Claude target
Global pre-flight skip: mock Path.home() to a temp dir with only .claude/ (no .cursor/), run without --interface, verify Claude target written and Cursor target skipped with warning
Global pre-flight error: --interface cursor with no ~/.cursor/ raises CommandError
Local install: mock get_project_root() to a temp dir, run with --local --interface hermes, verify AGENTS.md created with Hermes overlay content
Local section replacement: pre-create an AGENTS.md with other content + desloppify markers, run --local --interface windsurf, verify only desloppify section replaced
Local requires interface: --local without --interface raises CommandError
Codex global blocked: --interface codex prints informative skip message
Bundled resources readable: importlib.resources.files('desloppify.data.global') returns valid content for each expected file
Global discovery in scan: mock Path.home() with a valid global skill file, verify find_global_skill() returns correct SkillInstall, verify scan post-check suppresses "no skill document found" when global install is current
Step 7: Sync guard
Add a test in desloppify/tests/test_bundled_sync.py that compares docs/SKILL.md with desloppify/data/global/SKILL.md (and each overlay) to catch drift between source-of-truth docs and bundled copies. Fail with a clear message: "Bundled skill data is out of sync with docs/. Run: cp docs/*.md desloppify/data/global/"
Edit (update post-check to call find_global_skill() before warning)
desloppify/app/commands/registry.py
Edit (add setup)
desloppify/app/cli_support/parser_groups_admin.py
Edit (add parser)
desloppify/app/cli_support/parser.py
Edit (wire parser)
pyproject.toml
Edit (package-data)
desloppify/tests/commands/test_setup.py
Create
desloppify/tests/test_bundled_sync.py
Create
code
Plan metadata:
{
"version": 3,
"timestamp": "2026-03-20T17:33:16Z",
"hash": "sha256:099610c51c90b89a689070cc1319a8507d35d069f55aa6107797addf4503a67b",
"changes_summary": "Addressed both remaining significant flags:\n\n(1) setup_global_install_not_discoverable: Extended the fix beyond just check_skill_version() to also cover the scan workflow. Specifically, auto_update_skill() in agent_context.py:419-432 now calls find_global_skill() as a fallback before printing "No skill document found". If a current global install exists, no warning is shown. If a stale global install exists, the warning points to desloppify setup (not update-skill). This closes the full discovery loop \u2014 find_installed_skill() for project-local, find_global_skill() for home-directory installs.\n\n(2) setup_global_paths_not_repo_validated: Added a new Step 2 that (a) documents the provenance of each global path with explicit comments in the code explaining they depend on external tool behavior, and (b) adds pre-flight validation \u2014 the command checks that the tool's config directory exists (~/.claude/, ~/.cursor/) before writing. In all-targets mode, missing tool dirs are skipped with a warning; in single-interface mode, it's an error. This prevents writing orphan files for tools the user hasn't installed and makes the external dependency explicit rather than assumed.",
"flags_addressed": [
"setup_global_install_not_discoverable",
"setup_global_paths_not_repo_validated"
],
"questions": [
"Should we also bundle AMP, OpenCode, and Droid overlays for potential future global targets, or keep the bundled set minimal (claude + cursor + windsurf/gemini/hermes)?",
"Sync strategy: the plan uses a test guard that compares docs/ vs data/global/. Alternative: read docs/ at build time via a setuptools hook. Test guard is simpler \u2014 confirm this is preferred.",
"Once the Codex global path is confirmed, should it be added to GLOBAL_TARGETS or should Codex remain project-only? The .agents/skills/ convention suggests it may be project-scoped by design."
],
"success_criteria": [
"pip install desloppify && desloppify setup installs skill files to ~/.claude/skills/desloppify/SKILL.md and ~/.cursor/rules/desloppify.md \u2014 all readable and containing the correct skill version marker.",
"desloppify setup --interface claude installs only the Claude target.",
"desloppify setup --interface codex prints a clear message explaining codex global is not yet supported and suggests update-skill.",
"desloppify setup skips targets whose tool config dir doesn't exist (e.g., no ~/.cursor/) with a yellow warning, and errors if ALL targets are skipped.",
"desloppify setup --interface cursor with no /.cursor/ directory raises CommandError.",
"desloppify setup --local --interface hermes creates or updates AGENTS.md at the project root (not cwd) with Hermes overlay content wrapped in begin/end markers.",
"desloppify setup --local --interface windsurf on an existing AGENTS.md with other content preserves that content and only replaces the desloppify section.",
"desloppify setup --local without --interface raises CommandError with guidance on which interfaces are valid.",
"All operations work offline \u2014 files come from importlib.resources bundled data, no network calls.",
"After desloppify setup, running desloppify scan in a project without a per-project skill install does NOT print 'No skill document found' \u2014 the scan post-check detects the global install via find_global_skill().",
"check_skill_version() detects stale global installs and warns with 'Run: desloppify setup'.",
"python -m pytest desloppify/tests/commands/test_setup.py desloppify/tests/test_bundled_sync.py -q passes.",
"desloppify setup prints a clear summary of what was installed and where, including any skipped targets."
],
"assumptions": [
"Global skill paths (/.claude/skills/, ~/.cursor/rules/) depend on external tool behavior, not on desloppify's own code. The setup command validates tool presence by checking the parent config dir exists before writing.",
"importlib.resources.files() works for bundled .md files when installed via pip (including editable installs). Standard Python 3.11+ behavior.",
"Bundled skill files are a snapshot matching the shipped version. Users wanting the latest use update-skill (downloads from GitHub).",
"No network access needed for setup \u2014 this is the key differentiator from update-skill.",
"docs/ is the source of truth. Bundled copies kept in sync via test guard.",
"Section markers (desloppify-begin/end) are the established pattern for shared-file installs.",
"Codex global skill path is unresolved \u2014 excluded until confirmed. Per-project install via update-skill still works.",
"get_project_root() is the correct base for --local, matching all other install paths in the codebase.",
"The existence of ~/.claude/ is a reliable indicator that Claude Code is installed; likewise ~/.cursor/ for Cursor. If these dirs don't exist, the tool won't read skills from them."
],
"delta_from_previous_percent": 25.44
}
code
Gate summary:
{
"passed": false,
"criteria_check": {
"count": 13,
"items": [
"pip install desloppify && desloppify setup installs skill files to ~/.claude/skills/desloppify/SKILL.md and ~/.cursor/rules/desloppify.md \u2014 all readable and containing the correct skill version marker.",
"desloppify setup --interface claude installs only the Claude target.",
"desloppify setup --interface codex prints a clear message explaining codex global is not yet supported and suggests update-skill.",
"desloppify setup skips targets whose tool config dir doesn't exist (e.g., no ~/.cursor/) with a yellow warning, and errors if ALL targets are skipped.",
"desloppify setup --interface cursor with no ~/.cursor/ directory raises CommandError.",
"desloppify setup --local --interface hermes creates or updates AGENTS.md at the project root (not cwd) with Hermes overlay content wrapped in begin/end markers.",
"desloppify setup --local --interface windsurf on an existing AGENTS.md with other content preserves that content and only replaces the desloppify section.",
"desloppify setup --local without --interface raises CommandError with guidance on which interfaces are valid.",
"All operations work offline \u2014 files come from importlib.resources bundled data, no network calls.",
"After desloppify setup, running desloppify scan in a project without a per-project skill install does NOT print 'No skill document found' \u2014 the scan post-check detects the global install via find_global_skill().",
"check_skill_version() detects stale global installs and warns with 'Run: desloppify setup'.",
"python -m pytest desloppify/tests/commands/test_setup.py desloppify/tests/test_bundled_sync.py -q passes.",
"desloppify setup prints a clear summary of what was installed and where, including any skipped targets."
]
},
"preflight_results": {
"project_dir_exists": true,
"project_dir_writable": true,
"success_criteria_present": true,
"claude_available": true,
"codex_available": true
},
"unresolved_flags": [
{
"id": "setup_global_install_not_discoverable",
"concern": "The scan path is still not fully global-aware. v3 fixes the post-check warning, but _try_auto_update_skill() still runs first and only consults find_installed_skill(). If a user has only a global install, scan will still try to auto-download a per-project skill via update_installed_skill(interface) before the new fallback logic runs, which undercuts the offline/global setup story and keeps the scan workflow behaviorally tied to project-local installs.",
"category": "correctness",
"severity_hint": "likely-significant",
"evidence": "desloppify/app/commands/scan/reporting/agent_context.py:242-260 calls find_installed_skill() and, when that returns None, immediately detects the agent interface and runs update_installed_skill(interface); desloppify/app/skill_docs.py:59-83 still defines find_installed_skill() as project-root-only discovery.",
"raised_in": "critique_v3.json",
"status": "open",
"severity": "significant",
"verified": false,
"addressed_in": "plan_v3.md"
},
{
"id": "setup_global_paths_not_repo_validated",
"concern": "The repo still does not validate the proposed home-directory targets. v3 makes that explicit, but the implementation plan still treats ~/.claude/... and ~/.cursor/... as the product\u2019s write targets and adds a directory-existence heuristic on top. Against the actual repository, that remains an external assumption rather than an in-repo contract, so the core feature is still being built on paths the codebase itself does not establish.",
"category": "correctness",
"severity_hint": "likely-significant",
"evidence": "All existing install/search targets in desloppify/app/skill_docs.py:20-45 are relative paths interpreted against the project root, and desloppify/app/commands/update_skill/cmd.py:172-200 writes them under get_project_root(). There is no existing repository code that reads, writes, or validates home-directory skill locations for Claude or Cursor.",
"raised_in": "critique_v3.json",
"status": "open",
"severity": "significant",
"verified": false,
"addressed_in": "plan_v3.md"
}
]
}
code
Requirements:
- Implement the intent, not just the text.
- Adapt if repository reality contradicts the plan.
- Report deviations explicitly.
- Output concrete files changed and commands run.
{"output":"Implemented the desloppify setup feature end-to-end: bundled offline skill assets, added the new CLI command, extended global skill discovery, and covered the scan workflow so a valid global install suppresses the old “No skill document found” warning.\n\nFiles Changed\n- pyproject.toml\n- desloppify/data/init.py\n- desloppify/data/global/init.py\n- desloppify/data/global/SKILL.md\n- desloppify/data/global/CLAUDE.md\n- desloppify/data/global/CURSOR.md\n- desloppify/data/global/CODEX.md\n- desloppify/data/global/WINDSURF.md\n- desloppify/data/global/GEMINI.md\n- desloppify/data/global/HERMES.md\n- desloppify/app/commands/setup/init.py\n- desloppify/app/commands/setup/cmd.py\n- desloppify/app/skill_docs.py\n- desloppify/app/commands/scan/reporting/agent_context.py\n- desloppify/app/commands/registry.py\n- desloppify/app/cli_support/parser_groups_admin.py\n- desloppify/app/cli_support/parser_groups.py\n- desloppify/app/cli_support/parser.py\n- desloppify/tests/commands/test_setup.py\n- desloppify/tests/test_bundled_sync.py\n\nCommands Run\n- mkdir -p desloppify/data/global && touch desloppify/data/__init__.py desloppify/data/global/__init__.py && cp docs/SKILL.md docs/CLAUDE.md docs/CURSOR.md docs/CODEX.md docs/WINDSURF.md docs/GEMINI.md docs/HERMES.md desloppify/data/global/\n- python -c \"from importlib.resources import files; print(files('desloppify.data.global').joinpath('SKILL.md').read_text()[:50])\"\n- python -m pytest desloppify/tests/commands/test_setup.py desloppify/tests/test_bundled_sync.py -q\n- python -m pytest desloppify/tests/commands/test_update_skill_cmd_direct.py desloppify/tests/commands/test_transitive_modules_update_skill.py desloppify/tests/commands/test_transitive_engine.py -q\n\nVerification\n- Bundled resource read succeeded.\n- 16 passed in the new setup/sync test set.\n- 88 passed in the targeted existing update-skill/parser regression tests.\n\nDeviation\n- I changed _try_auto_update_skill() slightly beyond the written plan: if a global skill install exists at all, scan now avoids auto-downloading a project-local skill. Without that, desloppify setup still got undercut by scan’s project-local auto-install path. This matches the feature intent better and makes stale global installs warn with Run: desloppify setup instead of silently creating a local install.\n\nUnrelated existing worktree changes in desloppify/cli.py and .megaplan/ were left untouched.","files_changed":[[REDACTED],[REDACTED],[REDACTED],[REDACTED],[REDACTED],[REDACTED],[REDACTED],[REDACTED],[REDACTED],[REDACTED],[REDACTED],[REDACTED],[REDACTED],[REDACTED],[REDACTED],[REDACTED],[REDACTED],[REDACTED],[REDACTED],[REDACTED]],"commands_run":["mkdir -p desloppify/data/global && touch desloppify/data/init.py desloppify/data/global/init.py && cp docs/SKILL.md docs/CLAUDE.md docs/CURSOR.md docs/CODEX.md docs/WINDSURF.md docs/GEMINI.md docs/HERMES.md desloppify/data/global/","python -c "from importlib.resources import files; print(files('desloppify.data.global').joinpath('SKILL.md').read_text()[:50])"","python -m pytest desloppify/tests/commands/test_setup.py desloppify/tests/test_bundled_sync.py -q","python -m pytest desloppify/tests/commands/test_update_skill_cmd_direct.py desloppify/tests/commands/test_transitive_modules_update_skill.py desloppify/tests/commands/test_transitive_engine.py -q"],"deviations":["Adjusted scan auto-install behavior so any existing global skill install blocks project-local auto-download; this was necessary to make desloppify setup behave consistently with the intended offline/global workflow."]}